Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
convert two tesh to use s4u instead of using SIMIX directly
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Tue, 4 Feb 2020 16:18:36 +0000 (17:18 +0100)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Tue, 4 Feb 2020 16:50:25 +0000 (17:50 +0100)
teshsuite/simix/generic-simcalls/generic-simcalls.cpp
teshsuite/simix/stack-overflow/stack-overflow.cpp

index 6fd72c9..0fb69ea 100644 (file)
@@ -8,8 +8,9 @@
 
 #include <xbt/future.hpp>
 
 
 #include <xbt/future.hpp>
 
-#include <simgrid/engine.h>
 #include <simgrid/kernel/future.hpp>
 #include <simgrid/kernel/future.hpp>
+#include <simgrid/s4u/Actor.hpp>
+#include <simgrid/s4u/Engine.hpp>
 #include <simgrid/simix.hpp>
 #include <simgrid/simix/blocking_simcall.hpp>
 #include <xbt/log.h>
 #include <simgrid/simix.hpp>
 #include <simgrid/simix/blocking_simcall.hpp>
 #include <xbt/log.h>
@@ -99,10 +100,10 @@ static void master()
 
 int main(int argc, char* argv[])
 {
 
 int main(int argc, char* argv[])
 {
-  SIMIX_global_init(&argc, argv);
+  simgrid::s4u::Engine e(&argc, argv);
   xbt_assert(argc == 2, "Usage: %s platform.xml\n", argv[0]);
   xbt_assert(argc == 2, "Usage: %s platform.xml\n", argv[0]);
-  simgrid_load_platform(argv[1]);
-  simcall_process_create("master", example::master, NULL, sg_host_by_name("Tremblay"), NULL);
-  SIMIX_run();
+  e.load_platform(argv[1]);
+  simgrid::s4u::Actor::create("master", e.host_by_name("Tremblay"), example::master);
+  e.run();
   return 0;
 }
   return 0;
 }
index d2100f3..ccab36f 100644 (file)
@@ -5,9 +5,9 @@
 /* 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. */
 
 /* 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/simix.hpp"
+#include "simgrid/s4u/Actor.hpp"
+#include "simgrid/s4u/Engine.hpp"
 #include "xbt/log.h"
 #include "xbt/log.h"
-#include <simgrid/engine.h>
 
 #include <string>
 
 
 #include <string>
 
@@ -41,13 +41,13 @@ static void master()
 
 int main(int argc, char* argv[])
 {
 
 int main(int argc, char* argv[])
 {
-  SIMIX_global_init(&argc, argv);
+  simgrid::s4u::Engine e(&argc, argv);
 
   xbt_assert(argc == 2, "Usage: %s platform.xml\n", argv[0]);
 
 
   xbt_assert(argc == 2, "Usage: %s platform.xml\n", argv[0]);
 
-  simgrid_load_platform(argv[1]);
-  simcall_process_create("master", master, NULL, sg_host_by_name("Tremblay"), NULL);
-  SIMIX_run();
+  e.load_platform(argv[1]);
+  simgrid::s4u::Actor::create("master", e.host_by_name("Tremblay"), master);
+  e.run();
 
   return 0;
 }
 
   return 0;
 }