# Parallelization without domain decomposition

**URL:** <https://fenicsproject.discourse.group/t/parallelization-without-domain-decomposition/3868>\
**Category:** Uncategorized\
**Created:** [July 31, 2020, 2:35pm UTC](https://fenicsproject.discourse.group/t/parallelization-without-domain-decomposition/3868 "2020-07-31T14:35:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mebeling](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/mebeling/32/1543_2.png) [@mebeling](https://fenicsproject.discourse.group/u/mebeling)\
**Post date:** [July 31, 2020, 2:35pm UTC](https://fenicsproject.discourse.group/t/parallelization-without-domain-decomposition/3868/1 "2020-07-31T14:35:31Z")

</div>

Let us assume we have a vector of length 10\*N.  
Each vector entry is calculated by computing an integral over the whole domain.

To speed things up, the program is supposed to run on 10 cores leading to N integrations on each core. How would one go about doing this?

The issue with regular mpirun is that it employs domain decomposition. However, each core needs access to the whole domain in order to calculate the integral.

---

<div class="post-metadata">

**Author:** ![nate](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/nate/32/17_2.png) [@nate](https://fenicsproject.discourse.group/u/nate)\
**Post date:** [July 31, 2020, 2:37pm UTC](https://fenicsproject.discourse.group/t/parallelization-without-domain-decomposition/3868/2 "2020-07-31T14:37:36Z")

</div>

Choose your MPI communicators appropriately. I.e. don’t use `COMM_WORLD` when you should perhaps use `COMM_SELF` or a split.

---

<div class="post-metadata">

**Author:** ![volkerk](https://avatars.discourse-cdn.com/v4/letter/v/9d8465/32.png) [@volkerk](https://fenicsproject.discourse.group/u/volkerk)\
**Post date:** [July 31, 2020, 2:38pm UTC](https://fenicsproject.discourse.group/t/parallelization-without-domain-decomposition/3868/3 "2020-07-31T14:38:53Z")

</div>

Do what @nate says, or try with the multiprocessing module from python.

[https://docs.python.org/3/library/multiprocessing.html](https://docs.python.org/3/library/multiprocessing.html)
