- .def_property("amount", &Operation::get_amount, &Operation::set_amount, "The amount of work to do for this operation.")
- .def("enqueue_execs", py::overload_cast<int>(&Operation::enqueue_execs), py::call_guard<py::gil_scoped_release>(), py::arg("n"), "Enqueue executions for this operation.")
- .def("add_successor", py::overload_cast<OperationPtr>(&Operation::add_successor), py::call_guard<py::gil_scoped_release>(), py::arg("op"), "Add a successor to this operation.")
- .def("remove_successor", py::overload_cast<OperationPtr>(&Operation::remove_successor), py::call_guard<py::gil_scoped_release>(), py::arg("op"), "Remove a successor of this operation.")
- .def("remove_all_successors", &Operation::remove_all_successors, py::call_guard<py::gil_scoped_release>(), "Remove all successors of this operation.")
- .def("on_this_start", py::overload_cast<const std::function<void(Operation*)>&>(&Operation::on_this_start), py::arg("func"), "Add a callback called when this operation starts.")
- .def("on_this_end", py::overload_cast<const std::function<void(Operation*)>&>(&Operation::on_this_end), py::arg("func"), "Add a callback called when this operation ends.")
- .def("__repr__", [](const OperationPtr op) {
- return op->get_name();
- });
-
- /* Class CommOp */
- py::class_<CommOp, CommOpPtr, Operation>(m, "CommOp",
- "Communication Operation. See the C++ documentation for details.")
- .def_static("init", py::overload_cast<const std::string&>(&CommOp::init), py::call_guard<py::gil_scoped_release>(),
- py::arg("name"), "CommOp constructor")
- .def_static("init", py::overload_cast<const std::string&, double, Host*, Host*>(&CommOp::init), py::call_guard<py::gil_scoped_release>(),
- py::arg("name"), py::arg("bytes"), py::arg("source"), py::arg("destination"), "CommOp constructor")
+ .def_property("amount", &Operation::get_amount, &Operation::set_amount,
+ "The amount of work to do for this operation.")
+ .def("enqueue_execs", py::overload_cast<int>(&Operation::enqueue_execs), py::call_guard<py::gil_scoped_release>(),
+ py::arg("n"), "Enqueue executions for this operation.")
+ .def("add_successor", py::overload_cast<OperationPtr>(&Operation::add_successor),
+ py::call_guard<py::gil_scoped_release>(), py::arg("op"), "Add a successor to this operation.")
+ .def("remove_successor", py::overload_cast<OperationPtr>(&Operation::remove_successor),
+ py::call_guard<py::gil_scoped_release>(), py::arg("op"), "Remove a successor of this operation.")
+ .def("remove_all_successors", &Operation::remove_all_successors, py::call_guard<py::gil_scoped_release>(),
+ "Remove all successors of this operation.")
+ .def("on_this_start", py::overload_cast<const std::function<void(Operation*)>&>(&Operation::on_this_start),
+ py::arg("func"), "Add a callback called when this operation starts.")
+ .def("on_this_end", py::overload_cast<const std::function<void(Operation*)>&>(&Operation::on_this_end),
+ py::arg("func"), "Add a callback called when this operation ends.")
+ .def(
+ "__repr__", [](const OperationPtr op) { return "<simgrid.Operation " + op->get_name() + ">"; },
+ "Textual representation of the Operation");
+
+ /* Class CommOp */
+ py::class_<CommOp, CommOpPtr, Operation>(m, "CommOp",
+ "Communication Operation. See the C++ documentation for details.")
+ .def_static("init", py::overload_cast<const std::string&>(&CommOp::init),
+ py::call_guard<py::gil_scoped_release>(), py::arg("name"), "CommOp constructor")
+ .def_static("init", py::overload_cast<const std::string&, double, Host*, Host*>(&CommOp::init),
+ py::call_guard<py::gil_scoped_release>(), py::arg("name"), py::arg("bytes"), py::arg("source"),
+ py::arg("destination"), "CommOp constructor")