# MPICH or OpenMPI

**URL:** <https://precice.discourse.group/t/mpich-or-openmpi/383>\
**Category:** Installing preCICE\
**Tags:** openfoam\
**Created:** [November 5, 2020, 8:55pm UTC](https://precice.discourse.group/t/mpich-or-openmpi/383 "2020-11-05T20:55:05Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jun\_leng](https://avatars.discourse-cdn.com/v4/letter/j/c89c15/32.png) [@jun\_leng](https://precice.discourse.group/u/jun_leng)\
**Post date:** [November 5, 2020, 8:55pm UTC](https://precice.discourse.group/t/mpich-or-openmpi/383/1 "2020-11-05T20:55:05Z")

</div>

Dear all,

I installed preCICE with MPICH since the website said OpenMPI does not currently fully support the MPI ports functionality. In case you link to OpenMPI, you cannot use MPI for the m2n communication of preCICE.

However, OpenFOAM needs OpenMPI for parallel computation. So I installed openFOAM with OpenMPI.

Will these two different ways of compiling affect the coupling of preCICE and OpenFOAM and parallel simulation?

Thanks,

Jun

---

<div class="post-metadata">

**Author:** ![Makis](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/makis/32/25_2.png) [@Makis](https://precice.discourse.group/u/Makis)\
**Post date:** [November 5, 2020, 10:16pm UTC](https://precice.discourse.group/t/mpich-or-openmpi/383/2 "2020-11-05T22:16:25Z")

</div>

Dear @jun_leng,

we currently have different issues with both MPICH and OpenMPI:

- MPICH: [https://github.com/precice/precice/issues/684](https://github.com/precice/precice/issues/684)
- OpenMPI: [https://github.com/precice/precice/issues/746](https://github.com/precice/precice/issues/746)

However, the important part here is that you only need/makes sense to use MPI ports (instead of TCP sockets) for inter-solver communication in very large cases.

Other than that, preCICE also uses MPI for intra-solver communication. In this case, it is important that you have preCICE built with the same MPI version as your solver. So, since OpenFOAM is using OpenMPI, you should also choose OpenMPI.

Until we identify and fix the OpenMPI issue linked above, you can always [configure your cases to use sockets](https://github.com/precice/precice/wiki/Communication-Configuration).

---

<div class="post-metadata">

**Author:** ![jun\_leng](https://avatars.discourse-cdn.com/v4/letter/j/c89c15/32.png) [@jun\_leng](https://precice.discourse.group/u/jun_leng)\
**Post date:** [November 5, 2020, 10:40pm UTC](https://precice.discourse.group/t/mpich-or-openmpi/383/3 "2020-11-05T22:40:59Z")

</div>

Hi @Makis,  
Thank you for your advice. So is it true that the MPI ports are only used to speed up communications between solvers and has no effect on parallel computation in opwnFOAM? And I can still use TCP sockets for communication even if my openFOAM solver uses MPI for parallel computation, right?

---

<div class="post-metadata">

**Author:** ![Makis](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/makis/32/25_2.png) [@Makis](https://precice.discourse.group/u/Makis)\
**Post date:** [November 5, 2020, 11:32pm UTC](https://precice.discourse.group/t/mpich-or-openmpi/383/4 "2020-11-05T23:32:01Z")

</div>

> [@jun\_leng](#):
>
> And I can still use TCP sockets for communication even if my openFOAM solver uses MPI for parallel computation, right?

Yes, this is correct. These are different communications that do not directly affect each other. In fact, all of our tutorials are configured to use sockets, but still you can run them in parallel, without any changes to the solvers.

---

<div class="post-metadata">

**Author:** ![Makis](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/makis/32/25_2.png) [@Makis](https://precice.discourse.group/u/Makis)\
**Post date:** [January 20, 2021, 4:37pm UTC](https://precice.discourse.group/t/mpich-or-openmpi/383/5 "2021-01-20T16:37:39Z")

</div>

With preCICE v2.2.0, we have fixed all known issues with MPICH.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/precice/original/1X/67d2a5fa6f80e597e2267ff17fa8c1673cd11caa.svg) [@system](https://precice.discourse.group/u/system)\
**Post date:** [January 23, 2021, 4:37pm UTC](https://precice.discourse.group/t/mpich-or-openmpi/383/6 "2021-01-23T16:37:39Z")

</div>

Closed on January 23, 2021, 4:37pm UTC

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
