IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 37332


Ignore:
Timestamp:
Aug 29, 2014, 3:18:55 PM (12 years ago)
Author:
watersc1
Message:

stack_skycell.pl: We should never use the uri value, the path_base should be used instead.
sc_chip: use the ...tmp directory tree instead of the ...raw directory tree.
sc_transfer: same, remove -t option
sc_prep_run: implement job subscription values in the stask call, to prevent stacks overloading a node.
sc_warp: write a valid uri entry.
sc_stack: write a component map file that contains the locations of both possible locations for the warp.
sc_stack_mdc: read that map and use it to construct a useful mdc file with the most useful files.

sc_exec,sc_camera,queuestaticsky: mergeinfo things that svn insists I need to commit.

Location:
tags/ipp-pv3-20140717/ippScripts/scripts
Files:
2 deleted
11 edited

Legend:

Unmodified
Added
Removed
  • tags/ipp-pv3-20140717/ippScripts/scripts

  • tags/ipp-pv3-20140717/ippScripts/scripts/queuestaticsky.pl

  • tags/ipp-pv3-20140717/ippScripts/scripts/sc_mk_stack_mdc.pl

    r36844 r37332  
    11#! /usr/bin/env perl                                                                                                                                                       
    2 
    32use Carp;
    43use warnings;
    54use strict;
    65
     6use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt );
     7use Pod::Usage qw( pod2usage );
     8
     9
     10my $remote_root = '/scratch3/watersc1/';
     11my
     12
     13my ($compmap_file);
     14GetOptions(
     15    'compmap=s'   => \$compmap_file,
     16    ) or pod2usage( 2 );
     17
     18pod2usage( -msg => "Required options: --compmap", -exitval => 3) unless
     19    defined($compmap_file);
     20
     21my %component_map = ();
     22open(CM,$compmap_file) || die "Cannot find requested compmap file";
     23while(<CM>) {
     24    chomp;
     25    my ($symbolic_name,$disk_name) = split /\s+/;
     26    $component_map{$symbolic_name} = $disk_name;
     27}
     28close(CM);
     29
    730my $counter = 0;
    831
    932foreach my $path_base (@ARGV) {
    10     print "INPUT${counter}  METADATA\n";
    11     print "   IMAGE           STR     ${path_base}.fits\n";
    12     print "   MASK            STR     ${path_base}.mask.fits\n";
    13     print "   VARIANCE        STR     ${path_base}.wt.fits\n";
    14     print "   PSF             STR     ${path_base}.psf\n";
    15     print "   SOURCES         STR     ${path_base}.cmf\n";
    16     print "   BKGMODEL        STR     ${path_base}.mdl.fits\n";
    17     print "END\n\n";
     33    my $mdc_content = "";
     34    my $file = "";
     35    my $error = 0;
     36    #header
     37    $mdc_content .= "INPUT${counter}  METADATA\n";
     38
     39    # check each file against its possible locations, incrementing the error counter if not found
     40    $file = do_checks("${path_base}.fits",$error);
     41    $mdc_content .=  "   IMAGE           STR     $file\n";
     42
     43    $file = do_checks("${path_base}.mask.fits",$error);
     44    $mdc_content .=  "   MASK            STR     $file\n";
     45
     46    $file = do_checks("${path_base}.wt.fits",$error);
     47    $mdc_content .=  "   VARIANCE        STR     $file\n";
     48   
     49    $file = do_checks("${path_base}.psf",$error);
     50    $mdc_content .=  "   PSF             STR     $file\n";
     51   
     52    $file = do_checks("${path_base}.cmf",$error);
     53    $mdc_content .=  "   SOURCES         STR     $file\n";
     54
     55    # This is static, and isn't used by ppStack, but I believe needs to exist in the mdc. 2014-08-28 czw
     56    $mdc_content .=  "   BKGMODEL        STR     ${path_base}.mdl.fits\n";
     57    $mdc_content .=  "END\n\n";
     58
     59    # If we had no errors, print it and move on.
     60    if ($error != 0) {
     61        print $mdc_content;
     62    }
     63
    1864    $counter++;
    1965}
     66
     67sub do_checks {
     68    my $file = shift(@ARGV);
     69    if (! ((-e $file)&&(-s $file))) { # This file does not exist or is zero size.
     70        $file = "${remote_root}/tmp/$component_map{$file}";
     71        if (! ((-e $file)&&(-s $file))) { # The other expected file did not exist.
     72            $file = '';
     73            die "Missing file!";
     74        }
     75    }
     76    return($file);
     77}
     78   
  • tags/ipp-pv3-20140717/ippScripts/scripts/sc_prepare_camera.pl

    • Property svn:mergeinfo deleted
  • tags/ipp-pv3-20140717/ippScripts/scripts/sc_prepare_chip.pl

    r37316 r37332  
    2222my $remote_root     = '/scratch3/watersc1/';  # Far side destination base location
    2323my $remote_hostname = "LANL/Mustang";         # Name of the remote node.
    24 my $remote_raw      = "${remote_root}/raw/";  # Directory to find raw data in.
     24my $remote_raw      = "${remote_root}/tmp/";  # Directory to find raw data in.
    2525my $threads_req     = 4;
    2626
  • tags/ipp-pv3-20140717/ippScripts/scripts/sc_prepare_run.pl

    r37298 r37332  
    2424# my $remote_root   = '/lustre/scratch1/turquoise/watersc1/ps1/'; # Far side destination base location
    2525my $remote_root = '/scratch3/watersc1/';
    26 my $remote_raw    = "${remote_root}/raw/";  # Directory to find raw data in.
     26my $remote_raw    = "${remote_root}/tmp/";  # Directory to find raw data in.
    2727
    2828my $threads       = 2;                      # How many threads are we going to use?
     
    3636$job_cost{"warp"}   = 110 / 60 / 60;
    3737$job_cost{"stack"}  = 1500 / 60 / 60;
     38
     39# This object holds how "expensive" a given job is in terms of cores on a node. 
     40# Passed to stask to limit how many jobs run simultaneously
     41my %job_subscription = (); 
     42$job_subscription{"camera"} = 1;
     43$job_subscription{"chip"}   = 1;
     44$job_subscription{"warp"}   = 1;
     45$job_subscription{"stack"}  = 3;
    3846
    3947my $proc_per_node = 24;                     # processors per node
     
    236244print COMMAND "date\n";
    237245print COMMAND 'srun -n $SLURM_JOB_NUM_NODES -m cyclic -l /bin/hostname | sort -n | awk \'{printf "%s\n", $2}\' > hosts.${SLURM_JOB_ID}' . "\n";
    238 print COMMAND "${remote_root}/stask_chip.py $remote_config " . 'hosts.${SLURM_JOB_ID} 1' . "\n";
     246print COMMAND "${remote_root}/stask_chip.py $remote_config " . 'hosts.${SLURM_JOB_ID} '  . $job_subscription{$stage} . "\n";
    239247print COMMAND "date\n";
    240248close(COMMAND);
  • tags/ipp-pv3-20140717/ippScripts/scripts/sc_prepare_stack.pl

    • Property svn:mergeinfo deleted
    r37322 r37332  
    136136# STEP 3: Iterate over the sub-components
    137137{
     138    # Generate a file mapping the symbolic and "disk" representations of each needed file.
     139    my $uri_compmap   = ${remote_outroot}.compmap;
     140    my $component_map = $ipprc->file_resolve($uri_compmap,1);   
     141    my ($ipp_compmap, $remote_compmap) = &uri_to_outputs($component_map);
     142    open(COMPMAP,">$ipp_compmap") || &my_die("Couldn't open file? $ipp_compmap",  $remote_id, $stack_id, $PS_EXIT_SYS_ERROR, $fail_state);
     143   
     144    # Loop over all needed components for this stack.
    138145    my $warp_path_base_string = "";
    139146    foreach my $warpEntry ( @{ $warpData } ) {
     
    145152
    146153        # Append file names to transfer lists so we can recover if warps are deleted.
    147         &uri_to_outputs($warp_path_base . ".fits");
    148         &uri_to_outputs($warp_path_base . ".wt.fits");
    149         &uri_to_outputs($warp_path_base . ".mask.fits");
    150         &uri_to_outputs($warp_path_base . ".cmf");
    151 #       &uri_to_outputs($warp_path_base . ".psf");
    152     }
    153     my $mk_mdc_command = "mkdir -p $remote_outdir && sc_mk_stack_mdc.pl $warp_path_base_string > ${remote_outroot}.in.mdc";
     154        my $remote_file;
     155        (undef,$remote_file) = &uri_to_outputs($warp_path_base . ".fits");
     156        print COMPMAP "${warp_path_base}.fits $remote_file\n";
     157        (undef,$remote_file) = &uri_to_outputs($warp_path_base . ".wt.fits");
     158        print COMPMAP "${warp_path_base}.wt.fits $remote_file\n";
     159        (undef,$remote_file) = &uri_to_outputs($warp_path_base . ".mask.fits");
     160        print COMPMAP "${warp_path_base}.maskfits $remote_file\n";
     161        (undef,$remote_file) = &uri_to_outputs($warp_path_base . ".cmf");
     162        print COMPMAP "${warp_path_base}.cmf $remote_file\n";
     163        (undef,$remote_file) = &uri_to_outputs($warp_path_base . ".psf");
     164        print COMPMAP "${warp_path_base}.psf $remote_file\n";
     165    }
     166
     167    close(COMPMAP);
     168
     169    my $mk_mdc_command = "mkdir -p $remote_outdir && sc_mk_stack_mdc.pl --compmap $remote_compmap $warp_path_base_string > ${remote_outroot}.in.mdc";
    154170    my $recipe_ppstack = $ipprc->reduction($reduction, 'STACK_PPSTACK'); # Recipe to use
    155171    my $ppstack_command  = " ppStack -input ${remote_outroot}.in.mdc ";
  • tags/ipp-pv3-20140717/ippScripts/scripts/sc_prepare_warp.pl

    • Property svn:mergeinfo deleted
    r37322 r37332  
    184184
    185185        my $post_cmd_echo = " echo -n \"warptool  -addwarped -warp_id $warp_id -skycell_id $skycell_id -tess_id $tess_id ";
    186         $post_cmd_echo   .= " -path_base $remote_outroot -uri UNKNOWN ";
    187186        $post_cmd_echo   .=  " -dbname $dbname " if defined $dbname;
     187        $post_cmd_echo   .= " -uri ${ipp_outroot}.fits ";
    188188        $post_cmd_echo   .= " -path_base $ipp_outroot -hostname $remote_hostname -dtime_script 0 \" > ${remote_outroot}.dbinfo ";
    189189
  • tags/ipp-pv3-20140717/ippScripts/scripts/sc_remote_exec.pl

  • tags/ipp-pv3-20140717/ippScripts/scripts/sc_transfer_tool.pl

    • Property svn:mergeinfo deleted
    r37324 r37332  
    1616   $remote_root = '/scratch3/watersc1/';
    1717
    18 my $local_raw = "${remote_root}/raw/";
     18#my $local_raw = "${remote_root}/tmp/";
    1919my $local_tmp = "${remote_root}/tmp/";
    2020my $threads = 11;
     
    7979# split in input file list
    8080unless(-d $local_tmp) { system("mkdir -p $local_tmp"); }
    81 unless(-d $local_raw) { system("mkdir -p $local_raw"); }
     81#unless(-d $local_raw) { system("mkdir -p $local_raw"); }
    8282
    8383# we have two modes: fetch (-> LANL) and return (-> IPP)
     
    212212    my $option = $server_options{$destination_host};
    213213
    214     my $command = "rsync -Lt --size-only --omit-dir-times -e '$ssh_cmd ${option}' --files-from=${transfer_filelist} ${local_tmp} ${destination_host}:/";
     214    my $command = "rsync -L --size-only --omit-dir-times -e '$ssh_cmd ${option}' --files-from=${transfer_filelist} ${local_tmp} ${destination_host}:/";
    215215    print STDERR "$command\n";
    216216   
     
    248248    my $option = $server_options{$destination_host};
    249249
    250     my $command = "rsync --size-only -e '$ssh_cmd ${option}' --files-from=${transfer_filelist} ${destination_host}:/ ${local_raw}";
     250    my $command = "rsync --size-only -e '$ssh_cmd ${option}' --files-from=${transfer_filelist} ${destination_host}:/ ${local_tmp}";
    251251    print STDERR "$command\n";
    252252
  • tags/ipp-pv3-20140717/ippScripts/scripts/stack_skycell.pl

    r36397 r37332  
    225225    $num++;
    226226
    227     my $image = $file->{uri};   # Image name
     227#    my $image = $file->{uri};   # Image name
     228    my $image = $ipprc->filename("PSWARP.OUTPUT", $file->{path_base} ); # Image name
    228229    my $mask = $ipprc->filename( "PSWARP.OUTPUT.MASK", $file->{path_base} ); # Mask name
    229230    my $weight = $ipprc->filename( "PSWARP.OUTPUT.VARIANCE", $file->{path_base} ); # Weight name
Note: See TracChangeset for help on using the changeset viewer.