Changeset 37102 for trunk/ippScripts
- Timestamp:
- Jul 22, 2014, 3:50:46 PM (12 years ago)
- Location:
- trunk/ippScripts/scripts
- Files:
-
- 6 edited
-
sc_prepare_camera.pl (modified) (6 diffs)
-
sc_prepare_chip.pl (modified) (4 diffs)
-
sc_prepare_stack.pl (modified) (3 diffs)
-
sc_prepare_warp.pl (modified) (5 diffs)
-
sc_remote_exec.pl (modified) (14 diffs)
-
sc_transfer_tool.pl (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/sc_prepare_camera.pl
r36966 r37102 18 18 19 19 # Hard coded values 20 my $remote_root = '/scratch3/watersc1/'; # Far side destination base location 20 # my $remote_root = '/scratch3/watersc1/'; # Far side destination base location 21 my $remote_root = '/lustre/scratch1/turquoise/watersc1/ps1/'; # Far side destination base location 21 22 my $threads = 2; # How many threads are we going to use? 22 23 my $job_cost = 1700 / 60 / 60; # Estimate of how long a job runs, in hours. … … 27 28 my $max_time = 8; # longest allocation to ask for 28 29 my $remote_hostname= "LANL/Mustang"; # Name of the remote node. 29 my @return_component_list = ("DBINFO.EXP", "PSASTRO.CONFIG", "PSASTRO.OUTPUT", "LOG.EXP", "TRACE.EXP","PSASTRO.STATS");30 my @return_component_list = ("DBINFO.EXP", "PSASTRO.CONFIG", "PSASTRO.OUTPUT", "LOG.EXP", "PSASTRO.STATS"); 30 31 # Look for programs we need 31 32 my $missing_tools; … … 186 187 $psastro_command .= " -recipe PSASTRO $recipe_psastro "; 187 188 $psastro_command .= " -tracedest ${remote_outroot}.trace -log ${remote_outroot}.log "; 188 $psastro_command .= " -dumpconfig ${remote_outroot}. mdc -stats ${remote_outroot}.stats ";189 $psastro_command .= " -dumpconfig ${remote_outroot}.psastro.mdc -stats ${remote_outroot}.stats "; 189 190 $psastro_command .= " -recipe PPSTATS CAMSTATS "; 190 191 … … 202 203 my ($ipp_disk, $remote_disk) = uri_to_outputs_for_return( $filename); 203 204 my $remote_outroot_dir = dirname($ipp_disk); 204 print CONFIG " && mkdir -p ${remote_root}/tmp/${remote_outroot_dir} && ln -sf $remote_disk ${remote_root}/tmp/${ipp_disk} ";205 print CONFIG " && mkdir -p ${remote_root}/tmp/${remote_outroot_dir} && ln -sf $remote_disk ${remote_root}/tmp/${ipp_disk} && touch $remote_disk "; 205 206 } 206 207 foreach my $chipInfo (@{ $inpData2 }) { … … 208 209 my ($ipp_disk, $remote_disk) = uri_to_outputs_for_return( $filename); 209 210 my $remote_outroot_dir = dirname($ipp_disk); 210 print CONFIG " && mkdir -p ${remote_root}/tmp/${remote_outroot_dir} && ln -sf $remote_disk ${remote_root}/tmp/${ipp_disk} ";211 print CONFIG " && mkdir -p ${remote_root}/tmp/${remote_outroot_dir} && ln -sf $remote_disk ${remote_root}/tmp/${ipp_disk} && touch $remote_disk "; 211 212 } 212 213 print CONFIG "\n"; … … 239 240 $node_req = int(($node_need * $job_cost) / ($fill_factor * $time_req)) + 1; 240 241 } 242 $time_req += 1; # Safety addition. 241 243 242 244 open(COMMAND, ">$disk_command") || &my_die("Couldn't open file? $disk_command",$remote_id,$PS_EXIT_SYS_ERROR); -
trunk/ippScripts/scripts/sc_prepare_chip.pl
r36966 r37102 18 18 19 19 # Hard coded values 20 my $remote_root = '/scratch3/watersc1/'; # Far side destination base location 20 # my $remote_root = '/scratch3/watersc1/'; # Far side destination base location 21 my $remote_root = '/lustre/scratch1/turquoise/watersc1/ps1/'; # Far side destination base location 21 22 my $remote_raw = "${remote_root}/raw/"; # Directory to find raw data in. 22 23 my $threads = 2; # How many threads are we going to use? … … 152 153 #print Dumper(%detrends); 153 154 154 my @return_component_list = ("DBINFO.IMFILE","PPIMAGE.STATS","LOG.IMFILE"," TRACE.IMFILE","PPIMAGE.BACKMDL","PPIMAGE.PATTERN");155 my @return_component_list = ("DBINFO.IMFILE","PPIMAGE.STATS","LOG.IMFILE","PPIMAGE.BACKMDL","PPIMAGE.PATTERN"); 155 156 156 157 # … … 348 349 my ($ipp_disk, $remote_disk) = uri_to_outputs_for_return( $filename ); 349 350 my $remote_outroot_dir = dirname($ipp_disk); 350 print CONFIG " && mkdir -p ${remote_root}/tmp/${remote_outroot_dir} && ln -sf $remote_disk ${remote_root}/tmp/${ipp_disk} ";351 print CONFIG " && mkdir -p ${remote_root}/tmp/${remote_outroot_dir} && ln -sf $remote_disk ${remote_root}/tmp/${ipp_disk} && touch $remote_disk "; 351 352 # print " $filename $ipp_disk $remote_disk\n"; 352 353 # die; … … 405 406 $node_req = int(($node_need * $job_cost) / ($fill_factor * $time_req)) + 1; 406 407 } 408 $time_req += 1; # Safety addition. 407 409 408 410 open(COMMAND, ">$disk_command") || &my_die("Couldn't open file? $disk_command",$chip_id,$PS_EXIT_SYS_ERROR); -
trunk/ippScripts/scripts/sc_prepare_stack.pl
r36966 r37102 18 18 19 19 # Hard coded values 20 my $remote_root = '/scratch3/watersc1/'; # Far side destination base location 20 #my $remote_root = '/scratch3/watersc1/'; # Far side destination base location 21 my $remote_root = '/lustre/scratch1/turquoise/watersc1/ps1/'; # Far side destination base location 21 22 my $threads = 2; # How many threads are we going to use? 22 23 my $job_cost = 1500 / 60 / 60; # Estimate of how long a job runs, in hours. … … 29 30 my @return_component_list = ("DBINFO.EXP", "PPSTACK.UNCONV","PPSTACK.UNCONV.MASK","PPSTACK.UNCONV.VARIANCE", 30 31 "PPSTACK.UNCONV.EXP","PPSTACK.UNCONV.EXPWT","PPSTACK.UNCONV.EXPNUM","PSPHOT.OUTPUT", 31 "LOG.EXP", "TRACE.EXP","PSASTRO.STATS",32 "PPSTACK.CONFIG","PPSTACK.TARGET.PSF" );32 "LOG.EXP", "PSASTRO.STATS", 33 "PPSTACK.CONFIG","PPSTACK.TARGET.PSF","PSPHOT.STACK.PSF.SAVE"); 33 34 #,"PPSTACK.CONV.KERNEL"); 34 35 # Look for programs we need … … 208 209 my ($ipp_disk, $remote_disk) = uri_to_outputs_for_return( $filename); 209 210 my $remote_outroot_dir = dirname($ipp_disk); 210 print CONFIG " && mkdir -p ${remote_root}/tmp/${remote_outroot_dir} && ln -sf $remote_disk ${remote_root}/tmp/${ipp_disk} ";211 print CONFIG " && mkdir -p ${remote_root}/tmp/${remote_outroot_dir} && ln -sf $remote_disk ${remote_root}/tmp/${ipp_disk} && touch $remote_disk "; 211 212 } 212 213 -
trunk/ippScripts/scripts/sc_prepare_warp.pl
r36966 r37102 18 18 19 19 # Hard coded values 20 my $remote_root = '/scratch3/watersc1/'; # Far side destination base location 20 # my $remote_root = '/scratch3/watersc1/'; 21 my $remote_root = '/lustre/scratch1/turquoise/watersc1/ps1/'; # Far side destination base location 21 22 my $threads = 2; # How many threads are we going to use? 22 23 my $job_cost = 70 / 60 / 60; # Estimate of how long a job runs, in hours. … … 27 28 my $max_time = 8; # longest allocation to ask for 28 29 my $remote_hostname= "LANL/Mustang"; # Name of the remote node. 29 my @return_component_list = ("DBINFO.EXP", "PSWARP.CONFIG", "PSWARP.OUTPUT", "PSWARP.OUTPUT.MASK", "PSWARP.OUTPUT.VARIANCE", "PSWARP.OUTPUT.SOURCES","PSPHOT.PSF.S AVE","LOG.EXP","TRACE.EXP");30 my @return_component_list = ("DBINFO.EXP", "PSWARP.CONFIG", "PSWARP.OUTPUT", "PSWARP.OUTPUT.MASK", "PSWARP.OUTPUT.VARIANCE", "PSWARP.OUTPUT.SOURCES","PSPHOT.PSF.SKY.SAVE","LOG.EXP"); 30 31 # Look for programs we need 31 32 my $missing_tools; … … 202 203 $pswarp_command .= " -threads 4 "; # -image_id ${image_id} -source_id ${source_id} "; 203 204 $pswarp_command .= " -recipe PPSTATS WARPSTATS "; 204 $pswarp_command .= " -dumpconfig ${remote_outroot}. mdc -stats ${remote_outroot}.stats ";205 $pswarp_command .= " -dumpconfig ${remote_outroot}.pswarp.mdc -stats ${remote_outroot}.stats "; 205 206 206 207 # print "$pswarp_command \n"; … … 218 219 # Determine which output files need to be returned 219 220 foreach my $component(@return_component_list) { 220 my $filename = $ipprc->filename($component,$ipp_outroot );221 my $filename = $ipprc->filename($component,$ipp_outroot,$skycell_id); 221 222 my ($ipp_disk, $remote_disk) = uri_to_outputs_for_return( $filename); 222 223 my $remote_outroot_dir = dirname($ipp_disk); 223 print CONFIG " && mkdir -p ${remote_root}/tmp/${remote_outroot_dir} && ln -sf $remote_disk ${remote_root}/tmp/${ipp_disk} ";224 print CONFIG " && mkdir -p ${remote_root}/tmp/${remote_outroot_dir} && ln -sf $remote_disk ${remote_root}/tmp/${ipp_disk} && touch $remote_disk "; 224 225 } 225 226 … … 255 256 $node_req = int(($node_need * $job_cost) / ($fill_factor * $time_req)) + 1; 256 257 } 258 $time_req += 1; # Safety addition. 257 259 258 260 open(COMMAND, ">$disk_command") || &my_die("Couldn't open file? $disk_command",$remote_id,$PS_EXIT_SYS_ERROR); -
trunk/ippScripts/scripts/sc_remote_exec.pl
r36844 r37102 18 18 my $SEC_HOST = 'mu-fe4'; 19 19 my $IPP_PATH = '/turquoise/usr/projects/cosmo/mswarren/ipp/'; 20 my $remote_root = '/scratch3/watersc1/';21 20 #my $remote_root = '/scratch3/watersc1/'; 21 my $remote_root = '/lustre/scratch1/turquoise/watersc1/ps1/'; 22 22 # tools 23 23 my $missing_tools; … … 33 33 34 34 # Options 35 my ($remote_id,$path_base,$policy,$poll,$job_id,$dbname,$verbose,$no_update,$camera); 36 35 my ($remote_id,$path_base,$policy,$poll,$force,$job_id,$dbname,$verbose,$no_update,$camera); 36 $force = 0; 37 $verbose = 0; 37 38 GetOptions( 38 39 'remote_id=s' => \$remote_id, … … 41 42 'policy=s' => \$policy, 42 43 'poll' => \$poll, 44 'force-poll' => \$force, 43 45 'camera=s' => \$camera, 44 46 'dbname=s' => \$dbname, … … 61 63 62 64 print "passed authentication challenge.\n"; 65 66 # Phase 1.5: Grab the information about this run; 67 my $rt_cmd = "$remotetool -listrun -remote_id $remote_id "; 68 $rt_cmd .= " -dbname $dbname " if defined($dbname); 69 my ( $rt_success, $rt_error_code, $rt_full_buf, $rt_stdout_buf, $rt_stderr_buf ) = 70 run(command => $rt_cmd, verbose => $verbose); 71 unless ($rt_success) { 72 $rt_error_code = (($rt_error_code >> 8) or $PS_EXIT_PROG_ERROR); 73 &my_die("UNable to run remotetool to determine remote run status", 74 $remote_id,$rt_error_code); 75 } 76 my $rrData = $mdcParser->parse(join "", @$rt_stdout_buf) or 77 &my_die("UNable to run remotetool to determine remote run status", 78 $remote_id,$rt_error_code); 79 my $rrData2 = parse_md_list($rrData); 80 my $runData = ${ $rrData2 }[0]; # There should be only one 63 81 64 82 # These are operations we only need to do on the first call, not on subsequent poll operations. … … 92 110 my (undef,$remote_check) = uri_convert($uri_check); 93 111 my (undef,$remote_transfer)= uri_convert($uri_transfer); 94 # my $ssh_check_stdout = ssh_exec_command("${remote_root}/sc_validate_files.pl --check_list $remote_check --transfer_list $remote_transfer"); 112 95 113 my $ssh_check_stdout = ssh_exec_command("${remote_root}/sc_transfer_tool.pl --input $remote_check --fetch $remote_transfer"); 96 114 # We no longer need to parse this output, as it retrieves files itself. … … 130 148 # Poll the job status? 131 149 my $poll_count = 0; 132 my $poll_max = 5;150 my $poll_max = 1; # If it isn't finished now, it's unlikely to magically finish in the next five minutes. 133 151 my $poll_sleep = 60; 134 152 my $poll_response = 0; 135 while (($poll_count < $poll_max)&&($poll_response != 1)&&($poll_response != -1)) { 153 if ($force) { 154 $poll_response = 1; 155 } 156 my $poll_word = "nothing"; 157 while (($poll_count < $poll_max)&&($poll_response != 1)&&($poll_response != -1)&&($force != 1)) { 136 158 if ($verbose) { 137 159 print "Polling code. Sleeping. $poll_count of $poll_max $poll_response\n"; … … 140 162 sleep($poll_sleep); 141 163 } 142 $poll_response= poll_job($job_id);164 ($poll_response,$poll_word) = poll_job($job_id); 143 165 144 166 if ($poll_response == 1) { # This job has completed … … 146 168 } 147 169 elsif ($poll_response == -1) { # This job has an error 148 &my_die("The job exited incorrectly.",$remote_id, $PS_EXIT_PROG_ERROR); 170 warn("The job exited incorrectly: $remote_id $job_id $poll_word. Attempting to recover what we can."); 171 $poll_response = 1; # To fool the check later into proceding 172 # &my_die("The job exited incorrectly.",$remote_id, $PS_EXIT_PROG_ERROR); 149 173 } 150 174 $poll_count++; … … 165 189 my $uri_return = $path_base . ".return"; 166 190 my ($ipp_return,$remote_return) = uri_convert($uri_return); 167 scp_get($remote_return,$ipp_return); 168 # Feed teh return list into the 169 my $return_push_output = ssh_exec_command("${remote_root}/sc_transfer_tool.pl --input $remote_return"); 170 print "$return_push_output\n"; 171 172 191 # We shouldn't need to get this file. We made that file. 192 #scp_get($remote_return,$ipp_return); 193 194 # Check to see if we can resume. Pack the files into an array 195 my @returned_files = (); 196 my @dbinfo_files = (); 197 my @dbindex = (); 198 my $iter = 0; 173 199 open(RETURN, "$ipp_return") || &my_die("Couldn't open file? $ipp_return", $remote_id,$PS_EXIT_SYS_ERROR); 174 while (<RETURN>) {200 while (<RETURN>) { 175 201 chomp; 202 push @returned_files, $_; 176 203 if ($_ =~ /dbinfo/) { 177 my $file = $_; 178 # $file =~ s/${remote_root}.tmp//; THis shouldn't be needed, as the transfer tool munges the files on that side. 179 open(DBF,"$file") || warn "Missing file $file\n"; 180 my $cmd = <DBF>; 181 chomp($cmd); 182 $cmd =~ s/-/ -/g; # This is just a safety check for missing space. 183 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 184 run(command => $cmd, verbose => $verbose); 185 unless ($success) { 186 # This shouldn't fail, but we also can't suddenly abort if something does fail. Maybe retry if this looks to be a continuing issue? 187 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 188 warn("The command that shouldn't fail has failed: $cmd $remote_id $error_code");##,$remote_id,$error_code); 189 } 190 close(DBF); 191 } 204 push @dbinfo_files, $_; 205 push @dbindex, $iter; 206 } 207 $iter++; 208 192 209 } 193 210 close(RETURN); 211 212 # Binary search it. BUT: We're binary searching binary values. So, 213 # this has to be far more careful than a fully sorted case would be. 214 # Only scan the dbinfo files as those are the things that are 215 # generated after the processing, and so must be the last things to 216 # exist. 217 218 my $first = 0; 219 my $last = $#dbinfo_files; 220 my $mid = 0; 221 my $range = 20; # How wide of a chunk to look through to catch threading drops 222 my $offset = 0; # Offset to start from. 223 if (( stat($dbinfo_files[$last]) )[7] != 0) { $offset = $#dbinfo_files;} 224 else { 225 my $count = 0; 226 while ($first < $last - $range) { 227 228 $mid = int(($last + $first)/2); 229 for (my $i = 0; $i <= $range; $i++) { 230 my $size = (stat($dbinfo_files[$mid + $i]))[7]; 231 # print STDERR "$first $last $mid $i $size $dbinfo_files[$mid + $i]\n"; 232 if ($size == 0) { 233 if ($last == $mid + $i) { 234 $first = $last - 1; 235 } 236 $last = $mid + $i; 237 $i = $range + 10; 238 } 239 } 240 if ($last > $mid + $range) { $first = $mid + $range; } 241 $count++; 242 if ($count > 200) { 243 &my_die("The iteration loop couldn't converge after 200 rounds, suggesting something has gone wrong.", 244 $remote_id,4,"error_run"); 245 } 246 } 247 $offset = $mid - $range; # Because I want to make sure I get to the beginning of the thread group. 248 $offset = $dbindex[$offset]; # Because we need to convert from dbinfo space to returned file space. 249 } 250 251 # Feed teh return list into the transfer tool 252 # If this fails, we should go to an auth wait point. 253 my $return_push_output = ssh_exec_command("${remote_root}/sc_transfer_tool.pl --input $remote_return --offset $offset"); 254 my $return_push_output_print = join "\n", @{ $return_push_output }; 255 print "$return_push_output_print\n"; 256 257 #die(); 258 259 foreach my $file (@dbinfo_files) { 260 open(DBF,"$file") || warn "Missing file $file\n"; 261 my $cmd = <DBF>; 262 close(DBF); 263 chomp($cmd); 264 $cmd =~ s/-/ -/g; # This is just a safety check for missing space. 265 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 266 run(command => $cmd, verbose => $verbose); 267 unless ($success) { 268 # This shouldn't fail, but we also can't suddenly abort if something does fail. 269 # Now we're going to drop the component that owns this dbinfo, which should force a retry. 270 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 271 warn("The command that shouldn't fail has failed: $cmd $remote_id $error_code"); 272 drop_component($remote_id,$cmd,$file); 273 } 274 275 } 194 276 195 277 # We're done, so set the state and exit. 196 278 &my_die("Finished",$remote_id,0,"full"); 197 198 279 199 280 … … 209 290 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 210 291 &my_die("Authorization check failed.",$remote_id,0,'auth'); 211 212 # my $update_command = "$remotetool -updaterun -remote_id $remote_id ";213 # $update_command .= " -set_state auth ";214 # $update_command .= " -dbname $dbname " if defined $dbname;215 # system($update_command);216 # exit(0); # This isn't an error. It's a state we monitor and move to automatically.217 292 } 218 293 } … … 250 325 sub ssh_exec_command { 251 326 my $cmd = shift; 252 $cmd = "$ssh $DMZ_HOST ssh${SEC_HOST} $cmd";327 $cmd = "$ssh $DMZ_HOST ssh ${SEC_HOST} $cmd"; 253 328 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 254 329 run(command => $cmd, verbose => $verbose); 255 330 unless ($success) { 256 331 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 332 # If we failed, see if we failed due to authorization. 333 check_ssh_connection(); 257 334 &my_die("Failed to execute command: >>$cmd<<"); 258 335 } … … 266 343 267 344 if ($response =~ /State: Running/) { 268 return(0 );345 return(0,"Running"); 269 346 } 270 347 elsif ($response =~ /State: Completed/) { 271 return(1 );348 return(1,"Completed"); 272 349 } 273 350 elsif ($response =~ /State: Idle/) { 274 return(-2 );351 return(-2,"Idle"); 275 352 } 276 353 else { 277 return(-1); 354 my $response_word = $response; 355 $response_word =~ s/.*State: //; 356 $response_word =~ s/\n.*//; 357 return(-1,$response_word); 278 358 } 279 359 } … … 324 404 return($local_uri); 325 405 } 406 407 sub drop_component { 408 my $remote_id = shift; 409 my $cmd = shift; 410 my $file = shift; 411 412 if ($cmd eq '') { 413 # Zero byte file. This dbinfo was never constructed properly. 414 415 # Steal the stage_id from the filename. This isn't something I'm happy about. 416 my $stage = $runData->{stage}; 417 my $stage_id = $file; 418 if ($stage eq 'chip') { 419 $stage_id =~ s/^.*ch\.//; 420 } 421 elsif ($stage eq 'camera') { 422 $stage_id =~ s/^.*cm\.//; 423 } 424 elsif ($stage eq 'warp') { 425 $stage_id =~ s/^.*wrp\.//; 426 } 427 elsif ($stage eq 'stack') { 428 $stage_id =~ s/^.*stk\.//; 429 } 430 $stage_id =~ s/\..*$//; 431 432 # Drop this from the database 433 my $drop_cmd = "$remotetool -dropcomponent -remote_id $remote_id -stage_id $stage_id "; 434 $drop_cmd .= " -dbname $dbname " if defined($dbname); 435 system($drop_cmd); 436 } 437 438 } 439 326 440 sub my_die { 327 441 my $msg = shift; … … 347 461 } 348 462 349 # I don't think I need this anymore, but I don't want to burn it until I"m sure.350 351 # exit(1);352 # # Read this as a metadata object353 # my $ssh_exec_stdout = ssh_exec_command("sc_validate_processing.pl ${path_base}.out");354 # my $retrieveData = $mdcParser->parse(join "", @$ssh_exec_stdout);355 # my $retrieveData2= parse_md_list($retrieveData);356 357 # foreach my $retrieveEntry (@$retrieveData2) {358 # my $process_fault = $retrieveEntry->{fault};359 # my $dbcommand = $retrieveEntry->{dbcommand};360 # my $filelist = $retrieveEntry->{filelist};361 362 # scp_get("${filelist}",${filelist});363 # open(FL,${filelist});364 # while(<FL>) {365 # chomp;366 # my $f = $_;367 # scp_get("${f}",$f);368 # }369 # close(FL);370 371 # my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =372 # run(command => $dbcommand, verbose => $verbose);373 # unless ($success) {374 # $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);375 # &my_die("The database command returned did not execute correctly. $dbcommand $process_fault",376 # $remote_id,$error_code);377 # }378 379 # if ($process_fault != 0) {380 # $fault = 1;381 # }382 # }383 384 # if (($policy ne 'ignore')&&($fault != 0)) {385 # &my_die("This job exited without all components finishing successfully. Halting.",386 # $remote_id,$fault,"halt");387 # }388 # else {389 # print "This job exited without all components finishing successfully. $fault\n" if $fault;390 # &my_die("This job finished. Setting remote job to full.",391 # $remote_id,0,"full");392 # }393 394 # Promote to finished.395 #&my_die(); # Not really, but I don't have the tool interface finished, so these are all just placeholders.396 463 # Quick review: 397 464 # new -> pending -> run -> full -
trunk/ippScripts/scripts/sc_transfer_tool.pl
r37013 r37102 10 10 use Sys::Hostname; 11 11 12 my $local_raw = '/scratch3/watersc1/raw/'; 13 my $local_tmp = '/scratch3/watersc1/tmp/'; 12 my $remote_root = '/lustre/scratch1/turquoise/watersc1/ps1/'; 13 14 my $local_raw = "${remote_root}/raw/"; 15 my $local_tmp = "${remote_root}/tmp/"; 14 16 my $threads = 10; 15 17 my @hosts = ('ippc20.ipp.ifa.hawaii.edu','ippc24.ipp.ifa.hawaii.edu','ippc28.ipp.ifa.hawaii.edu', … … 68 70 } 69 71 elsif (!($fetch)) { # We are pushing 70 print { $filehandles[$i] } "${local_tmp}/$_" . "\n"; 72 # The rsync call expects to find files of a given name in the directory specified. 73 # print { $filehandles[$i] } "${local_tmp}/$_" . "\n"; 74 print { $filehandles[$i] } "$_" . "\n"; 71 75 } 72 76 } … … 112 116 113 117 # the transform bit is there because it looks like the ' gets dropped, so the * is interpreted, and why is our tar so out of date? 114 my $command = "tar cf - --ignore-failed-read --dereference --files-from=${transfer_filelist} | /usr/projects/cosmo/amd6100/bin/ssh -o NoneSwitch=yes -o NoneEnabled=yes $destination_host tar xf - -C /data/ --transform '" . 's,^.\*/data/,,' . "' --dereference"; 118 # my $command = "tar cf - --ignore-failed-read --dereference --files-from=${transfer_filelist} | /usr/projects/cosmo/amd6100/bin/ssh -o NoneSwitch=yes -o NoneEnabled=yes $destination_host tar xf - -C /data/ --transform '" . 's,^.\*/data/,,' . "' --dereference"; 119 my $command = "rsync -Lpt -e '/usr/projects/cosmo/amd6100/bin/ssh -o NoneSwitch=yes -o NoneEnabled=yes' --files-from=${transfer_filelist} ${local_tmp} ${destination_host}:/"; 115 120 print STDERR "$command\n"; 116 121 … … 118 123 run(command => $command, verbose => $verbose); 119 124 unless ($success) { 120 121 125 print STDERR "ERROR: $error_code\n"; 122 126 # my $std = join "\n", @{ $stdout_buf }; … … 125 129 # print "STDERR: $std\n"; 126 130 127 foreach my $line (@{ $stderr_buf }) { # This is a hack. A messy ugly hack.128 if ($line =~ /No such file or directory/) {129 my $file = (split /\s+/, $line)[1];130 $file =~ s/:$//;131 if ($file !~ /nebulous/) { next; }132 print STDERR "Touching $file so tar can continue.\n";133 system("touch $file");134 }135 }131 # foreach my $line (@{ $stderr_buf }) { # This is a hack. A messy ugly hack. 132 # if ($line =~ /No such file or directory/) { 133 # my $file = (split /\s+/, $line)[1]; 134 # $file =~ s/:$//; 135 # if ($file !~ /nebulous/) { next; } 136 # print STDERR "Touching $file so tar can continue.\n"; 137 # system("touch $file"); 138 # } 139 # } 136 140 137 141 warn("Transfer of $transfer_filelist to $destination_host failed with error $error_code.");
Note:
See TracChangeset
for help on using the changeset viewer.
