From: Martin Quinson Date: Sun, 9 Aug 2015 17:48:43 +0000 (+0200) Subject: rename simcall process_change_host -> process_set_host X-Git-Tag: v3_12~313 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/078c6c2a470a459348df3c6e802fecaaad34948f rename simcall process_change_host -> process_set_host --- diff --git a/include/simgrid/simix.h b/include/simgrid/simix.h index 938034390f..d79ac02a99 100644 --- a/include/simgrid/simix.h +++ b/include/simgrid/simix.h @@ -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); diff --git a/src/msg/msg_process.c b/src/msg/msg_process.c index 257ff1e8f6..339854884c 100644 --- a/src/msg/msg_process.c +++ b/src/msg/msg_process.c @@ -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; } diff --git a/src/simix/libsmx.c b/src/simix/libsmx.c index 8a9a196129..bd862a37f3 100644 --- a/src/simix/libsmx.c +++ b/src/simix/libsmx.c @@ -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) diff --git a/src/simix/popping_accessors.h b/src/simix/popping_accessors.h index b2aaa30fb0..253b120b90 100644 --- a/src/simix/popping_accessors.h +++ b/src/simix/popping_accessors.h @@ -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); diff --git a/src/simix/popping_bodies.c b/src/simix/popping_bodies.c index b808841645..817100de37 100644 --- a/src/simix/popping_bodies.c +++ b/src/simix/popping_bodies.c @@ -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(); diff --git a/src/simix/popping_enum.h b/src/simix/popping_enum.h index 739618414c..f0519f2a1d 100644 --- a/src/simix/popping_enum.h +++ b/src/simix/popping_enum.h @@ -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, diff --git a/src/simix/popping_generated.c b/src/simix/popping_generated.c index a2d70ab609..24b9f74b75 100644 --- a/src/simix/popping_generated.c +++ b/src/simix/popping_generated.c @@ -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); diff --git a/src/simix/simcalls.in b/src/simix/simcalls.in index 6d442278ff..5a412c9396 100644 --- a/src/simix/simcalls.in +++ b/src/simix/simcalls.in @@ -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) diff --git a/src/simix/smx_process.c b/src/simix/smx_process.c index daee2615fd..bc1a0528d6 100644 --- a/src/simix/smx_process.c +++ b/src/simix/smx_process.c @@ -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; }