MPI link

I use the PGI Fortran accelerator workstation 13.10 (Windows version). I try to use MPI on my multicore machine. The following is the simple MPI code

   Program MPI_test
     use MPI
     implicit none
     integer :: np, myid
     integer :: ierr
     call MPI_init(ierr)
     call MPI_COMM_SIZE( MPI_COMM_WORLD, np   , ierr )
     call MPI_COMM_RANK(MPI_COMM_WORLD, myid, ierr )
     write(*,*) " Processor : " , myid
     call MPI_Finalize(ierr)
   end program

I compile this code using the following command

 pgfortran -Mmpi=msmpi code.f90

However, there are some error messages
PGF90-F-0004-Unable to open MODULE file mpi.mod
PGF90/x86-64 Windows 13.10-0:compilation-aborted

Is it means that the msmpi does not include the mpi.mod file ?
I try to install the MPICH2 library, but I do not know how to
link the MPICH2 library in PGI compile. Does someone have the same problem ?


Hi Neo,

Most likely when you installed the PGI compilers you didn’t install the MS-MPI that we ship with the package. There’s a step in the installation which asks you if you wish to install this package. With ours, we include the mpi.mod module file. Another possibility is that you installed the Microsoft HPC 2012 MS-MPI package separately before the PGI installation so our installer skipped this step.

Can you look in your installed program list to see if you have “Microsoft HPC Pack 2012 MS-MPI”? If so, uninstall it and then re-run the PGI installation. If it’s not there, re-run the PGI installer. In both cases, make sure to assent to the MS-MPI install and license.

Hope this helps,

Hi Mat,
Thank for your kind reply. I will try to resolve this problem. By the way, I try to xecute the multiGPUs calculation via MPI on my single multicore machine. I installed the PGI Acc. Fortran V16.1 (linux) successfully. The linux system is ubuntu. Then, I install the MPICH 3.1 library and test it successfully.

The environment variable is setting as follows

export PATH= /opt/mpich/bin:$PATH

When I compile the f90 code via the command line

pgfortran -Mmpi=mpich test.f90

The system show the error message

PGF90-F-0004-Unable to open MODULE file mpi_base.mod (test.f90: 9)
PGF90/x86-64 Linux 16.1-0: compilation aborted

Do you have any idea about this problem. It looks like the link MPI library problem

The following is my configure file

CC=pgcc CXX=pgcpp FC=pgfortran F77=pgf77 CFLAGS='-fast' FFLAGS='-fast'   CXXFLAGS='-fast' F77FLAGS='-fast' LD=ld CPP=cpp 
./configure --prefix=/opt/mpich


The “-Mmpi” can only be used with the various MPI versions we ship with the compilers. To use your own build, you’ll want to compile using the MPI driver (mpif90) assuming you’ve build and configured your MPICH to use PGI.

When you installed the PGI Linux compilers, did you also install the PGI supplied MPICH? (It’s an option when you run the install script.) Given the error, my assumption is that it wasn’t installed. You can check by seeing if the “$PGI/linux86-64/2016/mpi” directory exists.

  • Mat