1 /* Copyright (c) 2007-2019. 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");
10 simgrid::s4u::ExecPtr second;
14 double computation_amount = simgrid::s4u::this_actor::get_host()->get_speed();
16 simgrid::s4u::ExecPtr first = simgrid::s4u::this_actor::exec_init(computation_amount);
17 second = simgrid::s4u::this_actor::exec_init(computation_amount);
19 first->add_successor(second.get());
24 static void vetoed_worker()
26 second->vetoable_start();
27 XBT_INFO("%d %d", (int)second->get_state(), second->has_dependencies());
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("worker", simgrid::s4u::Host::by_name("Fafard"), worker);
37 simgrid::s4u::Actor::create("vetoed_worker", simgrid::s4u::Host::by_name("Fafard"), vetoed_worker);
41 XBT_INFO("Simulation time %g", e.get_clock());