X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/cf43f7d6117d1e5b8c55ebee06711c70f5bbca48..8b47d18183827cb13535fd1b3f50df6dfb04b73e:/examples/cpp/dag-scheduling/s4u-dag-scheduling.cpp diff --git a/examples/cpp/dag-scheduling/s4u-dag-scheduling.cpp b/examples/cpp/dag-scheduling/s4u-dag-scheduling.cpp index d20de088e1..97938f20de 100644 --- a/examples/cpp/dag-scheduling/s4u-dag-scheduling.cpp +++ b/examples/cpp/dag-scheduling/s4u-dag-scheduling.cpp @@ -165,10 +165,17 @@ int main(int argc, char** argv) }); e.load_platform(argv[1]); + const auto hosts = e.get_all_hosts(); + + /* Mark all hosts as sequential, as it ought to be in such a scheduling example. + * + * It means that the hosts can only compute one thing at a given time. If an execution already takes place on a given + * host, any subsequently started execution will be queued until after the first execution terminates */ + for (auto const& host : hosts) + host->set_concurrency_limit(1); /* Allocating the host attribute */ unsigned long total_nhosts = e.get_host_count(); - const auto hosts = e.get_all_hosts(); std::vector host_attributes(total_nhosts); for (unsigned long i = 0; i < total_nhosts; i++) hosts[i]->set_data(&host_attributes[i]);