Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
mv version related things from config.h.in to version.h.in
[simgrid.git] / src / smpi / bindings / smpi_pmpi.cpp
index a57e4b1..f78f90f 100644 (file)
@@ -7,6 +7,7 @@
 #include "simgrid/instr.h"
 #include "simgrid/s4u/Engine.hpp"
 #include "simgrid/s4u/Host.hpp"
+#include "simgrid/version.h"
 #include "smpi_comm.hpp"
 #include "smpi_datatype_derived.hpp"
 #include "smpi_status.hpp"
@@ -63,7 +64,6 @@ int PMPI_Finalize()
   smpi_process()->finalize();
 
   TRACE_smpi_comm_out(rank_traced);
-  TRACE_smpi_finalize(rank_traced);
   return MPI_SUCCESS;
 }
 
@@ -125,7 +125,7 @@ int PMPI_Abort(MPI_Comm /*comm*/, int /*errorcode*/)
   smpi_bench_end();
   // FIXME: should kill all processes in comm instead
   smx_actor_t actor = SIMIX_process_self();
-  simgrid::simix::simcall([actor] { actor->exit(); });
+  simgrid::kernel::actor::simcall([actor] { actor->exit(); });
   return MPI_SUCCESS;
 }
 
@@ -233,3 +233,30 @@ int PMPI_Keyval_create(MPI_Copy_function* copy_fn, MPI_Delete_function* delete_f
 int PMPI_Keyval_free(int* keyval) {
   return simgrid::smpi::Keyval::keyval_free<simgrid::smpi::Comm>(keyval);
 }
+
+MPI_Errhandler PMPI_Errhandler_f2c(MPI_Fint errhan){
+  if(errhan==-1)
+    return MPI_ERRHANDLER_NULL;
+  return static_cast<MPI_Errhandler>(simgrid::smpi::Errhandler::f2c(errhan));
+}
+
+MPI_Fint PMPI_Errhandler_c2f(MPI_Errhandler errhan){
+  if(errhan==MPI_ERRHANDLER_NULL)
+    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;
+}