Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
simix_global->create_process_function always exists
authorMartin Quinson <martin.quinson@loria.fr>
Fri, 2 Sep 2016 10:20:13 +0000 (12:20 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Fri, 2 Sep 2016 10:20:13 +0000 (12:20 +0200)
src/simix/ActorImpl.cpp
src/simix/smx_host.cpp
src/surf/sg_platf.cpp

index 465cfe4..d283b1e 100644 (file)
@@ -972,12 +972,8 @@ smx_actor_t SIMIX_process_restart(smx_actor_t process, smx_actor_t issuer) {
   SIMIX_process_kill(process, issuer);
 
   //start the new process
-  if (simix_global->create_process_function)
-    return simix_global->create_process_function(arg.name.c_str(), std::move(arg.code), arg.data, arg.hostname,
-        arg.kill_time, arg.properties, arg.auto_restart, nullptr);
-  else
-    return simcall_process_create(arg.name.c_str(), std::move(arg.code), arg.data, arg.hostname, arg.kill_time,
-      arg.properties, arg.auto_restart);
+  return simix_global->create_process_function(arg.name.c_str(), std::move(arg.code), arg.data, arg.hostname,
+      arg.kill_time, arg.properties, arg.auto_restart, nullptr);
 }
 
 void SIMIX_segment_index_set(smx_actor_t proc, int index){
index 3eb47dc..a835e87 100644 (file)
@@ -61,25 +61,14 @@ namespace simgrid {
       smx_process_arg_t arg;
       xbt_dynar_foreach(boot_processes,cpt,arg) {
         XBT_DEBUG("Booting Process %s(%s) right now", arg->name.c_str(), arg->hostname);
-        // FIXME: factorize this code by registering the simcall as default function
-        if (simix_global->create_process_function) {
-          simix_global->create_process_function(arg->name.c_str(),
-                                                arg->code,
-                                                nullptr,
-                                                arg->hostname,
-                                                arg->kill_time,
-                                                arg->properties,
-                                                arg->auto_restart,
-                                                nullptr);
-        } else {
-          simcall_process_create(arg->name.c_str(),
-                                 arg->code,
-                                 nullptr,
-                                 arg->hostname,
-                                 arg->kill_time,
-                                 arg->properties,
-                                 arg->auto_restart);
-        }
+        simix_global->create_process_function(arg->name.c_str(),
+            arg->code,
+            nullptr,
+            arg->hostname,
+            arg->kill_time,
+            arg->properties,
+            arg->auto_restart,
+            nullptr);
       }
     }
 
@@ -174,13 +163,8 @@ void SIMIX_host_autorestart(sg_host_t host)
   xbt_dynar_foreach (process_list, cpt, arg) {
 
     XBT_DEBUG("Restarting Process %s(%s) right now", arg->name.c_str(), arg->hostname);
-    if (simix_global->create_process_function) {
-      simix_global->create_process_function(arg->name.c_str(), arg->code, nullptr, arg->hostname, arg->kill_time,
-                                            arg->properties, arg->auto_restart, nullptr);
-    } else {
-      simcall_process_create(arg->name.c_str(), arg->code, nullptr, arg->hostname, arg->kill_time, arg->properties,
-                             arg->auto_restart);
-    }
+    simix_global->create_process_function(arg->name.c_str(), arg->code, nullptr, arg->hostname, arg->kill_time,
+        arg->properties, arg->auto_restart, nullptr);
   }
   xbt_dynar_reset(process_list);
 }
index a107150..5bfa669 100644 (file)
@@ -628,15 +628,10 @@ void sg_platf_new_process(sg_platf_process_cbarg_t process)
     XBT_DEBUG("Starting Process %s(%s) right now",
       arg->name.c_str(), sg_host_get_name(host));
 
-    if (simix_global->create_process_function)
-      process_created = simix_global->create_process_function(
-          arg->name.c_str(), std::move(code), nullptr,
-          sg_host_get_name(host), kill_time,
-          current_property_set, auto_restart, nullptr);
-    else
-      process_created = simcall_process_create(
-          arg->name.c_str(), std::move(code), nullptr, sg_host_get_name(host), kill_time,
-          current_property_set,auto_restart);
+    process_created = simix_global->create_process_function(
+        arg->name.c_str(), std::move(code), nullptr,
+        sg_host_get_name(host), kill_time,
+        current_property_set, auto_restart, nullptr);
 
     /* verify if process has been created (won't be the case if the host is currently dead, but that's fine) */
     if (!process_created) {