# Data mapping not allowed for parallel computation

**URL:** <https://precice.discourse.group/t/data-mapping-not-allowed-for-parallel-computation/374>\
**Category:** Using preCICE\
**Tags:** data-mapping, parallel\
**Created:** [October 29, 2020, 9:04am UTC](https://precice.discourse.group/t/data-mapping-not-allowed-for-parallel-computation/374 "2020-10-29T09:04:07Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![CarsvO](https://avatars.discourse-cdn.com/v4/letter/c/f08c70/32.png) [@CarsvO](https://precice.discourse.group/u/CarsvO)\
**Post date:** [October 29, 2020, 9:04am UTC](https://precice.discourse.group/t/data-mapping-not-allowed-for-parallel-computation/374/1 "2020-10-29T09:04:07Z")

</div>

Hello,

I am trying to run OpenFOAM on multiple CPU’s by splitting up the mesh, while coupled to Nutils. Also in the CHT tutorial a decomposepar is available, which I am using to figure out how it works. However I am still getting an error I cannot solve.

[precice] ERROR: For a parallel participant, only the mapping combinations read-consistent and write-conservative are allowed

I am not sure what is meant by this and how to fix this. Would any of you know, what to do?

Thank you in advance.

Kind regards,

Cars

---

<div class="post-metadata">

**Author:** ![uekerman](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/uekerman/32/2199_2.png) [@uekerman](https://precice.discourse.group/u/uekerman)\
**Post date:** [October 29, 2020, 2:15pm UTC](https://precice.discourse.group/t/data-mapping-not-allowed-for-parallel-computation/374/2 "2020-10-29T14:15:58Z")

</div>

Hi Cars,

There is some information on this here: [https://github.com/precice/precice/wiki/Mapping-Configuration#restrictions-for-parallel-participants](https://github.com/precice/precice/wiki/Mapping-Configuration#restrictions-for-parallel-participants)

Let us know if that is not enough.

Benjamin

---

<div class="post-metadata">

**Author:** ![CarsvO](https://avatars.discourse-cdn.com/v4/letter/c/f08c70/32.png) [@CarsvO](https://precice.discourse.group/u/CarsvO)\
**Post date:** [November 3, 2020, 9:11am UTC](https://precice.discourse.group/t/data-mapping-not-allowed-for-parallel-computation/374/3 "2020-11-03T09:11:27Z")

</div>

Hey Benjamin,

Thank you for the answer! I still do not understand it fully I think. It states that I have to adjust the mapping from write to read and that I have to make sure it uses both meshes. If i make a visualization of the original XML file, I can see that the mapping is already read by the Nutils file, so it cannot also be done by the OpenFOAM file right? Also there are already 2 different meshes used by nutils and in OpenFOAM it splits up the mesh, however i think it eventually uses one mesh name stated in the precicedict file, since the boundary interface is coupled to this file, which is present in both the processor folders after using the decomposepar dict.

Do you maybe know, where I am going wrong here?

 ![image](https://global.discourse-cdn.com/free1/uploads/precice/original/1X/a56ee54840503cc5160b1348a3d3dc736419c3a8.png)

Kind regards,

Cars

---

<div class="post-metadata">

**Author:** ![uekerman](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/uekerman/32/2199_2.png) [@uekerman](https://precice.discourse.group/u/uekerman)\
**Post date:** [November 3, 2020, 5:29pm UTC](https://precice.discourse.group/t/data-mapping-not-allowed-for-parallel-computation/374/4 "2020-11-03T17:29:04Z")

</div>

Could you post your current preCICE config file?  
The image looks good for serial computation, but not for parallel (assuming that you want two consistent mappings).

---

<div class="post-metadata">

**Author:** ![CarsvO](https://avatars.discourse-cdn.com/v4/letter/c/f08c70/32.png) [@CarsvO](https://precice.discourse.group/u/CarsvO)\
**Post date:** [November 4, 2020, 2:56pm UTC](https://precice.discourse.group/t/data-mapping-not-allowed-for-parallel-computation/374/5 "2020-11-04T14:56:38Z")

</div>

Hey,

In this case it is the same as in the CHT tutorial. I want to test it out in that case, before i continue with it.

I want to run the openfoam part on 2 or more cpu’s, so the decomposepar splits it up on 2 processors. It is still the same mesh however. The openfoam and nutils part can still run in serial.

[precice-config.xml](https://precice.discourse.group/uploads/short-url/hGWPgjKJvue3lWzYs3EUywdsQDp.xml) (1.8 KB)

---

<div class="post-metadata">

**Author:** ![uekerman](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/uekerman/32/2199_2.png) [@uekerman](https://precice.discourse.group/u/uekerman)\
**Post date:** [November 5, 2020, 12:56pm UTC](https://precice.discourse.group/t/data-mapping-not-allowed-for-parallel-computation/374/6 "2020-11-05T12:56:12Z")

</div>

Runs only in serial because you use a `write-consistent` mapping:

```xml
  <participant name="OpenFOAM">
    <use-mesh name="OpenFOAM-Mesh" provide="yes"/>
    <read-data name="Heat-Flux" mesh="OpenFOAM-Mesh"/>
    <write-data name="Temperature" mesh="OpenFOAM-Mesh"/>
  </participant>

  <participant name="Nutils">
    <use-mesh name="OpenFOAM-Mesh" from="OpenFOAM"/>
    <use-mesh name="Nutils-Mesh-GP" provide="yes"/>
    <use-mesh name="Nutils-Mesh-CC" provide="yes"/>
    <mapping:nearest-neighbor direction="write" from="Nutils-Mesh-CC" to="OpenFOAM-Mesh" constraint="consistent"/>
    <mapping:nearest-neighbor direction="read" from="OpenFOAM-Mesh" to="Nutils-Mesh-GP" constraint="consistent"/>
    <read-data name="Temperature" mesh="Nutils-Mesh-GP" />
    <write-data name="Heat-Flux" mesh="Nutils-Mesh-CC" />
  </participant>    

  <coupling-scheme:serial-explicit>
    ...
    <exchange data="Temperature" mesh="OpenFOAM-Mesh" from="OpenFOAM" to="Nutils"/>
    <exchange data="Heat-Flux" mesh="OpenFOAM-Mesh" from="Nutils" to="OpenFOAM"/>
  </coupling-scheme:serial-explicit>

```

Works in serial and parallel:

```xml
  <participant name="OpenFOAM">
    <use-mesh name="OpenFOAM-Mesh" provide="yes"/>
    <use-mesh name="Nutils-Mesh-CC" from="Nutils"/>
    <read-data name="Heat-Flux" mesh="OpenFOAM-Mesh"/>
    <write-data name="Temperature" mesh="OpenFOAM-Mesh"/>
    <mapping:nearest-neighbor direction="read" from="Nutils-Mesh-CC" to="OpenFOAM-Mesh" constraint="consistent"/>
  </participant>

  <participant name="Nutils">
    <use-mesh name="OpenFOAM-Mesh" from="OpenFOAM"/>
    <use-mesh name="Nutils-Mesh-GP" provide="yes"/>
    <use-mesh name="Nutils-Mesh-CC" provide="yes"/>
    <mapping:nearest-neighbor direction="read" from="OpenFOAM-Mesh" to="Nutils-Mesh-GP" constraint="consistent"/>
    <read-data name="Temperature" mesh="Nutils-Mesh-GP" />
    <write-data name="Heat-Flux" mesh="Nutils-Mesh-CC" />
  </participant>    

  <coupling-scheme:serial-explicit>
    ...
    <exchange data="Temperature" mesh="OpenFOAM-Mesh" from="OpenFOAM" to="Nutils"/>
    <exchange data="Heat-Flux" mesh="Nutils-Mesh-CC" from="Nutils" to="OpenFOAM"/>
  </coupling-scheme:serial-explicit>

```

---

<div class="post-metadata">

**Author:** ![CarsvO](https://avatars.discourse-cdn.com/v4/letter/c/f08c70/32.png) [@CarsvO](https://precice.discourse.group/u/CarsvO)\
**Post date:** [November 5, 2020, 1:51pm UTC](https://precice.discourse.group/t/data-mapping-not-allowed-for-parallel-computation/374/7 "2020-11-05T13:51:41Z")

</div>

Hey,

I can see now how I understood it wrong. I misunderstood the concept of direction = ‘write’. However it is very clear now. Thank you for your time and answers!

Kind regards,

Cars

---

<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:** [November 8, 2020, 1:51pm UTC](https://precice.discourse.group/t/data-mapping-not-allowed-for-parallel-computation/374/8 "2020-11-08T13:51:43Z")

</div>

Closed on November 8, 2020, 1:51pm UTC

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