From 0f72436247d97c3780700e0bb38c85ebec5659aa Mon Sep 17 00:00:00 2001 From: Robert Chisholm Date: Fri, 21 Jul 2023 17:08:41 +0100 Subject: [PATCH] fixup --- include/flamegpu/simulation/detail/AbstractSimRunner.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/include/flamegpu/simulation/detail/AbstractSimRunner.h b/include/flamegpu/simulation/detail/AbstractSimRunner.h index 60c4dbc5e..2ae9d4bda 100644 --- a/include/flamegpu/simulation/detail/AbstractSimRunner.h +++ b/include/flamegpu/simulation/detail/AbstractSimRunner.h @@ -47,10 +47,11 @@ class AbstractSimRunner { ErrorDetail t; constexpr int count = 4; constexpr int array_of_blocklengths[count] = {1, 1, 1, sizeof(ErrorDetail::exception_string)}; - constexpr MPI_Aint array_of_displacements[count] = { reinterpret_cast(&t.run_id - &t), - reinterpret_cast(&t.device_id - &t), - reinterpret_cast(&t.runner_id - &t), - reinterpret_cast(&t.exception_string - &t) }; + constexpr void* t_ptr = reinterpret_cast(&t); + constexpr MPI_Aint array_of_displacements[count] = { reinterpret_cast(&t.run_id) - t_ptr), + reinterpret_cast(&t.device_id) - t_ptr), + reinterpret_cast(&t.runner_id) - t_ptr), + reinterpret_cast(&t.exception_string) - t_ptr }; constexpr MPI_Datatype array_of_types[count] = {MPI_UNSIGNED, MPI_UNSIGNED, MPI_UNSIGNED, MPI_CHAR}; MPI_Type_create_struct(count, array_of_blocklengths, array_of_displacements, array_of_types, &rtn); }