-/* Copyright (c) 2021. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2021-2022. 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. */
exec2->start();
XBT_INFO("Calling wait_any..");
- long index;
try {
- index = sg4::Exec::wait_any(pending_execs);
+ long index = sg4::Exec::wait_any(pending_execs);
XBT_INFO("Wait any returned index %ld (exec on %s)", index, pending_execs.at(index)->get_host()->get_cname());
- } catch (simgrid::HostFailureException& e) {
+ } catch (const simgrid::HostFailureException&) {
XBT_INFO("Dispatcher has experienced a host failure exception, so it knows that something went wrong");
XBT_INFO("Now it needs to figure out which of the two execs failed by looking at their state");
}
try {
pending_execs[1]->wait();
- } catch (simgrid::HostFailureException& e) {
+ } catch (const simgrid::HostFailureException& e) {
XBT_INFO("Waiting on a FAILED exec raises an exception: '%s'", e.what());
}
pending_execs.pop_back();
XBT_INFO("Wait for remaining exec, just to be nice");
- index = simgrid::s4u::Exec::wait_any(pending_execs);
+ simgrid::s4u::Exec::wait_any(pending_execs);
XBT_INFO("Dispatcher ends");
}
int main(int argc, char** argv)
{
-
sg4::Engine engine(&argc, argv);
auto* zone = sg4::create_full_zone("AS0");