From: Christian Heinrich Date: Wed, 28 Mar 2018 19:35:58 +0000 (+0200) Subject: [SMPI] Fix branch conditions X-Git-Tag: v3.20~594 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/e9f7e02c87f625ae4367f048dfd59cac1c2f2949?ds=inline [SMPI] Fix branch conditions --- 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; }