diff --git a/sources/Common/DYNMultiProcessingContext.h b/sources/Common/DYNMultiProcessingContext.h index 190d6fb..f9bf158 100644 --- a/sources/Common/DYNMultiProcessingContext.h +++ b/sources/Common/DYNMultiProcessingContext.h @@ -114,6 +114,7 @@ class Context { } #endif +#ifdef _MPI_ /** * @brief Broadcast data from root rank to all process * @@ -122,10 +123,21 @@ class Context { */ template void broadcast(T& data) const { -#ifdef _MPI_ broadcastImpl(Tag(), data); -#endif } +#else + /** + * @brief No-op broadcast function for builds without MPI + * + * When MPI is not enabled, this function does nothing. It is provided to maintain interface compatibility. + * + * @tparam T the data type to broadcast + */ + template + void broadcast(T&) const { + // do nothing + } +#endif #ifdef _MPI_ /**