Changeset 37833 for trunk/ippScripts/scripts/sc_prepare_stack.pl
- Timestamp:
- Jan 12, 2015, 12:53:36 PM (11 years ago)
- Location:
- trunk/ippScripts/scripts
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
sc_prepare_stack.pl (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts
- Property svn:mergeinfo set to
-
trunk/ippScripts/scripts/sc_prepare_stack.pl
r37195 r37833 1 1 #! /usr/bin/env perl 2 3 # generate the input & output files lists and commands for a single stackRun 2 4 3 5 use Carp; … … 16 18 use Pod::Usage qw( pod2usage ); 17 19 18 19 20 # 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 22 my $remote_root = '/scratch3/watersc1/'; # Far side destination base location 23 my $remote_hostname = "LANL/Mustang"; # Name of the remote node. 24 my $threads_req = 4; # How many threads are we going to use? 25 26 my $fail_state = "prep_fail"; 27 36 28 # Look for programs we need 37 29 my $missing_tools; 38 39 30 my $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);31 my $stacktool = can_run('stacktool') or (warn "Can't find stacktool" and $missing_tools = 1); 41 32 42 33 if ($missing_tools) { … … 48 39 GetOptions( 49 40 'remote_id=s' => \$remote_id, 41 'stack_id=s' => \$stack_id, 50 42 'camera|c=s' => \$camera, 51 43 'dbname|d=s' => \$dbname, … … 56 48 57 49 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 58 pod2usage( -msg => "Required options: --remote_id -- camera --dbname --path_base", -exitval => 3) unless50 pod2usage( -msg => "Required options: --remote_id --stack_id --camera --dbname --path_base", -exitval => 3) unless 59 51 defined($remote_id) and 52 defined($stack_id) and 60 53 defined($camera) and 61 54 defined($path_base) and 62 55 defined($dbname); 63 my $ipprc = PS::IPP::Config->new( $camera ) or my_die( "Unable to set up", $remote_id); 56 57 my $ipprc = PS::IPP::Config->new( $camera ) or &my_die( "Unable to set up", $remote_id, $stack_id, $PS_EXIT_CONFIG_ERROR, $fail_state); 64 58 65 59 my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files 66 60 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"; 61 my @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 89 69 my $uri_transfer= $path_base . ".transfer"; 90 70 my $uri_check = $path_base . ".check"; … … 93 73 my $uri_return = $path_base . ".return"; 94 74 95 my $disk_command = $ipprc->file_resolve($uri_command,1);96 75 my $disk_transfer= $ipprc->file_resolve($uri_transfer,1); 97 76 my $disk_check = $ipprc->file_resolve($uri_check,1); … … 100 79 my $disk_return = $ipprc->file_resolve($uri_return,1); 101 80 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. 81 my (undef, $remote_config) = &uri_convert($uri_config); # Needs to be done after we've created it. 82 83 open(TRANSFER, ">$disk_transfer") || &my_die("Couldn't open file? $disk_transfer",$remote_id, $stack_id, $PS_EXIT_SYS_ERROR, $fail_state); 84 open(CHECK, ">$disk_check") || &my_die("Couldn't open file? $disk_check", $remote_id, $stack_id, $PS_EXIT_SYS_ERROR, $fail_state); 85 open(CONFIG, ">$disk_config") || &my_die("Couldn't open file? $disk_config", $remote_id, $stack_id, $PS_EXIT_SYS_ERROR, $fail_state); 86 open(GENERATE, ">$disk_generate") || &my_die("Couldn't open file? $disk_generate",$remote_id, $stack_id, $PS_EXIT_SYS_ERROR, $fail_state); 87 open(RETURN, ">$disk_return") || &my_die("Couldn't open file? $disk_return", $remote_id, $stack_id, $PS_EXIT_SYS_ERROR, $fail_state); 88 113 89 my $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. 92 my ($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); 128 98 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}; 141 110 $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 } 115 my $ipp_outroot = "${workdir}/${tess_id}/${skycell_id}/${tess_id}.${skycell_id}.stk.${stack_id}"; 116 my $remote_outroot = &uri_local_to_remote($ipp_outroot); 117 my $remote_outdir = &uri_local_to_remote("${workdir}/${tess_id}/${skycell_id}"); 118 119 # STEP 2: Get the list of input warps 120 my ($warpData); 121 { 149 122 # This actually returns all the individual stack/skyfiles that comprise this run. Because consistency. 150 123 my $command = "$stacktool -inputskyfile -stack_id $stack_id "; 151 124 $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); 154 127 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. 167 146 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 182 179 my $ppstack_command = " ppStack -input ${remote_outroot}.in.mdc "; 183 180 $ppstack_command .= " ${remote_outroot} -stats ${remote_outroot}.stats "; … … 191 188 $ppstack_command .= " -R PPSTACK.UNCONV.VARIANCE FITS.TYPE COMP_STACK"; 192 189 $ppstack_command .= " -tracedest ${remote_outroot}.trace -log ${remote_outroot}.log "; 193 $ppstack_command .= " -threads 4";190 $ppstack_command .= " -threads $threads_req "; 194 191 $ppstack_command .= " -dumpconfig ${remote_outroot}.mdc "; 195 192 $ppstack_command .= " -stack_id $stack_id -skycell_id $skycell_id -tess_id $tess_id "; … … 199 196 $post_cmd_echo .= " -dbname $dbname " if defined $dbname; 200 197 $post_cmd_echo .= " -hostname $remote_hostname -dtime_script 0 \" > ${remote_outroot}.dbinfo "; 201 198 202 199 my $post_cmd_SfM = " ppStatsFromMetadata ${remote_outroot}.stats - STACK_SKYCELL >> ${remote_outroot}.dbinfo "; 203 200 … … 207 204 # Determine which output files need to be returned 208 205 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 } 218 211 print CONFIG "\n"; 219 212 } … … 224 217 close(GENERATE); 225 218 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 fill233 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 RESOURCES254 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 263 219 unless($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"; 266 224 $command .= " -dbname $dbname " if defined $dbname; 267 225 … … 269 227 } 270 228 271 272 229 ## Common SC routines 273 230 231 # KEEP 274 232 sub uri_convert { # (ipp_disk,remote_disk) = uri_convert(neb_uri); 275 233 my $neb_uri = shift; 276 234 my $ipp_disk= $ipprc->file_resolve( $neb_uri ); 277 235 my $remote_disk = $ipp_disk; 278 236 279 237 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); 281 239 } 282 240 … … 288 246 } 289 247 248 # KEEP 290 249 sub uri_convert_and_create { # (ipp_disk,remote_disk) = uri_convert_and_create(neb_uri); ipp_disk is created if it doesn't exist 291 250 my $neb_uri = shift; 292 251 my $ipp_disk= $ipprc->file_resolve( $neb_uri , 1); 293 252 my $remote_disk = $ipp_disk; 294 253 295 254 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); 297 256 } 298 257 … … 304 263 } 305 264 265 # KEEP 306 266 sub uri_to_outputs { # (ipp_disk,remote_disk) = uri_to_output(neb_uri); Appends to TRANSFER and CHECK filehandles 307 267 my $neb_uri = shift; 308 268 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"; 315 272 return($ipp_disk,$remote_disk); 316 273 } 317 274 275 # KEEP 318 276 sub uri_to_outputs_for_return { # (ipp_disk,remote_disk) = uri_to_outputs_for_return(neb_uri); create ipp_disk, append to RETURN and GENERATE 319 277 my $neb_uri = shift; 320 278 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"; 326 282 return($ipp_disk,$remote_disk); 327 283 } 328 284 285 # KEEP 329 286 sub uri_local_to_remote { #(remote_uri) = uri_local_to_remote(local_neb_uri); 330 287 # This needs to replace the nebulous tag with the remote root. … … 337 294 return($remote_uri); 338 295 } 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 349 296 350 297 sub my_die { # exit with status; my_die(message,stage_id,exit_code,exit_status); 351 298 my $msg = shift; 352 my $id = shift; 299 my $remote_id = shift; 300 my $stage_id = shift; 353 301 my $exit_code = shift; 354 302 my $exit_state = shift; … … 357 305 358 306 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"; 363 310 $command .= " -set_state $exit_state " if defined $exit_state; 364 311 $command .= " -dbname $dbname " if defined $dbname;
Note:
See TracChangeset
for help on using the changeset viewer.
