# Solving independent problems in parallel

**URL:** <https://fenicsproject.discourse.group/t/solving-independent-problems-in-parallel/13298>\
**Category:** General\
**Created:** [January 12, 2024, 7:53am UTC](https://fenicsproject.discourse.group/t/solving-independent-problems-in-parallel/13298 "2024-01-12T07:53:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![federicobetti](https://avatars.discourse-cdn.com/v4/letter/f/50afbb/32.png) [@federicobetti](https://fenicsproject.discourse.group/u/federicobetti)\
**Post date:** [January 12, 2024, 7:53am UTC](https://fenicsproject.discourse.group/t/solving-independent-problems-in-parallel/13298/1 "2024-01-12T07:53:47Z")

</div>

Hello,

I am trying to solve independent problems in parallel. Up to 16 procs the speedup is good with respect to solving only 1 problem in serial, but then suddenly this drops dramatically. Inspecting the times, this slowdown is due to a slower assemble of the stiffness matrix. The solve time is constant on the other hand. Is there any reason/fix for this behaviour?

Thanks,  
Federico

---

<div class="post-metadata">

**Author:** ![federicobetti](https://avatars.discourse-cdn.com/v4/letter/f/50afbb/32.png) [@federicobetti](https://fenicsproject.discourse.group/u/federicobetti)\
**Post date:** [January 12, 2024, 7:59am UTC](https://fenicsproject.discourse.group/t/solving-independent-problems-in-parallel/13298/2 "2024-01-12T07:59:02Z")

</div>

Let me maybe ask a more specific question: the communicator of a matrix assembled with

`dolfinx.fem.petsc.assemble_matrix(form, bcs)`

is derived from the mesh one (which is MPI.COMM\_SELF) or not? If not, how can one achieve this?

---

<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:** [January 12, 2024, 9:35am UTC](https://fenicsproject.discourse.group/t/solving-independent-problems-in-parallel/13298/3 "2024-01-12T09:35:17Z")

</div>

The matrix assembler is derived from the one in the mesh.  
Without an example at hand, it is hard to pinpoint why your problem doesn’t scale after 16 processors.
