1 /* Copyright (c) 2010-2018. The SimGrid Team. All rights reserved. */
3 /* This program is free software; you can redistribute it and/or modify it
4 * under the terms of the license (GNU LGPL) which comes with this package. */
6 #include "simgrid/s4u.hpp"
8 XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_test, "Messages specific for this s4u example");
12 simgrid::s4u::Host* jupiter = simgrid::s4u::Host::by_name("Jupiter");
13 XBT_INFO("Master waiting");
14 simgrid::s4u::this_actor::sleep_for(1);
16 XBT_INFO("Turning off the worker host");
18 XBT_INFO("Master has finished");
23 XBT_INFO("Worker waiting");
25 simgrid::s4u::this_actor::sleep_for(5);
26 } catch (simgrid::HostFailureException& e) {
27 XBT_INFO("The host has died ... as expected.");
31 int main(int argc, char* argv[])
33 simgrid::s4u::Engine e(&argc, argv);
34 e.load_platform(argv[1]);
36 simgrid::s4u::Actor::create("master", simgrid::s4u::Host::by_name("Tremblay"), master);
37 simgrid::s4u::Actor::create("worker", simgrid::s4u::Host::by_name("Jupiter"), worker);
40 XBT_INFO("Simulation time %g", e.get_clock());