Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
No valgrind leak check for issue71.
[simgrid.git] / teshsuite / s4u / issue71 / issue71.cpp
1 #include <simgrid/s4u.hpp>
2 #include <vector>
3
4 using namespace std;
5 using namespace simgrid;
6
7 static void runner()
8 {
9   auto e                    = s4u::Engine::get_instance();
10   simgrid::s4u::Host* host0 = e->host_by_name("c1_0");
11   simgrid::s4u::Host* host1 = e->host_by_name("c2_0");
12
13   std::vector<double> comp = {1e6, 1e6};
14   std::vector<double> comm = {1, 2, 3, 4};
15
16   vector<simgrid::s4u::Host*> h1 = {host0, host1};
17   simgrid::s4u::this_actor::parallel_execute(h1, comp, comm);
18 }
19
20 int main(int argc, char* argv[])
21 {
22   s4u::Engine e(&argc, argv);
23   e.set_config("host/model:ptask_L07");
24
25   xbt_assert(argc == 2,
26              "\nUsage: %s platform_ok.xml\n"
27              "\tor: %s platform_bad.xml\n",
28              argv[0], argv[0]);
29
30   const char* platform_file = argv[1];
31   e.load_platform(platform_file);
32
33   simgrid::s4u::Actor::create("actor", e.host_by_name("c1_0"), runner);
34
35   e.run();
36   return 0;
37 }