CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Installation

[OpenFOAM.org] Installing OpenFoam using MPICH2

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By jherb
  • 1 Post By ettaka

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 16, 2015, 08:00
Default Installing OpenFoam using MPICH2
  #1
New Member
 
Join Date: Jun 2015
Posts: 4
Rep Power: 10
Kolchmob0711 is on a distinguished road
Dear all,

first of all, I'm really proud to have a forum like this one and till now I could solve every of my problems by reading the threads carefully.
But now I reached a point, at which I stuck...
I build a small cluster computer (4 nodes) for my lab and we already run some software like ANSYS and NUMECA on it. Therefor we decided to use the MPICH2 (Version 1.4.1) as mpi-environment and everything works fine. The only problem is with OpenFoam. I know OpenFoam uses as standard the OpenMPI and I also know that it is possible to make OpenFoam with MPICH2 (but how?)
Till now I changed the statement at /etc/bashrc to MPICH and in /etc/config/settings.sh I tried to set the names under mpich for my case. Then I went to main folder and made ./Allwmake...But it doesn't work, when I run a job in parallel I get an error message, that something went wrong with Pstream.
It would be really nice if somebody of you can provide me a simple line-by-line tutorial to fix that problem (and I don't have the possibility to switch to OpenMPI)

Greets
Kolchmob
Kolchmob0711 is offline   Reply With Quote

Old   June 17, 2015, 05:19
Default
  #2
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 21
jherb is on a distinguished road
These are the changes, I did to use MPICH2:

in $WM_PROJECT_DIR/etc/bashrc:
Code:
export WM_MPLIB=MPI-MVAPICH2
in $WM_PROJECT_DIR/etc/config/settings.sh add to
Code:
case "$WM_MPLIB" in
...
Code:
MPI-MVAPICH2)
    export MPI_HOME=/usr/lib64/mpi/gcc/mvapich2/ # you probably have to change this
    export MPI_ARCH_PATH=$MPI_HOME
    _foamAddPath $MPI_ARCH_PATH/bin
    _foamAddLib     $MPI_ARCH_PATH/lib64
    export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/mvapich2
    ;;
in $WM_PROJECT_DIR/wmake/rules/linux64Gcc (if you use 64bit linux and gcc, else you have to chose the correct directory) add the file mplibMPI-MVAPICH2 with the following content:
Code:
PFLAGS     = -DMPICH_SKIP_MPICXX
PLIBS      = -L$(MPI_ARCH_PATH)/lib64 -lmpich -lrt -lopa
PINC       = -I$(MPI_ARCH_PATH)/include
This worked for OpenFOAM 2.3.1. Your paths (and perhaps also the compiler flags) might be different but this should help you for the start.

But I guess you have to recompile OpenFOAM.
wyldckat likes this.
jherb is offline   Reply With Quote

Old   June 17, 2015, 05:52
Default
  #3
New Member
 
Join Date: Jun 2015
Posts: 4
Rep Power: 10
Kolchmob0711 is on a distinguished road
Hi Joachim,

thanks a lot for your help...now it's working. The missing step was to create that mplib file in rules-directory. I recompiled only the Pstream and for me that was fine. I already started the first simulations on the cluster :-)))
Thx
Greets
Kolchmob0711 is offline   Reply With Quote

Old   June 29, 2015, 09:28
Default Could you help me with this problem
  #4
New Member
 
Alan
Join Date: Jun 2015
Posts: 3
Rep Power: 10
yyz987 is on a distinguished road
Hi Kolchmob,

I am a beginner of OpenFoam, but I need to installing OpenFoam using MPICH2 just as you did. It will be very grateful of you if you can share your specific configuration in doing this job on this forum. My English is not well good, I hope you can understand what I mean.

Greets
YYZ
yyz987 is offline   Reply With Quote

Old   July 10, 2015, 01:58
Default
  #5
New Member
 
Join Date: Jun 2015
Posts: 4
Rep Power: 10
Kolchmob0711 is on a distinguished road
Hello yyz987,

sorry for my late response but I was on vacation...
What i did:
1. Change the bashrc: uncomment export WM_MPLIB=SYSTEMOPENMPI and use export WM_MPLIB=mpich instead
2. Adapt the entries in etc/config/settings.sh to your mpich2 installation (Check with echo commnad if all the enviromentals are well defined)
3. Add the file in wmake/rules /linux64Gcc (see the post of Joachim)
4. For me it works to make a ./Allwmake in src/Pstream
5. It should work then...perhaps you have to check with sudo update-alternatives --config mpirun, which mpi flavor (I guess you also have openmpi) should be use

Add also in your ~/.bashrc WM_MPLIB=MPICH if you defined an alias like of240

Greets,
Kolchmob
Kolchmob0711 is offline   Reply With Quote

Old   July 10, 2015, 06:30
Default
  #6
New Member
 
Alan
Join Date: Jun 2015
Posts: 3
Rep Power: 10
yyz987 is on a distinguished road
Hi Kolchmob,

Thanks for your line-by-line tutorial first. I come from China, and I'm not familiar with ubuntu command. I'm trying to configure OpenFoam as you did. My ultimate goal is not to make OpenFoam with MPICH2, but to make CFDEMcoupling software with MPICH2. I'm also very interested in the small cluster computer (4 nodes) of your lab. I want to make a small cluster computer for my lab and run my CFDEMcoupling software on it. I want to know if it is a must to use MPICH2 instead of OpenMPI if I'm going to make a small cluster computer for my lab. And chould you give me some help about what I should learn as a start.

Greets
YYZ
yyz987 is offline   Reply With Quote

Old   July 10, 2015, 09:31
Default
  #7
New Member
 
Join Date: Jun 2015
Posts: 4
Rep Power: 10
Kolchmob0711 is on a distinguished road
Hi yyz987,

The answer is: it depends...some 'commercial' software is compiled with mpich some another with openmpi.
I've never heard about this software (CFDEM), but I read a little bit about it and so I guess it is OpenMpi because of its opensource (you can also recompile it with another mpi-flavor). I think for more detailed informations you should contact the customer.
Regarding to the cluster itself: https://help.ubuntu.com/community/MpichCluster and https://www.digitalocean.com/communi...-vps-instances.
This two tutorials help me (as a normal engineer) to setup the cluster. As job scheduler you can use http://www.openlava.org/

Greets
Kolch
Kolchmob0711 is offline   Reply With Quote

Old   July 10, 2015, 09:53
Default
  #8
New Member
 
Alan
Join Date: Jun 2015
Posts: 3
Rep Power: 10
yyz987 is on a distinguished road
Hi Kolchmob,

CFDEMcoupling is a hybrid software using OpenFoam and LIGGGHTS. LIGGGHTS is
a DEM simulation software. If you want to know more details, you can see the introduction on http://www.cfdem.com. CFDEMcoupling is using the same mpi-flavor as OpenFoam(OpenMPI), but there may be some differences between them. I am a new learner, and I am still working hard to study it...

Greets
YYZ
yyz987 is offline   Reply With Quote

Old   January 14, 2016, 09:31
Default MVAPICH2, conflict due to ptscotchDecomp.C
  #9
New Member
 
Eelis Takala
Join Date: Jan 2016
Posts: 1
Rep Power: 0
ettaka is on a distinguished road
Hello,

I tried compiling OpenFOAM to our cluster. I had a problem:

In file included from /export/modules/apps/mvapich2/2.1/gnu/include/mpi.h:2237:0,
from ptscotchDecomp.C:125:
/export/modules/apps/mvapich2/2.1/gnu/include/mpicxx.h:2737:34: error: conflicting declaration of C function ‘void MPI::Init(int&, char**&)’
extern void Init(int &, char **& );
^
/export/modules/apps/mvapich2/2.1/gnu/include/mpicxx.h:2736:13: note: previous declaration ‘void MPI::Init()’
extern void Init(void);
^
/export/modules/apps/mvapich2/2.1/gnu/include/mpicxx.h:2739:45: error: conflicting declaration of C function ‘int MPI::Init_thread(int&, char**&, int)’
extern int Init_thread(int &, char **&, int );
^
/export/modules/apps/mvapich2/2.1/gnu/include/mpicxx.h:2738:12: note: previous declaration ‘int MPI::Init_thread(int)’
extern int Init_thread(int);
^
This is what I did to make it work:

Code:
diff --git a/src/parallel/decompose/ptscotchDecomp/ptscotchDecomp.C b/src/parallel/decompose/ptscotchDecomp/ptscotchDecomp.C
index 29f1f6b..c8a3acd 100644
--- a/src/parallel/decompose/ptscotchDecomp/ptscotchDecomp.C
+++ b/src/parallel/decompose/ptscotchDecomp/ptscotchDecomp.C
@@ -118,11 +118,11 @@ License
 #include "OFstream.H"
 #include "globalIndex.H"
 #include "SubField.H"
+#include <mpi.h>

 extern "C"
 {
     #include <stdio.h>
-    #include <mpi.h>
     #include "ptscotch.h"
 }
See also:
http://lists.mcs.anl.gov/pipermail/m...ry/006405.html
Behradskn likes this.
ettaka is offline   Reply With Quote

Old   February 14, 2016, 07:36
Default
  #10
New Member
 
Yue Wang
Join Date: Sep 2009
Posts: 14
Rep Power: 16
popstar0426 is on a distinguished road
Hi, Kolchmob:
I installed mpich2 in ubuntu with "sudo apt-get install mpich2"
Do you know where is the MPI_HOME for mpich2?

Best regards!
popstar0426 is offline   Reply With Quote

Old   April 12, 2022, 01:13
Default IPlocations
  #11
New Member
 
Herbert Prater
Join Date: Apr 2022
Posts: 1
Rep Power: 0
HerbertPrater is on a distinguished road
what is my IP address provides free lookup tool to check location of your IP Address Data is gathered through several GEO IP data providers Just enter an IP and check location
HerbertPrater is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[waves2Foam] A few notes about problems and solutions when installing with OpenFOAM v1712 oceanFoam OpenFOAM Community Contributions 0 June 22, 2018 08:52
[OpenFOAM.org] Installing OpenFoam 3.0.1 on cluster hello177 OpenFOAM Installation 1 April 24, 2016 08:35
question about installing Openfoam 1.6-ext Haotian OpenFOAM Installation 2 November 17, 2013 18:47
New OpenFOAM Forum Structure jola OpenFOAM 2 October 19, 2011 06:55
Cross-compiling OpenFOAM 1.7.0 on Linux for Windows 32 and 64bits with Mingw-w64 wyldckat OpenFOAM Announcements from Other Sources 3 September 8, 2010 06:25


All times are GMT -4. The time now is 13:12.