1 /* Copyright (c) 2010-2015. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
7 #include "simgrid/s4u.hpp"
9 XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_test, "Messages specific for this s4u example");
13 simgrid::s4u::Host* jupiter = simgrid::s4u::Host::by_name("Jupiter");
14 XBT_INFO("Master waiting");
15 simgrid::s4u::this_actor::sleep_for(1);
17 XBT_INFO("Turning off the worker host");
19 XBT_INFO("Master has finished");
24 XBT_INFO("Worker waiting");
25 // TODO, This should really be MSG_HOST_FAILURE
26 simgrid::s4u::this_actor::sleep_for(5);
27 XBT_ERROR("Worker should be off already.");
30 int main(int argc, char* argv[])
32 simgrid::s4u::Engine* e = new simgrid::s4u::Engine(&argc, argv);
33 e->loadPlatform(argv[1]);
35 simgrid::s4u::Actor::createActor("master", simgrid::s4u::Host::by_name("Tremblay"), master);
36 simgrid::s4u::Actor::createActor("worker", simgrid::s4u::Host::by_name("Jupiter"), worker);
39 XBT_INFO("Simulation time %g", e->getClock());