Changeset 2ef2c5b
- Timestamp:
- Sep 14, 2007 11:50:23 AM (17 years ago)
- Branches:
- axis_example, compt_changes, info-ops, master, version-1.30, version-2.00, version-3.01, version-3.02
- Children:
- 321c0cb
- Parents:
- c9f5490
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedkit/splitter.pl
rc9f5490 r2ef2c5b 83 83 my($s); 84 84 85 &ssh_cmd($user, $host, "mkdir -p $dest_dir"); 85 86 for $s (@scripts) { 86 87 &scp_file("$local_script_dir/$s", "$user\@$host", $dest_dir) || … … 96 97 my($d, $f); 97 98 99 98 100 $d = IO::Dir->new($src_dir) || return 0; 99 101 102 &ssh_cmd($user, $host, "mkdir -p $dest_dir"); 100 103 while ( $f = $d->read()) { 101 104 next if $f =~ /^\./; 102 &scp_file("$src_dir/$f", "$user\@$host", $dest_dir) || return 0; 105 if ( -d "$src_dir/$f" ) { 106 &ship_configs($host, $user, "$src_dir/$f", "$dest_dir/$f") || 0; 107 } 108 else { 109 &scp_file("$src_dir/$f", "$user\@$host", $dest_dir) || return 0; 110 } 103 111 } 104 112 return 1; … … 156 164 # Remote experiment is swapped out, modify it and swap it in. 157 165 if ($state eq "swapped") { 158 &ssh_cmd($user, $host, "/usr/testbed/bin/modexp -w $pid $eid $tclfile", 159 "modexp") || return 0; 160 # First copy new scripts and hostinfo into the remote /proj 166 # First copy new scripts and hostinfo into the remote /proj (because 167 # the experiment exists, the directory tree should be there. 161 168 &scp_file("./hostnames", "$user\@$host", $to_hostname) || return 0; 162 169 &ship_scripts($host, $user, $proj_dir) || return 0; 163 170 &ship_configs($host, $user, "$tmpdir/$tb", $proj_dir) || return 0; 171 &ssh_cmd($user, $host, "/usr/testbed/bin/modexp -w $pid $eid $tclfile", 172 "modexp") || return 0; 164 173 # Now start up 165 174 &ssh_cmd($user, $host, "/usr/testbed/bin/swapexp -w $pid $eid in", … … 276 285 # Open a pipe to the splitter program and start it parsing the experiments 277 286 $pipe = new IO::Pipe; 278 $pipe->reader("$tclsh $tcl_splitter -s -m $master -p $pid $gid $eid $tcl") || 279 die "Cannot execute $tclsh $tcl_splitter -s -p $pid $gid $eid $tcl:$!\n"; 287 # NB no more -p call on parse call. 288 $pipe->reader("$tclsh $tcl_splitter -s -m $master $pid $gid $eid $tcl") || 289 die "Cannot execute $tclsh $tcl_splitter -s -m $master $pid $gid $eid $tcl:$!\n"; 280 290 281 291 # Parse the splitter output. This loop creates the sub experiments, gateway … … 406 416 next; 407 417 }; 408 418 (/^#\s+Begin\s+tarfiles/../^#\s+End\s+tarfiles/) && do { 419 next if /^#/; 420 chomp; 421 push(@tarfiles, $_); 422 next; 423 }; 409 424 410 425 next unless $destfile; # Unidentified testbed, ignore config … … 428 443 $pipe->close(); 429 444 die "No nodes in master testbed ($master)\n" unless $allocated{$master}; 445 446 for $t (@tarfiles) { 447 die "tarfile '$t' unreadable: $!\n" unless -r $t; 448 for $tb (keys %allocated) { 449 unless (-d "$tmpdir/$tb/tarfiles") { 450 mkdir("$tmpdir/$tb/tarfiles") || 451 die "Can't create $tmpdir/$tb/tarfiles:$!\n"; 452 } 453 copy($t, "$tmpdir/$tb/tarfiles") || 454 die "Can't copy $t to $tmpdir/$tb/tarfiles:$!\n"; 455 } 456 } 430 457 431 458 exit(0) unless $startem;
Note: See TracChangeset
for help on using the changeset viewer.