From e9f7e02c87f625ae4367f048dfd59cac1c2f2949 Mon Sep 17 00:00:00 2001 From: Christian Heinrich Date: Wed, 28 Mar 2018 21:35:58 +0200 Subject: [PATCH] [SMPI] Fix branch conditions --- src/smpi/internals/smpi_replay.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/smpi/internals/smpi_replay.cpp b/src/smpi/internals/smpi_replay.cpp index ae1ad78e7a..e65846bb9d 100644 --- a/src/smpi/internals/smpi_replay.cpp +++ b/src/smpi/internals/smpi_replay.cpp @@ -229,13 +229,16 @@ public: } else { int datatype_index = 0, disp_index = 0; - if (action.size() > 3 + 2 * comm_size) { /* datatype + disp are specified */ + /* The 3 comes from "0 gather ", which must always be present. + * The + comm_size is the recvcounts array, which must also be present + */ + if (action.size() > 3 + comm_size + comm_size) { /* datatype + disp are specified */ datatype_index = 3 + comm_size; disp_index = datatype_index + 1; - } else if (action.size() > 3 + 2 * comm_size) { /* disps specified; datatype is not specified; use the default one */ + } else if (action.size() > 3 + comm_size + 2) { /* disps specified; datatype is not specified; use the default one */ datatype_index = -1; disp_index = 3 + comm_size; - } else if (action.size() > 3 + comm_size) { /* only datatype, no disp specified */ + } else if (action.size() > 3 + comm_size) { /* only datatype, no disp specified */ datatype_index = 3 + comm_size; } -- 2.20.1