Skip to content

Commit

Permalink
CoreNrn: support for rebalanced files.dat (#3147)
Browse files Browse the repository at this point in the history
Context: For MMB (BBPP134-917) we need to be able to load a set
of .dat files distributed in given way. However for the moment
CoreNeuron only reads it in plain RoundRobin, which is not suitable
to load ranks a different number of files.

Changes: We introduce a mark value (-1 in this case) indicating no-data
so that, even with round-robin, we can define precisely which rank will
load a given data file. All ranks will be able to jump strides of size
`N_RANKS` (at their respective offset) and find entries targeted at them.
Upon seeing a `-1` the rank knows it is done and can stop reading.

This is a minor addition which enabled us to load balance and run the
MMB simulation.
  • Loading branch information
ferdonline authored Dec 5, 2024
1 parent 9e5dd3d commit 942d5ef
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/coreneuron/io/nrn_setup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,12 @@ void nrn_read_filesdat(int& ngrp, int*& grp, const char* filesdat) {

nrn_assert(fscanf(fp, "%d\n", &iFile) == 1);
if ((iNum % nrnmpi_numprocs) == nrnmpi_myid) {
// A "-1" entry means that this rank should not be assigned further gid groups.
// It is a way to create files.dat files which deterministically assign gid groups to
// ranks, particularly useful for very large simulations which required load balancing.
if (iFile == -1) {
break;
}
grp[ngrp] = iFile;
ngrp++;
}
Expand Down

0 comments on commit 942d5ef

Please sign in to comment.