IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 15, 2010, 1:29:28 PM (16 years ago)
Author:
watersc1
Message:

Merge of realtime burntool and new nightly science code into trunk.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/ippTasks/register.pro

    r25418 r30049  
    88book init regPendingImfile
    99book init regPendingExp
     10book init regPendingBurntoolImfile
    1011
    1112macro register.reset
    1213  book init regPendingImfile
    1314  book init regPendingExp
     15  book init regPendingBurntoolImfile
    1416end
    1517
     
    1820  book listbook regPendingImfile
    1921  book listbook regPendingExp
     22  book listbook regPendingBurntoolImfile
    2023end
    2124
     
    3336    active true
    3437  end
     38  task register.burntool.load
     39    active true
     40  end
     41  task register.burntool.run
     42    active true
     43  end
    3544end
    3645
     
    4857    active false
    4958  end
    50 end
     59  task register.burntool.load
     60    active false
     61  end
     62  task register.burntool.run
     63    active false
     64  end
     65end
     66
     67$valid_burntool_value = 14
    5168
    5269macro replace.survey.values
     
    129146# these variables will cycle through the known database names
    130147$regPendingImfile_DB = 0
     148$regPendingBurntoolImfile_DB = 0
    131149$regPendingExp_DB = 0
    132150
     
    429447end
    430448
     449
     450# select imfiles that can now be burntooled.
     451task       register.burntool.load
     452  host     local
     453
     454  periods  -poll $LOADPOLL
     455  periods  -exec $LOADEXEC
     456  periods  -timeout 30
     457  npending 1
     458
     459  # silently drop stdout
     460  stdout NULL
     461  stderr $LOGDIR/register.burntool.load.log
     462 
     463  # select entried from the current DB; cycle to the next DB, if it exists
     464  task.exec
     465    $run = regtool -pendingburntoolimfile
     466    $today = `date -u +%Y-%m-%d`
     467# debugging purposes
     468    $today = "2010-12-06"
     469    $run = $run -date $today -valid_burntool $valid_burntool_value
     470    if ($DB:n == 0)
     471      option DEFAULT
     472    else
     473      # save the DB name for the exit tasks
     474      option $DB:$regPendingBurntoolImfile_DB
     475      $run = $run -dbname $DB:$regPendingBurntoolImfile_DB
     476      $regPendingBurntoolImfile_DB ++
     477      if ($regPendingBurntoolImfile_DB >= $DB:n) set regPendingBurntoolImfile_DB = 0
     478    end
     479
     480    echo $run
     481    add_poll_args run
     482    command $run
     483  end
     484
     485  # success
     486  task.exit $EXIT_SUCCESS
     487    # convert 'stdout' to book format
     488    ipptool2book stdout regPendingBurntoolImfile -key exp_id:class_id -uniq -setword dbname $options:0 -setword pantaskState INIT
     489    book shuffle regPendingBurntoolImfile
     490    if ($VERBOSE > 2)
     491      book listbook regPendingBurntoolImfile
     492    end
     493
     494    # delete existing entries in the appropriate pantasksStates
     495    process_cleanup regPendingBurntoolImfile
     496  end
     497
     498  # locked list
     499  task.exit   default
     500    showcommand failure
     501  end
     502  task.exit   crash
     503    showcommand crash
     504  end
     505  task.exit   timeout
     506    showcommand timeout
     507  end
     508end
     509
     510# run the ipp_apply_burntool_single.pl script on the pending images
     511task          register.burntool.run
     512  periods     -poll $RUNPOLL
     513  periods     -exec $RUNEXEC
     514  periods     -timeout 30
     515
     516  task.exec
     517    if ($NETWORK == 0) break
     518    book npages regPendingBurntoolImfile -var N
     519    if ($N == 0)
     520      periods -exec $RUNEXEC
     521      break
     522    end
     523    periods -exec 0.05
     524
     525    # look for new images to burn in regPendingBurntoolImfile
     526    book getpage regPendingBurntoolImfile 0 -var pageName -key pantaskState INIT
     527    if ("$pageName" == "NULL") break
     528
     529    book setword regPendingBurntoolImfile $pageName pantaskState RUN
     530
     531    book getword regPendingBurntoolImfile $pageName exp_id      -var EXP_ID
     532    book getword regPendingBurntoolImfile $pageName class_id    -var CLASS_ID
     533    book getword regPendingBurntoolImfile $pageName uri         -var THIS_URI
     534    book getword regPendingBurntoolImfile $pageName previous_uri -var PREVIOUS_URI
     535    book getword regPendingBurntoolImfile $pageName camera      -var CAMERA
     536    book getword regPendingBurntoolImfile $pageName dbname      -var DBNAME
     537    set.host.for.camera $CAMERA $CLASS_ID
     538
     539    stdout $LOGDIR/register.burntool.run.log
     540    stderr $LOGDIR/register.burntool.run.log
     541
     542    $run = ipp_apply_burntool_single.pl --exp_id $EXP_ID --class_id $CLASS_ID --this_uri $THIS_URI
     543    if ("$PREVIOUS_URI" != "NULL")
     544      $run = $run --previous_uri $PREVIOUS_URI
     545    end
     546
     547    add_standard_args run
     548
     549    options $pageName
     550
     551    if ($VERBOSE > 1)
     552      echo command $run
     553    end
     554    command $run
     555  end
     556
     557  # default exit status
     558  task.exit default
     559    process_exit regPendingBurntoolImfile $options:0 $JOB_STATUS
     560  end
     561
     562  # locked list
     563  task.exit crash
     564    showcommand crash
     565    echo "hostname: $JOB_HOSTNAME"
     566    book setword regPendingBurntoolImfile $options:0 pantaskState CRASH
     567  end
     568
     569  # operation timed out
     570  task.exit  timeout
     571    showcommand timeout
     572    book setword regPendingBurntoolImfile $options:0 pantaskState TIMEOUT
     573  end
     574end
     575
     576   
     577   
     578 
    431579## XXX add a global path to output files 
Note: See TracChangeset for help on using the changeset viewer.