IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 31454


Ignore:
Timestamp:
May 5, 2011, 1:12:27 PM (15 years ago)
Author:
watersc1
Message:

Last minute updates and changes to LAP code to get the pantasks module working.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippScripts/scripts/lap_science.pl

    r31435 r31454  
    182182    $chip_cmd .= " -set_label $exposure->{label} -set_data_group $data_group ";
    183183    $chip_cmd .= " -set_workdir $workdir -set_dist_group $exposure->{dist_group} ";
     184    $chip_cmd .= " -set_reduction LAP_SCIENCE ";
    184185
    185186    my ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     
    489490    }
    490491
    491 
     492    print "STATUS: LAP_ID           $lap_id\n";
    492493    print "STATUS: DEFINED_QSTACK:  $defined_qstack\n";
    493494    print "STATUS: HAVE_QSTACK:     $have_qstack\n";
     
    504505
    505506    print "STATUS: TOTAL_EXPOSURES: $total_exposures\n";
     507    print "\n";
    506508    if ($do_nothing) {
    507509        exit(0);
     
    545547        }
    546548    }
    547    
     549    print "\n";
     550    return(0);
    548551}
    549552
  • trunk/ippTasks/Makefile.am

    r30375 r31454  
    4141        lossy_compress.pro \
    4242        background.pro \
    43         diffphot.pro
     43        diffphot.pro \
     44        lap.pro
    4445
    4546other_files = \
  • trunk/ippTasks/lap.pro

    r31435 r31454  
    44
    55$lapSeq:n = 0
    6 
    7 book init lapRuns
     6$lap_N = 0
     7$lap_DB = 0
     8
     9$lap_NewPage = 0
     10$lap_RunPage = 0
     11$lap_DonePage = 0
     12
     13book init lapNewRuns
     14book init lapRunRuns
     15book init lapFullRuns
     16book init lapDoneRuns
     17
     18macro lap.show.books
     19    book listbook lapNewRuns
     20    book listbook lapRunRuns
     21    book listbook lapDoneRuns
     22    book listbook lapFullRuns
     23end
     24
     25macro lap.on
     26    task lap.initial.load
     27      active true
     28    end
     29    task lap.initial.run
     30      active true
     31    end
     32    task lap.monitor.load
     33      active true
     34    end
     35    task lap.monitor.run
     36      active true
     37    end
     38    task lap.cleanup.load
     39      active true
     40    end
     41    task lap.cleanup.run
     42      active true
     43    end
     44end
     45
     46macro lap.off
     47    task lap.initial.load
     48      active false
     49    end
     50    task lap.initial.run
     51      active false
     52    end
     53    task lap.monitor.load
     54      active false
     55    end
     56    task lap.monitor.run
     57      active false
     58    end
     59    task lap.cleanup.load
     60      active false
     61    end
     62    task lap.cleanup.run
     63      active false
     64    end
     65end
     66
     67macro lap.cleanup.on
     68    task lap.cleanup.load
     69      active true
     70    end
     71    task lap.cleanup.run
     72      active true
     73    end
     74end
     75
     76macro lap.cleanup.off
     77    task lap.cleanup.load
     78      active false
     79    end
     80    task lap.cleanup.run
     81      active false
     82    end
     83end
    884
    985macro lap.add.sequence
     
    80156  # success
    81157  task.exit  0
    82     book delpage lapNewRuns $options:0
    83     ipptool2book stdout lapNewRuns -uniq -key proj
     158#    book delpage lapNewRuns $options:0
     159    ipptool2book stdout lapNewRuns -uniq -key lap_id -setword dbname $options:0 -setword pantaskState INIT
    84160
    85161    if ($VERBOSE > 2)
     
    109185
    110186  task.exec
    111     stdout NULL
     187    stdout $LOGDIR/lap.initial.log
    112188    stderr $LOGDIR/lap.initial.log
    113189
     
    117193
    118194
    119     book getpage lapNewRuns 0 -var pageName -key pantaskState INIT
    120     if ("$pageName" == "NULL") break
    121 
    122     book setword lapNewRuns $pageName pantaskState RUN
    123     book getword lapNewRuns $pageName lap_id -var LAP_ID
    124     book getword lapNewRuns $pageName dbname -var DBNAME
     195    book getpage lapNewRuns $lap_NewPage -var lapNewPageName
     196
     197    $lap_NewPage ++
     198    if ($lap_NewPage >= $N) set lap_NewPage = 0
     199
     200
     201    if ("$lapNewPageName" == "NULL") break
     202
     203    book setword lapNewRuns $lapNewPageName pantaskState RUN
     204    book getword lapNewRuns $lapNewPageName lap_id -var LAP_ID
     205    book getword lapNewRuns $lapNewPageName dbname -var DBNAME
    125206
    126207    $run = lap_science.pl --chip_mode --dbname $DBNAME --lap_id $LAP_ID
     
    132213  # success
    133214  task.exit  0
    134     book delpage lapNewRuns $options:0
    135     ipptool2book stdout lapNewRuns -uniq -key proj
     215#    book delpage lapNewRuns $options:0
     216#    ipptool2book stdout lapNewRuns -uniq -key lap_id
    136217
    137218    if ($VERBOSE > 2)
     
    167248    $run = laptool -pendingrun -state run
    168249
    169     if ($lapSeq:n != 0)
     250    if ($lapSeq:n == 0)
     251      break
     252    else
    170253      option $lapSeq:$lap_N
    171254      $run = $run -seq_id $lapSeq:$lap_N
     
    184267
    185268    add_poll_labels run
    186 
    187     command $run
    188   end
    189   # success
    190   task.exit  0
    191     book delpage lapRuRuns $options:0
    192     ipptool2book stdout lapRunRuns -uniq -key lap_id
     269#    echo $run
     270    command $run
     271  end
     272  # success
     273  task.exit  0
     274#    book delpage lapRunRuns $options:0
     275    ipptool2book stdout lapRunRuns -uniq -key lap_id -setword dbname $options:0 -setword pantaskState INIT
    193276
    194277    if ($VERBOSE > 2)
     
    218301
    219302  task.exec
    220     stdout NULL
    221     stderr $LOGDIR/lap.initial.log
     303    stdout $LOGDIR/lap.monitor.log
     304    stderr $LOGDIR/lap.monitor.log
    222305
    223306    book npages lapRunRuns -var N
     307
     308#    echo $N $NETWORK
    224309    if ($N == 0) break
    225310    if ($NETWORK == 0) break
    226311
    227312
    228     book getpage lapNewRuns 0 -var pageName -key pantaskState INIT
    229     if ("$pageName" == "NULL") break
    230 
    231     book setword lapNewRuns $pageName pantaskState RUN
    232     book getword lapNewRuns $pageName lap_id -var LAP_ID
    233     book getword lapNewRuns $pageName dbname -var DBNAME
     313    book getpage lapRunRuns $lap_RunPage -var lapRunPageName
     314
     315    $lap_RunPage ++
     316    if ($lap_RunPage >= $N) set lap_RunPage = 0
     317
     318#    echo $lapRunPageName
     319    if ("$lapRunPageName" == "NULL") break
     320
     321    book setword lapRunRuns $lapRunPageName pantaskState RUN
     322    book getword lapRunRuns $lapRunPageName lap_id -var LAP_ID
     323    book getword lapRunRuns $lapRunPageName dbname -var DBNAME
    234324
    235325    $run = lap_science.pl --monitor_mode --dbname $DBNAME --lap_id $LAP_ID
     
    241331  # success
    242332  task.exit  0
    243     book delpage lapRunRuns $options:0
    244     ipptool2book stdout lapRunRuns -uniq -key proj
     333#    book delpage lapRunRuns $options:0
     334#    ipptool2book stdout lapRunRuns -uniq -key lap_id
    245335
    246336    if ($VERBOSE > 2)
     
    298388  # success
    299389  task.exit  0
    300     book delpage lapDoneRuns $options:0
    301     ipptool2book stdout lapDoneRuns -uniq -key lap_id
     390    ipptool2book stdout lapDoneRuns -uniq -key lap_id  -setword dbname $options:0 -setword pantaskState INIT
    302391
    303392    if ($VERBOSE > 2)
     
    327416
    328417  task.exec
    329     stdout NULL
     418    stdout $LOGDIR/lap.cleanup.log
    330419    stderr $LOGDIR/lap.cleanup.log
    331420
    332     book npages lapNewRuns -var N
     421    book npages lapDoneRuns -var N
    333422    if ($N == 0) break
    334423    if ($NETWORK == 0) break
    335424
    336425
    337     book getpage lapNewRuns 0 -var pageName -key pantaskState INIT
    338     if ("$pageName" == "NULL") break
    339 
    340     book setword lapDoneRuns $pageName pantaskState RUN
    341     book getword lapDoneRuns $pageName lap_id -var LAP_ID
    342     book getword lapDoneRuns $pageName dbname -var DBNAME
     426    book getpage lapDoneRuns $lap_DonePage -var lapDonePageName
     427
     428    $lap_DonePage ++
     429    if ($lap_DonePage >= $N) set lap_DonePage = 0
     430
     431    if ("$lapDonePageName" == "NULL") break
     432
     433    book setword lapDoneRuns $lapDonePageName pantaskState RUN
     434    book getword lapDoneRuns $lapDonePageName lap_id -var LAP_ID
     435    book getword lapDoneRuns $lapDonePageName dbname -var DBNAME
    343436
    344437    $run = lap_science.pl --cleanup_mode --dbname $DBNAME --lap_id $LAP_ID
     
    350443  # success
    351444  task.exit  0
    352     book delpage lapDoneRuns $options:0
    353     ipptool2book stdout lapDoneRuns -uniq -key proj
     445#    ipptool2book stdout lapDoneRuns -uniq -key lap_id
    354446
    355447    if ($VERBOSE > 2)
Note: See TracChangeset for help on using the changeset viewer.