"Registers the main function of an actor");
/* Class Netzone */
- py::class_<simgrid::s4u::NetZone, std::unique_ptr<simgrid::s4u::NetZone, py::nodelete>>(m, "NetZone",
- "Networking Zones")
- .def_static("create_full_zone", &simgrid::s4u::create_full_zone, "Creates a zone of type FullZone")
+ py::class_<simgrid::s4u::NetZone, std::unique_ptr<simgrid::s4u::NetZone, py::nodelete>> netzone(m, "NetZone",
+ "Networking Zones");
+ netzone.def_static("create_full_zone", &simgrid::s4u::create_full_zone, "Creates a zone of type FullZone")
.def_static("create_torus_zone", &simgrid::s4u::create_torus_zone, "Creates a cluster of type Torus")
.def_static("create_fatTree_zone", &simgrid::s4u::create_fatTree_zone, "Creates a cluster of type Fat-Tree")
.def_static("create_dragonfly_zone", &simgrid::s4u::create_dragonfly_zone, "Creates a cluster of type Dragonfly")
.export_values();
/* Class NetPoint */
- py::class_<simgrid::kernel::routing::NetPoint, std::unique_ptr<simgrid::kernel::routing::NetPoint, py::nodelete>>(
- m, "NetPoint", "NetPoint object");
+ py::class_<simgrid::kernel::routing::NetPoint, std::unique_ptr<simgrid::kernel::routing::NetPoint, py::nodelete>>
+ netpoint(m, "NetPoint", "NetPoint object");
/* Class Link */
py::class_<simgrid::s4u::Link, std::unique_ptr<simgrid::s4u::Link, py::nodelete>> link(m, "Link", "Network link");
py::class_<PyGetAsync>(m, "PyGetAsync", "Wrapper for async get communications")
.def(py::init<>())
.def(
- "get", [](PyGetAsync* self) { return py::reinterpret_steal<py::object>(*(self->get())); },
+ "get", [](const PyGetAsync* self) { return py::reinterpret_steal<py::object>(*(self->get())); },
"Get python object after async communication in receiver side");
/* Class Comm */
hosts = []
# dijkstra
dijkstra = NetZone.create_dijkstra_zone("dijkstra")
- this_actor.info("Creating zone: " + dijkstra.name)
+ msg_base = "Creating zone: "
+ this_actor.info(msg_base + dijkstra.name)
dijkstra.set_parent(root)
host1 = dijkstra.create_host("host1", [1e9, 1e8]).set_core_count(2)
hosts.append(host1)
# vivaldi
vivaldi = NetZone.create_vivaldi_zone("vivaldi")
- this_actor.info("Creating zone: " + vivaldi.name)
+ this_actor.info(msg_base + vivaldi.name)
vivaldi.set_parent(root)
host3 = vivaldi.create_host("host3", 1e9).set_coordinates("1 1 1").seal()
host4 = vivaldi.create_host("host4", "1Gf").set_coordinates("2 2 2").seal()
# empty
empty = NetZone.create_empty_zone("empty")
- this_actor.info("Creating zone: " + empty.name)
+ this_actor.info(msg_base + empty.name)
empty.set_parent(root)
host5 = empty.create_host("host5", 1e9)
hosts.append(host5)
# wifi
wifi = NetZone.create_wifi_zone("wifi")
- this_actor.info("Creating zone: " + wifi.name)
+ this_actor.info(msg_base + wifi.name)
wifi.set_parent(root)
router = wifi.create_router("wifi_router")
wifi.set_property("access_point", "wifi_router")
wifi.seal()
# create routes between netzones
- linkA = vivaldi.create_link("linkA", 1e9).seal()
- linkB = vivaldi.create_link("linkB", "1GBps").seal()
- linkC = vivaldi.create_link("linkC", "1GBps").seal()
+ link_a = vivaldi.create_link("linkA", 1e9).seal()
+ link_b = vivaldi.create_link("linkB", "1GBps").seal()
+ link_c = vivaldi.create_link("linkC", "1GBps").seal()
root.add_route(dijkstra.get_netpoint(), vivaldi.get_netpoint(
- ), host1.get_netpoint(), host3.get_netpoint(), [LinkInRoute(linkA)], True)
+ ), host1.get_netpoint(), host3.get_netpoint(), [LinkInRoute(link_a)], True)
root.add_route(vivaldi.get_netpoint(), empty.get_netpoint(
- ), host3.get_netpoint(), host5.get_netpoint(), [LinkInRoute(linkB)], True)
+ ), host3.get_netpoint(), host5.get_netpoint(), [LinkInRoute(link_b)], True)
root.add_route(empty.get_netpoint(), wifi.get_netpoint(
- ), host5.get_netpoint(), router, [LinkInRoute(linkC)], True)
+ ), host5.get_netpoint(), router, [LinkInRoute(link_c)], True)
# create actors Sender/Receiver
Actor.create("sender", hosts[0], Sender(hosts))