# Problem with real functionspace in parallel

**URL:** <https://fenicsproject.discourse.group/t/problem-with-real-functionspace-in-parallel/15236>\
**Category:** Legacy DOLFIN\
**Created:** [July 12, 2024, 7:13am UTC](https://fenicsproject.discourse.group/t/problem-with-real-functionspace-in-parallel/15236 "2024-07-12T07:13:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![plugged](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/plugged/32/5115_2.png) [@plugged](https://fenicsproject.discourse.group/u/plugged)\
**Post date:** [July 12, 2024, 7:13am UTC](https://fenicsproject.discourse.group/t/problem-with-real-functionspace-in-parallel/15236/1 "2024-07-12T07:13:29Z")

</div>

I face a problem using a real function space in parallel. I have the following MWE

```auto
from fenics import *

# parameters["dof_ordering_library"] = "Boost"

mesh = UnitSquareMesh(8, 8)
R = FunctionSpace(mesh, "R", 0)

```

which, when run with `mpirun -n 2 python test.py` fails with the following reason

```auto
*** -------------------------------------------------------------------------
*** DOLFIN encountered an error. If you are not able to resolve this issue
*** using the information listed below, you can ask for help at
***
*** fenics-support@googlegroups.com
***
*** Remember to include the error message listed below and, if possible,
*** include a *minimal* running example to reproduce the error.
***
*** -------------------------------------------------------------------------
*** Error: Unable to re-order graph using SCOTCH.
*** Reason: Error during re-ordering.
*** Where: This error was encountered inside SCOTCH.cpp.
*** Process: 0
*** 
*** DOLFIN version: 2019.1.0
*** Git changeset: ea4ec9db9a0ab5757694c6a6ff308b135231a4dd
*** -------------------------------------------------------------------------

```

So apparently, SCOTCH can not reorder the (single) DoF in parallel. Running the script in serial works fine.  
Also, uncommenting the one commented line to use boost as graph reordering tool also works. Does anyone have any ideas how to fix this or where the issue comes from?

For the scotch version, I am using

```auto
scotch 7.0.4 hd53efc5_2 conda-forge

```

which is installed with PETSc 3.21 from conda forge.  
I have tried downgrading to scotch v6, which worked for me, but then I could not use the newest PETSc version.

Thanks in advance,  
Sebastian

---

<div class="post-metadata">

**Author:** ![plugged](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/plugged/32/5115_2.png) [@plugged](https://fenicsproject.discourse.group/u/plugged)\
**Post date:** [July 12, 2024, 8:45am UTC](https://fenicsproject.discourse.group/t/problem-with-real-functionspace-in-parallel/15236/2 "2024-07-12T08:45:32Z")

</div>

I could change my code so that I don’t require a single real function space is not required anymore. For mixed elements, where one of them is real, there seems to be no issue. I’ll leave this here, in case anyone else has the problem.

---

<div class="post-metadata">

**Author:** ![riccobelli](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/riccobelli/32/3706_2.png) [@riccobelli](https://fenicsproject.discourse.group/u/riccobelli)\
**Post date:** [July 31, 2024, 11:27am UTC](https://fenicsproject.discourse.group/t/problem-with-real-functionspace-in-parallel/15236/3 "2024-07-31T11:27:21Z")

</div>

Even with mixed elements some issues arise. For example this code returns the same error if run in parallel

```auto
from fenics import *

mesh = UnitSquareMesh(8, 8)
P1 = FiniteElement("CG", mesh.ufl_cell(), 1)
R = FiniteElement("R", mesh.ufl_cell(), 0)
ME = MixedElement([P1, R])
V = FunctionSpace(mesh, ME)

up = Function(V)
u, p = up.split(deepcopy=True)

```

Does anyone have suggestion on how to proceed? Thanks!

---

<div class="post-metadata">

**Author:** ![riccobelli](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/riccobelli/32/3706_2.png) [@riccobelli](https://fenicsproject.discourse.group/u/riccobelli)\
**Post date:** [July 31, 2024, 12:32pm UTC](https://fenicsproject.discourse.group/t/problem-with-real-functionspace-in-parallel/15236/4 "2024-07-31T12:32:14Z")

</div>

@plugged, in the meanwhile this issue is solved, could you please explain me how to downgrade SCOTCH while keeping fenics at version 2019.1.0 in conda? Thank you!

---

<div class="post-metadata">

**Author:** ![plugged](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/plugged/32/5115_2.png) [@plugged](https://fenicsproject.discourse.group/u/plugged)\
**Post date:** [July 31, 2024, 1:30pm UTC](https://fenicsproject.discourse.group/t/problem-with-real-functionspace-in-parallel/15236/5 "2024-07-31T13:30:21Z")

</div>

You can do so with the command

```auto
conda create -n <name> -c conda-forge fenics=2019 scotch"<7"

```

when you install a new environment. Be careful, as other specifications could result in you also installing libscotch 7, which is not compatible with scotch 6.
