Yellow

505.277.6900
help@carc.unm.edu

Walk-in office hours
with Dr. Ryan Johnson,
Applications Scientist

Wednesdays 10 am to noon

19. Interactive PBS Jobs

Normally a job is submitted for execution on a cluster or supercomputer using the command qsub script.pbs. However, at times, such as when debugging, it can be useful to run a job interactively. To run a job in this way type qsub –I, and the batch manager will log you into a node where you can directly run your code. For example, here is the output from an interactive session running a “hello world” MPI program on four cores of a single physical node:

ebryer@nano:~$ qsub -I -lnodes=1:ppn=4 -lwalltime=00:05:00
qsub: waiting for job 27304.nano.nano.alliance.unm.edu to start
qsub: job 27304.nano.nano.alliance.unm.edu ready

Nano Portable Batch System Prologue
Job Id: 27304.nano.nano.alliance.unm.edu
Username: ebryer
Job 27304.nano.nano.alliance.unm.edu running on nodes:
nano27 

prologue running on host: nano27
ebryer@nano27:~$ module load openmpi/gnu
ebryer@nano27:~$ mpiexec -np 4 ./helloworld 2>/dev/null
hello_parallel.f: Number of tasks=  4 My rank=  0 My name=nano27
hello_parallel.f: Number of tasks=  4 My rank=  1 My name=nano27
hello_parallel.f: Number of tasks=  4 My rank=  2 My name=nano27
hello_parallel.f: Number of tasks=  4 My rank=  3 My name=nano27 

Three commands were executed here.  The first, qsub -I -lnodes=1:ppn=4 -lwalltime=00:05:00, asked the batch manager to provide one node of nano with all 4 of that node’s cores for use.  The walltime was specified as 5 minutes, since this was a simple code that would execute quickly.  The second command, module load openmpi/gnu, loaded the module used when compiling the “hello world” program; this ensures that the necessary MPI libraries would be available during execution.  The third command, mpiexec -np 4 ./helloworld 2>/dev/null, ran the “hello world” program.  (The standard error was directed to null to remove a spurious message that appears sometimes on the machine.) 

Center for Advanced Research Computing

MSC01 1190
1601 Central Ave. NE
Albuquerque, NM 87106

p: 505.277.8249
f:  505.277.8235
e: