IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 11323


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

added multi-db support and workdirs to tasks

Location:
trunk/ippTasks
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTasks/detrend.norm.pro

    r11235 r11323  
    2929  book listbook detPendingNormExp
    3030end
     31
     32# these variables will cycle through the known database names
     33$detPendingNormStatImfile_DB = 0
     34$detPendingNormImfile_DB = 0
     35$detPendingNormExp_DB = 0
    3136
    3237# select images ready for copy
     
    4449
    4550  task.exec
    46     command dettool -tonormalizedstat -limit 20
     51    if ($DB:n == 0)
     52      option DEFAULT
     53      command dettool -tonormalizedstat -limit 20
     54    else
     55      # save the DB name for the exit tasks
     56      option $DB:$detPendingNormStatImfile_DB
     57      command dettool -tonormalizedstat -limit 20 -dbname $DB:$detPendingNormStatImfile_DB
     58      $detPendingNormStatImfile_DB ++
     59      if ($detPendingNormStatImfile_DB >= $DB:n) set detPendingNormStatImfile_DB = 0
     60    end
    4761  end
    4862
     
    5064  task.exit    0
    5165    # convert 'stdout' to book format
    52     ipptool2book stdout detPendingNormStatImfile -key det_id:iteration -uniq
     66    ipptool2book stdout detPendingNormStatImfile -key det_id:iteration -uniq -setword dbname $options:0
    5367    if ($VERBOSE > 2)
    5468      book listbook detPendingNormStatImfile
     
    5771    # delete existing entries which are DONE
    5872    book delpage detPendingNormStatImfile -key state DONE
     73    book delpage detPendingNormStatImfile -key state DATA_ERR
    5974  end
    6075
     
    90105    book getword detPendingNormStatImfile $pageName iteration -var ITERATION
    91106    book getword detPendingNormStatImfile $pageName camera    -var CAMERA 
     107    book getword detPendingNormStatImfile $pageName workdir   -var WORKDIR
     108    book getword detPendingNormStatImfile $pageName dbname    -var DBNAME
     109    set_standard_args
    92110
    93111    # specify choice of remote host:
     
    108126    # create example job options as a demonstration
    109127    if ($VERBOSE > 1)
    110       echo command detrend_norm_calc.pl --det_id $DET_ID --iteration $ITERATION --det_type $DET_TYPE
    111     end
    112     command detrend_norm_calc.pl --det_id $DET_ID --iteration $ITERATION --det_type $DET_TYPE
     128      echo command detrend_norm_calc.pl --det_id $DET_ID --iteration $ITERATION --det_type $DET_TYPE $ARGS
     129    end
     130    command detrend_norm_calc.pl --det_id $DET_ID --iteration $ITERATION --det_type $DET_TYPE $ARGS
    113131  end
    114132
     
    139157
    140158  task.exec
    141     command dettool -tonormalize -limit 20
     159    if ($DB:n == 0)
     160      option DEFAULT
     161      command dettool -tonormalize -limit 20
     162    else
     163      # save the DB name for the exit tasks
     164      option $DB:$detPendingNormImfile_DB
     165      command dettool -tonormalize -limit 20 -dbname $DB:$detPendingNormImfile_DB
     166      $detPendingNormImfile_DB ++
     167      if ($detPendingNormImfile_DB >= $DB:n) set detPendingNormImfile_DB = 0
     168    end
    142169  end
    143170
     
    145172  task.exit    0
    146173    # convert 'stdout' to book format
    147     ipptool2book stdout detPendingNormImfile -key det_id:iteration -uniq
     174    ipptool2book stdout detPendingNormImfile -key det_id:iteration -uniq -setword dbname $options:0
    148175    if ($VERBOSE > 2)
    149176      book listbook detPendingNormImfile
     
    152179    # delete existing entries which are DONE
    153180    book delpage detPendingNormImfile -key state DONE
     181    book delpage detPendingNormImfile -key state DATA_ERR
    154182  end
    155183
     
    188216    book getword detPendingNormImfile $pageName class_id  -var CLASS_ID
    189217    book getword detPendingNormImfile $pageName norm      -var NORM     
     218    book getword detPendingNormImfile $pageName workdir   -var WORKDIR
     219    book getword detPendingNormImfile $pageName dbname    -var DBNAME
     220    set_standard_args
    190221
    191222    # specify choice of remote host:
     
    205236    # create example job options as a demonstration
    206237    if ($VERBOSE > 1)
    207       echo command detrend_norm_apply.pl --det_id $DET_ID --iteration $ITERATION --class_id $CLASS_ID --value $NORM --input_uri $URI --camera $CAMERA --det_type $DET_TYPE
    208     end
    209     command detrend_norm_apply.pl --det_id $DET_ID --iteration $ITERATION --class_id $CLASS_ID --value $NORM --input_uri $URI --camera $CAMERA --det_type $DET_TYPE
     238      echo command detrend_norm_apply.pl --det_id $DET_ID --iteration $ITERATION --class_id $CLASS_ID --value $NORM --input_uri $URI --camera $CAMERA --det_type $DET_TYPE $ARGS
     239    end
     240    command detrend_norm_apply.pl --det_id $DET_ID --iteration $ITERATION --class_id $CLASS_ID --value $NORM --input_uri $URI --camera $CAMERA --det_type $DET_TYPE $ARGS
    210241  end
    211242
     
    236267
    237268  task.exec
    238     command dettool -tonormalizedexp -limit 20
     269    if ($DB:n == 0)
     270      option DEFAULT
     271      command dettool -tonormalizedexp -limit 20
     272    else
     273      # save the DB name for the exit tasks
     274      option $DB:$detPendingNormExp_DB
     275      command dettool -tonormalizedexp -limit 20 -dbname $DB:$detPendingNormExp_DB
     276      $detPendingNormExp_DB ++
     277      if ($detPendingNormExp_DB >= $DB:n) set detPendingNormExp_DB = 0
     278    end
    239279  end
    240280
     
    242282  task.exit    0
    243283    # convert 'stdout' to book format
    244     ipptool2book stdout detPendingNormExp -key det_id:iteration -uniq
     284    ipptool2book stdout detPendingNormExp -key det_id:iteration -uniq -setword dbname $options:0
    245285    if ($VERBOSE > 2)
    246286      book listbook detPendingNormExp
     
    249289    # delete existing entries which are DONE
    250290    book delpage detPendingNormExp -key state DONE
     291    book delpage detPendingNormExp -key state DATA_ERR
    251292  end
    252293
     
    282323    book getword detPendingNormExp $pageName det_type  -var DET_TYPE
    283324    book getword detPendingNormExp $pageName camera    -var CAMERA 
     325    book getword detPendingNormExp $pageName workdir   -var WORKDIR
     326    book getword detPendingNormExp $pageName dbname    -var DBNAME
     327    set_standard_args
    284328
    285329    # specify choice of remote host:
     
    299343    # create example job options as a demonstration
    300344    if ($VERBOSE > 1)
    301       echo command detrend_norm_exp.pl --det_id $DET_ID --iteration $ITERATION --camera $CAMERA --det_type $DET_TYPE
    302     end
    303     command detrend_norm_exp.pl --det_id $DET_ID --iteration $ITERATION --camera $CAMERA --det_type $DET_TYPE
     345      echo command detrend_norm_exp.pl --det_id $DET_ID --iteration $ITERATION --camera $CAMERA --det_type $DET_TYPE $ARGS
     346    end
     347    command detrend_norm_exp.pl --det_id $DET_ID --iteration $ITERATION --camera $CAMERA --det_type $DET_TYPE $ARGS
    304348  end
    305349
  • trunk/ippTasks/detrend.process.pro

    r11210 r11323  
    2727  book listbook detPendingProcessedExp
    2828end
     29
     30# these variables will cycle through the known database names
     31$detPendingProcessedImfile_DB = 0
     32$detPendingProcessedExp_DB = 0
    2933
    3034# select images ready for copy
     
    4246
    4347  task.exec
    44     command dettool -toprocessedimfile -limit 20
     48    if ($DB:n == 0)
     49      option DEFAULT
     50      command dettool -toprocessedimfile -limit 20
     51    else
     52      # save the DB name for the exit tasks
     53      option $DB:$detPendingProcessedImfile_DB
     54      command dettool -toprocessedimfile -limit 20 -dbname $DB:$detPendingProcessedImfile_DB
     55      $detPendingProcessedImfile_DB ++
     56      if ($detPendingProcessedImfile_DB >= $DB:n) set detPendingProcessedImfile_DB = 0
     57    end
    4558  end
    4659
     
    4861  task.exit    0
    4962    # convert 'stdout' to book format
    50     ipptool2book stdout detPendingProcessedImfile -key det_id:exp_tag:class_id -uniq
     63    ipptool2book stdout detPendingProcessedImfile -key det_id:exp_tag:class_id -uniq -setword dbname $options:0
    5164    if ($VERBOSE > 2)
    5265      book listbook detPendingProcessedImfile
     
    5568    # delete existing entries which are DONE
    5669    book delpage detPendingProcessedImfile -key state DONE
     70    book delpage detPendingProcessedImfile -key state DATA_ERR
    5771  end
    5872
     
    91105    book getword detPendingProcessedImfile $pageName uri      -var URI     
    92106    book getword detPendingProcessedImfile $pageName camera   -var CAMERA   
     107    book getword detPendingProcessedImfile $pageName workdir  -var WORKDIR
     108    book getword detPendingProcessedImfile $pageName dbname   -var DBNAME
     109    set_standard_args
    93110
    94111    # specify choice of remote host:
     
    100117
    101118    ## generate output log based on filerule
    102     ## XXX use OUTPATH from db to set output path
    103     ## XXX use ipp_filename.pl DETPROC.LOG $outroot $CLASS_ID`
    104     $word = `basename $EXP_TAG | tr '.' ' '`
    105     list word -split $word
    106     $base = $word:0
    107     stdout $LOGSUBDIR/$base/$EXP_TAG.detproc.$DET_ID.$CLASS_ID.log
    108     stderr $LOGSUBDIR/$base/$EXP_TAG.detproc.$DET_ID.$CLASS_ID.log
    109     exec mkdir -p $LOGSUBDIR/$base
     119    $outroot = $WORKDIR/$EXP_TAG
     120    $logfile = `ipp_filename.pl DETPROC.LOG $outroot $CLASS_ID`
     121    stdout $logfile
     122    stderr $logfile
     123    exec mkdir -p $WORKDIR
    110124
    111125    # save the pageName for future reference below
     
    114128    # create example job options as a demonstration
    115129    if ($VERBOSE > 1)
    116       echo command detrend_process_imfile.pl --det_id $DET_ID --det_type $DET_TYPE --exp_tag $EXP_TAG --class $CLASS --class_id $CLASS_ID --input_uri $URI --camera $CAMERA
    117     end
    118     command detrend_process_imfile.pl --det_id $DET_ID --det_type $DET_TYPE --exp_tag $EXP_TAG --class $CLASS --class_id $CLASS_ID --input_uri $URI --camera $CAMERA
     130      echo command detrend_process_imfile.pl --det_id $DET_ID --det_type $DET_TYPE --exp_tag $EXP_TAG --class $CLASS --class_id $CLASS_ID --input_uri $URI --camera $CAMERA $ARGS
     131    end
     132    command detrend_process_imfile.pl --det_id $DET_ID --det_type $DET_TYPE --exp_tag $EXP_TAG --class $CLASS --class_id $CLASS_ID --input_uri $URI --camera $CAMERA $ARGS
    119133  end
    120134
     
    145159
    146160  task.exec
    147     command dettool -toprocessedexp -limit 20
     161    if ($DB:n == 0)
     162      command dettool -toprocessedexp -limit 20
     163    else
     164      # save the DB name for the exit tasks
     165      option $DB:$detPendingProcessedExp_DB
     166      command dettool -toprocessedexp -limit 20 -dbname $DB:$detPendingProcessedExp_DB
     167      $detPendingProcessedExp_DB ++
     168      if ($detPendingProcessedExp_DB >= $DB:n) set detPendingProcessedExp_DB = 0
     169    end
    148170  end
    149171
     
    151173  task.exit    0
    152174    # convert 'stdout' to book format
    153     ipptool2book stdout detPendingProcessedExp -key det_id:iteration:exp_tag -uniq
     175    if ($options:n == 0)
     176      ipptool2book stdout detPendingProcessedExp -key det_id:iteration:exp_tag -uniq
     177    else
     178      ipptool2book stdout detPendingProcessedExp -key det_id:iteration:exp_tag -uniq -setword DBNAME $options:0
     179    end
    154180    if ($VERBOSE > 2)
    155181      book listbook detPendingProcessedExp
     
    158184    # delete existing entries which are DONE
    159185    book delpage detPendingProcessedExp -key state DONE
     186    book delpage detPendingProcessedExp -key state DATA_ERR
    160187  end
    161188
     
    192219    book getword detPendingProcessedExp $pageName exp_tag   -var EXP_TAG
    193220    book getword detPendingProcessedExp $pageName camera    -var CAMERA 
     221    book getword detPendingProcessedExp $pageName workdir   -var WORKDIR
     222    book getword detPendingProcessedExp $pageName dbname    -var DBNAME
     223    set_standard_args
    194224
    195225    # specify choice of remote host:
     
    200230    end
    201231
    202     # XXX this is still a lame rule
    203     $word = `basename $EXP_TAG | tr '.' ' '`
    204     list word -split $word
    205     $base = $word:0
    206     stdout $LOGSUBDIR/$base/$EXP_TAG.detproc.$DET_ID.log
    207     stderr $LOGSUBDIR/$base/$EXP_TAG.detproc.$DET_ID.log
    208     exec mkdir -p $LOGSUBDIR/$base
     232    # XXX push this into the filerules?
     233    $outroot = $WORKDIR/$EXP_TAG
     234    $logfile = $outroot/$EXP_TAG.detproc.$DET_ID.log
     235    stdout $logfile
     236    stderr $logfile
     237    exec mkdir -p $outroot
    209238
    210239    # save the pageName for future reference below
     
    213242    # create example job options as a demonstration
    214243    if ($VERBOSE > 1)
    215       echo command detrend_process_exp.pl --det_id $DET_ID --exp_tag $EXP_TAG --camera $CAMERA
    216     end
    217     command detrend_process_exp.pl --det_id $DET_ID --exp_tag $EXP_TAG --camera $CAMERA
     244      echo command detrend_process_exp.pl --det_id $DET_ID --exp_tag $EXP_TAG --camera $CAMERA $ARGS
     245    end
     246    command detrend_process_exp.pl --det_id $DET_ID --exp_tag $EXP_TAG --camera $CAMERA $ARGS
    218247  end
    219248
  • trunk/ippTasks/detrend.reject.pro

    r11235 r11323  
    2626end
    2727
     28# this variable will cycle through the known database names
     29$detRejectExp_DB = 0
     30
    2831# select images ready for copy
    2932# new entries are added to detRejectExp
     
    4043
    4144  task.exec
    42     command dettool -residdetrun -limit 20
     45    if ($DB:n == 0)
     46      option DEFAULT
     47      command dettool -residdetrun -limit 20
     48    else
     49      # save the DB name for the exit tasks
     50      option $DB:$detRejectExp_DB
     51      command dettool -residdetrun -limit 20 -dbname $DB:$detRejectExp_DB
     52      $detRejectExp_DB ++
     53      if ($detRejectExp_DB >= $DB:n) set detRejectExp_DB = 0
     54    end
    4355  end
    4456
     
    4658  task.exit    0
    4759    # convert 'stdout' to book format
    48     ipptool2book stdout detRejectExp -key det_id:iteration -uniq
     60    ipptool2book stdout detRejectExp -key det_id:iteration -uniq -setword dbname $options:0
    4961    if ($VERBOSE > 2)
    5062      book listbook detRejectExp
     
    5365    # delete existing entries which are DONE
    5466    book delpage detRejectExp -key state DONE
     67    book delpage detRejectExp -key state DATA_ERR
    5568  end
    5669
     
    87100    book getword detRejectExp $pageName mode      -var MODE     
    88101    book getword detRejectExp $pageName camera    -var CAMERA   
     102    book getword detRejectExp $pageName workdir   -var WORKDIR
     103    book getword detRejectExp $pageName dbname    -var DBNAME
     104    set_standard_args
    89105
    90106    # specify choice of remote host:
     
    104120    # create example job options as a demonstration
    105121    if ($VERBOSE > 1)
    106       echo command detrend_reject_exp.pl --det_id $DET_ID --iteration $ITERATION --det_type $DET_TYPE --camera $CAMERA
     122      echo command detrend_reject_exp.pl --det_id $DET_ID --iteration $ITERATION --det_type $DET_TYPE --camera $CAMERA $ARGS
    107123    end
    108     command detrend_reject_exp.pl --det_id $DET_ID --iteration $ITERATION --det_type $DET_TYPE --camera $CAMERA
     124    command detrend_reject_exp.pl --det_id $DET_ID --iteration $ITERATION --det_type $DET_TYPE --camera $CAMERA $ARGS
    109125 end
    110126
  • trunk/ippTasks/detrend.resid.pro

    r11210 r11323  
    2727  book listbook detPendingResidExp
    2828end
     29
     30# these variables will cycle through the known database names
     31$detPendingResidImfile_DB = 0
     32$detPendingResidExp_DB = 0
    2933
    3034# select images ready for copy
     
    4246
    4347  task.exec
    44     command dettool -toresidimfile -limit 20
     48    if ($DB:n == 0)
     49      option DEFAULT
     50      command dettool -toresidimfile -limit 20
     51    else
     52      # save the DB name for the exit tasks
     53      option $DB:$detPendingResidImfile_DB
     54      command dettool -toresidimfile -limit 20 -dbname $DB:$detPendingResidImfile_DB
     55      $detPendingResidImfile_DB ++
     56      if ($detPendingResidImfile_DB >= $DB:n) set detPendingResidImfile_DB = 0
     57    end
    4558  end
    4659
     
    4861  task.exit    0
    4962    # convert 'stdout' to book format
    50     ipptool2book stdout detPendingResidImfile -key det_id:iteration:exp_tag:class_id -uniq
     63    ipptool2book stdout detPendingResidImfile -key det_id:iteration:exp_tag:class_id -uniq -setword dbname $options:0
    5164    if ($VERBOSE > 2)
    5265      book listbook detPendingResidImfile
     
    5568    # delete existing entries which are DONE
    5669    book delpage detPendingResidImfile -key state DONE
     70    book delpage detPendingResidImfile -key state DATA_ERR
    5771  end
    5872
     
    93107    book getword detPendingResidImfile $pageName det_uri   -var DET_URI 
    94108    book getword detPendingResidImfile $pageName camera    -var CAMERA   
     109    book getword detPendingResidImfile $pageName workdir   -var WORKDIR
     110    book getword detPendingResidImfile $pageName dbname    -var DBNAME
     111    set_standard_args
    95112
    96113    # specify choice of remote host:
     
    114131    # create command
    115132    if ($VERBOSE > 1)
    116       echo command detrend_resid.pl --det_id $DET_ID --iteration $ITERATION --exp_tag $EXP_TAG --class_id $CLASS_ID --det_type $DET_TYPE --detrend $DET_URI --input_uri $URI --camera $CAMERA --mode $MODE
    117     end
    118     command detrend_resid.pl --det_id $DET_ID --iteration $ITERATION --exp_tag $EXP_TAG --class_id $CLASS_ID --det_type $DET_TYPE --detrend $DET_URI --input_uri $URI --camera $CAMERA --mode $MODE
     133      echo command detrend_resid.pl --det_id $DET_ID --iteration $ITERATION --exp_tag $EXP_TAG --class_id $CLASS_ID --det_type $DET_TYPE --detrend $DET_URI --input_uri $URI --camera $CAMERA --mode $MODE $ARGS
     134    end
     135    command detrend_resid.pl --det_id $DET_ID --iteration $ITERATION --exp_tag $EXP_TAG --class_id $CLASS_ID --det_type $DET_TYPE --detrend $DET_URI --input_uri $URI --camera $CAMERA --mode $MODE $ARGS
    119136  end
    120137
     
    145162
    146163  task.exec
    147     command dettool -toresidexp -limit 20
     164    if ($DB:n == 0)
     165      option DEFAULT
     166      command dettool -toresidexp -limit 20
     167    else
     168      # save the DB name for the exit tasks
     169      option $DB:$detPendingResidExp_DB
     170      command dettool -toresidexp -limit 20 -dbname $DB:$detPendingResidExp_DB
     171      $detPendingResidExp_DB ++
     172      if ($detPendingResidExp_DB >= $DB:n) set detPendingResidExp_DB = 0
     173    end
    148174  end
    149175
     
    151177  task.exit    0
    152178    # convert 'stdout' to book format
    153     ipptool2book stdout detPendingResidExp -key det_id:iteration:exp_tag -uniq
     179    ipptool2book stdout detPendingResidExp -key det_id:iteration:exp_tag -uniq -setword dbname $options:0
    154180    if ($VERBOSE > 2)
    155181      book listbook detPendingResidExp
     
    158184    # delete existing entries which are DONE
    159185    book delpage detPendingResidExp -key state DONE
     186    book delpage detPendingResidExp -key state DATA_ERR
    160187  end
    161188
     
    194221    book getword detPendingResidExp $pageName include   -var INCLUDE
    195222    book getword detPendingResidExp $pageName camera    -var CAMERA 
     223    book getword detPendingResidExp $pageName workdir   -var WORKDIR
     224    book getword detPendingResidExp $pageName dbname    -var DBNAME
     225    set_standard_args
    196226
    197227    # specify choice of remote host:
     
    215245    # create example job options as a demonstration
    216246    if ($VERBOSE > 1)
    217       echo command detrend_reject_imfile.pl --det_id $DET_ID --iteration $ITERATION --exp_tag $EXP_TAG --det_type $DET_TYPE --camera $CAMERA
    218     end
    219     command detrend_reject_imfile.pl --det_id $DET_ID --iteration $ITERATION --exp_tag $EXP_TAG --det_type $DET_TYPE --camera $CAMERA
     247      echo command detrend_reject_imfile.pl --det_id $DET_ID --iteration $ITERATION --exp_tag $EXP_TAG --det_type $DET_TYPE --camera $CAMERA $ARGS
     248    end
     249    command detrend_reject_imfile.pl --det_id $DET_ID --iteration $ITERATION --exp_tag $EXP_TAG --det_type $DET_TYPE --camera $CAMERA $ARGS
    220250  end
    221251
  • trunk/ippTasks/detrend.stack.pro

    r11210 r11323  
    2626end
    2727
     28# this variable will cycle through the known database names
     29$detPendingStackedImfile_DB = 0
     30
    2831# select images ready for detrend_stack.pl
    2932# new entries are added to detPendingStackedImfile
     
    4043
    4144  task.exec
    42     command dettool -tostacked -limit 20
     45    if ($DB:n == 0)
     46      option DEFAULT
     47      command dettool -tostacked -limit 20
     48    else
     49      # save the DB name for the exit tasks
     50      option $DB:$detPendingStackedImfile_DB
     51      command dettool -tostacked -limit 20 -dbname $DB:$detPendingStackedImfile_DB
     52      $detPendingStackedImfile_DB ++
     53      if ($detPendingStackedImfile_DB >= $DB:n) set detPendingStackedImfile_DB = 0
     54    end
    4355  end
    4456
     
    4658  task.exit    0
    4759    # convert 'stdout' to book format
    48     ipptool2book stdout detPendingStackedImfile -key det_id:iteration:class_id -uniq
     60    ipptool2book stdout detPendingStackedImfile -key det_id:iteration:class_id -uniq -setword dbname $options:0
    4961    if ($VERBOSE > 2)
    5062      book listbook detPendingStackedImfile
     
    5365    # delete existing entries which are DONE
    5466    book delpage detPendingStackedImfile -key state DONE
     67    book delpage detPendingStackedImfile -key state DATA_ERR
    5568  end
    5669
     
    87100    book getword detPendingStackedImfile $pageName class_id  -var CLASS_ID
    88101    book getword detPendingStackedImfile $pageName camera    -var CAMERA 
     102    book getword detPendingStackedImfile $pageName workdir   -var WORKDIR
     103    book getword detPendingStackedImfile $pageName dbname    -var DBNAME
     104    set_standard_args
    89105
    90106    # specify choice of remote host:
     
    105121    # create the command line
    106122    if ($VERBOSE > 1)
    107       echo command detrend_stack.pl --det_id $DET_ID --iteration $ITERATION --class_id $CLASS_ID --det_type $DET_TYPE --camera $CAMERA
     123      echo command detrend_stack.pl --det_id $DET_ID --iteration $ITERATION --class_id $CLASS_ID --det_type $DET_TYPE --camera $CAMERA $ARGS
    108124    end
    109     command detrend_stack.pl --det_id $DET_ID --iteration $ITERATION --class_id $CLASS_ID --det_type $DET_TYPE --camera $CAMERA
     125    command detrend_stack.pl --det_id $DET_ID --iteration $ITERATION --class_id $CLASS_ID --det_type $DET_TYPE --camera $CAMERA $ARGS
    110126  end
    111127
  • trunk/ippTasks/pantasks.pro

    r11210 r11323  
    2525$EXIT_DATA_ERR    = 5
    2626
     27# DB lists the database names in use; the default ipprc database
     28# is only used if DB:n is 0
    2729$DB:n = 0
     30
     31macro init.simtest.defDB
     32  $LOGDIR = `ipp_datapath.pl path://SIMTEST`
     33  $LOGDIR = $LOGDIR/logs
     34  exec mkdir -p $LOGDIR
     35
     36  if ($parallel)
     37    controller exit true
     38    controller host add alala
     39  end
     40end
    2841
    2942macro init.simtest
     
    109122end
    110123
     124macro set_standard_args
     125  $ARGS = ""
     126  if ("$DBNAME" != "DEFAULT")
     127    $ARGS = $ARGS --dbname $DBNAME
     128  end
     129  if ("$WORKDIR" != "")
     130    $ARGS = $ARGS --workdir $WORKDIR
     131  else
     132    echo WORKDIR not set
     133  end
     134end
     135
    111136macro process_exit
    112137  if ($0 != 4)
  • 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
  • trunk/ippTasks/phase2.pro

    r11236 r11323  
    2626end
    2727
     28# this variable will cycle through the known database names
     29$phase2_DB = 0
     30
    2831# select images ready for phase2 analysis
    2932# new entries are added to p2PendingImfile
     
    4043
    4144  task.exec
    42     command p2tool -pendingimfile -limit 20
     45    if ($DB:n == 0)
     46      option DEFAULT
     47      command p2tool -pendingimfile -limit 20
     48    else
     49      # save the DB name for the exit tasks
     50      option $DB:$phase2_DB
     51      command p2tool -pendingimfile -limit 20 -dbname $DB:$phase2_DB
     52      $phase2_DB ++
     53      if ($phase2_DB >= $DB:n) set phase2_DB = 0
     54    end
    4355  end
    4456
     
    4658  task.exit    0
    4759    # convert 'stdout' to book format
    48     ipptool2book stdout p2PendingImfile -key exp_tag:class_id -uniq
     60    ipptool2book stdout p2PendingImfile -key exp_tag:class_id -uniq -setword dbname $options:0
    4961    if ($VERBOSE > 2)
    5062      book listbook p2PendingImfile
     
    5365    # delete existing entries which are DONE
    5466    book delpage p2PendingImfile -key state DONE
     67    book delpage p2PendingImfile -key state DATA_ERR
    5568  end
    5669
     
    87100    book getword p2PendingImfile $pageName class_id -var CLASS_ID
    88101    book getword p2PendingImfile $pageName uri -var URI
     102    book getword p2PendingImfile $pageName workdir -var WORKDIR
     103    book getword p2PendingImfile $pageName dbname -var DBNAME
     104    set_standard_args
    89105
    90106    # specify choice of remote host
     
    108124    # create the command line
    109125    if ($VERBOSE > 1)
    110       echo command phase2.pl --exp_tag $EXP_TAG --class_id $CLASS_ID --uri $URI --camera $CAMERA
     126      echo command phase2.pl --exp_tag $EXP_TAG --class_id $CLASS_ID --uri $URI --camera $CAMERA $ARGS
    111127    end
    112     command phase2.pl --exp_tag $EXP_TAG --class_id $CLASS_ID --uri $URI --camera $CAMERA --workdir $WORKDIR
     128    command phase2.pl --exp_tag $EXP_TAG --class_id $CLASS_ID --uri $URI --camera $CAMERA $ARGS
    113129  end
    114130
  • trunk/ippTasks/phase3.pro

    r11210 r11323  
    2626end
    2727
     28# this variable will cycle through the known database names
     29$phase3_DB = 0
     30
    2831# select images ready for phase3 analysis
    2932# new entries are added to p3PendingExp
     
    4043
    4144  task.exec
    42     command p3tool -pendingexp -limit 20
     45    if ($DB:n == 0)
     46      option DEFAULT
     47      command p3tool -pendingexp -limit 20
     48    else
     49      # save the DB name for the exit tasks
     50      option $DB:$phase3_DB
     51      command p3tool -pendingexp -limit 20 -dbname $DB:$phase3_DB
     52      $phase3_DB ++
     53      if ($phase3_DB >= $DB:n) set phase3_DB = 0
     54    end
    4355  end
    4456
     
    4658  task.exit    0
    4759    # convert 'stdout' to book format
    48     ipptool2book stdout p3PendingExp -key exp_tag -uniq
     60    ipptool2book stdout p3PendingExp -key exp_tag -uniq -setword dbname $options:0
    4961    if ($VERBOSE > 2)
    5062      book listbook p3PendingExp
     
    5365    # delete existing entries which are DONE
    5466    book delpage p3PendingExp -key state DONE
     67    book delpage p3PendingExp -key state DATA_ERR
    5568  end
    5669
     
    7083  periods      -poll $runpoll
    7184  periods      -exec $runexec
    72   periods      -timeout 5
     85  periods      -timeout 10
    7386
    7487  task.exec
     
    8497    book getword p3PendingExp $pageName camera -var CAMERA
    8598    book getword p3PendingExp $pageName exp_tag -var EXP_TAG
     99    book getword p3PendingExp $pageName workdir -var WORKDIR
     100    book getword p3PendingExp $pageName dbname -var DBNAME
     101    set_standard_args
    86102
    87103    # specify choice of remote host:(need to choose based on chips)
     
    92108    end
    93109
    94     # XXX this is still a lame rule
    95     $word = `basename $EXP_TAG | tr '.' ' '`
    96     list word -split $word
    97     $base = $word:0
    98     stdout $LOGSUBDIR/$base/$EXP_TAG.log
    99     stderr $LOGSUBDIR/$base/$EXP_TAG.log
    100     exec mkdir -p $LOGSUBDIR/$base
     110    # output log from filerule
     111    $outroot = $WORKDIR/$EXP_TAG
     112    $logfile = `ipp_filename.pl PHASE3.LOG $outroot $CLASS_ID`
     113    stdout $logfile
     114    stderr $logfile
     115    exec mkdir -p $WORKDIR
    101116
    102117    # save the pageName for future reference below
     
    105120    # create the command line
    106121    if ($VERBOSE > 1)
    107       echo command phase3.pl --exp_tag $EXP_TAG
     122      echo command phase3.pl --exp_tag $EXP_TAG $ARGS
    108123    end
    109     command phase3.pl --exp_tag $EXP_TAG --camera $CAMERA
     124    command phase3.pl --exp_tag $EXP_TAG --camera $CAMERA $ARGS
    110125  end
    111126
    112127  # success
    113   task.exit 0
    114     # phase3exp.pl updates DB tables, here we just update the page
    115     book setword p3PendingExp $options:0 state DONE
    116   end
    117 
    118   # default exit status
    119   task.exit    default
    120     showcommand failure
    121     book setword p3PendingExp $options:0 state FAIL
     128  task.exit default
     129    process_exit p3PendingExp $options:0 $JOB_STATUS
    122130  end
    123131
Note: See TracChangeset for help on using the changeset viewer.