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
Another attempt at fixing the Flag2 job of jenkins
[simgrid.git]
/
examples
/
cpp
/
task-switch-host
/
s4u-task-switch-host.cpp
diff --git
a/examples/cpp/task-switch-host/s4u-task-switch-host.cpp
b/examples/cpp/task-switch-host/s4u-task-switch-host.cpp
index 252f3382e34a1b31837f2cb82c4136ecdcf33546..c236bdbdb9a4eb1bb089e024d6cf2dc42cb64310 100644
(file)
--- a/
examples/cpp/task-switch-host/s4u-task-switch-host.cpp
+++ b/
examples/cpp/task-switch-host/s4u-task-switch-host.cpp
@@
-52,14
+52,21
@@
int main(int argc, char* argv[])
// Add a function to be called before each firing of comm0
// This function modifies the graph of tasks by adding or removing
// successors to comm0
// Add a function to be called before each firing of comm0
// This function modifies the graph of tasks by adding or removing
// successors to comm0
- comm0->on_this_start_cb([
comm0, exec1, exec2, jupiter, fafard](
sg4::Task*) {
+ comm0->on_this_start_cb([
&comm0, exec1, exec2, jupiter, fafard](const
sg4::Task*) {
static int count = 0;
static int count = 0;
- if (count % 2 == 0)
{
+ if (count % 2 == 0)
comm0->set_destination(jupiter);
comm0->set_destination(jupiter);
+ else
+ comm0->set_destination(fafard);
+ count++;
+ });
+
+ comm0->on_this_completion_cb([&comm0, exec1, exec2](const sg4::Task*) {
+ static int count = 0;
+ if (count % 2 == 0) {
comm0->add_successor(exec1);
comm0->remove_successor(exec2);
} else {
comm0->add_successor(exec1);
comm0->remove_successor(exec2);
} else {
- comm0->set_destination(fafard);
comm0->add_successor(exec2);
comm0->remove_successor(exec1);
}
comm0->add_successor(exec2);
comm0->remove_successor(exec1);
}