On 10/10/24 08:47, Junxiang Wang wrote:
>
> The program didn't proceed after I made a subroutine called
>
> laplace_cell(cell,
> cell_matrix,
> cell_rhs);
>
> within the assemble_system() function.
On a given MPI process, you call this function on every cell the process
owns. But not every process owns the same number of cells, and so every
process calls the function a different number of times.
But *inside* the function you call
evant_solution.reinit(locally_owned_dofs,
locally_relevant_dofs,
mpi_communicator);
which is a "collective" call in which all processes have to participate.
It cannot work if you call the function different numbers of times
because then there will be processes that get to that point and other
processes that are already done assembling on their cells. You end up
with a deadlock in these situations, and that's what you observe.
There is a little bit more information about "Collective operations" in
the glossary:
https://dealii.org/developer/doxygen/deal.II/DEALGlossary.html
Best
W.