How to compile and run a C/MPI program "tst.c" on the cluster p1 in batch mode?
First you should decide for your favorite MPI implementation.
Available are:
- the MPICH implementation with ch_gm device. To compile the program use
> /usr/local/clos/mpich/bin/mpicc tst.c -o tst -lm
- the MPICH implementation with ch_p4 device. To compile the program use
> /usr/lib/mpich/bin/mpicc tst.c -o tst -lm
remark:
- the option -o tst specifies the filename "tst" of the executable (default is "a.out")
- -lm is necessary if you use the math library
- Note that programs using stdin (e.g. scanf(...)) do not work
properly in batch mode. The stdin cannot easily be redirected.
- to submit the program on 5 processors, use
> pbs_sub tst -np 5 myarg
remark:
- myarg is passed to the program as command line option
- after submission you get the job-id, e.g. 526.master1
- if your job needs more than the default value 3600 minutes (= 1hour)
you should specify the required time explicitely. For example, to get two hours type
> pbs_sub -l walltime=7200 -- tst -np 5 myarg
- to check the job queue, type
> pbs_stat -v
- premature output of your job can be obtained with
> pbs_output 526
- after completion, the output (stdout/stderr) can be found in the files tst.o526 and tst.e526
Back