stardis-solver

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

commit 31a84236384ca9172274c734f706a04df967a12c
parent d12a0dbc36544c409242b90c660866ea41e06541
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Mon, 29 Nov 2021 14:24:08 +0100

Fix the MPI implementation of the gather_accumulators function

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

diff --git a/src/sdis.c b/src/sdis.c @@ -292,10 +292,11 @@ gather_accumulators goto exit; } + nprocs = (size_t)dev->mpi_nprocs; per_proc_acc_temp = MEM_CALLOC(dev->allocator, nprocs, sizeof(struct accum)); per_proc_acc_time = MEM_CALLOC(dev->allocator, nprocs, sizeof(struct accum)); - if(per_proc_acc_temp) { res = RES_MEM_ERR; goto error; } - if(per_proc_acc_time) { res = RES_MEM_ERR; goto error; } + if(!per_proc_acc_temp) { res = RES_MEM_ERR; goto error; } + if(!per_proc_acc_time) { res = RES_MEM_ERR; goto error; } /* Gather thread accumulators */ sum_accums(per_thread_acc_temp, dev->nthreads, &per_proc_acc_temp[0]);