-
To compile a FORTRAN90 MPI code use the 'compiler' called mpif90 (it is
just a wrapper for the pgf90 compiler).
It is located in /opt/openmpi/pgi/bin/ , which should be in your path.
You can send it the same
flags as pgf90.
Try it out with this simple test program:
-------------------------------------------
program Hello
!
implicit none
include "mpif.h"
integer::ierr,ipid
!
call MPI_INIT(ierr)
!
call MPI_COMM_RANK(MPI_COMM_WORLD,ipid,ierr)
!
write(*,*)"Hello, I'm: ",ipid
!
call MPI_FINALIZE(ierr)
!
stop
end program Hello
--------------------------------------------
Compile with
mpif90 -o Hello.exe Hello.f90
To submit a job through SGE you can write a batch file such as:
--------------------------------------------
#!/bin/bash
#$ -V
#$ -pe openmpi 8
#$ -cwd
mpirun -np $NSLOTS Hello.exe
--------------------------------------------
The line "#$ -pe
openmpi 8" specifies the SGE Parallel Environment 'openmpi' (which is the proper
one to use for MPI jobs) with 8 slots i.e. $NSLOTS=8.
The maximum number of slots is limited to 64.
Submit this batch file, called "batch.sh", to the queue using "qmon" and clicking on
"Job
Submit", or launch qsub match.sh on the command line.
You can monitor the status of your job using "qstat -f".
Back to Aster Q/A