Harvard |  FAS |  GSAS |  Division of Science |  HUIT 

Compiling and Running MPI/Fortran Code on Odyssey

 

You can use the compiler wrapper mpif90:

% module load hpc/openmpi-1.4.1_intel-11.1.046

Java Runtime Environment 1.6 module
****************************************************

This module sets up the following environment
variables for Java Runtime Environment 1.6:
PATH /n/sw/jdk1.6.0_12/bin

****************************************************

Loading module devel/intel-11.1.046.
Loading module hpc/openmpi-1.4.1_intel-11.1.046.
% cat hello.f90
program test_mpi

use mpi

implicit none
integer :: rank, ierr

call mpi_init( ierr )
call mpi_comm_rank(MPI_COMM_WORLD, rank, ierr)
print *,”Hello from rank”, rank
call mpi_finalize(ierr)

end program test_mpi

% mpif90 hello.f90
/n/sw/intel/ifort/11.0/083//lib/intel64/libimf.so: warning: warning: feupdateenv is not implemented and will always fail
% bsub -I -q short_parallel -n 2 -a openmpi mpirun.lsf ./a.out
Job <933022> is submitted to queue .
<<Waiting for dispatch ...>> <<Starting on hero1107>> Hello from rank 1
Hello from rank 0
Job /lsf/7.0/linux2.6-glibc2.3-x86_64/bin/openmpi_wrapper ./a.out

TID HOST_NAME COMMAND_LINE STATUS TERMINATION_TIME
===== ========== ================ ======================= ===================
00000 hero1107 ./a.out Done 01/31/2010 07:02:26
00001 hero1107 ./a.out Done 01/31/2010 07:02:26

Site last updated May 23, 2013