$ cp -r /share/apps/samples/openmpi-f90 ./
! Filename: mpi_hello.f90
! Description: A parallel hello world program
PROGRAM HelloWorld
include 'mpif.h'
call mpi_init(ierr)
call mpi_comm_size(MPI_COMM_WORLD,npes, ierr)
call mpi_comm_rank(MPI_COMM_WORLD,irank,ierr)
print*,'Hello World! I am ',irank,' of ',npes
call mpi_finalize(ierr)
END PROGRAM
$ module load openmpi-intel
(Loads the openmpi/intel-12 module)
$ module load openmpi/intel-11
$ module load openmpi/intel-12
$ module load openmpi-gnu
$ module load openmpi/gcc45
$ module load openmpi/gcc46
$ module load openmpi/gcc47
$ mpif90 -o openmpi-hello mpi_hello.cpp
#PBS -N openmpi-hello
#PBS -q @nic-cluster.mst.edu
#PBS -l nodes=2
#PBS -l walltime=01:00:00
#PBS -m abe
#PBS -M joeminer@mst.edu
#PBS -V
cd $PBS_O_WORKDIR
mpirun -np 2 ./openmpi-hello
$ qsub jobfile.job
Hello World! I am 0 of 2
Hello World! I am 1 of 2
If the output is not what you expected check the openmpi-hello.e#### file.