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
Cleanup work to make is_race_reversible() a method of Transition
[simgrid.git]
/
examples
/
cpp
/
energy-link
/
s4u-energy-link.cpp
diff --git
a/examples/cpp/energy-link/s4u-energy-link.cpp
b/examples/cpp/energy-link/s4u-energy-link.cpp
index 66e849c337b086340562db6305928696ec486020..b20ad0ad84d429a50156fc0c983af63cb7856c14 100644
(file)
--- a/
examples/cpp/energy-link/s4u-energy-link.cpp
+++ b/
examples/cpp/energy-link/s4u-energy-link.cpp
@@
-1,4
+1,4
@@
-/* Copyright (c) 2017-202
2
. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2017-202
3
. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
@@
-22,7
+22,7
@@
static void sender(std::vector<std::string> args)
long comm_size = std::stol(args.at(1));
XBT_INFO("Send %ld bytes, in %d flows", comm_size, flow_amount);
long comm_size = std::stol(args.at(1));
XBT_INFO("Send %ld bytes, in %d flows", comm_size, flow_amount);
- sg4::Mailbox* mailbox = sg4::Mailbox::by_name(
std::string("message")
);
+ sg4::Mailbox* mailbox = sg4::Mailbox::by_name(
"message"
);
/* Sleep a while before starting the example */
sg4::this_actor::sleep_for(10);
/* Sleep a while before starting the example */
sg4::this_actor::sleep_for(10);
@@
-33,10
+33,10
@@
static void sender(std::vector<std::string> args)
mailbox->put(payload, comm_size);
} else {
// Start all comms in parallel, and wait for all completions in one shot
mailbox->put(payload, comm_size);
} else {
// Start all comms in parallel, and wait for all completions in one shot
- s
td::vector<sg4::CommPtr>
comms;
+ s
g4::ActivitySet
comms;
for (int i = 0; i < flow_amount; i++)
for (int i = 0; i < flow_amount; i++)
- comms.push
_back
(mailbox->put_async(bprintf("%d", i), comm_size));
-
sg4::Comm::wait_all(comms
);
+ comms.push(mailbox->put_async(bprintf("%d", i), comm_size));
+
comms.wait_all(
);
}
XBT_INFO("sender done.");
}
}
XBT_INFO("sender done.");
}
@@
-47,7
+47,7
@@
static void receiver(std::vector<std::string> args)
XBT_INFO("Receiving %d flows ...", flow_amount);
XBT_INFO("Receiving %d flows ...", flow_amount);
- sg4::Mailbox* mailbox = sg4::Mailbox::by_name(
std::string("message")
);
+ sg4::Mailbox* mailbox = sg4::Mailbox::by_name(
"message"
);
if (flow_amount == 1) {
char* res = mailbox->get<char>();
if (flow_amount == 1) {
char* res = mailbox->get<char>();
@@
-56,11
+56,11
@@
static void receiver(std::vector<std::string> args)
std::vector<char*> data(flow_amount);
// Start all comms in parallel, and wait for their completion in one shot
std::vector<char*> data(flow_amount);
// Start all comms in parallel, and wait for their completion in one shot
- s
td::vector<sg4::CommPtr>
comms;
+ s
g4::ActivitySet
comms;
for (int i = 0; i < flow_amount; i++)
for (int i = 0; i < flow_amount; i++)
- comms.push
_back
(mailbox->get_async<char>(&data[i]));
+ comms.push(mailbox->get_async<char>(&data[i]));
-
sg4::Comm::wait_all(comms
);
+
comms.wait_all(
);
for (int i = 0; i < flow_amount; i++)
xbt_free(data[i]);
}
for (int i = 0; i < flow_amount; i++)
xbt_free(data[i]);
}