CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Installation (
-   -   Problems with MPI implementation (

francesco_capuano January 20, 2012 11:49

Problems with MPI implementation
Hi everybody,

I'm having some problems running OpenFOAM v 2.1.0 in parallel mode. In particular, I need to update the PStream library to switch from OpenMPI to Intel MPI, which is actually installed on the cluster I'm using.

I have followed the instructions in

but they refer to old versions of OpenFOAM (v. 1.XXX) and I cannot figure out what's the problem.

Is there anyone who has successfully switched from OpenMPI to other MPI implementations?

wyldckat January 21, 2012 14:57

Greetings Francesco,

The wiki page isn't very out of date, the instructions there still apply to the latest versions of OpenFOAM... with a few minor adjustments...

Basically, there are 3 places that need attention (OpenFOAM version number is just a reference):
  1. "OpenFOAM-2.1.0/etc/bashrc" - check where it says:

    #- MPI implementation:
    #              | GAMMA | MPI | QSMPI

  2. "OpenFOAM-2.1.0/etc/config/" - search for the code that starts with:

    # Communications library
    # ~~~~~~~~~~~~~~~~~~~~~~


    case "$WM_MPLIB" in

    Wait... you will find in 2.1.0 on this file, near the end, the entry for "INTELMPI)". It assumes that "MPI_ROOT" is properly defined before you source "OpenFOAM-2.1.0/etc/bashrc".
  3. "OpenFOAM-2.1.0/wmake/rules/linux64Gcc/mplibINTELMPI" - this is the rules file for the "INTELMPI" option.
And that's pretty much it!

Best regards,

francesco_capuano January 21, 2012 16:57

Thanks Bruno for your quick and clear reply!

As soon as I get back to work I will try and let you know!


francesco_capuano January 24, 2012 05:06

Dear Bruno,

I get the following message:

Warning in /u2/capuanf/OpenFOAM/OpenFOAM-2.0.1/etc/config/settings.csh:
MPI_ROOT not a valid mpt installation directory.
Please set MPI_ROOT to the mpt installation directory.
(usually done by loading the mpt module)
MPI_ROOT currently set to '/dummy'

MPI_ROOT is not properly set! How can I fix this?

Problem solved! I just defined the MPI_ROOT variable properly in my .bashrc file and it worked!

Thanks in advance!

sandy September 19, 2012 05:21

Hi Francesco,

I met the same problem. Could you give a detailed list how to set the MPI_ROOT variable in .bashrc ?? Thanks

francesco_capuano September 19, 2012 11:09


Originally Posted by sandy (Post 382505)
Hi Francesco,

I met the same problem. Could you give a detailed list how to set the MPI_ROOT variable in .bashrc ?? Thanks

Hi Sandy,

you can define the MPI_ROOT variable by adding the line

export MPI_ROOT=mpipath

at the end of the your .bashrc file. mpipath is the mpi installation path of your computer/cluster. You can either try to find it yourself or ask it to your cluster technician. Just to give you a clue, in my case the installation path is


In case you have further questions, please don't hesitate to ask.


hawkeye321 January 15, 2013 21:46

MPI version and OpenFOAM 2.1
I am using OpenFOAM 2.1,and have LAM/MPI already installed (LAM 7.1.4/MPI 2 C++/ROMIO - Indiana University). When I am trying to rum icofoam on 3 processors I get this error

It seems that [at least] one of the processes that was started with
mpirun did not invoke MPI_INIT before quitting (it is possible that
more than one process did not invoke MPI_INIT -- mpirun was only
notified of the first one, which was on node n0).

mpirun can *only* be used with MPI programs (i.e., programs that
invoke MPI_INIT and MPI_FINALIZE). You can use the "lamexec" program
to run non-MPI programs over the lambooted nodes.
Any idea why i get this error?
I have already run some cases on parallel with OpenFOAM 1.7 and mpirun (Open MPI) 1.3.2. Can I used LAM/MPI instead of OpenMPI? If yes, is there a certain version of LAM/MPI which is compatible with OpenFOAM 2.1?

nimasam January 16, 2013 02:53

i dont know what the error is, but there is a suggestion in error line

You can use the "lamexec" program
did you try this program?

All times are GMT -4. The time now is 23:40.