M471 HAMMER USAGE NOTES (1) Compiling C code: Use the wrapper script "mpicc". This command runs the cc compiler with the correct include and library paths for MPI and related libraries. % mpicc -o hello hello.c (2) Compiling Fortran code: Use the wrapper script "mpif90". This command runs the IBM xlf compiler with the correct include and library paths for MPI and related libraries. % mpif90 -o hello hello.f90 (3) Running MPI code: To run on the frontend on 4 processors: % mpirun -np 4 ./hello Note: dont make long running jobs on the frontend, since this is the machine we all use for editing, compiling and debugging when logged in to hammer. This command will run 4 processes, but since the frontend only has 2 physical processors, this will not be very efficient for programs that do significant computation. It is mostly useful for debugging. You can see how busy the frontend "hammer.hpc.uhnm.edu" machine is by running % top -o cpu (4) Running MPI code on the Hammer backend interactively: Request 2 nodes, 2 cpus per node, interactive, for 900 seconds. (These nodes will be assigned exclusively to you) % qsub -I -l nodes=2:ppn=2,walltime=900 [cd into directory with "hello" command] % mpirun -machinefile $PBS_NODEFILE -np 4 ./hello Note: without the "-machinefile $PBS_NODEFILE" option, mpirun will run all 4 of the "hello" processes on a single node (which only has 2 processors). To exit an interactive login and return to the Hammer frontend machine (freeing up the requested nodes for other users), type "exit" (5) To run an MPI code as a batch job, issue the command: % qsub < batch.job where batch.job is a script that could look like this: #!/bin/tcsh -f #PBS -N yourjobname #PBS -l nodes=3:ppn=2 #PBS -l walltime=900 cd simple mpirun -np 6 -machinefile $PBS_NODEFILE simple The "yourjobname" is the name you want to assign to your job. That is the job name that will show up with anyone runs "qstat" and the output (what you would see on the screen when running interactively) will be in two files: yourjobname.o#### yourjobname.e#### The output is in the ".o" file, and error messages, if any, are in the ".e" file. (6) Monitoring the status of jobs. To see information about running jobs and queues, try: % qstat For detailed information about a job in the queing system, type: % qstat -f #### where #### is the job number shown by "qstat" For detailed information about the Math 471 que itself: % qstat -Q -f ma471 To remove a job from the que: % qdel #### where #### is the job number shown by the qstat command.