Skip to content

Commit

Permalink
Dummy implementation without MPI.
Browse files Browse the repository at this point in the history
  • Loading branch information
jblueh committed Feb 28, 2024
1 parent c255654 commit 123d7e0
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions include/codi/tapes/misc/tapeValues.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<typename Comm>
void combineDataMPI(Comm communicator) {
CODI_UNUSED(communicator);
}
#endif

/// Get the allocated memory in bytes.
Expand Down

0 comments on commit 123d7e0

Please sign in to comment.