From 123d7e0e30bbdf0a9f55bfa718d07f2ec65e4a7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Bl=C3=BChdorn?= Date: Wed, 28 Feb 2024 18:41:36 +0100 Subject: [PATCH] Dummy implementation without MPI. --- include/codi/tapes/misc/tapeValues.hpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/include/codi/tapes/misc/tapeValues.hpp b/include/codi/tapes/misc/tapeValues.hpp index 42b30e2b..9b6862a4 100644 --- a/include/codi/tapes/misc/tapeValues.hpp +++ b/include/codi/tapes/misc/tapeValues.hpp @@ -248,22 +248,29 @@ namespace codi { } } - /// Perform an MPI_Allreduce with MPI_COMM_WORLD. - /// This method is deprecated and only kept for backwards compatibility. combineDataMPI should be used instead. + /** @brief Perform an MPI_Allreduce with MPI_COMM_WORLD. + * + * This method is deprecated and only kept for backwards compatibility. combineDataMPI should be used instead. + */ void combineData() { #ifdef MPI_VERSION combineDataMPI(MPI_COMM_WORLD); #endif } -#ifdef MPI_VERSION /// Perform an MPI_Allreduce with the given communicator. +#ifdef MPI_VERSION void combineDataMPI(MPI_Comm communicator) { MPI_Allreduce(MPI_IN_PLACE, doubleData.data(), doubleData.size(), MPI_DOUBLE, MPI_SUM, communicator); MPI_Allreduce(MPI_IN_PLACE, longData.data(), longData.size(), MPI_LONG, MPI_SUM, communicator); MPI_Allreduce(MPI_IN_PLACE, unsignedLongData.data(), unsignedLongData.size(), MPI_UNSIGNED_LONG, MPI_SUM, communicator); } +#else + template + void combineDataMPI(Comm communicator) { + CODI_UNUSED(communicator); + } #endif /// Get the allocated memory in bytes.