Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[simix] Use simgrid::simix::args in MSG
[simgrid.git] / src / msg / msg_process.cpp
index 51b7929..e871197 100644 (file)
@@ -40,7 +40,7 @@ void MSG_process_cleanup_from_SIMIX(smx_process_t smx_proc)
     simcall_process_set_data(smx_proc, NULL);
   }
 
-  TRACE_msg_process_destroy(smx_proc->name, smx_proc->pid);
+  TRACE_msg_process_destroy(smx_proc->name.c_str(), smx_proc->pid);
   // free the data if a function was provided
   if (msg_proc && msg_proc->data && msg_global->process_data_cleanup) {
     msg_global->process_data_cleanup(msg_proc->data);
@@ -53,11 +53,12 @@ void MSG_process_cleanup_from_SIMIX(smx_process_t smx_proc)
 
 /* This function creates a MSG process. It has the prototype enforced by SIMIX_function_register_process_create */
 smx_process_t MSG_process_create_from_SIMIX(const char *name, xbt_main_func_t code, void *data, const char *hostname,
-                                            double kill_time, int argc, char **argv, xbt_dict_t properties,
+                                            double kill_time, simgrid::simix::args args, xbt_dict_t properties,
                                             int auto_restart, smx_process_t parent_process)
 {
   msg_host_t host = MSG_host_by_name(hostname);
-  msg_process_t p = MSG_process_create_with_environment(name, code, data, host, argc, argv, properties);
+  msg_process_t p = MSG_process_create_with_environment(
+    name, code, data, host, args.argc(), args.to_argv(), properties);
   if (p) {
     MSG_process_set_kill_time(p,kill_time);
     MSG_process_auto_restart_set(p,auto_restart);
@@ -135,8 +136,6 @@ msg_process_t MSG_process_create_with_environment(const char *name, xbt_main_fun
   simdata->waiting_action = NULL;
   simdata->waiting_task = NULL;
   simdata->m_host = host;
-  simdata->argc = argc;
-  simdata->argv = argv;
   simdata->data = data;
   simdata->last_errno = MSG_OK;
 
@@ -178,8 +177,6 @@ msg_process_t MSG_process_attach(const char *name, void *data, msg_host_t host,
   simdata->waiting_action = NULL;
   simdata->waiting_task = NULL;
   simdata->m_host = host;
-  simdata->argc = 0;
-  simdata->argv = NULL;
   simdata->data = data;
   simdata->last_errno = MSG_OK;