Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove xbt::args: use vector<string> instead
[simgrid.git] / src / surf / sg_platf.cpp
index c675e25..56a02ef 100644 (file)
@@ -237,12 +237,9 @@ void sg_platf_new_link(sg_platf_link_cbarg_t link){
 void sg_platf_new_cluster(sg_platf_cluster_cbarg_t cluster)
 {
   using simgrid::routing::AsCluster;
-  using simgrid::routing::AsClusterTorus;
-  using simgrid::routing::AsClusterFatTree;
-  using simgrid::routing::AsCluster;
-  using simgrid::routing::AsClusterTorus;
   using simgrid::routing::AsClusterDragonfly;
   using simgrid::routing::AsClusterFatTree;
+  using simgrid::routing::AsClusterTorus;
 
   int rankId=0;
 
@@ -573,14 +570,15 @@ void sg_platf_new_process(sg_platf_process_cbarg_t process)
     msg->data[msg->used-3]='\0';
     xbt_die("%s", msg->data);
   }
-  xbt_main_func_t parse_code = SIMIX_get_registered_function(process->function);
-  xbt_assert(parse_code, "Function '%s' unknown", process->function);
+  simgrid::simix::ActorCodeFactory& factory = SIMIX_get_actor_code_factory(process->function);
+  xbt_assert(factory, "Function '%s' unknown", process->function);
 
   double start_time = process->start_time;
   double kill_time  = process->kill_time;
   int auto_restart = process->on_failure == SURF_PROCESS_ON_FAILURE_DIE ? 0 : 1;
 
-  std::function<void()> code = simgrid::xbt::wrapMain(parse_code, process->argc, process->argv);
+  std::vector<std::string> args(process->argv, process->argv + process->argc);
+  std::function<void()> code = factory(std::move(args));
 
   smx_process_arg_t arg = nullptr;
   smx_process_t process_created = nullptr;