Consideration about the number of parallel processors

33 views
Skip to first unread message

Toddy Liu

unread,
Dec 15, 2021, 4:31:41 AM12/15/21
to deal.II User Group
Dear Deal.II community,

I 'm going to solve a 3D problem using MPI and I want to determine the number of processors before running my code. In deal.II document(specifically the glossary part about parallel scaling),  I know it's better to make the number of dofs each process handles remain at more than 40000. 

So my problem is how to consider the number of dofs to determine the number of processors when the program is running step by step. 

For example, I create two dof_handlers(dof_handler_1 and dof_handler_2). My solution consists of solution_1, solution_2 and solution_3, these solution components are initialized by solution_1.reinit(dof_handler_1), solution_2.reinit(dof_handler_1) and solution_3.reinit(dof_handler_2), respectively. 

If these three solutions are solved in one step, it's clear that the number of dofs should be just 2*dof_handler_1.n_dofs() plus dof_handler_2.n_dofs(). But what if solution_1 is solved in step one then solution_2 and solution_3 are solved in step two. In this case, how to determine the number of dofs and then determine the number of processors?

Any advice or suggestions will be appreciated!
Thank you.

Best,
Toddy

Bruno Turcksin

unread,
Dec 15, 2021, 8:58:39 AM12/15/21
to deal.II User Group
Toddy,

This is just a rule of thumb, there is no formula to choose the number of processors. The documentation says that you need at least 40000 dofs per process so people don't run a problem with 1000 dofs on 100 processors and expect their code to be fast. The "best" number of processors to choose is different for each code and what metric you care for (time-to-solution, best use of a given allocation, memory per node usage, ...).

Best,

Bruno

Toddy Liu

unread,
Dec 15, 2021, 8:38:04 PM12/15/21
to deal.II User Group
Bruno,

Thanks for your reply, I think I've got the point.

Best,
Toddy

Reply all
Reply to author
Forward
0 new messages