Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
python: test Actor.is_suspended() and introduce this_actor.error
[simgrid.git] / src / bindings / python / simgrid_python.cpp
index d5ed159..2c0c154 100644 (file)
@@ -56,6 +56,7 @@ PYBIND11_MODULE(simgrid, m)
 
   py::module m2 = m.def_submodule("this_actor", "Bindings of the s4u::this_actor namespace.");
   m2.def("info", [](char* s) { XBT_INFO("%s", s); }, "Display a logging message of default priority.");
+  m2.def("error", [](char* s) { XBT_ERROR("%s", s); }, "Display a logging message of 'error' priority.");
   m2.def("execute", py::overload_cast<double, double>(&simgrid::s4u::this_actor::execute),
          "Block the current actor, computing the given amount of flops at the given priority, see :cpp:func:`void "
          "simgrid::s4u::this_actor::execute(double, double)`",
@@ -179,9 +180,7 @@ PYBIND11_MODULE(simgrid, m)
       .def("migrate", &Actor::migrate,
            "Moves that actor to another host, see :cpp:func:`void simgrid::s4u::Actor::migrate()`", py::arg("dest"))
       .def("self", &Actor::self, "Retrieves the current actor, see :cpp:func:`void simgrid::s4u::Actor::self()`")
-      .def("suspend", &Actor::suspend,
-           "Suspend that actor, that is blocked until resume()ed by another actor. See :cpp:func:`void "
-           "simgrid::s4u::Actor::suspend()`")
-      .def("resume", &Actor::resume,
-           "Resume that actor, that was previously suspend()ed. See :cpp:func:`void simgrid::s4u::Actor::suspend()`");
+      .def("is_suspended", &Actor::is_suspended, "Returns True if that actor is currently suspended.")
+      .def("suspend", &Actor::suspend, "Suspend that actor, that is blocked until resume()ed by another actor.")
+      .def("resume", &Actor::resume, "Resume that actor, that was previously suspend()ed.");
 }