htrdr

Solving radiative transfer in heterogeneous media
git clone git://git.meso-star.fr/htrdr.git
Log | Files | Refs | README | LICENSE

commit 9fd177178dd6bd718776eaa5cf77365f18c85936
parent b0280908a38980407715287ec5605ab3513a7c7a
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Fri, 14 Feb 2025 15:40:59 +0100

core: fix calculation of the number of chunks to solve

Diffstat:
Msrc/core/htrdr_solve_buffer.c | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/core/htrdr_solve_buffer.c b/src/core/htrdr_solve_buffer.c @@ -522,9 +522,9 @@ htrdr_solve_buffer proc_work_init(htrdr->allocator, &work); nitems = args->buffer_layout.width; - nchunks_proc = nitems / (size_t)htrdr->mpi_nprocs; - nchunks_remain = nitems - nchunks_proc*(size_t)htrdr->mpi_nprocs; - nchunks = nchunks_remain + nchunks_proc*(size_t)htrdr->mpi_nprocs; + nchunks = (nitems + (CHUNK_SIZE-1)/*ceil*/) / CHUNK_SIZE; + nchunks_proc = nchunks / (size_t)htrdr->mpi_nprocs; + nchunks_remain = nchunks - nchunks_proc*(size_t)htrdr->mpi_nprocs; /* Distribute the remaining chunks among the processes. Each process whose * rank is lower than the number of remaining chunks takes an additional