Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
rename simcall process_change_host -> process_set_host
authorMartin Quinson <martin.quinson@loria.fr>
Sun, 9 Aug 2015 17:48:43 +0000 (19:48 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Sun, 9 Aug 2015 17:48:43 +0000 (19:48 +0200)
include/simgrid/simix.h
src/msg/msg_process.c
src/simix/libsmx.c
src/simix/popping_accessors.h
src/simix/popping_bodies.c
src/simix/popping_enum.h
src/simix/popping_generated.c
src/simix/simcalls.in
src/simix/smx_process.c

index 9380343..d79ac02 100644 (file)
@@ -379,8 +379,6 @@ XBT_PUBLIC(void) SIMIX_process_throw(smx_process_t process, xbt_errcat_t cat, in
 
 /* Process handling */
 XBT_PUBLIC(void) simcall_process_cleanup(smx_process_t process);
-XBT_PUBLIC(void) simcall_process_change_host(smx_process_t process,
-                 sg_host_t dest);
 XBT_PUBLIC(void) simcall_process_suspend(smx_process_t process);
 XBT_PUBLIC(void) simcall_process_resume(smx_process_t process);
 
@@ -388,6 +386,7 @@ XBT_PUBLIC(void) simcall_process_resume(smx_process_t process);
 XBT_PUBLIC(int) simcall_process_count(void);
 XBT_PUBLIC(void *) simcall_process_get_data(smx_process_t process);
 XBT_PUBLIC(void) simcall_process_set_data(smx_process_t process, void *data);
+XBT_PUBLIC(void) simcall_process_set_host(smx_process_t process, sg_host_t dest);
 XBT_PUBLIC(sg_host_t) simcall_process_get_host(smx_process_t process);
 XBT_PUBLIC(const char *) simcall_process_get_name(smx_process_t process);
 XBT_PUBLIC(int) simcall_process_get_PID(smx_process_t process);
index 257ff1e..3398548 100644 (file)
@@ -223,7 +223,7 @@ msg_error_t MSG_process_migrate(msg_process_t process, msg_host_t host)
   simdata->m_host = host;
   msg_host_t now = simdata->m_host;
   TRACE_msg_process_change_host(process, now, host);
-  simcall_process_change_host(process, host);
+  simcall_process_set_host(process, host);
   return MSG_OK;
 }
 
index 8a9a196..bd862a3 100644 (file)
@@ -636,9 +636,9 @@ void simcall_process_cleanup(smx_process_t process)
  * \param process the process to migrate
  * \param dest name of the new host
  */
-void simcall_process_change_host(smx_process_t process, sg_host_t dest)
+void simcall_process_set_host(smx_process_t process, sg_host_t dest)
 {
-  simcall_BODY_process_change_host(process, dest);
+  simcall_BODY_process_set_host(process, dest);
 }
 
 void simcall_process_join(smx_process_t process, double timeout)
index b2aaa30..253b120 100644 (file)
@@ -533,19 +533,6 @@ static inline void simcall_process_cleanup__set__process(smx_simcall_t simcall,
     simcall->args[0].dp = arg;
 }
 
-static inline smx_process_t simcall_process_change_host__get__process(smx_simcall_t simcall) {
-  return (smx_process_t) simcall->args[0].dp;
-}
-static inline void simcall_process_change_host__set__process(smx_simcall_t simcall, void* arg) {
-    simcall->args[0].dp = arg;
-}
-static inline sg_host_t simcall_process_change_host__get__dest(smx_simcall_t simcall) {
-  return (sg_host_t) simcall->args[1].dp;
-}
-static inline void simcall_process_change_host__set__dest(smx_simcall_t simcall, void* arg) {
-    simcall->args[1].dp = arg;
-}
-
 static inline smx_process_t simcall_process_suspend__get__process(smx_simcall_t simcall) {
   return (smx_process_t) simcall->args[0].dp;
 }
@@ -619,6 +606,19 @@ static inline void simcall_process_set_data__set__data(smx_simcall_t simcall, vo
     simcall->args[1].dp = arg;
 }
 
+static inline smx_process_t simcall_process_set_host__get__process(smx_simcall_t simcall) {
+  return (smx_process_t) simcall->args[0].dp;
+}
+static inline void simcall_process_set_host__set__process(smx_simcall_t simcall, void* arg) {
+    simcall->args[0].dp = arg;
+}
+static inline sg_host_t simcall_process_set_host__get__dest(smx_simcall_t simcall) {
+  return (sg_host_t) simcall->args[1].dp;
+}
+static inline void simcall_process_set_host__set__dest(smx_simcall_t simcall, void* arg) {
+    simcall->args[1].dp = arg;
+}
+
 static inline smx_process_t simcall_process_get_host__get__process(smx_simcall_t simcall) {
   return (smx_process_t) simcall->args[0].dp;
 }
@@ -1939,9 +1939,9 @@ void simcall_HANDLER_vm_restore(smx_simcall_t simcall, sg_host_t ind_vm);
 void* simcall_HANDLER_process_create(smx_simcall_t simcall, 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);
 void simcall_HANDLER_process_kill(smx_simcall_t simcall, smx_process_t process);
 void simcall_HANDLER_process_killall(smx_simcall_t simcall, int reset_pid);
-void simcall_HANDLER_process_change_host(smx_simcall_t simcall, smx_process_t process, sg_host_t dest);
 void simcall_HANDLER_process_suspend(smx_simcall_t simcall, smx_process_t process);
 void simcall_HANDLER_process_resume(smx_simcall_t simcall, smx_process_t process);
+void simcall_HANDLER_process_set_host(smx_simcall_t simcall, smx_process_t process, sg_host_t dest);
 void simcall_HANDLER_process_join(smx_simcall_t simcall, smx_process_t process, double timeout);
 void simcall_HANDLER_process_sleep(smx_simcall_t simcall, double duration);
 smx_synchro_t simcall_HANDLER_process_execute(smx_simcall_t simcall, const char* name, double flops_amount, double priority, double bound, unsigned long affinity_mask);
index b808841..817100d 100644 (file)
@@ -857,28 +857,6 @@ inline static void simcall_BODY_process_cleanup(smx_process_t process) {
     
   }
   
-inline static void simcall_BODY_process_change_host(smx_process_t process, sg_host_t dest) {
-    smx_process_t self = SIMIX_process_self();
-
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) simcall_HANDLER_process_change_host(&self->simcall, process, dest);
-    /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
-
-    self->simcall.call = SIMCALL_PROCESS_CHANGE_HOST;
-    memset(&self->simcall.result, 0, sizeof(self->simcall.result));
-    memset(self->simcall.args, 0, sizeof(self->simcall.args));
-    self->simcall.args[0].dp = (void*) process;
-    self->simcall.args[1].dp = (void*) dest;
-    if (self != simix_global->maestro_process) {
-      XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
-                SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
-      SIMIX_process_yield(self);
-    } else {
-      SIMIX_simcall_handle(&self->simcall, 0);
-    }    
-    
-  }
-  
 inline static void simcall_BODY_process_suspend(smx_process_t process) {
     smx_process_t self = SIMIX_process_self();
 
@@ -1027,6 +1005,28 @@ inline static void simcall_BODY_process_set_data(smx_process_t process, void* da
     
   }
   
+inline static void simcall_BODY_process_set_host(smx_process_t process, sg_host_t dest) {
+    smx_process_t self = SIMIX_process_self();
+
+    /* Go to that function to follow the code flow through the simcall barrier */
+    if (0) simcall_HANDLER_process_set_host(&self->simcall, process, dest);
+    /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
+
+    self->simcall.call = SIMCALL_PROCESS_SET_HOST;
+    memset(&self->simcall.result, 0, sizeof(self->simcall.result));
+    memset(self->simcall.args, 0, sizeof(self->simcall.args));
+    self->simcall.args[0].dp = (void*) process;
+    self->simcall.args[1].dp = (void*) dest;
+    if (self != simix_global->maestro_process) {
+      XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
+                SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
+      SIMIX_process_yield(self);
+    } else {
+      SIMIX_simcall_handle(&self->simcall, 0);
+    }    
+    
+  }
+  
 inline static sg_host_t simcall_BODY_process_get_host(smx_process_t process) {
     smx_process_t self = SIMIX_process_self();
 
index 7396184..f0519f2 100644 (file)
@@ -57,7 +57,6 @@ typedef enum {
   SIMCALL_PROCESS_KILL,
   SIMCALL_PROCESS_KILLALL,
   SIMCALL_PROCESS_CLEANUP,
-  SIMCALL_PROCESS_CHANGE_HOST,
   SIMCALL_PROCESS_SUSPEND,
   SIMCALL_PROCESS_RESUME,
   SIMCALL_PROCESS_COUNT,
@@ -65,6 +64,7 @@ typedef enum {
   SIMCALL_PROCESS_GET_PPID,
   SIMCALL_PROCESS_GET_DATA,
   SIMCALL_PROCESS_SET_DATA,
+  SIMCALL_PROCESS_SET_HOST,
   SIMCALL_PROCESS_GET_HOST,
   SIMCALL_PROCESS_GET_NAME,
   SIMCALL_PROCESS_IS_SUSPENDED,
index a2d70ab..24b9f74 100644 (file)
@@ -61,7 +61,6 @@ const char* simcall_names[] = {
   [SIMCALL_PROCESS_KILL] = "SIMCALL_PROCESS_KILL",
   [SIMCALL_PROCESS_KILLALL] = "SIMCALL_PROCESS_KILLALL",
   [SIMCALL_PROCESS_CLEANUP] = "SIMCALL_PROCESS_CLEANUP",
-  [SIMCALL_PROCESS_CHANGE_HOST] = "SIMCALL_PROCESS_CHANGE_HOST",
   [SIMCALL_PROCESS_SUSPEND] = "SIMCALL_PROCESS_SUSPEND",
   [SIMCALL_PROCESS_RESUME] = "SIMCALL_PROCESS_RESUME",
   [SIMCALL_PROCESS_COUNT] = "SIMCALL_PROCESS_COUNT",
@@ -69,6 +68,7 @@ const char* simcall_names[] = {
   [SIMCALL_PROCESS_GET_PPID] = "SIMCALL_PROCESS_GET_PPID",
   [SIMCALL_PROCESS_GET_DATA] = "SIMCALL_PROCESS_GET_DATA",
   [SIMCALL_PROCESS_SET_DATA] = "SIMCALL_PROCESS_SET_DATA",
+  [SIMCALL_PROCESS_SET_HOST] = "SIMCALL_PROCESS_SET_HOST",
   [SIMCALL_PROCESS_GET_HOST] = "SIMCALL_PROCESS_GET_HOST",
   [SIMCALL_PROCESS_GET_NAME] = "SIMCALL_PROCESS_GET_NAME",
   [SIMCALL_PROCESS_IS_SUSPENDED] = "SIMCALL_PROCESS_IS_SUSPENDED",
@@ -362,11 +362,6 @@ case SIMCALL_PROCESS_CLEANUP:
       SIMIX_simcall_answer(simcall);
       break;  
 
-case SIMCALL_PROCESS_CHANGE_HOST:
-       simcall_HANDLER_process_change_host(simcall , (smx_process_t) simcall->args[0].dp, (sg_host_t) simcall->args[1].dp);
-      SIMIX_simcall_answer(simcall);
-      break;  
-
 case SIMCALL_PROCESS_SUSPEND:
        simcall_HANDLER_process_suspend(simcall , (smx_process_t) simcall->args[0].dp);
        break;  
@@ -401,6 +396,11 @@ case SIMCALL_PROCESS_SET_DATA:
       SIMIX_simcall_answer(simcall);
       break;  
 
+case SIMCALL_PROCESS_SET_HOST:
+       simcall_HANDLER_process_set_host(simcall , (smx_process_t) simcall->args[0].dp, (sg_host_t) simcall->args[1].dp);
+      SIMIX_simcall_answer(simcall);
+      break;  
+
 case SIMCALL_PROCESS_GET_HOST:
       simcall->result.dp = SIMIX_process_get_host((smx_process_t) simcall->args[0].dp);
       SIMIX_simcall_answer(simcall);
index 6d44227..5a412c9 100644 (file)
@@ -86,7 +86,6 @@ Func H process_create (void*) (name, const char*) (code, FPtr, xbt_main_func_t)
 Proc H process_kill (void) (process, void*, smx_process_t)
 Proc H process_killall (void) (reset_pid, int)
 Proc - process_cleanup (void) (process, void*, smx_process_t)
-Proc H process_change_host (void) (process, void*, smx_process_t) (dest, void*, sg_host_t)
 Blck H process_suspend (void) (process, void*, smx_process_t)
 Proc H process_resume (void) (process, void*, smx_process_t)
 Func - process_count (int)
@@ -94,6 +93,7 @@ Func - process_get_PID (int) (process, void*, smx_process_t)
 Func - process_get_PPID (int) (process, void*, smx_process_t)
 Func - process_get_data (void*) (process, void*, smx_process_t)
 Proc - process_set_data (void) (process, void*, smx_process_t) (data, void*)
+Proc H process_set_host (void) (process, void*, smx_process_t) (dest, void*, sg_host_t)
 Func - process_get_host (void*, sg_host_t) (process, void*, smx_process_t)
 Func - process_get_name (const char*) (process, void*, smx_process_t)
 Func - process_is_suspended (int) (process, void*, smx_process_t)
index daee261..bc1a052 100644 (file)
@@ -461,8 +461,7 @@ void SIMIX_process_killall(smx_process_t issuer, int reset_pid)
   SIMIX_process_empty_trash();
 }
 
-void simcall_HANDLER_process_change_host(smx_simcall_t simcall, smx_process_t process,
-                                  sg_host_t dest)
+void simcall_HANDLER_process_set_host(smx_simcall_t simcall, smx_process_t process, sg_host_t dest)
 {
   process->new_host = dest;
 }