Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
follow up on #228: fix make dist and cleanups
[simgrid.git] / examples / s4u / actor-execute / s4u-actor-execute.cpp
index 26fc7d1..66f5af0 100644 (file)
@@ -3,14 +3,15 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
- #include "simgrid/s4u.hpp"
- #include <cstdlib>
- #include <iostream>
+#include "simgrid/s4u.hpp"
 
-/* Main function of the actor I want to start manually */
-static int actor_function(std::vector<std::string> args)
+static int executor(std::vector<std::string> args)
 {
+  /* this_actor::execute() tells SimGrid to pause the calling actor
+   * until its host has computed the amount of flops passed as a parameter */
   simgrid::s4u::this_actor::execute(100);
+
+  /* This simple example does not do anything beyond that */
   return 0;
 }
 
@@ -20,9 +21,9 @@ int main(int argc, char *argv[])
   std::vector<std::string> args;
   xbt_assert(argc > 1, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]);
 
-  e.loadPlatform(argv[1]); 
-  
-  simgrid::s4u::Actor::createActor("simple_func", simgrid::s4u::Host::by_name("Tremblay"), actor_function, args);
+  e.loadPlatform(argv[1]);
+
+  simgrid::s4u::Actor::createActor("executor", simgrid::s4u::Host::by_name("Tremblay"), executor, args);
 
   e.run();