McCode icon indicating copy to clipboard operation
McCode copied to clipboard

_particle->_uid is not unique across MPI processes

Open willend opened this issue 11 months ago • 0 comments

Due to a new application of "particle identification" in Union, @mads-bertelsen needs unique particle identification, also across MPI nodes.

For this purpose and still having access to a "simple particle loop identifier" (used e.g. in MCPL_input), I intend to implement two counters in the particle struct:

long long _uid;  /* event ID */
long long _loopid;  /* event ID */

where initialisation should be something like this (ncount is "already" global count / mpi_node_count)

...
  /* CPU-loop */
  unsigned long long loops;
  loops = ceil((double)ncount/gpu_innerloop);
  #pragma acc parallel loop num_gangs(numgangs) vector_length(vecsize)
  for (unsigned long pidx=0 ; pidx < gpu_innerloop ; pidx++) {
       _class_particle particleN = mcgenstate(); // initial particle
       _class_particle* _particle = &particleN;
       particleN._loopid = particleN._uid = pidx;
       #ifdef USE_MPI
       particleN._uid += mpi_node_rank * ncount;
       #endif
....
  • to be implemented both in the FUNNEL and non-FUNNEL versions of the main event loop...

willend avatar Sep 25 '23 09:09 willend