IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 22, 2007, 3:52:53 PM (19 years ago)
Author:
eugene
Message:

cleanup the pantasks code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTasks/summit.copy.pro

    r14607 r14621  
    77$workdir    = /home/moanui/jhoblitt/workdir
    88
     9if ($?network == 0)
     10  $network = 1
     11end
    912if ($?parallel == 0)
    1013  $parallel = 0
    11 end
    12 
    13 if ($?network == 0)
    14   $network = 1
    1514end
    1615
     
    2019book init pzPendingImfile
    2120
    22 # run pzgetexp periodically to populate pzPendingExp
     21# run pzgetexp periodically to populate pzPendingExp in the database (no I/O)
    2322task pzgetexp
    2423  command      pzgetexp -uri $uri -inst $camera -telescope $telescope
     
    4342# build a book of exps/filesetids that need to be queried
    4443task pztool.pendingexp
    45     command      pztool -pendingexp -simple
     44    command      pztool -pendingexp
    4645    host         local
    4746
     
    5453    task.exit 0
    5554        # convert 'stdout' to book format
    56 #        ipptool2book stdout pzPendingExp -key exp_name:camera:telescope -uniq -setword dbname $options:0 -setword pantaskState INIT
     55#       ipptool2book stdout pzPendingExp -key exp_name:camera:telescope -uniq -setword dbname $options:0 -setword pantaskState INIT
     56
     57# XXX we probably want the database to be user-defined...
    5758        ipptool2book stdout pzPendingExp -key exp_name:camera:telescope -uniq -setword pantaskState INIT
    5859
     
    7879        if ($network == 0) break
    7980
     81        # if we are waiting on data, make the interval long
    8082        book npages pzPendingExp -var N
    8183        if ($N == 0)
    82             periods      -exec    20
     84            periods -exec 20
    8385            break
    8486        end
    85         periods      -exec    0.2
     87        periods -exec 0.2
    8688
    8789        # find an exp that needs imfiles fetched
     
    8991        if ($pageName == NULL) break
    9092
    91 
    9293        # set that exp to run
    9394        book setword pzPendingExp $pageName pantaskState RUN
    9495
    95         book getword pzPendingExp $pageName exp_id -var EXP_ID
     96        book getword pzPendingExp $pageName exp_name -var EXP_NAME
    9697        book getword pzPendingExp $pageName camera -var CAMERA
    9798        book getword pzPendingExp $pageName telescope -var TELESCOPE
     
    104105        options $pageName
    105106
    106         $run = pzgetimfiles -uri $URI -filesetid $EXP_ID -inst $CAMERA -telescope $TELESCOPE
     107        $run = pzgetimfiles -uri $URI -filesetid $EXP_NAME -inst $CAMERA -telescope $TELESCOPE
    107108
    108109        # create the command line
     
    132133# build a book of imfiles/files that need to be downloaded
    133134task pztool.pendingimfile
    134     command      pztool -pendingimfile -simple
     135    command      pztool -pendingimfile
    135136    host         local
    136137
     
    143144    task.exit    0
    144145        # convert 'stdout' to book format
    145 #        ipptool2book stdout pzPendingImfile -key exp_name:camera:telescope -uniq -setword dbname $options:0 -setword pantaskState INIT
     146#       ipptool2book stdout pzPendingImfile -key exp_name:camera:telescope -uniq -setword dbname $options:0 -setword pantaskState INIT
    146147        ipptool2book stdout pzPendingImfile -key exp_name:camera:telescope -uniq -setword pantaskState INIT
    147148
     
    168169        if ($network == 0) break
    169170
     171        # if we are waiting on data, make the interval long
    170172        book npages pzPendingImfile -var N
    171173        if ($N == 0)
    172             periods      -exec    20
     174            periods -exec 20
    173175            break
    174176        end
    175         periods      -exec    0.2
     177        periods -exec 0.2
    176178
    177179        # find an exp that needs imfiles fetched
    178180        book getpage pzPendingImfile 0 -var pageName -key pantaskState INIT
    179181        if ($pageName == NULL) break
    180 
    181182
    182183        # set that exp to run
     
    189190        book getword pzPendingImfile $pageName md5sum -var MD5SUM
    190191
    191         # store the current page
     192        # store the pageName with this job
    192193        options $pageName
    193194
     
    203204    # success
    204205    task.exit 0
    205         book getword options $pageName uri -var URI
    206         book getword options $pageName exp_name -var EXP_NAME
    207         book getword options $pageName class_id -var CLASS_ID
    208         book getword options $pageName bytes -var BYTES
    209         book getword options $pageName md5sum -var MD5SUM
    210 
    211         book delpage pzPendingImfiles optoins
    212 
    213         local $run = pztool -copydone -exp_name $EXP_NAME -inst $CAMERA -telescope $TELESCOPE -class $CLASS -class_id $CLASS_ID -uri  $workdir/$EXP_NAME.$CLASS_ID.fits
     206        # get related info from the associated page
     207        book getword pzPendingImfile $options:0 uri -var URI
     208        book getword pzPendingImfile $options:0 exp_name -var EXP_NAME
     209        book getword pzPendingImfile $options:0 class_id -var CLASS_ID
     210        book getword pzPendingImfile $options:0 bytes -var BYTES
     211        book getword pzPendingImfile $options:0 md5sum -var MD5SUM
     212
     213        # update the database with the success
     214        $run = pztool -copydone -exp_name $EXP_NAME -inst $CAMERA -telescope $TELESCOPE -class $CLASS -class_id $CLASS_ID -uri  $workdir/$EXP_NAME.$CLASS_ID.fits
    214215
    215216        # create the command line
    216217        if ($VERBOSE > 1)
    217           echo command $run
    218         end
    219         command $run
    220 
     218          echo exec $run
     219        end
     220        exec $run
     221
     222        # update the pantasks process tables
    221223        process_exit pzPendingExp $options:0 $JOB_STATUS
    222224    end
Note: See TracChangeset for help on using the changeset viewer.