IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 12, 2015, 12:53:36 PM (11 years ago)
Author:
eugene
Message:

merging changes from ipp-pv3-20140717 (via branches/eam_branches/ipp-pv3-20140717-merge)

Location:
trunk/ippScripts/scripts
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippScripts/scripts

  • trunk/ippScripts/scripts/sc_prepare_stack.pl

    r37195 r37833  
    11#! /usr/bin/env perl
     2
     3# generate the input & output files lists and commands for a single stackRun
    24
    35use Carp;
     
    1618use Pod::Usage qw( pod2usage );
    1719
    18 
    1920# Hard coded values
    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
    22 $remote_root = '/scratch3/watersc1/';
    23 my $threads       = 2;                      # How many threads are we going to use?
    24 my $job_cost      = 1500 / 60 / 60;           # Estimate of how long a job runs, in hours.
    25 my $proc_per_node = 24;                     # processors per node
    26 my $min_nodes     = 1;                      # smallest allocation to ask for
    27 my $max_nodes     = 1000;                   # largest allocation to ask for
    28 my $min_time      = 1;                      # shortest allocation to ask for
    29 my $max_time      = 8;                      # longest allocation to ask for
    30 my $remote_hostname   = "LANL/Mustang";         # Name of the remote node.
    31 my @return_component_list = ("DBINFO.EXP", "PPSTACK.UNCONV","PPSTACK.UNCONV.MASK","PPSTACK.UNCONV.VARIANCE",
    32                              "PPSTACK.UNCONV.EXP","PPSTACK.UNCONV.EXPWT","PPSTACK.UNCONV.EXPNUM","PSPHOT.OUTPUT",
    33                              "LOG.EXP", "PSASTRO.STATS",
    34                              "PPSTACK.CONFIG","PPSTACK.TARGET.PSF","PSPHOT.STACK.PSF.SAVE");
    35 #,"PPSTACK.CONV.KERNEL");
     21# my $remote_root   = '/lustre/scratch1/turquoise/watersc1/ps1/'; # Far side destination base location
     22my $remote_root     = '/scratch3/watersc1/';  # Far side destination base location
     23my $remote_hostname = "LANL/Mustang";         # Name of the remote node.
     24my $threads_req     = 4;                      # How many threads are we going to use?
     25
     26my $fail_state = "prep_fail";
     27
    3628# Look for programs we need
    3729my $missing_tools;
    38 
    3930my $remotetool = can_run('remotetool') or (warn "Can't find remotetool" and $missing_tools = 1);
    40 my $stacktool    = can_run('stacktool') or (warn "Can't find warptool" and $missing_tools = 1);
     31my $stacktool    = can_run('stacktool') or (warn "Can't find stacktool" and $missing_tools = 1);
    4132
    4233if ($missing_tools) {
     
    4839GetOptions(
    4940    'remote_id=s'    => \$remote_id,
     41    'stack_id=s'     => \$stack_id,
    5042    'camera|c=s'     => \$camera,
    5143    'dbname|d=s'     => \$dbname,
     
    5648
    5749pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
    58 pod2usage( -msg => "Required options: --remote_id --camera --dbname --path_base", -exitval => 3) unless
     50pod2usage( -msg => "Required options: --remote_id --stack_id --camera --dbname --path_base", -exitval => 3) unless
    5951    defined($remote_id) and
     52    defined($stack_id) and
    6053    defined($camera) and
    6154    defined($path_base) and
    6255    defined($dbname);
    63 my $ipprc = PS::IPP::Config->new( $camera ) or my_die( "Unable to set up", $remote_id);
     56
     57my $ipprc = PS::IPP::Config->new( $camera ) or &my_die( "Unable to set up", $remote_id, $stack_id, $PS_EXIT_CONFIG_ERROR, $fail_state);
    6458
    6559my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files
    6660
    67 #
    68 # Step 1: Get a list of the components that make up this remoteRun
    69 
    70 # SHould this call listrun to ensure we're in state new?
    71 my $rt_cmd = "$remotetool -listcomponent -remote_id $remote_id";
    72 $rt_cmd   .= " -dbname $dbname " if defined($dbname);
    73 
    74 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    75     run(command => $rt_cmd, verbose => $verbose);
    76 unless ($success) {
    77     $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    78     &my_die("Unable to run remotetool to determine stage parameters.",
    79             $remote_id,$error_code);
    80 }
    81 my $compData = $mdcParser->parse(join "", @$stdout_buf) or
    82     &my_die("Unable to determine component information.",
    83             $remote_id,$PS_EXIT_PROG_ERROR);
    84 my $compData2= parse_md_list($compData);
    85 
    86 #
    87 # Step 1b: Open output files
    88 my $uri_command = $path_base . ".cmd";
     61my @return_component_list = ("DBINFO.EXP", "PPSTACK.UNCONV","PPSTACK.UNCONV.MASK","PPSTACK.UNCONV.VARIANCE",
     62                             "PPSTACK.UNCONV.EXP","PPSTACK.UNCONV.EXPWT","PPSTACK.UNCONV.EXPNUM",
     63                             "PSPHOT.OUT.CMF.MEF", # Use this output product to get the one that exists.
     64                             "LOG.EXP", "PSASTRO.STATS",
     65                             "PPSTACK.CONFIG","PPSTACK.TARGET.PSF","PSPHOT.STACK.PSF.SAVE");
     66#,"PPSTACK.CONV.KERNEL");
     67
     68# STEP 0: Open output files
    8969my $uri_transfer= $path_base . ".transfer";
    9070my $uri_check   = $path_base . ".check";
     
    9373my $uri_return  = $path_base . ".return";
    9474
    95 my $disk_command = $ipprc->file_resolve($uri_command,1);
    9675my $disk_transfer= $ipprc->file_resolve($uri_transfer,1);
    9776my $disk_check   = $ipprc->file_resolve($uri_check,1);
     
    10079my $disk_return  = $ipprc->file_resolve($uri_return,1);
    10180
    102 my (undef, $remote_config) = uri_convert($uri_config); # Needs to be done after we've created it.
    103 
    104 open(TRANSFER, ">$disk_transfer")  || &my_die("Couldn't open file? $disk_transfer",$remote_id,$PS_EXIT_SYS_ERROR);
    105 open(CHECK,    ">$disk_check")  || &my_die("Couldn't open file? $disk_check",$remote_id,$PS_EXIT_SYS_ERROR);
    106 open(CONFIG,   ">$disk_config")  || &my_die("Couldn't open file? $disk_config",$remote_id,$PS_EXIT_SYS_ERROR);
    107 open(GENERATE, ">$disk_generate") || &my_die("Couldn't open file? $disk_generate",$remote_id,$PS_EXIT_SYS_ERROR);
    108 open(RETURN,   ">$disk_return") || &my_die("Couldn't open file? $disk_return", $remote_id, $PS_EXIT_SYS_ERROR);
    109 
    110 
    111 #
    112 # Step 2: Iterate over all componenets in this remote run.
     81my (undef, $remote_config) = &uri_convert($uri_config); # Needs to be done after we've created it.
     82
     83open(TRANSFER, ">$disk_transfer")  || &my_die("Couldn't open file? $disk_transfer",$remote_id, $stack_id, $PS_EXIT_SYS_ERROR, $fail_state);
     84open(CHECK,    ">$disk_check")     || &my_die("Couldn't open file? $disk_check",   $remote_id, $stack_id, $PS_EXIT_SYS_ERROR, $fail_state);
     85open(CONFIG,   ">$disk_config")    || &my_die("Couldn't open file? $disk_config",  $remote_id, $stack_id, $PS_EXIT_SYS_ERROR, $fail_state);
     86open(GENERATE, ">$disk_generate")  || &my_die("Couldn't open file? $disk_generate",$remote_id, $stack_id, $PS_EXIT_SYS_ERROR, $fail_state);
     87open(RETURN,   ">$disk_return")    || &my_die("Couldn't open file? $disk_return",  $remote_id, $stack_id, $PS_EXIT_SYS_ERROR, $fail_state);
     88
    11389my $job_index = 0;
    114 my @pre_commands = ();
    115 my @main_commands = ();
    116 my @post_commands = ();
    117 my %file_filter = ();
    118 
    119 
    120 foreach my $compEntry (@$compData2) {
    121     my $stack_id = $compEntry->{stage_id};
    122 
    123 # Get exposure level information from the stackRun we're working from.
    124     my $run_command = "$stacktool -tosum -stack_id $stack_id";
    125     $run_command .= " -dbname $dbname " if defined($dbname);
    126     ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    127         run(command => $run_command, verbose => 0);
     90
     91# STEP 1: Get exposure level information from the stackRun we're working from.
     92my ($reduction, $workdir, $tess_id, $skycell_id);
     93{
     94    my $command = "$stacktool -tosum -stack_id $stack_id";
     95    $command .= " -dbname $dbname " if defined($dbname);
     96    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     97        run(command => $command, verbose => $verbose);
    12898    unless ($success) {
    129         $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    130         &my_die("Unable to run stacktool -tosum ",
    131                 $stack_id,$error_code);
    132     }
    133 
    134     my $stackData = $mdcParser->parse(join "", @$stdout_buf) or
    135         &my_die("Unable to determine stack component information.",
    136                 $stack_id,$PS_EXIT_PROG_ERROR);
    137     my $stackData2= parse_md_list($stackData);
    138 
    139     my $stack = ${ $stackData2 }[0];
    140     my $reduction = $stack->{reduction};
     99        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     100        &my_die("Unable to run stacktool -tosum ", $remote_id, $stack_id, $error_code, $fail_state);
     101    }
     102
     103    my $MDlist = $mdcParser->parse(join "", @$stdout_buf) or
     104        &my_die("Unable to determine stack component information.", $remote_id, $stack_id, $PS_EXIT_PROG_ERROR, $fail_state);
     105    my $metadata = parse_md_list($MDlist);
     106
     107    my $stack = $metadata->[0];
     108
     109    $reduction = $stack->{reduction};
    141110    $reduction = 'DEFAULT' unless defined($reduction);
    142     my $workdir   = $stack->{workdir};
    143     my $tess_id   = $stack->{tess_id};
    144     my $skycell_id= $stack->{skycell_id};
    145 
    146     my $ipp_outroot    = "${workdir}/${tess_id}/${skycell_id}/${tess_id}.${skycell_id}.stk.${stack_id}";   
    147     my $remote_outroot = uri_local_to_remote($ipp_outroot);   
    148     my $remote_outdir  = uri_local_to_remote("${workdir}/${tess_id}/${skycell_id}");
     111    $workdir   = $stack->{workdir};
     112    $tess_id   = $stack->{tess_id};
     113    $skycell_id= $stack->{skycell_id};
     114}
     115my $ipp_outroot    = "${workdir}/${tess_id}/${skycell_id}/${tess_id}.${skycell_id}.stk.${stack_id}";
     116my $remote_outroot = &uri_local_to_remote($ipp_outroot);
     117my $remote_outdir  = &uri_local_to_remote("${workdir}/${tess_id}/${skycell_id}");
     118
     119# STEP 2: Get the list of input warps
     120my ($warpData);
     121{
    149122    # This actually returns all the individual stack/skyfiles that comprise this run.  Because consistency.
    150123    my $command = "$stacktool -inputskyfile -stack_id $stack_id ";
    151124    $command .= " -dbname $dbname " if defined($dbname);
    152     ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    153         run(command => $command, verbose => 0);
     125    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     126        run(command => $command, verbose => $verbose);
    154127    unless ($success) {
    155         $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    156         &my_die("Unable to run stacktool -inputskyfile ",
    157                 $stack_id,$error_code);
    158     }
    159 
    160     my $warpData = $mdcParser->parse(join "", @$stdout_buf) or
    161         &my_die("Unable to determine stack component information.",
    162                 $stack_id,$PS_EXIT_PROG_ERROR);
    163     my $warpData2= parse_md_list($warpData);
    164 
    165 #
    166 # Step 3: Iterate over the sub-components
     128        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     129        &my_die("Unable to run stacktool -inputskyfile ", $remote_id, $stack_id, $error_code, $fail_state);
     130    }
     131
     132    my $MDlist = $mdcParser->parse(join "", @$stdout_buf) or
     133        &my_die("Unable to determine stack component information.", $remote_id, $stack_id, $PS_EXIT_PROG_ERROR, $fail_state);
     134    $warpData = parse_md_list($MDlist);
     135}
     136
     137# STEP 3: Iterate over the sub-components
     138{
     139    # Generate a file mapping the symbolic and "disk" representations of each needed file.
     140    my $uri_compmap   = "${ipp_outroot}.compmap";
     141    my $component_map = $ipprc->file_resolve($uri_compmap,1);   
     142    my ($ipp_compmap, $remote_compmap) = &uri_to_outputs($component_map);
     143    open(COMPMAP,">$ipp_compmap") || &my_die("Couldn't open file? $ipp_compmap",  $remote_id, $stack_id, $PS_EXIT_SYS_ERROR, $fail_state);
     144   
     145    # Loop over all needed components for this stack.
    167146    my $warp_path_base_string = "";
    168     foreach my $warpEntry ( @{ $warpData2 } ) {
    169         my $warp_path_base = $warpEntry->{path_base};
    170         my $remote_path_base = uri_local_to_remote($warp_path_base);
    171         $warp_path_base_string .= " $remote_path_base ";
    172 
    173         # Append file names to transfer lists so we can recover if warps are deleted.
    174         uri_to_outputs($warp_path_base . ".fits");
    175         uri_to_outputs($warp_path_base . ".wt.fits");
    176         uri_to_outputs($warp_path_base . ".mask.fits");
    177         uri_to_outputs($warp_path_base . ".cmf");
    178 #       uri_to_outputs($warp_path_base . ".psf");
    179     }
    180     my $mk_mdc_command = "mkdir -p $remote_outdir && sc_mk_stack_mdc.pl $warp_path_base_string > ${remote_outroot}.in.mdc";
    181     my $recipe_ppstack = $ipprc->reduction($reduction, 'STACK_PPSTACK'); # Recipe to use                                                                         
     147    foreach my $warpEntry ( @{ $warpData } ) {
     148        my $warp_path_base = $warpEntry->{path_base};
     149        my $remote_path_base = &uri_local_to_remote($warp_path_base);
     150        $warp_path_base_string .= " $remote_path_base ";
     151
     152        if ($verbose) { print STDERR "$warp_path_base_string\n"; }
     153
     154        # Append file names to transfer lists so we can recover if warps are deleted.
     155        my $remote_file;
     156        my $ipp_disk;
     157        #  ${remote_root}/tmp/${ipp_disk}
     158        (undef,$remote_file) = &uri_to_outputs($warp_path_base . ".fits");
     159        ($ipp_disk,undef)    = &uri_convert($warp_path_base . ".fits");
     160        print COMPMAP "$remote_file ${remote_root}/tmp/${ipp_disk}\n";
     161        (undef,$remote_file) = &uri_to_outputs($warp_path_base . ".wt.fits");
     162        ($ipp_disk,undef)    = &uri_convert($warp_path_base . ".wt.fits");
     163        print COMPMAP "$remote_file ${remote_root}/tmp/${ipp_disk}\n";
     164        (undef,$remote_file) = &uri_to_outputs($warp_path_base . ".mask.fits");
     165        ($ipp_disk,undef)    = &uri_convert($warp_path_base . ".mask.fits");
     166        print COMPMAP "$remote_file ${remote_root}/tmp/${ipp_disk}\n";
     167        (undef,$remote_file) = &uri_to_outputs($warp_path_base . ".cmf");
     168        ($ipp_disk,undef)    = &uri_convert($warp_path_base . ".cmf");
     169        print COMPMAP "$remote_file ${remote_root}/tmp/${ipp_disk}\n";
     170        (undef,$remote_file) = &uri_to_outputs($warp_path_base . ".psf");
     171        ($ipp_disk,undef)    = &uri_convert($warp_path_base . ".psf");
     172        print COMPMAP "$remote_file ${remote_root}/tmp/${ipp_disk}\n";
     173    }
     174
     175    close(COMPMAP);
     176
     177    my $mk_mdc_command = "mkdir -p $remote_outdir && sc_mk_stack_mdc.pl --compmap ${remote_root}/tmp/${component_map} $warp_path_base_string > ${remote_outroot}.in.mdc";
     178    my $recipe_ppstack = $ipprc->reduction($reduction, 'STACK_PPSTACK'); # Recipe to use
    182179    my $ppstack_command  = " ppStack -input ${remote_outroot}.in.mdc ";
    183180    $ppstack_command    .= " ${remote_outroot} -stats ${remote_outroot}.stats ";
     
    191188    $ppstack_command    .= " -R PPSTACK.UNCONV.VARIANCE FITS.TYPE COMP_STACK";
    192189    $ppstack_command    .= " -tracedest ${remote_outroot}.trace -log ${remote_outroot}.log ";
    193     $ppstack_command    .= " -threads 4 ";
     190    $ppstack_command    .= " -threads $threads_req ";
    194191    $ppstack_command    .= " -dumpconfig ${remote_outroot}.mdc ";
    195192    $ppstack_command    .= " -stack_id $stack_id -skycell_id $skycell_id -tess_id $tess_id ";
     
    199196    $post_cmd_echo   .=  " -dbname $dbname " if defined $dbname;
    200197    $post_cmd_echo   .= " -hostname $remote_hostname -dtime_script 0 \" > ${remote_outroot}.dbinfo ";
    201        
     198
    202199    my $post_cmd_SfM  = " ppStatsFromMetadata ${remote_outroot}.stats - STACK_SKYCELL >> ${remote_outroot}.dbinfo ";
    203200
     
    207204    # Determine which output files need to be returned
    208205    foreach my $component(@return_component_list) {
    209         my $filename = $ipprc->filename($component,$ipp_outroot);
    210         my ($ipp_disk, $remote_disk) = uri_to_outputs_for_return( $filename);
    211         my $remote_outroot_dir = dirname($ipp_disk);
    212         print CONFIG " && mkdir -p ${remote_root}/tmp/${remote_outroot_dir} && ln -sf $remote_disk ${remote_root}/tmp/${ipp_disk} && touch $remote_disk ";
    213     }
    214 
    215 #     my $cleanup_cmd   = " (rm -f /scratch3/watersc1/sys_temp/${tess_id}.${skycell_id}.stk.${stack_id}.*conv.*.fits || true) ";   
    216 #     print CONFIG " && ${cleanup_cmd} \n";
    217 
     206        my $filename = $ipprc->filename($component,$ipp_outroot);
     207        my ($ipp_disk, $remote_disk) = &uri_to_outputs_for_return( $filename);
     208        my $remote_outroot_dir = dirname($ipp_disk);
     209        print CONFIG " && mkdir -p ${remote_root}/tmp/${remote_outroot_dir} && ln -sf $remote_disk ${remote_root}/tmp/${ipp_disk} && touch $remote_disk ";
     210    }
    218211    print CONFIG "\n";
    219212}
     
    224217close(GENERATE);
    225218
    226 #
    227 # Construct the moab command last, so we can use the job_index counter to estimate resources.  Somehow.
    228 my $proc_need = $job_index * $threads;       # how many total processors do we need?
    229 my $node_need = $proc_need / $proc_per_node; # this equals how many nodes?
    230 my $time_need = $job_index * $job_cost;      # How many seconds will this take?
    231 
    232 my $fill_factor = 0.8;  # This is the factor of how much of the time allocation we'd like to fill
    233 my ($time_req,$node_req);
    234 if ($node_need * $job_cost < $fill_factor * $min_nodes * $min_time) {
    235     $time_req = $min_time;
    236     $node_req = $min_nodes;
    237 }
    238 elsif ($node_need * $job_cost > $fill_factor * $max_nodes * $max_time) {
    239     $time_req = $max_time;
    240     $node_req = $max_nodes;
    241     print STDERR "You've requested the construction of a bundle that appears to need $node_need nodes and $job_cost time per job.  This exceeds the max limits ($max_nodes, $max_time).  Using those max values instead.  Good luck.\n";
    242 }
    243 else {
    244     $time_req = int(($node_need * $job_cost) / ($fill_factor * $max_nodes)) + 1;
    245     $node_req = int(($node_need * $job_cost) / ($fill_factor * $time_req)) + 1;
    246 }
    247 
    248 $time_req += 2;
    249 $node_req *= 3;
    250 open(COMMAND,  ">$disk_command") || &my_die("Couldn't open file? $disk_command",$remote_id,$PS_EXIT_SYS_ERROR);
    251 print COMMAND "#!/bin/tcsh\n";
    252 print COMMAND "##### Moab controll lines\n";
    253 print COMMAND "#MSUB -l nodes=${node_req}:ppn=${proc_per_node},walltime=${time_req}:00:00\n"; ## CHECK RESOURCES
    254 print COMMAND "#MSUB -j oe\n";
    255 print COMMAND "#MSUB -V\n";
    256 print COMMAND "#MSUB -o ${remote_root}stack.${remote_id}.out\n";
    257 print COMMAND "date\n";
    258 print COMMAND 'srun -n $SLURM_JOB_NUM_NODES -m cyclic -l /bin/hostname | sort -n | awk \'{printf "%s\n", $2}\' > hosts.${SLURM_JOB_ID}' . "\n";
    259 print COMMAND "${remote_root}/stask_chip.py $remote_config " . 'hosts.${SLURM_JOB_ID} 3' . "\n";
    260 print COMMAND "date\n";
    261 close(COMMAND);
    262 
    263219unless($no_update) {
    264     my $command = "remotetool -updaterun -remote_id $remote_id ";
    265     $command .= " -set_state pending ";
     220    my $command = "remotetool -updatecomponent -remote_id $remote_id -stage_id $stack_id ";
     221    $command .= " -set_jobs $job_index";
     222    $command .= " -set_path_base $path_base";
     223    $command .= " -set_state prep_done";
    266224    $command .= " -dbname $dbname " if defined $dbname;
    267225
     
    269227}
    270228
    271 
    272229## Common SC routines
    273230
     231# KEEP
    274232sub uri_convert { # (ipp_disk,remote_disk) = uri_convert(neb_uri);
    275233    my $neb_uri = shift;
    276234    my $ipp_disk= $ipprc->file_resolve( $neb_uri );
    277235    my $remote_disk = $ipp_disk;
    278    
     236
    279237    unless(defined($ipp_disk)) {
    280         my_die();
     238        &my_die( "Unable to generate file for $neb_uri ", $remote_id, $stack_id, $PS_EXIT_SYS_ERROR, $fail_state);
    281239    }
    282240
     
    288246}
    289247
     248# KEEP
    290249sub uri_convert_and_create { # (ipp_disk,remote_disk) = uri_convert_and_create(neb_uri); ipp_disk is created if it doesn't exist
    291250    my $neb_uri = shift;
    292251    my $ipp_disk= $ipprc->file_resolve( $neb_uri , 1);
    293252    my $remote_disk = $ipp_disk;
    294    
     253
    295254    unless(defined($ipp_disk)) {
    296         my_die();
     255        &my_die( "Unable to generate file for $neb_uri ", $remote_id, $stack_id, $PS_EXIT_SYS_ERROR, $fail_state);
    297256    }
    298257
     
    304263}
    305264
     265# KEEP
    306266sub uri_to_outputs { # (ipp_disk,remote_disk) = uri_to_output(neb_uri); Appends to TRANSFER and CHECK filehandles
    307267    my $neb_uri = shift;
    308268    my ($ipp_disk, $remote_disk) = uri_convert( $neb_uri );
    309    
    310     unless (exists($file_filter{$neb_uri})) {
    311         $file_filter{$neb_uri} = 1;
    312         print TRANSFER "$ipp_disk\n";
    313         print CHECK    "$remote_disk\n";
    314     }
     269
     270    print TRANSFER "$ipp_disk\n";
     271    print CHECK    "$remote_disk\n";
    315272    return($ipp_disk,$remote_disk);
    316273}
    317274
     275# KEEP
    318276sub uri_to_outputs_for_return { # (ipp_disk,remote_disk) = uri_to_outputs_for_return(neb_uri); create ipp_disk, append to RETURN and GENERATE
    319277    my $neb_uri = shift;
    320278    my ($ipp_disk, $remote_disk) = uri_convert_and_create( $neb_uri );
    321     unless (exists($file_filter{$neb_uri})) {
    322         $file_filter{$neb_uri} = 1;
    323         print RETURN "$ipp_disk\n";
    324         print GENERATE "$remote_disk\n";
    325     }
     279
     280    print RETURN "$ipp_disk\n";
     281    print GENERATE "$remote_disk\n";
    326282    return($ipp_disk,$remote_disk);
    327283}
    328284
     285# KEEP
    329286sub uri_local_to_remote { #(remote_uri) = uri_local_to_remote(local_neb_uri);
    330287    # This needs to replace the nebulous tag with the remote root.
     
    337294    return($remote_uri);
    338295}
    339  
    340 sub uri_remote_to_local { #(local_neb_uri) = uri_remote_to_local(remote_uri);
    341     # This needs to replace the remote root directory with the nebulous tag.
    342     my $remote_uri = shift;
    343     $remote_uri =~ s%${remote_root}%%;
    344     my $local_uri  = "neb:///" . $remote_uri;
    345    
    346     return($local_uri);
    347 }
    348 
    349296
    350297sub my_die { # exit with status; my_die(message,stage_id,exit_code,exit_status);
    351298    my $msg = shift;
    352     my $id  = shift;
     299    my $remote_id  = shift;
     300    my $stage_id  = shift;
    353301    my $exit_code = shift;
    354302    my $exit_state = shift;
     
    357305
    358306    carp($msg);
    359    
    360     if (defined $id and not $no_update) {
    361         my $command = "remotetool -updaterun -remote_id $id";
    362         $command .= " -fault $exit_code " if defined $exit_code;
     307
     308    if (defined $remote_id and defined $stage_id and not $no_update) {
     309        my $command = "remotetool -updatecomponent -remote_id $remote_id -stage_id $stage_id";
    363310        $command .= " -set_state $exit_state " if defined $exit_state;
    364311        $command .= " -dbname $dbname " if defined $dbname;
Note: See TracChangeset for help on using the changeset viewer.