1 /* Copyright (c) 2021-2023. 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>
12 auto* e = simgrid::s4u::Engine::get_instance();
13 simgrid::s4u::Host* host0 = e->host_by_name("c1_0");
14 simgrid::s4u::Host* host1 = e->host_by_name("c2_0");
16 std::vector<double> comp = {1e6, 1e6};
17 std::vector<double> comm = {1, 2, 3, 4};
19 std::vector<simgrid::s4u::Host*> h1 = {host0, host1};
20 simgrid::s4u::this_actor::parallel_execute(h1, comp, comm);
23 int main(int argc, char* argv[])
25 simgrid::s4u::Engine e(&argc, argv);
26 simgrid::s4u::Engine::set_config("host/model:ptask_L07");
29 "\nUsage: %s platform_ok.xml\n"
30 "\tor: %s platform_bad.xml\n",
33 const char* platform_file = argv[1];
36 e.load_platform(platform_file);
37 simgrid::s4u::Actor::create("actor", e.host_by_name("c1_0"), runner);
39 } catch (const simgrid::AssertionError& e) {
40 std::cout << e.what() << "\n";