Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright lines with new year.
[simgrid.git] / teshsuite / simix / generic-simcalls / generic-simcalls.cpp
index 497861e..7c15167 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2016-2018. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2016-2019. The SimGrid Team. All rights reserved.          */
 
 /* 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. */
@@ -8,6 +8,7 @@
 
 #include <xbt/future.hpp>
 
+#include <simgrid/engine.h>
 #include <simgrid/kernel/future.hpp>
 #include <simgrid/simix.hpp>
 #include <simgrid/simix/blocking_simcall.hpp>
@@ -30,7 +31,7 @@ static simgrid::kernel::Future<void> kernel_wait_until(double date)
   return future;
 }
 
-static int master(int argc, char* argv[])
+static void master()
 {
   // Test the simple immediate execution:
   XBT_INFO("Start");
@@ -93,8 +94,6 @@ static int master(int argc, char* argv[])
   XBT_INFO("The future is %s", future.is_ready() ? "ready" : "not ready");
   res = future.get();
   XBT_INFO("kernel_async with value returned with %i", res);
-
-  return 0;
 }
 }
 
@@ -102,9 +101,8 @@ int main(int argc, char* argv[])
 {
   SIMIX_global_init(&argc, argv);
   xbt_assert(argc == 2, "Usage: %s platform.xml\n", argv[0]);
-  SIMIX_function_register("master", example::master);
-  SIMIX_create_environment(argv[1]);
-  simcall_process_create("master", example::master, NULL, sg_host_by_name("Tremblay"), 0, NULL, NULL);
+  simgrid_load_platform(argv[1]);
+  simcall_process_create("master", example::master, NULL, sg_host_by_name("Tremblay"), NULL);
   SIMIX_run();
   return 0;
 }