Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
add MPI_Bsend, MPI_Ibsend, MPI_Bsend_init, MPI_Buffer_attach, MPI_Buffer_detach.
[simgrid.git] / src / smpi / bindings / smpi_pmpi.cpp
index 2b8f28e..7b40665 100644 (file)
@@ -244,3 +244,18 @@ MPI_Fint PMPI_Errhandler_c2f(MPI_Errhandler errhan){
     return -1;
   return errhan->c2f();
 }
+
+int PMPI_Buffer_attach(void *buf, int size){
+  if(buf==nullptr)
+    return MPI_ERR_BUFFER;
+  if(size<0)
+    return MPI_ERR_ARG;
+  smpi_process()->set_bsend_buffer(buf, size);
+  return MPI_SUCCESS;
+}
+
+int PMPI_Buffer_detach(void* buffer, int* size){
+  smpi_process()->bsend_buffer((void**)buffer, size);
+  smpi_process()->set_bsend_buffer(nullptr, 0);
+  return MPI_SUCCESS;
+}