IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 12, 2015, 12:55:39 PM (12 years ago)
Author:
eugene
Message:

merging changes from ipp-pv3-20140717 (via branches/eam_branches/ipp-pv3-20140717-merge)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTasks/remote.pro

    r36972 r37835  
    55# define chips
    66
     7book init remotePrepCompRuns
    78book init remotePrepRuns
    89book init remoteExecRuns
     
    1011
    1112$remote_label_iter = 0
    12 $remote_label_iter2 = 0
     13$remote_label_warp = 0
    1314$remote_stage_iter = 0
    14 $remoteP_DB = 0
    15 $remoteE_DB = 0
    16 $remoteL_DB = 0
     15
     16$remoteDefine_DB = 0
     17$remoteDefineWarp_DB = 0
     18$remotePrepComp_DB = 0
     19$remotePrep_DB = 0
     20$remoteExec_DB = 0
     21$remotePoll_DB = 0
    1722
    1823list STAGES
     
    2126#  warp
    2227  stack
     28  staticsky
    2329end
    2430
     
    3036    active false
    3137  end
     38  task  remote.prepcomp.load
     39    active false
     40  end
     41  task  remote.prepcomp.run
     42    active false
     43  end
    3244  task  remote.prep.load
    3345    active false
     
    5769    active true
    5870  end
     71  task  remote.prepcomp.load
     72    active true
     73  end
     74  task  remote.prepcomp.run
     75    active true
     76  end
    5977  task  remote.prep.load
    6078    active true
     
    7694  end
    7795end
    78 
    7996
    8097task          remote.define
     
    83100  periods     -exec 300
    84101  periods     -timeout 30
     102  active      true
    85103  npending    1
    86104
     
    94112    $remote_stage_iter ++
    95113
     114    # loop over all stages x all labels
    96115    if ($remote_stage_iter >= $STAGES:n)
    97116       set remote_stage_iter = 0
     
    101120    end
    102121
     122    # min entry limit?
    103123    $run = remotetool -definebyquery -label $label -stage $stage -path_base neb://@HOST@.0/remote/$label -limit 500
    104124    if ($DB:n == 0)
    105125      option DEFAULT
    106126    else
    107       option $DB:$remoteP_DB
    108       $run = $run -dbname $DB:$remoteP_DB
    109       $remoteP_DB ++
    110       if ($remoteP_DB >= $DB:n) set remoteP_DB = 0
     127      option $DB:$remoteDefine_DB
     128      $run = $run -dbname $DB:$remoteDefine_DB
     129      $remoteDefine_DB ++
     130      if ($remoteDefine_DB >= $DB:n) set remoteDefine_DB = 0
    111131    end
    112132
     
    134154  host        local
    135155  periods     -poll $LOADPOLL
    136   periods     -exec 1800
     156  periods     -exec 900
    137157  periods     -timeout 30
     158  active      true
    138159  npending    1
    139160
     
    142163    stderr $LOGDIR/remote.define.chip
    143164
    144     $label = $LABEL:$remote_label_iter2
    145 
    146     if ($remote_label_iter >= $LABEL:n) set remote_label_iter = 0
    147     echo  $remote_label_iter $label warp
    148 
    149     $run = remotetool -definebyquery -label $label -stage warp -path_base neb://@HOST@.0/remote/$label -limit 500
     165    $label = $LABEL:$remote_label_warp
     166
     167    if ($remote_label_warp >= $LABEL:n) set remote_label_warp = 0
     168    echo $remote_label_warp $label warp
     169
     170    $run = remotetool -definebyquery -label $label -stage warp -path_base neb://@HOST@.0/remote/$label -limit 50
    150171    if ($DB:n == 0)
    151172      option DEFAULT
    152173    else
    153       option $DB:$remoteP_DB
    154       $run = $run -dbname $DB:$remoteP_DB
    155       $remoteP_DB ++
    156       if ($remoteP_DB >= $DB:n) set remoteP_DB = 0
     174      option $DB:$remoteDefineWarp_DB
     175      $run = $run -dbname $DB:$remoteDefineWarp_DB
     176      $remoteDefineWarp_DB ++
     177      if ($remoteDefineWarp_DB >= $DB:n) set remoteDefineWarp_DB = 0
    157178    end
    158179
     
    161182   
    162183  end
    163     # success
     184
     185  # success
    164186  task.exit  0
    165187  end
     
    174196  task.exit    timeout
    175197    showcommand timeout
     198  end
     199end
     200
     201task         remote.prepcomp.load
     202  host       local
     203  periods    -poll $LOADPOLL
     204  periods    -exec $LOADEXEC
     205  periods    -timeout 30
     206  active     true
     207  npending   1
     208
     209  task.exec
     210    stdout NULL
     211    stderr $LOGDIR/remote.prepcomp.load
     212
     213    $run = remotetool -listcomponent -state new
     214
     215    if ($DB:n == 0)
     216      option DEFAULT
     217    else
     218      option $DB:$remotePrepComp_DB
     219      $run = $run -dbname $DB:$remotePrepComp_DB
     220      $remotePrepComp_DB ++
     221      if ($remotePrepComp_DB >= $DB:n) set remotePrepComp_DB = 0
     222    end
     223
     224    add_poll_args run
     225    add_poll_labels run
     226    command $run
     227  end
     228
     229  # success
     230  task.exit  0
     231    ipptool2book stdout remotePrepCompRuns -uniq -key remote_id:stage_id -setword dbname $options:0 -setword pantaskState INIT
     232    process_cleanup remotePrepCompRuns
     233
     234    if ($VERBOSE > 2)
     235      book listbook remotePrepCompRuns
     236    end
     237  end
     238  # locked list
     239  task.exit    default
     240    showcommand failure
     241  end
     242  task.exit    crash
     243    showcommand crash
     244  end
     245  #operation times out?
     246  task.exit    timeout
     247    showcommand timeout
     248  end
     249end
     250
     251# run the prep component operations in parallel
     252task           remote.prepcomp.run
     253  host         anyhost
     254  periods      -poll $RUNPOLL
     255  periods      -exec $RUNEXEC
     256  periods      -timeout 600
     257  active       true
     258
     259  task.exec
     260    # if we are unable to run the 'exec', use a long retry time
     261    periods -exec $RUNEXEC
     262
     263    stdout $LOGDIR/remote.prepcomp.run
     264    stderr $LOGDIR/remote.prepcomp.run
     265
     266    book npages remotePrepCompRuns -var N
     267    if ($N == 0) break
     268    if ($NETWORK == 0) break
     269
     270    book getpage remotePrepCompRuns 0 -var pageName -key pantaskState INIT
     271    if ("$pageName" == "NULL") break
     272
     273    book setword remotePrepCompRuns $pageName pantaskState RUN
     274    book getword remotePrepCompRuns $pageName remote_id -var REMOTE_ID
     275    book getword remotePrepCompRuns $pageName stage_id  -var STAGE_ID
     276    book getword remotePrepCompRuns $pageName stage     -var STAGE
     277    book getword remotePrepCompRuns $pageName run_path_base -var RUN_PATH_BASE
     278    book getword remotePrepCompRuns $pageName dbname    -var DBNAME
     279
     280    sprintf outroot "%s/remote_%s.%s/stage_%s" $RUN_PATH_BASE $STAGE $REMOTE_ID $STAGE_ID
     281
     282    if ("$STAGE" == "chip")
     283      $command = sc_prepare_chip.pl --camera GPC1 --chip_id $STAGE_ID --remote_id $REMOTE_ID --path_base $outroot --dbname $DBNAME
     284    end
     285    if ("$STAGE" == "camera")
     286      $command = sc_prepare_camera.pl --camera GPC1 --cam_id $STAGE_ID --remote_id $REMOTE_ID --path_base $outroot --dbname $DBNAME
     287    end
     288    if ("$STAGE" == "warp")
     289      $command = sc_prepare_warp.pl --camera GPC1 --warp_id $STAGE_ID --remote_id $REMOTE_ID --path_base $outroot --dbname $DBNAME
     290    end
     291    if ("$STAGE" == "stack")
     292      $command = sc_prepare_stack.pl --camera GPC1 --stack_id $STAGE_ID --remote_id $REMOTE_ID --path_base $outroot --dbname $DBNAME
     293    end
     294    if ("$STAGE" == "staticsky")
     295      $command = sc_prepare_staticsky.pl --camera GPC1 --sky_id $STAGE_ID --remote_id $REMOTE_ID --path_base $outroot -dbname $DBNAME
     296    end
     297
     298    options $pageName
     299
     300    periods -exec 0.05
     301    command $command
     302  end
     303
     304  # default exit status
     305  task.exit    default
     306    process_exit remotePrepCompRuns $options:0 $JOB_STATUS
     307  end
     308  # locked list
     309  task.exit    crash
     310    process_exit remotePrepCompRuns $options:0 $EXIT_CRASH_ERR
     311  end
     312
     313  # operation timed out?
     314  task.exit    timeout
     315    showcommand timeout
     316    book setword remotePrepCompRuns $options:0 pantaskState TIMEOUT
    176317  end
    177318end
     
    181322  periods    -poll $LOADPOLL
    182323  periods    -exec 30
     324  active     true
    183325  npending   1
    184326
     
    187329    stderr $LOGDIR/remote.prep.load
    188330
    189     $run = remotetool -listrun -state new
     331    $run = remotetool -doneprep -state new
    190332
    191333    if ($DB:n == 0)
    192334      option DEFAULT
    193335    else
    194       option $DB:$remoteP_DB
    195       $run = $run -dbname $DB:$remoteP_DB
    196       $remoteP_DB ++
    197       if ($remoteP_DB >= $DB:n) set remoteP_DB = 0
     336      option $DB:$remotePrep_DB
     337      $run = $run -dbname $DB:$remotePrep_DB
     338      $remotePrep_DB ++
     339      if ($remotePrep_DB >= $DB:n) set remotePrep_DB = 0
    198340    end
    199341
     
    201343    command $run
    202344  end
     345
    203346  # success
    204347  task.exit  0
     
    230373  periods      -timeout 600000
    231374  active       true
    232   npending     10
     375  npending     1
    233376
    234377  task.exec
     
    247390    book getword remotePrepRuns $pageName stage     -var STAGE
    248391    book getword remotePrepRuns $pageName path_base -var PATH_BASE
    249 #    book getword remotePrepRuns $pageName label     -var LABEL
     392#   book getword remotePrepRuns $pageName label     -var LABEL
    250393    book getword remotePrepRuns $pageName dbname    -var DBNAME
    251394
    252395    sprintf outroot "%s/remote_%s.%s" $PATH_BASE $STAGE $REMOTE_ID
    253396
    254     if ("$STAGE" == "chip")
    255       $command = sc_prepare_chip.pl --camera GPC1 --remote_id $REMOTE_ID --path_base $outroot --dbname $DBNAME
    256     end
    257     if ("$STAGE" == "camera")
    258       $command = sc_prepare_camera.pl --camera GPC1 --remote_id $REMOTE_ID --path_base $outroot --dbname $DBNAME
    259     end
    260     if ("$STAGE" == "warp")
    261       $command = sc_prepare_warp.pl --camera GPC1 --remote_id $REMOTE_ID --path_base $outroot --dbname $DBNAME
    262     end
    263     if ("$STAGE" == "stack")
    264       $command = sc_prepare_stack.pl --camera GPC1 --remote_id $REMOTE_ID --path_base $outroot --dbname $DBNAME
    265     end
     397    $command = sc_prepare_run.pl --camera GPC1 --remote_id $REMOTE_ID --stage $STAGE --path_base $outroot --dbname $DBNAME
    266398
    267399    options $pageName
     
    284416  end
    285417end
    286 
    287418
    288419task         remote.exec.load
     
    290421  periods    -poll $LOADPOLL
    291422  periods    -exec $LOADEXEC
     423  active     false
    292424  npending   1
    293425
     
    303435      option DEFAULT
    304436    else
    305       option $DB:$remoteE_DB
    306       $run = $run -dbname $DB:$remoteE_DB
    307       $remoteE_DB ++
    308       if ($remoteE_DB >= $DB:n) set remoteE_DB = 0
     437      option $DB:$remoteExec_DB
     438      $run = $run -dbname $DB:$remoteExec_DB
     439      $remoteExec_DB ++
     440      if ($remoteExec_DB >= $DB:n) set remoteExec_DB = 0
    309441    end
    310442
     
    340472  periods      -exec 30
    341473  periods      -timeout 6000000
    342   active       true
     474  active       false
    343475  npending     3
    344476
     
    386518end
    387519
    388 
    389520task         remote.poll.load
    390521  host       local
    391522  periods    -poll $LOADPOLL
    392   periods    -exec $LOADEXEC
     523  periods    -exec 300
     524  active       false
    393525  npending   1
    394526
     
    397529    stderr $LOGDIR/remote.poll.load
    398530
    399     $end_date = `date +%Y-%m-%dT%H:%M:%S -d '1 hour ago'`
    400     $run = remotetool -listrun -state run -poll_end $end_date
     531    # $end_date = `date +%Y-%m-%dT%H:%M:%S -d '1 hour ago'`
     532    # $run = remotetool -listrun -state run -poll_end $end_date
     533    $run = remotetool -listrun -state run
    401534
    402535    if ($DB:n == 0)
    403536      option DEFAULT
    404537    else
    405       option $DB:$remoteL_DB
    406       $run = $run -dbname $DB:$remoteL_DB
    407       $remoteL_DB ++
    408       if ($remoteL_DB >= $DB:n) set remoteL_DB = 0
     538      option $DB:$remotePoll_DB
     539      $run = $run -dbname $DB:$remotePoll_DB
     540      $remotePoll_DB ++
     541      if ($remotePoll_DB >= $DB:n) set remotePoll_DB = 0
    409542    end
    410543
     
    412545    command $run
    413546  end
     547
    414548  # success
    415549  task.exit  0
     
    440574  periods      -exec 30
    441575  periods      -timeout 6000000
    442   active       true
    443   npending     3
     576  active       false
     577  npending     10
    444578
    445579  task.exec
     
    466600    # This can't have an invalid job_id
    467601    if ($JOB_ID == -1) break
    468     $command = sc_remote_exec.pl --remote_id $REMOTE_ID --path_base $outroot --verbose --dbname $DBNAME --camera GPC1 --poll --job_id $JOB_ID
     602    $command = sc_remote_poll.pl --remote_id $REMOTE_ID --path_base $outroot --verbose --dbname $DBNAME --camera GPC1 --job_id $JOB_ID
    469603
    470604    options $pageName
Note: See TracChangeset for help on using the changeset viewer.