Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[sonar] Explicit cast when loosing precision (C examples).
[simgrid.git] / examples / c / energy-exec-ptask / energy-exec-ptask.c
index f4e9888..54ac870 100644 (file)
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(energy_exec_ptask, "Messages specific for this example");
 
-static void runner(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
+static void runner(int argc, char* argv[])
 {
   /* Retrieve the list of all hosts as an array of hosts */
-  int host_count   = sg_host_count();
+  int host_count   = (int)sg_host_count();
   sg_host_t* hosts = sg_host_list();
 
   XBT_INFO("First, build a classical parallel task, with 1 Gflop to execute on each node, "
@@ -90,13 +90,12 @@ int main(int argc, char* argv[])
 
   simgrid_load_platform(argv[1]);
 
-  /* Pick a process, no matter which, from the platform file */
+  /* Pick the first host from the platform file */
   sg_host_t* all_hosts = sg_host_list();
   sg_host_t first_host = all_hosts[0];
   free(all_hosts);
 
-  sg_actor_t actor = sg_actor_init("test", first_host);
-  sg_actor_start(actor, runner, 0, NULL);
+  sg_actor_create("test", first_host, runner, 0, NULL);
 
   simgrid_run();
   XBT_INFO("Simulation done.");