-/* Copyright (c) 2009-2021. The SimGrid Team.
+/* Copyright (c) 2009-2022. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
std::vector<simgrid::s4u::ActivityPtr> current;
for (const auto& a : dag)
- if (dynamic_cast<simgrid::s4u::Exec*>(a.get()) != nullptr && a->is_waited_by() == 0)
+ if (dynamic_cast<simgrid::s4u::Exec*>(a.get()) != nullptr && a->has_no_successor())
current.push_back(a);
while (not current.empty()) {
result.push_back(newfile);
}
}
- if (file->is_waited_by() == 0) {
+ if (file->has_no_successor()) {
for (auto const& it : file->get_dependencies()) {
newfile = Comm::sendto_init()->set_name(file->get_name())->set_payload_size(file->get_remaining());
it->add_successor(newfile);
if ((a != root_task) && (a != end_task)) {
if (a->dependencies_solved())
root_task->add_successor(a);
- if (a->is_waited_by() == 0)
+ if (a->has_no_successor())
a->add_successor(end_task);
}
}
root->add_successor(a);
}
- if (a->is_waited_by() == 0 && a != end) {
+ if (a->has_no_successor() && a != end) {
XBT_DEBUG("Activity '%s' has no successors. Add dependency to 'end'", a->get_cname());
a->add_successor(end);
}
for (const auto& a : dag)
a->destroy();
dag.clear();
+ dag.shrink_to_fit();
}
return dag;