diff --git a/dccrg_mpi_support.hpp b/dccrg_mpi_support.hpp index fe7a5d2..96f2af7 100644 --- a/dccrg_mpi_support.hpp +++ b/dccrg_mpi_support.hpp @@ -185,6 +185,10 @@ class All_Gather total_send_count += (uint64_t) send_count; } + if(total_send_count == 0) { + //Early abort if there is nothing to communicate. + return; + } std::vector temp_result(total_send_count, std::numeric_limits::max()); // give a sane address to gatherv also when nothing to send