1 /* Copyright (c) 2007-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"
7 #include "simgrid/forward.h"
8 #include "simgrid/s4u/forward.hpp"
10 XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_test, "Messages specific for this s4u example");
14 simgrid::s4u::Host* fafard = simgrid::s4u::Host::by_name("Fafard");
15 simgrid::s4u::Host* ginette = simgrid::s4u::Host::by_name("Ginette");
17 XBT_INFO("I'm a wizard! I can run a task on the Fafard host from the Ginette one! Look!");
18 simgrid::s4u::ExecPtr activity = simgrid::s4u::this_actor::exec_init(48.492e6);
19 activity->setHost(ginette);
21 XBT_INFO("It started. Running 48.492Mf takes exactly one second on Ginette (but not on Fafard).");
23 simgrid::s4u::this_actor::sleep_for(0.1);
24 XBT_INFO("Load on Fafard: %e flops/s; Load on Ginette: %e flops/s.", fafard->getLoad(), ginette->getLoad());
31 int main(int argc, char* argv[])
33 simgrid::s4u::Engine e(&argc, argv);
34 e.loadPlatform(argv[1]);
35 simgrid::s4u::Actor::createActor("test", simgrid::s4u::Host::by_name("Fafard"), wizard);