Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove function SIMIX_process_create_with_parent.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Mon, 10 Mar 2014 12:07:44 +0000 (13:07 +0100)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Mon, 10 Mar 2014 15:25:46 +0000 (16:25 +0100)
Add the parameter parent_process to SIMIX_process_create.

include/simgrid/simix.h
src/msg/msg_private.h
src/msg/msg_process.c
src/simix/smx_deployment.c
src/simix/smx_host.c
src/simix/smx_process.c
src/simix/smx_process_private.h

index 623f761..da13e26 100644 (file)
@@ -110,7 +110,8 @@ typedef void (*smx_creation_func_t) ( /* process */ smx_process_t*,
                                       /* argc */ int,
                                       /* argv */ char**,
                                       /* props */ xbt_dict_t,
-                                      /* auto_restart */ int);
+                                      /* auto_restart */ int,
+                                      /* parent_process */ smx_process_t);
 
 
 /******************************* Networking ***********************************/
index 1d2eb8f..5644882 100644 (file)
@@ -146,8 +146,10 @@ void __MSG_file_destroy(msg_file_priv_t host);
 void MSG_process_cleanup_from_SIMIX(smx_process_t smx_proc);
 void MSG_process_create_from_SIMIX(smx_process_t *process, const char *name,
                                    xbt_main_func_t code, void *data,
-                                   const char *hostname, double kill_time,  int argc,
-                                   char **argv, xbt_dict_t properties, int auto_restart);
+                                   const char *hostname, double kill_time,
+                                   int argc, char **argv,
+                                   xbt_dict_t properties, int auto_restart,
+                                   smx_process_t parent_process);
 void MSG_comm_copy_data_from_SIMIX(smx_action_t comm, void* buff, size_t buff_size);
 
 void _MSG_action_init(void);
index 6fbe364..6a64e9d 100644 (file)
@@ -56,9 +56,11 @@ 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 */
 void MSG_process_create_from_SIMIX(smx_process_t* process, const char *name,
-                                    xbt_main_func_t code, void *data,
-                                    const char *hostname, double kill_time, int argc, char **argv,
-                                    xbt_dict_t properties, int auto_restart)
+                                   xbt_main_func_t code, void *data,
+                                   const char *hostname, double kill_time,
+                                   int argc, char **argv,
+                                   xbt_dict_t properties, int auto_restart,
+                                   smx_process_t parent_process)
 {
   msg_host_t host = MSG_get_host_by_name(hostname);
   msg_process_t p = MSG_process_create_with_environment(name, code, data,
index 894de3c..d1fcee1 100644 (file)
@@ -80,7 +80,7 @@ static void parse_process(sg_platf_process_cbarg_t process)
                                             process->argc,
                                             (char**)(process->argv),
                                             current_property_set,
-                                            auto_restart);
+                                            auto_restart, NULL);
     else
       simcall_process_create(&process_created, (char*)(process->argv)[0], parse_code, NULL, sg_host_name(host), kill_time, process->argc,
           (char**)process->argv, current_property_set,auto_restart);
index 40f3c73..0ee1ee8 100644 (file)
@@ -53,7 +53,7 @@ void SIMIX_host_on(smx_host_t h)
   xbt_assert((host != NULL), "Invalid parameters");
 
   if (surf_resource_get_state(surf_workstation_resource_priv(h))==SURF_RESOURCE_OFF) {
-       surf_resource_set_state(surf_workstation_resource_priv(h), SURF_RESOURCE_ON);
+    surf_resource_set_state(surf_workstation_resource_priv(h), SURF_RESOURCE_ON);
     unsigned int cpt;
     smx_process_arg_t arg;
     xbt_dynar_foreach(host->boot_processes,cpt,arg) {
@@ -70,19 +70,19 @@ void SIMIX_host_on(smx_host_t h)
                                               arg->argc,
                                               arg->argv,
                                               arg->properties,
-                                              arg->auto_restart);
-      }
-      else {
+                                              arg->auto_restart,
+                                              NULL);
+      else {
         simcall_process_create(&process,
-                                              arg->argv[0],
-                                              arg->code,
-                                              NULL,
-                                              arg->hostname,
-                                              arg->kill_time,
-                                              arg->argc,
-                                              arg->argv,
-                                              arg->properties,
-                                              arg->auto_restart);
+                               arg->argv[0],
+                               arg->code,
+                               NULL,
+                               arg->hostname,
+                               arg->kill_time,
+                               arg->argc,
+                               arg->argv,
+                               arg->properties,
+                               arg->auto_restart);
       }
     }
   }
@@ -391,7 +391,8 @@ void SIMIX_host_restart_processes(smx_host_t host)
                                             arg->argc,
                                             arg->argv,
                                             arg->properties,
-                                            arg->auto_restart);
+                                            arg->auto_restart,
+                                            NULL);
     } else {
       simcall_process_create(&process,
                              arg->argv[0],
index 205d5b4..0fadb63 100644 (file)
@@ -179,17 +179,17 @@ void SIMIX_process_stop(smx_process_t arg) {
 smx_process_t SIMIX_process_create_from_wrapper(smx_process_arg_t args) {
 
   smx_process_t process;
-  simix_global->create_process_function(
-      &process,
-      args->name,
-      args->code,
-      args->data,
-      args->hostname,
-      args->kill_time,
-      args->argc,
-      args->argv,
-      args->properties,
-      args->auto_restart);
+  simix_global->create_process_function(&process,
+                                        args->name,
+                                        args->code,
+                                        args->data,
+                                        args->hostname,
+                                        args->kill_time,
+                                        args->argc,
+                                        args->argv,
+                                        args->properties,
+                                        args->auto_restart,
+                                        NULL);
   xbt_free(args);
   return process;
 }
@@ -205,9 +205,9 @@ void SIMIX_pre_process_create(smx_simcall_t simcall,
                           int argc, char **argv,
                           xbt_dict_t properties,
                           int auto_restart){
-  SIMIX_process_create_with_parent(process, name, code, data, hostname,
-                              kill_time, argc, argv, properties, auto_restart,
-                              simcall->issuer);
+  SIMIX_process_create(process, name, code, data, hostname,
+                       kill_time, argc, argv, properties, auto_restart,
+                       simcall->issuer);
 }
 /**
  * \brief Internal function to create a process.
@@ -226,21 +226,9 @@ void SIMIX_process_create(smx_process_t *process,
                           double kill_time,
                           int argc, char **argv,
                           xbt_dict_t properties,
-                          int auto_restart) {
-  SIMIX_process_create_with_parent(process, name, code, data, hostname,
-                                   kill_time, argc, argv, properties, auto_restart, NULL);
-}
-
-void SIMIX_process_create_with_parent(smx_process_t *process,
-                                 const char *name,
-                                 xbt_main_func_t code,
-                                 void *data,
-                                 const char *hostname,
-                                 double kill_time,
-                                 int argc, char **argv,
-                                 xbt_dict_t properties,
-                                 int auto_restart,
-                                 smx_process_t parent_process) {
+                          int auto_restart,
+                          smx_process_t parent_process)
+{
   *process = NULL;
   smx_host_t host = SIMIX_host_get_by_name(hostname);
 
@@ -956,19 +944,19 @@ smx_process_t SIMIX_process_restart(smx_process_t process, smx_process_t issuer)
                                           arg.argc,
                                           arg.argv,
                                           arg.properties,
-                                          arg.auto_restart);
-  }
-  else {
+                                          arg.auto_restart,
+                                          NULL);
+  else {
     simcall_process_create(&new_process,
-                                          arg.argv[0],
-                                          arg.code,
-                                          arg.data,
-                                          arg.hostname,
-                                          arg.kill_time,
-                                          arg.argc,
-                                          arg.argv,
-                                          arg.properties,
-                                          arg.auto_restart);
+                           arg.argv[0],
+                           arg.code,
+                           arg.data,
+                           arg.hostname,
+                           arg.kill_time,
+                           arg.argc,
+                           arg.argv,
+                           arg.properties,
+                           arg.auto_restart);
 
   }
   return new_process;
index 0d24943..eb269f9 100644 (file)
@@ -70,17 +70,8 @@ void SIMIX_process_create(smx_process_t *process,
                           double kill_time,
                           int argc, char **argv,
                           xbt_dict_t properties,
-                          int auto_restart);
-void SIMIX_process_create_with_parent(smx_process_t *process,
-                                 const char *name,
-                                 xbt_main_func_t code,
-                                 void *data,
-                                 const char *hostname,
-                                 double kill_time,
-                                 int argc, char **argv,
-                                 xbt_dict_t properties,
-                                 int auto_restart,
-                                 smx_process_t parent_process);
+                          int auto_restart,
+                          smx_process_t parent_process);
 void SIMIX_process_runall(void);
 void SIMIX_process_kill(smx_process_t process, smx_process_t issuer);
 void SIMIX_process_killall(smx_process_t issuer, int reset_pid);