Skip over navigation

Using mpich based on Gnu or Portland Compilers

The mpich compilers compilers include mpicc, mpiCC, mpicxx, mpif77 and mpif90. They have been built against the gnu 4.1.2 compilers on ted, the 7.1-1 Portland Compilers on ted and the 7.0-7 Portland Compilers on micah. I will refer to the Portland Compilers as pgi compilers.

The mpich compilers are located in

on tedbuilt on gnu/opt/openmpi/bin
built on pgi/share/apps/bin
on michbuilt on pgi /share/apps/openmpi.pgi/bin

At the top of your program include the following:

For ted and gnu built mpich
Fortran: include '/opt/openmpi/include/mpif.h'
C: #include </opt/openmpi/include/mpi.h>
For ted and pgi built mpich
Fortran: include '/share/apps/include/mpif.h'
C: #include </share/apps/include/mpi.h>
For micah and pig built mpich
Fortran: include '/share/apps/openmpi.pgi/include/mpif.h'
C: #include </share/apps/openmpi.pgi/include/mpi.h>

Compile using

XX yourcode -o yourprogram

where XX is the compiler, yourcode is your uncompiled code and yourpgrogram is the output.

If I were compiling a c program on ted and wanted to use the mpich compilers based on the Portland compilers and my uncompiled program was mad.c, my line might be

/share/apps/bin/mpicc mad.c -o mad


Margaret Doll 6-5-2007