1 /* Copyright (c) 2010-2017. 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");
24 // TODO, This should really be MSG_HOST_FAILURE
25 simgrid::s4u::this_actor::sleep_for(5);
26 XBT_ERROR("Worker should be off already.");
29 int main(int argc, char* argv[])
31 simgrid::s4u::Engine* e = new simgrid::s4u::Engine(&argc, argv);
32 e->loadPlatform(argv[1]);
34 simgrid::s4u::Actor::createActor("master", simgrid::s4u::Host::by_name("Tremblay"), master);
35 simgrid::s4u::Actor::createActor("worker", simgrid::s4u::Host::by_name("Jupiter"), worker);
38 XBT_INFO("Simulation time %g", e->getClock());