IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 26, 2007, 1:39:42 PM (19 years ago)
Author:
eugene
Message:

added multi-db support and workdirs to tasks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTasks/phase0.pro

    r11236 r11323  
    2828end
    2929
    30 $phase0_DB = 0
     30# these variables will cycle through the known database names
     31$p0PendingImfile_DB = 0
     32$p0PendingExp_DB = 0
    3133
    3234# select images ready for phase0 analysis
     
    3941  periods      -exec $loadexec
    4042  periods      -timeout 30
    41 
    42   # XXX test that this option works
    43 #  npending     1
     43  npending     1
    4444
    4545  # silently drop stdout
     
    4848
    4949  # select entries from the current DB; cycle to the next DB, if it exists
    50   # if the DB list is not set, use the value defined in .ipprc
     50  # iff the DB list is not set, use the value defined in .ipprc
    5151  task.exec
    5252    if ($DB:n == 0)
     53      option DEFAULT
    5354      command p0tool -pendingimfile -limit 20
    5455    else
    55       command p0tool -pendingimfile -limit 20 -dbname $DB:$phase0_DB
    56       $phase0_DB ++
    57       if ($phase0_DB >= $DB:n) set phase0_DB = 0
     56      # save the DB name for the exit tasks
     57      option $DB:$p0PendingImfile_DB
     58      command p0tool -pendingimfile -limit 20 -dbname $DB:$p0PendingImfile_DB
     59      $p0PendingImfile_DB ++
     60      if ($p0PendingImfile_DB >= $DB:n) set p0PendingImfile_DB = 0
    5861    end
    5962  end
     
    6265  task.exit $EXIT_SUCCESS
    6366    # convert 'stdout' to book format
    64     ipptool2book stdout p0PendingImfile -key exp_tag -uniq
     67    ipptool2book stdout p0PendingImfile -key exp_tag -uniq -setword dbname $options:0
    6568    if ($VERBOSE > 2)
    6669      book listbook p0PendingImfile
     
    105108    book getword p0PendingImfile $pageName uri -var URI
    106109    book getword p0PendingImfile $pageName workdir -var WORKDIR
    107 #    book getword p0PendingImfile $pageName dbname -var DBNAME
     110    book getword p0PendingImfile $pageName dbname -var DBNAME
     111    set_standard_args
    108112
    109113    # specify choice of remote host
     
    114118    end
    115119
    116     ## generate output log based on filerule
     120    ## generate output log based on filerule XXX put this in a function?
    117121    $outroot = $WORKDIR/$EXP_TAG
    118122    $logfile = `ipp_filename.pl PHASE0.LOG $outroot $CLASS_ID`
     
    126130    # create the command line
    127131    if ($VERBOSE > 1)
    128       echo command phase0_imfile.pl --exp_tag $EXP_TAG --class_id $CLASS_ID --uri $URI
    129     end
    130     command phase0_imfile.pl --exp_tag $EXP_TAG --class_id $CLASS_ID --uri $URI
     132      echo command phase0_imfile.pl --exp_tag $EXP_TAG --class_id $CLASS_ID --uri $URI $ARGS
     133    end
     134    command phase0_imfile.pl --exp_tag $EXP_TAG --class_id $CLASS_ID --uri $URI $ARGS
    131135  end
    132136
     
    155159
    156160  task.exec
    157     command p0tool -pendingexp -limit 20
     161    if ($DB:n == 0)
     162      option DEFAULT
     163      command p0tool -pendingexp -limit 20
     164    else
     165      # save the DB name for the exit tasks
     166      option $DB:$p0PendingExp_DB
     167      command p0tool -pendingexp -limit 20 -dbname $DB:$p0PendingExp_DB
     168      $p0PendingExp_DB ++
     169      if ($p0PendingExp_DB >= $DB:n) set p0PendingExp_DB = 0
     170    end
    158171  end
    159172
    160173  # success
    161   task.exit    0
     174  task.exit $EXIT_SUCCESS
    162175    # convert 'stdout' to book format
    163     ipptool2book stdout p0PendingExp -key exp_tag -uniq
     176    ipptool2book stdout p0PendingExp -key exp_tag -uniq -setword dbname $options:0
    164177    if ($VERBOSE > 2)
    165178      book listbook p0PendingExp
     
    200213    book getword p0PendingExp $pageName exp_tag -var EXP_TAG
    201214    book getword p0PendingExp $pageName workdir -var WORKDIR
     215    book getword p0PendingExp $pageName dbname -var DBNAME
     216    set_standard_args
    202217
    203218    # specify choice of remote host:(need to choose based on chips)
     
    220235    # create the command line
    221236    if ($VERBOSE > 1)
    222       echo command phase0_exp.pl --exp_tag $EXP_TAG
    223     end
    224     command phase0_exp.pl --exp_tag $EXP_TAG
     237      echo command phase0_exp.pl --exp_tag $EXP_TAG $ARGS
     238    end
     239    command phase0_exp.pl --exp_tag $EXP_TAG $ARGS
    225240  end
    226241
Note: See TracChangeset for help on using the changeset viewer.