+ "The peak computing speed in flops/s at the current pstate, NOT taking the external load into account. "
+ "This is the max potential speed.")
+ .def_property_readonly(
+ "available_speed", &Host::get_available_speed,
+ "Get the available speed ratio, between 0 and 1.\n"
+ "This accounts for external load (see :py:func:`set_speed_profile() <simgrid.Host.set_speed_profile>`).");
+ py::enum_<simgrid::s4u::Host::SharingPolicy>(host, "SharingPolicy")
+ .value("NONLINEAR", simgrid::s4u::Host::SharingPolicy::NONLINEAR)
+ .value("LINEAR", simgrid::s4u::Host::SharingPolicy::LINEAR)
+ .export_values();
+
+ /* Class Disk */
+ py::class_<simgrid::s4u::Disk, std::unique_ptr<simgrid::s4u::Disk, py::nodelete>> disk(
+ m, "Disk", "Simulated disk. See the C++ documentation for details.");
+ disk.def("read", py::overload_cast<sg_size_t, double>(&simgrid::s4u::Disk::read, py::const_),
+ py::call_guard<py::gil_scoped_release>(), "Read data from disk", py::arg("size"), py::arg("priority") = 1)
+ .def("write", py::overload_cast<sg_size_t, double>(&simgrid::s4u::Disk::write, py::const_),
+ py::call_guard<py::gil_scoped_release>(), "Write data in disk", py::arg("size"), py::arg("priority") = 1)
+ .def("read_async", &simgrid::s4u::Disk::read_async, py::call_guard<py::gil_scoped_release>(),
+ "Non-blocking read data from disk")
+ .def("write_async", &simgrid::s4u::Disk::write_async, py::call_guard<py::gil_scoped_release>(),
+ "Non-blocking write data in disk")
+ .def("set_sharing_policy", &simgrid::s4u::Disk::set_sharing_policy, py::call_guard<py::gil_scoped_release>(),
+ "Set sharing policy for this disk", py::arg("op"), py::arg("policy"),
+ py::arg("cb") = simgrid::s4u::NonLinearResourceCb())
+ .def("seal", &simgrid::s4u::Disk::seal, py::call_guard<py::gil_scoped_release>(), "Seal this disk")
+ .def_property_readonly(
+ "name", [](const simgrid::s4u::Disk* self) { return self->get_name(); }, "The name of this disk");
+ py::enum_<simgrid::s4u::Disk::SharingPolicy>(disk, "SharingPolicy")
+ .value("NONLINEAR", simgrid::s4u::Disk::SharingPolicy::NONLINEAR)
+ .value("LINEAR", simgrid::s4u::Disk::SharingPolicy::LINEAR)
+ .export_values();
+ py::enum_<simgrid::s4u::Disk::Operation>(disk, "Operation")
+ .value("READ", simgrid::s4u::Disk::Operation::READ)
+ .value("WRITE", simgrid::s4u::Disk::Operation::WRITE)
+ .value("READWRITE", simgrid::s4u::Disk::Operation::READWRITE)
+ .export_values();