# Parallel execution on MacOS

**URL:** <https://fenicsproject.discourse.group/t/parallel-execution-on-macos/2742>\
**Category:** installation\
**Created:** [March 28, 2020, 7:47pm UTC](https://fenicsproject.discourse.group/t/parallel-execution-on-macos/2742 "2020-03-28T19:47:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lhcgeneva](https://avatars.discourse-cdn.com/v4/letter/l/e56c9b/32.png) [@lhcgeneva](https://fenicsproject.discourse.group/u/lhcgeneva)\
**Post date:** [March 28, 2020, 7:47pm UTC](https://fenicsproject.discourse.group/t/parallel-execution-on-macos/2742/1 "2020-03-28T19:47:47Z")

</div>

I’d like to make use of fenics’ built-in parallel functionality. I’m using a MacBook Pro with anaconda, but other machines are available if needed. If I run the [Cahn-Hilliard example](https://bitbucket.org/fenics-project/dolfin/src/master/python/demo/documented/cahn-hilliard/demo_cahn-hilliard.py.rst#rst-header-id1) it seems to use all cores with the standard **solver lu**. This takes around **35 s** on my machine.

If I change to **gmres** it takes **10 s** and doesn’t seem to use more than one core. How do I make it use all cores with gmres?

The mesh in my real code is substantially larger and cannot practically use lu, hence my question how to paralllelize other solvers.

---

<div class="post-metadata">

**Author:** ![dokken](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/dokken/32/1560_2.png) [@dokken](https://fenicsproject.discourse.group/u/dokken)\
**Post date:** [March 28, 2020, 8:03pm UTC](https://fenicsproject.discourse.group/t/parallel-execution-on-macos/2742/2 "2020-03-28T20:03:44Z")

</div>

All basic demos in FEniCS can be excecuted in Python by calling: `mpirun -n 2 python3 demo.py`
