This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Solve() function in parallel processing

+1 vote

Hello,

I am trying to solve a highly nonlinear PDE in parallel, however I am running into issues due to the mesh being partitioned. The algorithm is written in Python and implements Picard iterations very similar to this scheme in the FEniCS documentation. The issues I am experiencing are specifically:

  1. During each Picard iteration, the system is solved using: solve(a == L, u, bcs). However, the solution u always returns as a zero vector when I run the simulation in parallel (if I run on one processor, the solution turns out fine).

  2. The PDE also has a scalar field coefficient that is "nonlocal" - the value at one point is computed using information from other points around the domain. In parallel, the function which computes this coefficient searches for information between separate mesh partitions, which inevitably results in errors.

Most of the computational expense in my simulation rises from the solve() step. It would be ideal if I could run the majority of the simulation in serial, and then switch to parallel to assemble the stiffness matrix and solve it. Is this possible to do?

asked Jan 22, 2016 by jimmy FEniCS Novice (730 points)

Jimmy,
How are you initiating the parallelization? Are you doing something like: mpiexec -n 2 python script.py?

Tim,

Yes, I am initiating the parallelization using the mpiexec -n 2 python script.py command.

...