IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 37102


Ignore:
Timestamp:
Jul 22, 2014, 3:50:46 PM (12 years ago)
Author:
watersc1
Message:

path change, trace drop, config typo fix, stack psf fix, exec force poll addition, exec drop/fails (likely needs further tuning), transfer shift to rsync return handler.

Location:
trunk/ippScripts/scripts
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippScripts/scripts/sc_prepare_camera.pl

    r36966 r37102  
    1818
    1919# 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
     21my $remote_root   = '/lustre/scratch1/turquoise/watersc1/ps1/'; # Far side destination base location
    2122my $threads       = 2;                      # How many threads are we going to use?
    2223my $job_cost      = 1700 / 60 / 60;         # Estimate of how long a job runs, in hours.
     
    2728my $max_time      = 8;                      # longest allocation to ask for
    2829my $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");
     30my @return_component_list = ("DBINFO.EXP", "PSASTRO.CONFIG", "PSASTRO.OUTPUT", "LOG.EXP", "PSASTRO.STATS");
    3031# Look for programs we need
    3132my $missing_tools;
     
    186187    $psastro_command   .= " -recipe PSASTRO $recipe_psastro ";
    187188    $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 ";
    189190    $psastro_command   .= " -recipe PPSTATS CAMSTATS ";
    190191   
     
    202203        my ($ipp_disk, $remote_disk) = uri_to_outputs_for_return( $filename);
    203204        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 ";
    205206    }
    206207    foreach my $chipInfo (@{ $inpData2 }) {
     
    208209        my ($ipp_disk, $remote_disk) = uri_to_outputs_for_return( $filename);
    209210        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 ";
    211212    }
    212213    print CONFIG "\n";
     
    239240    $node_req = int(($node_need * $job_cost) / ($fill_factor * $time_req)) + 1;
    240241}
     242$time_req += 1; # Safety addition.
    241243
    242244open(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  
    1818
    1919# 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
     21my $remote_root   = '/lustre/scratch1/turquoise/watersc1/ps1/'; # Far side destination base location
    2122my $remote_raw    = "${remote_root}/raw/";  # Directory to find raw data in.
    2223my $threads       = 2;                      # How many threads are we going to use?
     
    152153#print Dumper(%detrends);
    153154
    154 my @return_component_list = ("DBINFO.IMFILE","PPIMAGE.STATS","LOG.IMFILE","TRACE.IMFILE","PPIMAGE.BACKMDL","PPIMAGE.PATTERN");
     155my @return_component_list = ("DBINFO.IMFILE","PPIMAGE.STATS","LOG.IMFILE","PPIMAGE.BACKMDL","PPIMAGE.PATTERN");
    155156
    156157#
     
    348349            my ($ipp_disk, $remote_disk) = uri_to_outputs_for_return( $filename );
    349350            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 ";
    351352#           print "  $filename $ipp_disk $remote_disk\n";
    352353#           die;
     
    405406    $node_req = int(($node_need * $job_cost) / ($fill_factor * $time_req)) + 1;
    406407}
     408$time_req += 1; # Safety addition.
    407409
    408410open(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  
    1818
    1919# 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
     21my $remote_root   = '/lustre/scratch1/turquoise/watersc1/ps1/'; # Far side destination base location
    2122my $threads       = 2;                      # How many threads are we going to use?
    2223my $job_cost      = 1500 / 60 / 60;           # Estimate of how long a job runs, in hours.
     
    2930my @return_component_list = ("DBINFO.EXP", "PPSTACK.UNCONV","PPSTACK.UNCONV.MASK","PPSTACK.UNCONV.VARIANCE",
    3031                             "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");
    3334#,"PPSTACK.CONV.KERNEL");
    3435# Look for programs we need
     
    208209        my ($ipp_disk, $remote_disk) = uri_to_outputs_for_return( $filename);
    209210        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 ";
    211212    }
    212213
  • trunk/ippScripts/scripts/sc_prepare_warp.pl

    r36966 r37102  
    1818
    1919# Hard coded values
    20 my $remote_root   = '/scratch3/watersc1/';  # Far side destination base location
     20# my $remote_root   = '/scratch3/watersc1/'; 
     21my $remote_root = '/lustre/scratch1/turquoise/watersc1/ps1/'; # Far side destination base location
    2122my $threads       = 2;                      # How many threads are we going to use?
    2223my $job_cost      = 70 / 60 / 60;           # Estimate of how long a job runs, in hours.
     
    2728my $max_time      = 8;                      # longest allocation to ask for
    2829my $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.SAVE","LOG.EXP","TRACE.EXP");
     30my @return_component_list = ("DBINFO.EXP", "PSWARP.CONFIG", "PSWARP.OUTPUT", "PSWARP.OUTPUT.MASK", "PSWARP.OUTPUT.VARIANCE", "PSWARP.OUTPUT.SOURCES","PSPHOT.PSF.SKY.SAVE","LOG.EXP");
    3031# Look for programs we need
    3132my $missing_tools;
     
    202203        $pswarp_command    .= " -threads 4 "; # -image_id ${image_id} -source_id ${source_id} ";
    203204        $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 ";
    205206
    206207#       print "$pswarp_command \n";
     
    218219        # Determine which output files need to be returned
    219220        foreach my $component(@return_component_list) {
    220             my $filename = $ipprc->filename($component,$ipp_outroot);
     221            my $filename = $ipprc->filename($component,$ipp_outroot,$skycell_id);
    221222            my ($ipp_disk, $remote_disk) = uri_to_outputs_for_return( $filename);
    222223            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 ";
    224225        }
    225226
     
    255256    $node_req = int(($node_need * $job_cost) / ($fill_factor * $time_req)) + 1;
    256257}
     258$time_req += 1; # Safety addition.
    257259
    258260open(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  
    1818my $SEC_HOST = 'mu-fe4';
    1919my $IPP_PATH = '/turquoise/usr/projects/cosmo/mswarren/ipp/';
    20 my $remote_root  = '/scratch3/watersc1/';
    21 
     20#my $remote_root  = '/scratch3/watersc1/';
     21my $remote_root = '/lustre/scratch1/turquoise/watersc1/ps1/';
    2222# tools
    2323my $missing_tools;
     
    3333
    3434# Options
    35 my ($remote_id,$path_base,$policy,$poll,$job_id,$dbname,$verbose,$no_update,$camera);
    36 
     35my ($remote_id,$path_base,$policy,$poll,$force,$job_id,$dbname,$verbose,$no_update,$camera);
     36$force = 0;
     37$verbose = 0;
    3738GetOptions(
    3839    'remote_id=s'   => \$remote_id,
     
    4142    'policy=s'      => \$policy,
    4243    'poll'          => \$poll,
     44    'force-poll'    => \$force,
    4345    'camera=s'      => \$camera,
    4446    'dbname=s'      => \$dbname,
     
    6163
    6264print "passed authentication challenge.\n";
     65
     66# Phase 1.5: Grab the information about this run;
     67my $rt_cmd = "$remotetool -listrun -remote_id $remote_id ";
     68$rt_cmd   .= " -dbname $dbname " if defined($dbname);
     69my ( $rt_success, $rt_error_code, $rt_full_buf, $rt_stdout_buf, $rt_stderr_buf ) =
     70    run(command => $rt_cmd, verbose => $verbose);
     71unless ($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}
     76my $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);
     79my $rrData2 = parse_md_list($rrData);
     80my $runData = ${ $rrData2 }[0]; # There should be only one
    6381
    6482# These are operations we only need to do on the first call, not on subsequent poll operations.
     
    92110    my (undef,$remote_check) = uri_convert($uri_check);
    93111    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
    95113    my $ssh_check_stdout = ssh_exec_command("${remote_root}/sc_transfer_tool.pl --input $remote_check --fetch $remote_transfer");
    96114    # We no longer need to parse this output, as it retrieves files itself.
     
    130148# Poll the job status?
    131149my $poll_count = 0;
    132 my $poll_max   = 5;
     150my $poll_max   = 1; # If it isn't finished now, it's unlikely to magically finish in the next five minutes.
    133151my $poll_sleep = 60;
    134152my $poll_response = 0;
    135 while (($poll_count < $poll_max)&&($poll_response != 1)&&($poll_response != -1)) {
     153if ($force) {
     154    $poll_response = 1;
     155}
     156my $poll_word  = "nothing";
     157while (($poll_count < $poll_max)&&($poll_response != 1)&&($poll_response != -1)&&($force != 1)) {
    136158    if ($verbose) {
    137159        print "Polling code.  Sleeping.  $poll_count of $poll_max $poll_response\n";
     
    140162        sleep($poll_sleep);
    141163    }
    142     $poll_response = poll_job($job_id);
     164    ($poll_response,$poll_word) = poll_job($job_id);
    143165
    144166    if ($poll_response == 1) { # This job has completed
     
    146168    }
    147169    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);
    149173    }
    150174    $poll_count++;
     
    165189my $uri_return  = $path_base . ".return";
    166190my ($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
     195my @returned_files = ();
     196my @dbinfo_files   = ();
     197my @dbindex        = ();
     198my $iter           = 0;
    173199open(RETURN,   "$ipp_return") || &my_die("Couldn't open file? $ipp_return", $remote_id,$PS_EXIT_SYS_ERROR);
    174 while(<RETURN>) {
     200while (<RETURN>) {
    175201    chomp;
     202    push @returned_files, $_;
    176203    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
    192209}
    193210close(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
     218my $first = 0;
     219my $last  = $#dbinfo_files;
     220my $mid   = 0;
     221my $range = 20;  # How wide of a chunk to look through to catch threading drops
     222my $offset = 0;  # Offset to start from.
     223if (( stat($dbinfo_files[$last]) )[7] != 0) { $offset = $#dbinfo_files;}
     224else {
     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.
     253my $return_push_output = ssh_exec_command("${remote_root}/sc_transfer_tool.pl --input $remote_return --offset $offset");
     254my $return_push_output_print = join "\n", @{ $return_push_output };
     255print "$return_push_output_print\n";
     256
     257#die();
     258
     259foreach 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}
    194276
    195277# We're done, so set the state and exit.
    196278&my_die("Finished",$remote_id,0,"full");
    197 
    198279
    199280
     
    209290        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    210291        &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.
    217292    }
    218293}
     
    250325sub ssh_exec_command {
    251326    my $cmd = shift;
    252     $cmd = "$ssh $DMZ_HOST ssh ${SEC_HOST} $cmd";
     327    $cmd = "$ssh  $DMZ_HOST ssh ${SEC_HOST} $cmd";
    253328    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    254329        run(command => $cmd, verbose => $verbose);
    255330    unless ($success) {
    256331        $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();
    257334        &my_die("Failed to execute command: >>$cmd<<");
    258335    }
     
    266343   
    267344    if ($response =~ /State: Running/) {
    268         return(0);
     345        return(0,"Running");
    269346    }
    270347    elsif ($response =~ /State: Completed/) {
    271         return(1);
     348        return(1,"Completed");
    272349    }
    273350    elsif ($response =~ /State: Idle/) {
    274         return(-2);
     351        return(-2,"Idle");
    275352    }
    276353    else {
    277         return(-1);
     354        my $response_word = $response;
     355        $response_word =~ s/.*State: //;
     356        $response_word =~ s/\n.*//;
     357        return(-1,$response_word);
    278358    }
    279359}
     
    324404    return($local_uri);
    325405}
     406
     407sub 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
    326440sub my_die {
    327441    my $msg = shift;
     
    347461}
    348462
    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 object
    353 # 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.
    396463# Quick review:
    397464# new -> pending -> run -> full
  • trunk/ippScripts/scripts/sc_transfer_tool.pl

    r37013 r37102  
    1010use Sys::Hostname;
    1111
    12 my $local_raw = '/scratch3/watersc1/raw/';
    13 my $local_tmp = '/scratch3/watersc1/tmp/';
     12my $remote_root = '/lustre/scratch1/turquoise/watersc1/ps1/';
     13
     14my $local_raw = "${remote_root}/raw/";
     15my $local_tmp = "${remote_root}/tmp/";
    1416my $threads = 10;
    1517my @hosts = ('ippc20.ipp.ifa.hawaii.edu','ippc24.ipp.ifa.hawaii.edu','ippc28.ipp.ifa.hawaii.edu',
     
    6870    }
    6971    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";
    7175    }
    7276}
     
    112116
    113117    # 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}:/";
    115120    print STDERR "$command\n";
    116121
     
    118123        run(command => $command, verbose => $verbose);
    119124    unless ($success) {
    120 
    121125        print STDERR "ERROR:  $error_code\n";
    122126#       my $std = join "\n", @{ $stdout_buf };
     
    125129#       print "STDERR: $std\n";
    126130
    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#       }
    136140
    137141        warn("Transfer of $transfer_filelist to $destination_host failed with error $error_code.");
Note: See TracChangeset for help on using the changeset viewer.