X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/40103824c4b68507fb971451425fd5042589f959..505d827ccafbb31eb15cfbd72bdc6079e50525e2:/src/bindings/python/simgrid_python.cpp diff --git a/src/bindings/python/simgrid_python.cpp b/src/bindings/python/simgrid_python.cpp index 5f0f33599c..f9fcf3c15f 100644 --- a/src/bindings/python/simgrid_python.cpp +++ b/src/bindings/python/simgrid_python.cpp @@ -11,6 +11,7 @@ #include "simgrid/kernel/ProfileBuilder.hpp" #include "simgrid/kernel/routing/NetPoint.hpp" #include +#include #include #include #include @@ -441,6 +442,8 @@ PYBIND11_MODULE(simgrid, m) py::overload_cast(&Host::create_disk), py::call_guard(), "Create a disk") .def("seal", &Host::seal, py::call_guard(), "Seal this host") + .def("turn_off", &Host::turn_off, py::call_guard(), "Turn off this host") + .def("turn_on", &Host::turn_on, py::call_guard(), "Turn on this host") .def_property("pstate", &Host::get_pstate, py::cpp_function(&Host::set_pstate, py::call_guard()), "The current pstate (read/write property).") @@ -476,7 +479,24 @@ PYBIND11_MODULE(simgrid, m) "") .def( "__repr__", [](const Host* h) { return "Host(" + h->get_name() + ")"; }, - "Textual representation of the Host"); + "Textual representation of the Host.") + .def_static( + "sg_host_load_plugin_init", []() { sg_host_load_plugin_init(); }, py::call_guard(), + "Initialize host load plugin.") + .def( + "reset_load", [](const Host* h) { sg_host_load_reset(h); }, py::call_guard(), + "Reset counters of the host load plugin for this host.") + .def_property_readonly( + "current_load", [](const Host* h) { return sg_host_get_current_load(h); }, "Current load of the host.") + .def_property_readonly( + "avg_load", [](const Host* h) { return sg_host_get_avg_load(h); }, "Average load of the host.") + .def_property_readonly( + "idle_time", [](const Host* h) { return sg_host_get_idle_time(h); }, "Idle time of the host") + .def_property_readonly( + "total_idle_time", [](const Host* h) { return sg_host_get_total_idle_time(h); }, + "Total idle time of the host.") + .def_property_readonly( + "computed_flops", [](const Host* h) { return sg_host_get_computed_flops(h); }, "Computed flops of the host."); py::enum_(host, "SharingPolicy") .value("NONLINEAR", simgrid::s4u::Host::SharingPolicy::NONLINEAR)