Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
don't mess with argv before having SimGrid taking its share of options
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Thu, 16 May 2019 13:02:26 +0000 (15:02 +0200)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Fri, 17 May 2019 21:51:44 +0000 (23:51 +0200)
examples/s4u/synchro-barrier/s4u-synchro-barrier.cpp

index e131c30..3e5e1ec 100644 (file)
@@ -35,12 +35,13 @@ static void master(int process_count)
 
 int main(int argc, char **argv)
 {
 
 int main(int argc, char **argv)
 {
+  simgrid::s4u::Engine e(&argc, argv);
+
   // Parameter: Number of processes in the barrier
   xbt_assert(argc >= 2, "Usage: %s <process-count>\n", argv[0]);
   int process_count = std::stoi(argv[1]);
   xbt_assert(process_count > 0, "<process-count> must be greater than 0");
 
   // Parameter: Number of processes in the barrier
   xbt_assert(argc >= 2, "Usage: %s <process-count>\n", argv[0]);
   int process_count = std::stoi(argv[1]);
   xbt_assert(process_count > 0, "<process-count> must be greater than 0");
 
-  simgrid::s4u::Engine e(&argc, argv);
   e.load_platform("../../platforms/two_hosts.xml");
   simgrid::s4u::Actor::create("master", simgrid::s4u::Host::by_name("Tremblay"), master, process_count);
   e.run();
   e.load_platform("../../platforms/two_hosts.xml");
   simgrid::s4u::Actor::create("master", simgrid::s4u::Host::by_name("Tremblay"), master, process_count);
   e.run();