Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Reduce scope for temporary variables.
[simgrid.git] / src / smpi / bindings / smpi_pmpi.cpp
index 6f205a2c9055a834038ccca52ddb78170cf6cd46..98d2f46e1d20e995c88d16ac996f8ed1ce8d77e1 100644 (file)
@@ -4,6 +4,7 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "private.hpp"
+#include "simgrid/host.h"
 #include "simgrid/instr.h"
 #include "simgrid/s4u/Engine.hpp"
 #include "simgrid/s4u/Host.hpp"
@@ -201,10 +202,9 @@ int PMPI_Get_count(const MPI_Status * status, MPI_Datatype datatype, int *count)
   } else if (not datatype->is_valid()) {
     return MPI_ERR_TYPE;
   } else {
-    size_t size = datatype->size();
-    if (size == 0) {
+    if (datatype->size() == 0) {
       *count = 0;
-    } else if (status->count % size != 0) {
+    } else if (status->count % datatype->size() != 0) {
       *count = MPI_UNDEFINED;
     } else {
       *count = simgrid::smpi::Status::get_count(status, datatype);