Parallization Step-40

56 views
Skip to first unread message

Junxiang Wang

unread,
Oct 10, 2024, 10:47:44 AM10/10/24
to deal.II User Group
Dear  Prof. Timo Heister and  Wolfgang Bangerth

I am trying to solve my multiphysics problem by deal.ii and it's paralization.

I started from STEP-40 and encountered a problem regarding paralization and MPI.

The program didn't proceed after I made a subroutine called 

             laplace_cell(cell,
                                 cell_matrix,
                                 cell_rhs);

within the assemble_system() function.

I am wondering if you can help me to debug or if you may know if there is any wrong with the modification I have made.

I have attached the modified *.cc file. 

Thanks a lot and hope to hear from you soon.

Best regards,

Junxiang. 
step-40.cc

Wolfgang Bangerth

unread,
Oct 10, 2024, 12:03:17 PM10/10/24
to dea...@googlegroups.com

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.

James Shi

unread,
Oct 14, 2024, 8:41:26 AM10/14/24
to dea...@googlegroups.com
Hi,

These lines in laplace_cell()  (especially the reinit function) may cause MPI to stuck,
LA::MPI::Vector evant_solution;

evant_solution.reinit(locally_owned_dofs,
locally_relevant_dofs,
mpi_communicator);
I cannot figure out why you need them. Is this a typo?

Junxiang Wang <wangj...@gmail.com> 于2024年10月10日周四 22:47写道:
--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dealii+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/9b2ea27f-0179-485e-9d8c-5da45096b328n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages