Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add a deleted flag to keep track of invalid but not actually deleted handles
[simgrid.git] / src / smpi / bindings / smpi_pmpi.cpp
index 4a07b91..73a9d6b 100644 (file)
@@ -150,6 +150,18 @@ int PMPI_Get_address(const void *location, MPI_Aint * address)
   return PMPI_Address(location, address);
 }
 
+MPI_Aint PMPI_Aint_add(MPI_Aint address, MPI_Aint disp)
+{
+  xbt_assert(address <= PTRDIFF_MAX - disp, "overflow in MPI_Aint_add");
+  return address + disp;
+}
+
+MPI_Aint PMPI_Aint_diff(MPI_Aint address, MPI_Aint disp)
+{
+  xbt_assert(address >= PTRDIFF_MIN + disp, "underflow in MPI_Aint_diff");
+  return address - disp;
+}
+
 int PMPI_Get_processor_name(char *name, int *resultlen)
 {
   int len = std::min<int>(sg_host_self()->get_name().size(), MPI_MAX_PROCESSOR_NAME - 1);