IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 3, 2014, 1:54:29 PM (13 years ago)
Author:
bills
Message:

add code for managing summarizing fullForceRuns and managing the
associated table

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/bills_branches/bills_201312/ippTasks/fullforce.pro

    r36388 r36417  
    88### Initialise the books containing the tasks to do
    99book init fullForceRun
     10book init fullForceSummary
    1011
    1112### Database lists
    1213$fullForce_DB = 0
    1314$fullForce_revert_DB = 0
     15$fullForceSummary_DB = 0
     16$fullForceSummary_revert_DB = 0
    1417
    1518### Check status of fullForce tasks
    16 macro fullForce.status
     19macro fullforce.status
    1720  book listbook fullForceRun
    1821end
    1922
    2023### Reset fullForce tasks
    21 macro fullForce.reset
     24macro fullforce.reset
    2225  book init fullForceRun
    2326end
     27macro fullforce.summary.status
     28  book listbook fullForceSummary
     29end
     30
     31### Reset fullForce tasks
     32macro fullforce.summary.reset
     33  book init fullForceSummary
     34end
    2435
    2536### Turn fullForce tasks on
    26 macro fullForce.on
    27   task fullForce.load
    28     active true
    29   end
    30   task fullForce.run
     37macro fullforce.on
     38  task fullforce.load
     39    active true
     40  end
     41  task fullforce.run
     42    active true
     43  end
     44  task fullforce.summary.load
     45    active true
     46  end
     47  task fullforce.summary.run
    3148    active true
    3249  end
     
    3451
    3552### Turn fullForce tasks off
    36 macro fullForce.off
    37   task fullForce.load
    38     active false
    39   end
    40   task fullForce.run
    41     active false
    42   end
    43 end
    44 
    45 macro fullForce.revert.on
    46   task fullForce.revert
    47     active true
    48   end
    49 end
    50 
    51 macro fullForce.revert.off
    52   task fullForce.revert
    53     active false
    54   end
    55 end
    56 
    57 ### Load tasks for fullForce
     53macro fullforce.off
     54  task fullforce.load
     55    active false
     56  end
     57  task fullforce.run
     58    active false
     59  end
     60  task fullforce.summary.load
     61    active false
     62  end
     63  task fullforce.summary.run
     64    active false
     65  end
     66end
     67
     68macro fullforce.revert.on
     69  task fullforce.revert
     70    active true
     71  end
     72  task fullforce.summary.revert
     73    active true
     74  end
     75end
     76
     77macro fullforce.revert.off
     78  task fullforce.revert
     79    active false
     80  end
     81  task fullforce.summary.revert
     82    active false
     83  end
     84end
     85
     86### Load tasks for fullforce
    5887### Tasks are loaded into fullForceRun.
    59 task           fullForce.load
     88task           fullforce.load
    6089  host         local
    6190
     
    6695
    6796  stdout NULL
    68   stderr $LOGDIR/fullForce.log
     97  stderr $LOGDIR/fullforce.log
    6998
    7099  task.exec
     
    88117  task.exit    0
    89118    # convert 'stdout' to book format
    90     ipptool2book stdout fullForceRun -key ff_id -uniq -setword dbname $options:0 -setword pantaskState INIT
     119    ipptool2book stdout fullForceRun -key ff_id:warp_id -uniq -setword dbname $options:0 -setword pantaskState INIT
    91120    if ($VERBOSE > 2)
    92121      book listbook fullForceRun
     
    112141end
    113142
    114 ### Run tasks for the fullForce analysis
     143### Run tasks for the fullforce analysis
    115144### Tasks are taken from fullForceRun.
    116 task           fullForce.run
     145task           fullforce.run
    117146  periods      -poll $RUNPOLL
    118147  periods      -exec $RUNEXEC
     
    152181    sprintf outroot "%s/%s/%s/%s.%s.wrp.%s.ff.%s" $WORKDIR $TESS_ID $SKYCELL_ID $TESS_ID $SKYCELL_ID $WARP_ID $FF_ID
    153182
    154     stdout $LOGDIR/fullForce.log
    155     stderr $LOGDIR/fullForce.log
    156 
    157     $run = psphot_fullforce_warp.pl --ff_id $FF_ID --outroot $outroot --redirect-output --camera $CAMERA --warp_path_base $WARP_PATH_BASE --sources_path_base $SOURCES_PATH_BASE --skycell_id $SKYCELL_ID --threads @MAX_THREADS@
     183    stdout $LOGDIR/fullforce.log
     184    stderr $LOGDIR/fullforce.log
     185
     186    $run = psphot_fullforce_warp.pl --ff_id $FF_ID --warp_id $WARP_ID --outroot $outroot --redirect-output --camera $CAMERA --warp_path_base $WARP_PATH_BASE --sources_path_base $SOURCES_PATH_BASE --skycell_id $SKYCELL_ID --threads @MAX_THREADS@
    158187    if ("$REDUCTION" != "NULL")
    159188      $run = $run --reduction $REDUCTION
     
    192221end
    193222
    194 task fullForce.revert
     223task fullforce.revert
    195224  host         local
    196225
     
    202231 
    203232  stdout NULL
    204   stderr $LOGDIR/revert.log
     233  stderr $LOGDIR/fullforce.revert.log
    205234
    206235  task.exec
     
    243272end
    244273
     274### Load tasks for fullForceSummary
     275### Tasks are loaded into fullForceSummary.
     276task           fullforce.summary.load
     277  host         local
     278
     279  periods      -poll $LOADPOLL
     280  periods      -exec $LOADEXEC
     281  periods      -timeout 30
     282  npending     1
     283
     284  stdout NULL
     285  stderr $LOGDIR/fullforce.summary.log
     286
     287  task.exec
     288    if ($LABEL:n == 0) break
     289    $run = fftool -toadvance
     290    if ($DB:n == 0)
     291      option DEFAULT
     292    else
     293      # save the DB name for the exit tasks
     294      option $DB:$fullForceSummary_DB
     295      $run = $run -dbname $DB:$fullForceSummary_DB
     296      $fullForceSummary_DB ++
     297      if ($fullForceSummary_DB >= $DB:n) set fullForceSummary_DB = 0
     298    end
     299    add_poll_args run
     300    add_poll_labels run
     301    command $run
     302  end
     303
     304  # success
     305  task.exit    0
     306    # convert 'stdout' to book format
     307    ipptool2book stdout fullForceSummary -key ff_id -uniq -setword dbname $options:0 -setword pantaskState INIT
     308    if ($VERBOSE > 2)
     309      book listbook fullForceSummary
     310    end
     311
     312    # delete existing entries in the appropriate pantaskStates
     313    process_cleanup fullForceSummary
     314  end
     315
     316  # locked list
     317  task.exit    default
     318    showcommand failure
     319  end
     320
     321  task.exit    crash
     322    showcommand crash
     323  end
     324
     325  # operation times out?
     326  task.exit    timeout
     327    showcommand timeout
     328  end
     329end
     330
     331### Run tasks for the fullForceSummary analyasis
     332### Tasks are taken from fullForceSummary.
     333task           fullforce.summary.run
     334  periods      -poll $RUNPOLL
     335  periods      -exec $RUNEXEC
     336  periods      -timeout 10800
     337
     338  task.exec
     339    # if we are unable to run use "long" exectime
     340    periods -exec $RUNEXEC
     341    book npages fullForceSummary -var N
     342    if ($N == 0) break
     343    if ($NETWORK == 0) break
     344    if ($BURNTOOLING == 1) break
     345
     346
     347    # look for new entries in fullForceSummary (pantaskState == INIT)
     348    book getpage fullForceSummary 0 -var pageName -key pantaskState INIT
     349    if ("$pageName" == "NULL") break
     350
     351    book setword fullForceSummary $pageName pantaskState RUN
     352    book getword fullForceSummary $pageName ff_id -var FF_ID
     353    book getword fullForceSummary $pageName tess_id -var TESS_DIR
     354    book getword fullForceSummary $pageName skycell_id -var SKYCELL_ID
     355    book getword fullForceSummary $pageName camera -var CAMERA
     356    book getword fullForceSummary $pageName workdir -var WORKDIR_TEMPLATE
     357    book getword fullForceSummary $pageName reduction -var REDUCTION
     358    book getword fullForceSummary $pageName dbname -var DBNAME
     359
     360    # set the host and workdir based on the skycell hash
     361    # set.host.for.skycell $SKYCELL_ID
     362    host anyhost
     363    set.workdir.by.skycell $SKYCELL_ID $WORKDIR_TEMPLATE $default_host WORKDIR
     364
     365    basename $TESS_DIR -var TESS_ID
     366    sprintf outroot "%s/%s/%s/%s.%s.ff.%s" $WORKDIR $TESS_ID $SKYCELL_ID $TESS_ID $SKYCELL_ID $FF_ID
     367
     368    stdout $LOGDIR/fullforce.summary.log
     369    stderr $LOGDIR/fullforce.summary.log
     370
     371    $run = psphot_fullforce_summary.pl --ff_id $FF_ID --outroot $outroot --redirect-output --camera $CAMERA --threads @MAX_THREADS@
     372    if ("$REDUCTION" != "NULL")
     373      $run = $run --reduction $REDUCTION
     374    end
     375    add_standard_args run
     376
     377    # save the pageName for future reference below
     378    options $pageName
     379
     380    # create the command line
     381    if ($VERBOSE > 1)
     382      echo command $run
     383    end
     384    # since we have work to do shorten exec time
     385    periods -exec .05
     386    command $run
     387  end
     388
     389  # default exit status
     390  task.exit    default
     391    process_exit fullForceSummary $options:0 $JOB_STATUS
     392  end
     393
     394  # locked list
     395  task.exit    crash
     396    showcommand crash
     397    echo "hostname: $JOB_HOSTNAME"
     398    book setword fullForceSummary $options:0 pantaskState CRASH
     399  end
     400
     401  # operation timed out?
     402  task.exit    timeout
     403    showcommand timeout
     404    book setword fullForceSummary $options:0 pantaskState TIMEOUT
     405  end
     406end
     407
     408task fullforce.summary.revert
     409  host         local
     410
     411  periods      -poll 10.0
     412  periods      -exec 1200.0
     413  periods      -timeout 120.0
     414  npending     1
     415  active true
     416 
     417  stdout NULL
     418  stderr $LOGDIR/fullforce.summary.revert.log
     419
     420  task.exec
     421    if ($LABEL:n == 0) break
     422    # Only revert failures with fault=2 (SYS_ERROR), which tend to be
     423    # temporary filesystem problems.  Every other fault type is
     424    # interesting and should be kept for debugging (and so it does not
     425    # continue to occur).
     426    $run = fftool -revertsummary -fault 2
     427    if ($DB:n == 0)
     428      option DEFAULT
     429    else
     430      # save the DB name for the exit tasks
     431      option $DB:$fullForceSummary_revert_DB
     432      $run = $run -dbname $DB:$fullForceSummary_revert_DB
     433      $fullForceSummary_revert_DB ++
     434      if ($fullForceSummary_revert_DB >= $DB:n) set fullForceSummary_revert_DB = 0
     435    end
     436    add_poll_labels run
     437    command $run
     438  end
     439
     440  # success
     441  task.exit    0
     442  end
     443
     444  # locked list
     445  task.exit    default
     446    showcommand failure
     447  end
     448
     449  task.exit    crash
     450    showcommand crash
     451  end
     452
     453  # operation times out?
     454  task.exit    timeout
     455    showcommand timeout
     456  end
     457end
     458
Note: See TracChangeset for help on using the changeset viewer.