IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 24, 2010, 2:59:09 PM (16 years ago)
Author:
Paul Price
Message:

Merging trunk in advance of reintegrating into trunk.

Location:
branches/pap
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/pap

  • branches/pap/ippTasks/warp.pro

    r27926 r28484  
    1313book init warpPendingSkyCell
    1414book init warpPendingCleanup
     15book init warpPendingSummary
    1516
    1617### Database lists
     
    1920$warp_revert_overlap_DB = 0
    2021$warp_revert_warped_DB = 0
     22$warpSummary_DB = 0
    2123
    2224### Check status of warping tasks
     
    3032  book init warpInputExp
    3133  book init warpPendingSkyCell
     34  book init warpPendingSummary
    3235end
    3336
     
    5558    active true
    5659  end
     60  task warp.summary.load
     61    active true
     62  end
     63  task warp.summary.run
     64    active true
     65  end
    5766end
    5867
     
    7887  end
    7988  task warp.revert.warped
     89    active false
     90  end
     91  task warp.summary.load
     92    active false
     93  end
     94  task warp.summary.run
    8095    active false
    8196  end
     
    525540  end
    526541end
     542
     543### Load tasks for doing the warps
     544### Tasks are loaded into warpPendingSkyCell.
     545task           warp.summary.load
     546  host         local
     547
     548  periods      -poll $LOADPOLL
     549  periods      -exec $LOADEXEC
     550  periods      -timeout 1200
     551  npending     1
     552
     553  stdout NULL
     554  stderr $LOGDIR/warp.summary.log
     555
     556  task.exec
     557    if ($LABEL:n == 0) break
     558    $run = warptool -tosummary
     559    if ($DB:n == 0)
     560      option DEFAULT
     561    else
     562      # save the DB name for the exit tasks
     563      option $DB:$warpSummary_DB
     564      $run = $run -dbname $DB:$warpSummary_DB
     565      $warpSummary_DB ++
     566      if ($warpSummary_DB >= $DB:n) set warpSummary_DB = 0
     567    end
     568    add_poll_args run
     569    add_poll_labels run
     570    command $run
     571  end
     572
     573  # success
     574  task.exit    0
     575    # convert 'stdout' to book format
     576    # XXX change tess_id to tess_dir when db is updated
     577    ipptool2book stdout warpPendingSummary -key warp_id -uniq -setword dbname $options:0 -setword pantaskState INIT
     578    if ($VERBOSE > 2)
     579      book listbook warpPendingSummary
     580    end
     581
     582    # delete existing entries in the appropriate pantaskStates
     583    process_cleanup warpPendingSummary
     584  end
     585
     586  # locked list
     587  task.exit    default
     588    showcommand failure
     589  end
     590
     591  task.exit    crash
     592    showcommand crash
     593  end
     594
     595  # operation times out?
     596  task.exit    timeout
     597    showcommand timeout
     598  end
     599end
     600
     601### Run tasks for calculating the warp overlaps
     602### Tasks are taken from warpPendingSkyCell.
     603task           warp.summary.run
     604  periods      -poll $RUNPOLL
     605  periods      -exec $RUNEXEC
     606  periods      -timeout 60
     607
     608  task.exec
     609    # if we are unable to run the 'exec', use a long retry time
     610    periods -exec $RUNEXEC
     611
     612    book npages warpPendingSummary -var N
     613    if ($N == 0) break
     614    if ($NETWORK == 0) break
     615   
     616    # look for new images in warpPendingSkyCell (pantaskState == INIT)
     617    book getpage warpPendingSummary 0 -var pageName -key pantaskState INIT
     618    if ("$pageName" == "NULL") break
     619
     620    book setword warpPendingSummary $pageName pantaskState RUN
     621    book getword warpPendingSummary $pageName warp_id -var WARP_ID
     622    book getword warpPendingSummary $pageName camera -var CAMERA
     623    book getword warpPendingSummary $pageName workdir -var WORKDIR_TEMPLATE
     624    book getword warpPendingSummary $pageName dbname -var DBNAME
     625    book getword warpPendingSummary $pageName tess_id -var TESS_DIR
     626    book getword warpPendingSummary $pageName exp_tag -var EXP_TAG
     627    book getword warpPendingSummary $pageName state -var RUN_STATE
     628
     629    # set the host and workdir based on the skycell hash
     630    host anyhost
     631    strsub $WORKDIR_TEMPLATE @HOST@.0 $default_host -var WORKDIR
     632#    set.workdir.by.skycell $SKYCELL_ID $WORKDIR_TEMPLATE $default_host WORKDIR
     633
     634#    if ("$PATH_BASE" == "NULL")
     635        ## generate outroot specific to this exposure
     636    basename $TESS_DIR -var TESS_ID
     637
     638    sprintf outroot "%s/%s/%s.wrp.%s.%s" $WORKDIR $EXP_TAG $EXP_TAG $WARP_ID $TESS_ID
     639
     640
     641    stdout $LOGDIR/warp.summary.log
     642    stderr $LOGDIR/warp.summary.log
     643
     644    $run = skycell_jpeg.pl --stage warp --stage_id $WARP_ID --camera $CAMERA --outroot $outroot
     645    add_standard_args run
     646
     647    # save the pageName for future reference below
     648    options $pageName
     649
     650    # create the command line
     651    if ($VERBOSE > 1)
     652      echo command $run
     653    end
     654    periods -exec 0.05
     655    command $run
     656  end
     657
     658  # default exit status
     659  task.exit    default
     660    process_exit warpPendingSummary $options:0 $JOB_STATUS
     661  end
     662
     663  # locked list
     664  task.exit    crash
     665    showcommand crash
     666    echo "hostname: $JOB_HOSTNAME"
     667    book setword warpPendingSummary $options:0 pantaskState CRASH
     668  end
     669
     670  # operation timed out?
     671  task.exit    timeout
     672    showcommand timeout
     673    book setword warpPendingSummary $options:0 pantaskState TIMEOUT
     674  end
     675end
Note: See TracChangeset for help on using the changeset viewer.