From 29e97bdea2c22ffd618bbde0394740c81c27faf8 Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Tue, 21 Nov 2023 17:00:55 +0000 Subject: [PATCH] Add detail::MPIEnsemble members for the group rank and size. Plus docstring changes --- .../flamegpu/simulation/detail/MPIEnsemble.h | 19 ++++++++++++++++++- src/flamegpu/simulation/detail/MPIEnsemble.cu | 2 ++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/include/flamegpu/simulation/detail/MPIEnsemble.h b/include/flamegpu/simulation/detail/MPIEnsemble.h index 692f41c05..3c3a46a45 100644 --- a/include/flamegpu/simulation/detail/MPIEnsemble.h +++ b/include/flamegpu/simulation/detail/MPIEnsemble.h @@ -30,8 +30,25 @@ class MPIEnsemble { }; public: + /** + * The rank within the world MPI communicator + */ const int world_rank; + /** + * The size of the world MPI communicator + */ const int world_size; + /** + * The rank within the MPI shared memory communicator (i.e. the within the node) + */ + const int group_rank; + /** + * The size of the MPI shared memory communicator (i.e. the within the node) + */ + const int group_size; + /** + * The total number of runs to be executed (only used for printing error warnings) + */ const unsigned int total_runs; /** * Construct the object for managing MPI comms during an ensemble @@ -94,7 +111,7 @@ class MPIEnsemble { */ static int queryMPISharedGroupRank(); /** - * @return retrieve the number of mpi processes on the current shared memory region + * @return retrieve the number of mpi processes on the current shared memory region */ static int queryMPISharedGroupSize(); /** diff --git a/src/flamegpu/simulation/detail/MPIEnsemble.cu b/src/flamegpu/simulation/detail/MPIEnsemble.cu index 68fe42f4a..6fb26f391 100644 --- a/src/flamegpu/simulation/detail/MPIEnsemble.cu +++ b/src/flamegpu/simulation/detail/MPIEnsemble.cu @@ -10,6 +10,8 @@ MPIEnsemble::MPIEnsemble(const CUDAEnsemble::EnsembleConfig &_config, const unsi : config(_config) , world_rank(queryMPIWorldRank()) , world_size(queryMPIWorldSize()) + , group_rank(queryMPISharedGroupRank()) + , group_size(queryMPISharedGroupSize()) , total_runs(_total_runs) , MPI_ERROR_DETAIL(AbstractSimRunner::createErrorDetailMPIDatatype()) { }