stardis-solver

Solve coupled heat transfers
git clone git://git.meso-star.fr/stardis-solver.git
Log | Files | Refs | README | LICENSE

commit 93094260fe7ae20660360f9b23004c74f2a988fc
parent 59c0f9ae68a619d1f30b53719e6bdd91274413ad
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Wed,  6 Dec 2023 18:43:17 +0100

Fix the way work is distributed across processes

The function for calculating the number of realisations per process has
been rewritten to use the new function used to calculate the scope of
work to be done per process. This last function was buggy and only
returned the expected result for the first master process.

Diffstat:
Msrc/sdis.c | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/sdis.c b/src/sdis.c @@ -472,11 +472,12 @@ compute_process_index_range size_t per_process_indices = 0; size_t remaining_indices = 0; - /* Compute minimum the number of indices on each process */ + /* Compute the minimum number of indices on each process */ per_process_indices = nindices / (size_t)dev->mpi_nprocs; range[0] = per_process_indices * (size_t)dev->mpi_rank; - range[1] = per_process_indices; /* Upper bound is _exclusive */ + range[1] = range[0] + per_process_indices; /* Upper bound is _exclusive */ + ASSERT(range[0] <= range[1]); /* Set the remaining number of indexes that are not managed by 1 process */ remaining_indices =