IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 37281


Ignore:
Timestamp:
Aug 21, 2014, 3:37:50 PM (12 years ago)
Author:
eugene
Message:

add remote.prepcomp.load,.run

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tags/ipp-pv3-20140717/ippTasks/remote.pro

    r36972 r37281  
    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
    … …  
    3035    active false
    3136  end
     37  task  remote.prepcomp.load
     38    active false
     39  end
     40  task  remote.prepcomp.run
     41    active false
     42  end
    3243  task  remote.prep.load
    3344    active false
    … …  
    5768    active true
    5869  end
     70  task  remote.prepcomp.load
     71    active true
     72  end
     73  task  remote.prepcomp.run
     74    active true
     75  end
    5976  task  remote.prep.load
    6077    active true
    … …  
    7693  end
    7794end
    78 
    7995
    8096task          remote.define
    … …  
    84100  periods     -timeout 30
    85101  npending    1
     102  active      true
    86103
    87104  task.exec
    … …  
    94111    $remote_stage_iter ++
    95112
     113    # loop over all stages x all labels
    96114    if ($remote_stage_iter >= $STAGES:n)
    97115       set remote_stage_iter = 0
    … …  
    101119    end
    102120
     121    # min entry limit?
    103122    $run = remotetool -definebyquery -label $label -stage $stage -path_base neb://@HOST@.0/remote/$label -limit 500
    104123    if ($DB:n == 0)
    105124      option DEFAULT
    106125    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
     126      option $DB:$remoteDefine_DB
     127      $run = $run -dbname $DB:$remoteDefine_DB
     128      $remoteDefine_DB ++
     129      if ($remoteDefine_DB >= $DB:n) set remoteDefine_DB = 0
    111130    end
    112131
    … …  
    137156  periods     -timeout 30
    138157  npending    1
     158  active      false
    139159
    140160  task.exec
    … …  
    142162    stderr $LOGDIR/remote.define.chip
    143163
    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
     164    $label = $LABEL:$remote_label_warp
     165
     166    if ($remote_label_warp >= $LABEL:n) set remote_label_warp = 0
     167    echo $remote_label_warp $label warp
    148168
    149169    $run = remotetool -definebyquery -label $label -stage warp -path_base neb://@HOST@.0/remote/$label -limit 500
    … …  
    151171      option DEFAULT
    152172    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
     173      option $DB:$remoteDefineWarp_DB
     174      $run = $run -dbname $DB:$remoteDefineWarp_DB
     175      $remoteDefineWarp_DB ++
     176      if ($remoteDefineWarp_DB >= $DB:n) set remoteDefineWarp_DB = 0
    157177    end
    158178
    … …  
    161181   
    162182  end
    163     # success
     183
     184  # success
    164185  task.exit  0
    165186  end
    … …  
    174195  task.exit    timeout
    175196    showcommand timeout
     197  end
     198end
     199
     200task         remote.prepcomp.load
     201  host       local
     202  periods    -poll $LOADPOLL
     203  periods    -exec 30
     204  npending   1
     205  active     true
     206
     207  task.exec
     208    stdout NULL
     209    stderr $LOGDIR/remote.prepcomp.load
     210
     211    $run = remotetool -listcomponent -state new
     212
     213    if ($DB:n == 0)
     214      option DEFAULT
     215    else
     216      option $DB:$remotePrepComp_DB
     217      $run = $run -dbname $DB:$remotePrepComp_DB
     218      $remotePrepComp_DB ++
     219      if ($remotePrepComp_DB >= $DB:n) set remotePrepComp_DB = 0
     220    end
     221
     222    add_poll_args run
     223    add_poll_labels run
     224    command $run
     225  end
     226
     227  # success
     228  task.exit  0
     229    ipptool2book stdout remotePrepCompRuns -uniq -key remote_id:stage_id -setword dbname $options:0 -setword pantaskState INIT
     230    process_cleanup remotePrepCompRuns
     231
     232    if ($VERBOSE > 2)
     233      book listbook remotePrepCompRuns
     234    end
     235  end
     236  # locked list
     237  task.exit    default
     238    showcommand failure
     239  end
     240  task.exit    crash
     241    showcommand crash
     242  end
     243  #operation times out?
     244  task.exit    timeout
     245    showcommand timeout
     246  end
     247end
     248
     249# run the prep component operations in parallel
     250task           remote.prepcomp.run
     251  host         anyhost
     252  periods      -poll $LOADPOLL
     253  periods      -exec $LOADEXEC
     254  periods      -timeout 600
     255  active       true
     256  npending     10
     257
     258  task.exec
     259    stdout $LOGDIR/remote.prepcomp.run
     260    stderr $LOGDIR/remote.prepcomp.run
     261
     262    book npages remotePrepCompRuns -var N
     263    if ($N == 0) break
     264    if ($NETWORK == 0) break
     265
     266    book getpage remotePrepCompRuns 0 -var pageName -key pantaskState INIT
     267    if ("$pageName" == "NULL") break
     268
     269    book setword remotePrepCompRuns $pageName pantaskState RUN
     270    book getword remotePrepCompRuns $pageName remote_id -var REMOTE_ID
     271    book getword remotePrepCompRuns $pageName stage_id  -var STAGE_ID
     272    book getword remotePrepCompRuns $pageName stage     -var STAGE
     273    book getword remotePrepCompRuns $pageName run_path_base -var RUN_PATH_BASE
     274    book getword remotePrepCompRuns $pageName dbname    -var DBNAME
     275
     276    sprintf outroot "%s/remote_%s.%s/stage_%s" $RUN_PATH_BASE $STAGE $REMOTE_ID $STAGE_ID
     277
     278    if ("$STAGE" == "chip")
     279      $command = sc_prepare_chip.pl --camera GPC1 --chip_id $STAGE_ID --remote_id $REMOTE_ID --path_base $outroot --dbname $DBNAME
     280    end
     281    if ("$STAGE" == "camera")
     282      $command = sc_prepare_camera.pl --camera GPC1 --stage_id $STAGE_ID --remote_id $REMOTE_ID --path_base $outroot --dbname $DBNAME
     283      echo "skipping camera until scripts are ready"
     284      break
     285    end
     286    if ("$STAGE" == "warp")
     287      $command = sc_prepare_warp.pl --camera GPC1 --stage_id $STAGE_ID --remote_id $REMOTE_ID --path_base $outroot --dbname $DBNAME
     288      echo "skipping warp until scripts are ready"
     289      break
     290    end
     291    if ("$STAGE" == "stack")
     292      $command = sc_prepare_stack.pl --camera GPC1 --stage_id $STAGE_ID --remote_id $REMOTE_ID --path_base $outroot --dbname $DBNAME
     293      echo "skipping stack until scripts are ready"
     294      break
     295    end
     296
     297    options $pageName
     298    command $command
     299  end
     300
     301  # default exit status
     302  task.exit    default
     303    process_exit remotePrepCompRuns $options:0 $JOB_STATUS
     304  end
     305  # locked list
     306  task.exit    crash
     307    process_exit remotePrepCompRuns $options:0 $EXIT_CRASH_ERR
     308  end
     309
     310  # operation timed out?
     311  task.exit    timeout
     312    showcommand timeout
     313    book setword remotePrepCompRuns $options:0 pantaskState TIMEOUT
    176314  end
    177315end
    … …  
    181319  periods    -poll $LOADPOLL
    182320  periods    -exec 30
     321  active     false
    183322  npending   1
    184323
    … …  
    187326    stderr $LOGDIR/remote.prep.load
    188327
    189     $run = remotetool -listrun -state new
     328    $run = remotetool -listrun -state new -done-prep
    190329
    191330    if ($DB:n == 0)
    192331      option DEFAULT
    193332    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
     333      option $DB:$remotePrep_DB
     334      $run = $run -dbname $DB:$remotePrep_DB
     335      $remotePrep_DB ++
     336      if ($remotePrep_DB >= $DB:n) set remotePrep_DB = 0
    198337    end
    199338
    … …  
    201340    command $run
    202341  end
     342
    203343  # success
    204344  task.exit  0
    … …  
    229369  periods      -exec $LOADEXEC
    230370  periods      -timeout 600000
    231   active       true
     371  active       false
    232372  npending     10
    233373
    … …  
    247387    book getword remotePrepRuns $pageName stage     -var STAGE
    248388    book getword remotePrepRuns $pageName path_base -var PATH_BASE
    249 #    book getword remotePrepRuns $pageName label     -var LABEL
     389#   book getword remotePrepRuns $pageName label     -var LABEL
    250390    book getword remotePrepRuns $pageName dbname    -var DBNAME
    251391
    252392    sprintf outroot "%s/remote_%s.%s" $PATH_BASE $STAGE $REMOTE_ID
    253393
    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
     394    $command = sc_prepare_run.pl --camera GPC1 --remote_id $REMOTE_ID --path_base $outroot --dbname $DBNAME
    266395
    267396    options $pageName
    … …  
    290419  periods    -poll $LOADPOLL
    291420  periods    -exec $LOADEXEC
     421  active     false
    292422  npending   1
    293423
    … …  
    303433      option DEFAULT
    304434    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
     435      option $DB:$remoteExec_DB
     436      $run = $run -dbname $DB:$remoteExec_DB
     437      $remoteExec_DB ++
     438      if ($remoteExec_DB >= $DB:n) set remoteExec_DB = 0
    309439    end
    310440
    … …  
    340470  periods      -exec 30
    341471  periods      -timeout 6000000
    342   active       true
     472  active       false
    343473  npending     3
    344474
    … …  
    391521  periods    -poll $LOADPOLL
    392522  periods    -exec $LOADEXEC
     523  active       false
    393524  npending   1
    394525
    … …  
    403534      option DEFAULT
    404535    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
     536      option $DB:$remotePoll_DB
     537      $run = $run -dbname $DB:$remotePoll_DB
     538      $remotePoll_DB ++
     539      if ($remotePoll_DB >= $DB:n) set remotePoll_DB = 0
    409540    end
    410541
    … …  
    440571  periods      -exec 30
    441572  periods      -timeout 6000000
    442   active       true
     573  active       false
    443574  npending     3
    444575
Note: See TracChangeset for help on using the changeset viewer.