Re: How is global data "All" synchronized across all processes?

From: Volker Springel <volker_at_MPA-Garching.MPG.DE>
Date: Sat, 2 Apr 2011 11:09:38 +0200

On Apr 1, 2011, at 11:33 PM, Mark Baumann wrote:

>
> Dear GADGET users,
>
> I have implemented sink particles across multiple processes in GADGET-2. In doing so, I am decrementing the variable All.TotNumPart as particles are deleted from the simulation.
>
> I am experiencing a problem in that different processes end up with different values of All.TotNumPart. Initial debugging seems to show that each process only registers the decrements that the process itself has made. This leads to my question: how is the struct "All" synchronized, if at all?
>
> By looking through the code I've found a few other places where All is modified, for instance All.Time is modified within run.c. However I do not see any blocking or communication code around these lines, leading me to wonder if changes to All.Time are registered on the other processes or not. Is there any place in the code that synchronizes the struct across all processes?
>

Hi Mark,

No, there isn't. Changes that are made (like All.Time) occur on all processes in exactly the same way, that's why no explicit synchronization is needed there. If a single processor (like in your case) wants to modify one of the variables, and this changes should be global, it somehow needs to tell the other processors as well about this change.

Volker



> If not, then I am guessing I will need to broadcast new values of All.TotNumPart whenever it is decremented by any process. Or, perhaps better, to do an Allreduce on particle number everytime a particle is deleted so that all processes will have an up-to-date value for All.TotNumPart. Before I do that, I wanted to ask you in case I am overlooking some synchronization code that already exists somewhere.
>
> Thank you for any insights,
>
> Mark
>
>
>
>
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> minimalist_at_MPA-Garching.MPG.de with a subject of: unsubscribe gadget-list
> A web-archive of this mailing list is available here:
> http://www.mpa-garching.mpg.de/gadget/gadget-list
Received on 2011-04-02 11:09:38

This archive was generated by hypermail 2.3.0 : 2023-01-10 10:01:31 CET