[PVFS2-CVS] commit by pcarns in pvfs2/test/common/pav: pav_create

CVS commit program cvs at parl.clemson.edu
Sun Sep 12 16:13:30 EDT 2004


Update of /projects/cvsroot/pvfs2/test/common/pav
In directory parlweb:/tmp/cvs-serv11731

Modified Files:
	pav_create 
Log Message:
one more swing at pav create:
- support # meta > # io if requested without unique meta servers
- fix a use of uninitialized value warning that pops up on some configs


Index: pav_create
===================================================================
RCS file: /projects/cvsroot/pvfs2/test/common/pav/pav_create,v
diff -p -u -r1.14 -r1.15
--- pav_create	3 Sep 2004 15:42:24 -0000	1.14
+++ pav_create	12 Sep 2004 19:13:30 -0000	1.15
@@ -333,6 +333,7 @@ sub split_machines {
     @ionodes = (),
     @metanodes = ();
     @compnodes = ();
+    @servernodes = ();
 
     my $count=0;
 
@@ -359,31 +360,47 @@ sub split_machines {
 	    close(FH);
     }
 
-    if ($count < ($href->{'IONCOUNT'} + $href->{'UNIQUEMETA'} * $href->{'METACOUNT'})) {
+    # decide how many total servers there will be
+    if ($href->{'UNIQUEMETA'}) {
+	$servernum = $href->{'IONCOUNT'} + $href->{'METACOUNT'};
+    } else {
+	# if servers are not unique, choose enough to satisfy larger of meta
+	# or io requirement
+	if ($href->{'METACOUNT'} >= $href->{'IONCOUNT'}) {
+	    $servernum = $href->{'METACOUNT'};
+	} else {
+	    $servernum = $href->{'IONCOUNT'};
+	}
+    }
+
+    if ($count < $servernum) {
 	print STDERR "ERROR: requested more server nodes than are available\n";
 	return(1);
     }
-    
+
     my $ionum = $href->{'IONCOUNT'};
     my $metanum = $href->{'METACOUNT'};
-    my $compnum = $count - ($href->{'IONCOUNT'} + $href->{'UNIQUEMETA'} * $href->{'METACOUNT'});
+    my $compnum = $count - $servernum;
 
-    if ($href->{'UNIQUEMETA'}) {
-        for ($i=0; $i<$metanum; $i++) {
-		$metanodes[$i] = shift @nodelist;
-	}
+    # split total set into servers and clients
+    if ($href->{'COMPUTENODES_LAST'}) {
+	@servernodes = @nodelist[0..($servernum-1)];
+	@compnodes = @nodelist[$servernum..($count-1)];
     } else {
-    	@metanodes = @nodelist[0..$metanum-1];
+	@compnodes = @nodelist[0..($compnum-1)];
+	@servernodes = @nodelist[$compnum..($count-1)];
     }
 
-    if ($href->{'COMPUTENODES_LAST'}) {
-	    @ionodes = @nodelist[0..$ionum-1];
-	    @compnodes = @nodelist[$ionum..$count-1];
+    # pick meta nodes 
+    @metanodes = @servernodes[0..($metanum-1)];
+
+    # pick io nodes
+    if ($href->{'UNIQUEMETA'}) {
+	@ionodes = @servernodes[$metanum..($servernum-1)];
     } else {
-	    @compnodes = @nodelist[0..$compnum-1];
-	    @ionodes = @nodelist[$compnum..$count-1];
+	@ionodes = @servernodes[0..($ionum-1)];
     }
-    
+
     $href->{'MGR'} = \@metanodes;
     $href->{'IONODES'} = \@ionodes;
     $href->{'COMPNODES'} = \@compnodes;



More information about the PVFS2-CVS mailing list