mpicc -o test1 test1.cYou may attach an optimization flag.
qsub -I -l nodes=1:ppn=16 -l walltime=00:15:00to start an interactive job on a single node with 16 cores for at most 15 minutes.
Once you run it, it will wait until a node is available, and then it will create an SSH session to that node. Your job will last until you exit that SSH session.
mpirun -v -machinefile $PBS_NODEFILE -np 16 ProgramNameThis command executes the MPI program with 16 processes on the allocated machines. $PBS_NODEFILE is a shell variable and its value is a file which contains machine names allocated by "qsub -I".
Notes:
Make sure your code does not wait for an input from a user keyboard!
cd ~/path-to-program mpirun -v -machinefile $PBS_NODEFILE -np somenumber ProgramName
qsub job-script-filewill submit your job to the scheduler and assign it a job number. Be careful when you are submitting multiple jobs with the same output file names since they may get overwritten by subsequent or concurrent jobs.
~tyang/mpiex ------------ MPI sample code directory (PI calculation, hello program) ~tyang/mpiex/Makefile ------------ the makefile for compiling and running a job ~tyang/mpiex/run-hello-mpi.job ------------ an example shell script to be used for job submission