Text-only Table of Contents (frame/ no frame)
(12) How to Run MPI Programs in A Batch Queue Previous Top Next

How to Run MPI Programs in a Batch Queue

Example of Submitting to PBS batch queue

Use a text editor to create a file called sample_pbs_script. Copy the lines below and add them to the file. Then use the command qsub to submit the file to the PBS batch queue. Use the command qstat job# where the job number is the number that was returned by the qsub command. Use the showq command to see the jobs in the PBS batch queue.

The batch queue determines which processors your job runs on.


discovery:~> cat sample_pbs_script
# declare a name for this job to be sample_job
#PBS -N hello_world
# request the default queue for this job
#PBS -q default
# request a total of 8 processors for this job (2 nodes and 4 processors per node)
#PBS -l nodes=2:ppn=4
# request 1 hour of wall time
#PBS -l walltime=1:00:00
# specify your email address so mail can be sent to when the job is finished
#PBS -M John.Smith@dartmouth.edu
# have email sent to you when the job is finished
#PBS -m ae
#change to the directory where you submitted the job
cd $PBS_O_WORKDIR
#include the full path to the name of your MPI program
mpiexec -comm p4 -np 4 /home/sas/Classes/intro_mpi/hello_world_c

discovery:~> qsub sample_pbs_script
40952.endeavor.bw01.dartmouth.edu

discovery:qstat 40952
Job id Name User Time Use S Queue
---------------- ---------------- ---------------- -------- - -----
40952.endeavor hello_world sas 0 R default

discovery: showq
ACTIVE JOBS--------------------
JOBNAME USERNAME STATE PROC REMAINING STARTTIME

40950 jsmith Running 4 18:16:25:07 Mon Oct 24 09:33:45
40952 sas Running 2 20:20:00:00 Wed Oct 26 13:08:38
.
.
.
128 active jobs 128 of 328 processors in use by local jobs (39.02%)
36 of 89 nodes active (40.45%)




Previous Top Next


running_mpi_ex2.src  last modified Apr 25, 2007 Introduction Table of Contents
(frame/no frame)
Printable
(single file)
© Dartmouth College