Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Convert actor-execute to s4u API
[simgrid.git] / examples / s4u / actor-execute / s4u-actor-execute.cpp
1 /* Copyright (c) 2010-2017. The SimGrid Team. All rights reserved.          */
2
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. */
5
6  #include "simgrid/s4u.hpp"
7  #include <cstdlib>
8  #include <iostream>
9
10 /* Main function of the actor I want to start manually */
11 static int actor_function(std::vector<std::string> args)
12 {
13   simgrid::s4u::this_actor::execute(100);
14   return 0;
15 }
16
17 int main(int argc, char *argv[])
18 {
19   simgrid::s4u::Engine e(&argc, argv);
20   std::vector<std::string> args;
21   xbt_assert(argc > 1, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]);
22
23   e.loadPlatform(argv[1]); 
24   
25   simgrid::s4u::Actor::createActor("simple_func", simgrid::s4u::Host::by_name("Tremblay"), actor_function, args);
26
27   e.run();
28
29   return 0;
30 }