Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
more doc updates
[simgrid.git] / examples / c / plugin-hostload / plugin-hostload.c
index b698fbc..18672ea 100644 (file)
@@ -34,7 +34,7 @@ static void execute_load_test(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char
   // Run a task
   start = simgrid_get_clock();
   XBT_INFO("Run a task of %.0E flops at current speed of %.0E flop/s", 200e6, sg_host_speed(host));
-  sg_actor_self_execute(200e6);
+  sg_actor_execute(200e6);
 
   XBT_INFO("Done working on my task; this took %.2fs; current peak speed: %.0E flop/s (when I started the computation, "
            "the speed was set to %.0E flop/s); number of flops computed so "
@@ -54,7 +54,7 @@ static void execute_load_test(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char
   // Run a second task
   start = simgrid_get_clock();
   XBT_INFO("Run a task of %.0E flops", 100e6);
-  sg_actor_self_execute(100e6);
+  sg_actor_execute(100e6);
   XBT_INFO("Done working on my task; this took %.2fs; current peak speed: %.0E flop/s; number of flops computed so "
            "far: %.2E",
            simgrid_get_clock() - start, sg_host_speed(host), sg_host_get_computed_flops(host));
@@ -85,7 +85,7 @@ static void change_speed(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* arg
   sg_host_t host = sg_host_by_name("MyHost1");
   sg_actor_sleep_for(10.5);
   XBT_INFO("I slept until now, but now I'll change the speed of this host "
-           "while the other process is still computing! This should slow the computation down.");
+           "while the other actor is still computing! This should slow the computation down.");
   sg_host_set_pstate(host, 2);
 }
 
@@ -97,11 +97,9 @@ int main(int argc, char* argv[])
   xbt_assert(argc == 2, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]);
 
   simgrid_load_platform(argv[1]);
-  sg_actor_t actor = sg_actor_init("load_test", sg_host_by_name("MyHost1"));
-  sg_actor_start(actor, execute_load_test, 0, NULL);
+  sg_actor_create("load_test", sg_host_by_name("MyHost1"), execute_load_test, 0, NULL);
 
-  sg_actor_t actor2 = sg_actor_init("change_speed", sg_host_by_name("MyHost1"));
-  sg_actor_start(actor2, change_speed, 0, NULL);
+  sg_actor_create("change_speed", sg_host_by_name("MyHost1"), change_speed, 0, NULL);
 
   simgrid_run();