Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

Subject: Re: [OMPI users] Equivalent .h files
From: Gus Correa (gus_at_[hidden])
Date: 2008-10-30 10:55:50

Benjamin Lamptey wrote:

> Hello,
> I am new at using open-mpi and will like to know something basic.
> What is the equivalent of the "mpif.h" in open-mpi which is normally
> "included" at
> the beginning of mpi codes (fortran in this case).

Hello Benjamin and List

As far as I know, it is just the same old "mpif.h". :)

Make sure you point to the right (OpenMPI) mpif77 or mpif90 wrapper when
you compile
your code, so as to get the correct mpif.h.
Use a full path name, if needed.
A common mistake is to inadvertently use another wrapper (say from
since some Linux distributions come with tons of MPI versions, compiler
wrappers, and include files.

For most cases mpif77/mpif90 will do the pre-compiler phase too,
if your source file names have the correct suffix (.F or .F90, instead
of .f or .f90).
Using the mpif77/mpif90 compiler wrappers is probably your best choice.
However, if your Makefile has a separate pre-compiler phase with cpp,
you need to add the corresponding "-I/my/path/to/openmpi/include" clause
to it,
otherwise it may not find the correct mpif.h file and use a wrong one.

Works for me.
I hope it helps you.

Gus Correa

Gustavo J. Ponce Correa, PhD - Email: gus_at_[hidden]
Lamont-Doherty Earth Observatory - Columbia University
P.O. Box 1000 [61 Route 9W] - Palisades, NY, 10964-8000 - USA
> I shall appreciate that for cpp as well.
> Thanks
> Ben
>users mailing list