A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Jenkins::Flag2: use ninja if avail; verbose builds
[simgrid.git]
/
examples
/
cpp
/
clusters-multicpu
/
s4u-clusters-multicpu.cpp
diff --git
a/examples/cpp/clusters-multicpu/s4u-clusters-multicpu.cpp
b/examples/cpp/clusters-multicpu/s4u-clusters-multicpu.cpp
index b637a23464c986299bb4c8fee1f190b2a3789bc9..b2ca2e78f75fd72ba8b9248c0c3a4c6c8979ed96 100644
(file)
--- a/
examples/cpp/clusters-multicpu/s4u-clusters-multicpu.cpp
+++ b/
examples/cpp/clusters-multicpu/s4u-clusters-multicpu.cpp
@@
-24,7
+24,7
@@
public:
void operator()() const
{
/* Vector in which we store all ongoing communications */
void operator()() const
{
/* Vector in which we store all ongoing communications */
- s
td::vector<sg4::CommPtr>
pending_comms;
+ s
g4::ActivitySet
pending_comms;
/* Make a vector of the mailboxes to use */
std::vector<sg4::Mailbox*> mboxes;
/* Make a vector of the mailboxes to use */
std::vector<sg4::Mailbox*> mboxes;
@@
-40,13
+40,13
@@
public:
auto* mbox = sg4::Mailbox::by_name(host->get_name());
mboxes.push_back(mbox);
sg4::CommPtr comm = mbox->put_async(payload, msg_size);
auto* mbox = sg4::Mailbox::by_name(host->get_name());
mboxes.push_back(mbox);
sg4::CommPtr comm = mbox->put_async(payload, msg_size);
- pending_comms.push
_back
(comm);
+ pending_comms.push(comm);
}
XBT_INFO("Done dispatching all messages");
/* Now that all message exchanges were initiated, wait for their completion in one single call */
}
XBT_INFO("Done dispatching all messages");
/* Now that all message exchanges were initiated, wait for their completion in one single call */
-
sg4::Comm::wait_all(pending_comms
);
+
pending_comms.wait_all(
);
XBT_INFO("Goodbye now!");
}
XBT_INFO("Goodbye now!");
}
@@
-87,8
+87,7
@@
public:
* @param id Internal identifier in the torus (for information)
* @return netpoint, gateway: the netpoint to the StarZone and CPU0 as gateway
*/
* @param id Internal identifier in the torus (for information)
* @return netpoint, gateway: the netpoint to the StarZone and CPU0 as gateway
*/
-static std::pair<simgrid::kernel::routing::NetPoint*, simgrid::kernel::routing::NetPoint*>
-create_hostzone(const sg4::NetZone* zone, const std::vector<unsigned long>& /*coord*/, unsigned long id)
+static sg4::NetZone* create_hostzone(const sg4::NetZone* zone, const std::vector<unsigned long>& /*coord*/, unsigned long id)
{
constexpr int num_cpus = 8; //!< Number of CPUs in the zone
constexpr double speed = 1e9; //!< Speed of each CPU
{
constexpr int num_cpus = 8; //!< Number of CPUs in the zone
constexpr double speed = 1e9; //!< Speed of each CPU
@@
-101,24
+100,21
@@
create_hostzone(const sg4::NetZone* zone, const std::vector<unsigned long>& /*co
/* setting my Torus parent zone */
host_zone->set_parent(zone);
/* setting my Torus parent zone */
host_zone->set_parent(zone);
- simgrid::kernel::routing::NetPoint* gateway = nullptr;
/* create CPUs */
for (int i = 0; i < num_cpus; i++) {
std::string cpu_name = hostname + "-cpu" + std::to_string(i);
/* create CPUs */
for (int i = 0; i < num_cpus; i++) {
std::string cpu_name = hostname + "-cpu" + std::to_string(i);
- const sg4::Host* host = host_zone->create_host(cpu_name, speed)
->seal()
;
+ const sg4::Host* host = host_zone->create_host(cpu_name, speed);
/* the first CPU is the gateway */
if (i == 0)
/* the first CPU is the gateway */
if (i == 0)
-
gateway = host->get_netpoint(
);
+
host_zone->set_gateway(host->get_netpoint()
);
/* create split-duplex link */
/* create split-duplex link */
- sg4::SplitDuplexLink* link = host_zone->create_split_duplex_link("link-" + cpu_name, link_bw);
- link->set_latency(link_lat)->seal();
+ auto* link = host_zone->create_split_duplex_link("link-" + cpu_name, link_bw)->set_latency(link_lat);
/* connecting CPU to outer world */
/* connecting CPU to outer world */
- host_zone->add_route(host->get_netpoint(), nullptr, nullptr, nullptr, {{link, sg4::LinkInRoute::Direction::UP}},
- true);
+ host_zone->add_route(host, nullptr, {{link, sg4::LinkInRoute::Direction::UP}}, true);
}
/* seal newly created netzone */
host_zone->seal();
}
/* seal newly created netzone */
host_zone->seal();
- return
std::make_pair(host_zone->get_netpoint(), gateway)
;
+ return
host_zone
;
}
/*************************************************************************************************/
}
/*************************************************************************************************/