From ea6bd35b6919a90a4d7fcd560c79bc56c415af50 Mon Sep 17 00:00:00 2001 From: Pietro Incardona Date: Fri, 19 Jun 2015 10:42:28 +0200 Subject: [PATCH] Fixing zero sized send --- src/VCluster.hpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/VCluster.hpp b/src/VCluster.hpp index 8dbe363..406bfec 100644 --- a/src/VCluster.hpp +++ b/src/VCluster.hpp @@ -283,7 +283,7 @@ public: * * \param prc list of processors with which it should communicate * - * \param v vector containing the data to send + * \param v vector containing the data to send (it is allowed to have 0 size vector) * * \param msg_alloc This is a call-back with the purpose of allocate space * for the incoming message and give back a valid pointer, the 6 parameters @@ -417,8 +417,11 @@ public: for (size_t i = 0 ; i < n_send ; i++) { - req.add(); - MPI_SAFE_CALL(MPI_Issend(ptr[i], sz[i], MPI_BYTE, prc[i], SEND_SPARSE, MPI_COMM_WORLD,&req.last())); + if (sz[i] != 0) + { + req.add(); + MPI_SAFE_CALL(MPI_Issend(ptr[i], sz[i], MPI_BYTE, prc[i], SEND_SPARSE, MPI_COMM_WORLD,&req.last())); + } } size_t rid = 0; -- GitLab