How to compile and run a C/MPI program "tst.c" on the cluster p1 in interactive mode?
- First, an interactive session has to be started with
> pbs_sub -l walltime=4000,nodes=4 -I --
remark:
- the default maximal time for the interactive job is 3600 minutes
- each node has two CPUs so that four nodes give access to eight CPUs
- then 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
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
- next call
> pbs_nodes --gm
remark:
- this command produces a file which contains information about the nodes
that are allocated for your interactive session. The filename is built using
the ID of your interactive session (e.g. 54586.master1.ch_gm.tmp)
- to submit the program on 5 processors, use
> /usr/local/clos/mpich/bin/mpirun.ch_gm --gm-f 54586.master1.ch_gm.tmp -np 5 tst myarg
remark:
- myarg is passed to the program as command line option
- the option --gm-f requires the filename produced with pbs_nodes
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
- next call
> pbs_nodes --p4
remark:
- this command produces a file which contains information about the nodes
that are allocated for your interactive session. The filename is built using
the ID of your interactive session (e.g. 54586.master1.ch_p4.tmp)
- to submit the program on 5 processors, use
> /usr/lib/mpich/bin/mpirun -machinefile 54586.master1.ch_p4.tmp -np 5 tst myarg
remark:
- myarg is passed to the program as command line option
- the option -machinefile requires the filename produced with pbs_nodes
Please allocate as few as possible nodes and terminate your interactive session as quickly as possible (using the command exit).
Back