From d0f0cfed6abef88b98a0dca11ba679247c1a7e19 Mon Sep 17 00:00:00 2001 From: Fernando Pereira Date: Tue, 29 Oct 2024 13:06:10 +0100 Subject: [PATCH] Intoduce a sentinel value to allow loading rebalanced files --- src/coreneuron/io/nrn_setup.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/coreneuron/io/nrn_setup.cpp b/src/coreneuron/io/nrn_setup.cpp index 285c19034a..f198662615 100644 --- a/src/coreneuron/io/nrn_setup.cpp +++ b/src/coreneuron/io/nrn_setup.cpp @@ -216,6 +216,10 @@ 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) { + if (iFile == -1) { + // Sentinel value, we are done for this rank + break; + } grp[ngrp] = iFile; ngrp++; }