Serial (Single Processor) Batch Jobs
Any batch job that does not require multiple processors or multiprocessing libraries, such as OpenMP and MPI, is a serial batch job. Here is a sample serial batch script, runjob.single:
#!/bin/bash
#
# All lines starting with "#PBS" are PBS commands
#
# Request 1 node
#PBS -l nodes=1
#
# Set wall clock time to 0 hours, 15 minutes and 0 seconds
#PBS -l walltime=00:15:00
# cd to working directory
cd $PBS_O_WORKDIR
# name of executable
MYPROG="ssor"
# Run MYPROG
$MYPROG >& myoutput
# make sure to exit the script, else job may not finish properly
exit 0
cootie:~/batch-examples % qsub runjob.single
13952.hn003.nerf.bu.edu
cootie:~/batch-examples % qstat
Job id Name User Time Use S Queue
---------------- ---------------- ---------------- -------- - -----
13952.hn003 runjob.single kadin 0 R dque
Typically, a batch job generates at least two files: an output file (equivalent to STDOUT) and an error file (equivalent to STDERR). The naming convention is batch-script-name.XJOBID, where X is either "o" for output or "e" for error. JOBID is the unique ID of the job - in this case it is 13952. In this example, there is no error and hence the file runjob.single.e13952 contains 0 records. The output file, runjob.single.o13952, consists of three sections:
- A header section (PBS Prologue) which lists information such as JOBID, user name and node list.
- A body section which includes user output to STDOUT. Incidentally, the warning message
Warning: no access to tty (Bad file descriptor).
Thus no job control in this shell.
reminds that this is a remote batch job which can not be acted upon (such as ^Z for suspension).
- A foot section (PBS Epilogue) which is similar to the header. A useful difference is the report of wallclock time towards the end.
----------------------------------------
Begin PBS Prologue Mon Oct 20 11:03:26 EDT 2003
Job ID: 13952.hn003.nerf.bu.edu
Username: kadin
Group: scv
Nodes: nodem049
End PBS Prologue Mon Oct 20 11:03:26 EDT 2003
----------------------------------------
Warning: no access to tty (Bad file descriptor).
Thus no job control in this shell.
The result = 1.000000 <== output of execution
----------------------------------------
Begin PBS Epilogue Mon Oct 20 11:03:32 EDT 2003
Job ID: 13952.hn003.nerf.bu.edu
Username: kadin
Group: scv
Job Name: runjob.single
Session: 15012
Limits: cput=24:00:00,neednodes=nodem049,walltime=00:15:00
Resources: cput=00:00:00,mem=0kb,vmem=0kb,walltime=00:00:01
Queue: dque
Account:
Nodes: nodem049
Killing leftovers...
End PBS Epilogue Mon Oct 20 11:03:32 EDT 2003
----------------------------------------
The runjob.single batch script above is fairly representative of a typical PBS batch script. The name of the executable is explicitly defined. As a result, the script is specific for the executable.
Submitting a serial bach job without a script
There is an alternative way to submit a batch script without having to prepare a batch
script. The user would instead run a script ssub which
takes the user's executable name as its command line input. Internally, ssub will
generate a specific batch script with the executable incorporated and submit to the batch queue. For example,
cootie % ssub ../mypath/executable-name
Additional PBS command line input may be passed on to ssub as a second command line input parameter:
cootie % ssub ../mypath/executable-name "-l walltime=00:30:00"
Because ssub is not a system script, you will need to copy it (left click to view and right-click to copy) into your local directory, like ~/bin. Remember to give this script an
execute attribute with
cootie % chmod +x ssub
|