[mpich-discuss] compile and running MPI using PGI

Gustavo Correa gus at ldeo.columbia.edu
Thu Mar 22 12:34:13 CDT 2012


On Mar 22, 2012, at 9:54 AM, Anthony Chan wrote:

> 
> 
> ----- Original Message -----
> 
>> I installed the PGI and also tested for our openMP code, I used mpi
>> guide
>> from the website it does not work well for MPI:
>> 
>> pgf90 tst_mp.f90 -Mmpi=mpich
> 
> If it is an OpenMP program, I think you should use -mp with pgfortran.
> OpenMP is different from MPI, you should contact your compiler vendor
> for support.
> 
> A.Chan

Hi Esmaeili Amin

I am assuming you want MPI not OpenMP, as pointed out by Anthony Chan, and Dave Goodell.

As far as I know, the -Mmpi flag to PGI tells it to link the program with the MPICH version that comes
with PGI, and if I remember right, that is still the old and no longer supported MPICH-1.

I would suggest that you download the most recent MPICH-2 version:


Then untar the tarball [tar -zxvf ], and do configure, make, make install.
You could use the PGI compilers to compile it, if you like.

configure --prefix=${HOME}/mpich2  CC=pgcc, CXX=pgCC, F77=pgfortran, FC=pgfortran 

[You can change the prefix flag to whatever installation directory you want, but don't use the same directory
 
make
make install

Then setup your PATH to point to the mpich2 executables and compiler wrappers.
If you use bash, in your .profile file append this line:
export PATH=${HOME}/mpich2/bin:${PATH}
If you use tcsh, in your .tcshrc file append this line:
setenv PATH ${HOME}/mpich2/bin:${PATH}

Then compile your code with the mpich2 wrappers, e.g.
mpif90 my_mpi_program.f90
and run it with mpirun.hydra.

I hope this helps,
Gus Correa



> _______________________________________________
> mpich-discuss mailing list     mpich-discuss at mcs.anl.gov
> To manage subscription options or unsubscribe:
> https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss



More information about the mpich-discuss mailing list