Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Python: Add Comm.wait_any
[simgrid.git] / src / bindings / python / simgrid_python.cpp
index 3f9119d..260dd8f 100644 (file)
@@ -184,9 +184,13 @@ PYBIND11_MODULE(simgrid, m)
            "Test whether the communication is terminated, see :cpp:func:`simgrid::s4u::Comm::test()`")
       .def("wait", [](simgrid::s4u::CommPtr self) { self->wait(); },
            "Block until the completion of that communication, see :cpp:func:`simgrid::s4u::Comm::wait()`")
-      .def("waitall", [](std::vector<simgrid::s4u::CommPtr>* comms) { simgrid::s4u::Comm::wait_all(comms); },
+      .def("wait_all", [](std::vector<simgrid::s4u::CommPtr>* comms) { simgrid::s4u::Comm::wait_all(comms); },
            "Block until the completion of all communications in the list, see "
-           ":cpp:func:`simgrid::s4u::Comm::wait_all()`");
+           ":cpp:func:`simgrid::s4u::Comm::wait_all()`")
+      .def(
+          "wait_any", [](std::vector<simgrid::s4u::CommPtr>* comms) { return simgrid::s4u::Comm::wait_any(comms); },
+          "Block until the completion of any communication in the list and return the index of the terminated one, see "
+          ":cpp:func:`simgrid::s4u::Comm::wait_any()`");
 
   /* Class Actor */
   py::class_<simgrid::s4u::Actor, ActorPtr>(m, "Actor",