diff --git a/libsrc/core/mpi_wrapper.hpp b/libsrc/core/mpi_wrapper.hpp index 102bc064..f26e66ec 100644 --- a/libsrc/core/mpi_wrapper.hpp +++ b/libsrc/core/mpi_wrapper.hpp @@ -8,6 +8,7 @@ #include "array.hpp" #include "exception.hpp" +#include "profiler.hpp" namespace ngcore { @@ -122,6 +123,7 @@ namespace ngcore int Rank() const { return rank; } int Size() const { return size; } void Barrier() const { + static Timer t("MPI - Barrier"); RegionTimer reg(t); if (size > 1) MPI_Barrier (comm); } @@ -200,6 +202,7 @@ namespace ngcore template ())> T Reduce (T d, const MPI_Op & op, int root = 0) const { + static Timer t("MPI - Reduce"); RegionTimer reg(t); if (size == 1) return d; T global_d; @@ -210,6 +213,7 @@ namespace ngcore template ())> T AllReduce (T d, const MPI_Op & op) const { + static Timer t("MPI - AllReduce"); RegionTimer reg(t); if (size == 1) return d; T global_d; @@ -272,6 +276,7 @@ namespace ngcore NETGEN_INLINE void MyMPI_WaitAll (FlatArray requests) { + static Timer t("MPI - WaitAll"); RegionTimer reg(t); if (!requests.Size()) return; MPI_Waitall (requests.Size(), requests.Data(), MPI_STATUSES_IGNORE); }