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/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.