From df12bbc75c274351f3b3a628740e0b3270f08e18 Mon Sep 17 00:00:00 2001 From: Samuel Lepetit Date: Fri, 29 Jun 2012 11:26:47 +0200 Subject: [PATCH] Use msg_host_t instead of m_host_t. --- .../msg/cloud/masterslave_virtual_machines.c | 6 +- examples/msg/io/file.c | 2 +- examples/msg/masterslave/masterslave_arg.c | 2 +- examples/msg/masterslave/masterslave_bypass.c | 4 +- .../msg/masterslave/masterslave_cluster.c | 4 +- .../msg/masterslave/masterslave_failure.c | 4 +- .../msg/masterslave/masterslave_forwarder.c | 8 +-- examples/msg/migration/migration.c | 2 +- examples/msg/parallel_task/parallel_task.c | 6 +- examples/msg/parallel_task/test_ptask.c | 8 +-- examples/msg/properties/msg_prop.c | 2 +- examples/msg/sendrecv/sendrecv.c | 4 +- examples/msg/token_ring/ring_call.c | 2 +- include/msg/datatypes.h | 7 +- include/msg/msg.h | 64 +++++++++---------- src/bindings/lua/lua_host.c | 24 +++---- src/bindings/lua/lua_platf.c | 4 +- src/bindings/lua/lua_private.h | 2 +- src/instr/instr_msg_process.c | 4 +- src/instr/instr_private.h | 6 +- src/msg/msg_gos.c | 22 +++---- src/msg/msg_host.c | 50 +++++++-------- src/msg/msg_mailbox.c | 6 +- src/msg/msg_mailbox.h | 4 +- src/msg/msg_private.h | 14 ++-- src/msg/msg_process.c | 18 +++--- src/msg/msg_task.c | 8 +-- src/msg/msg_vm.c | 4 +- teshsuite/simdag/platforms/basic_tracing.c | 4 +- 29 files changed, 148 insertions(+), 147 deletions(-) diff --git a/examples/msg/cloud/masterslave_virtual_machines.c b/examples/msg/cloud/masterslave_virtual_machines.c index 1bc53a2d77..48a81d72b0 100644 --- a/examples/msg/cloud/masterslave_virtual_machines.c +++ b/examples/msg/cloud/masterslave_virtual_machines.c @@ -43,7 +43,7 @@ static void work_batch(int slaves_count) { int master(int argc, char *argv[]) { int slaves_count = 10; - m_host_t *slaves = xbt_new(m_host_t,10); + msg_host_t *slaves = xbt_new(msg_host_t,10); int i; @@ -170,7 +170,7 @@ int main(int argc, char *argv[]) { MSG_error_t res = MSG_OK; xbt_dynar_t hosts_dynar; - m_host_t*hosts= xbt_new(m_host_t,10); + msg_host_t*hosts= xbt_new(msg_host_t,10); char**hostnames= xbt_new(char*,10); char**masterargv=xbt_new(char*,12); int i; @@ -194,7 +194,7 @@ int main(int argc, char *argv[]) "I need at least 10 hosts in the platform file, but %s contains only %ld hosts_dynar.", argv[1],xbt_dynar_length(hosts_dynar)); for (i=0;i<10;i++) { - hosts[i] = xbt_dynar_get_as(hosts_dynar,i,m_host_t); + hosts[i] = xbt_dynar_get_as(hosts_dynar,i,msg_host_t); hostnames[i] = xbt_strdup(MSG_host_get_name(hosts[i])); } masterargv[0]=xbt_strdup("master"); diff --git a/examples/msg/io/file.c b/examples/msg/io/file.c index 21c1b836ce..cdcf90116d 100644 --- a/examples/msg/io/file.c +++ b/examples/msg/io/file.c @@ -81,7 +81,7 @@ int main(int argc, char **argv) for(i = 0 ; iprivate data that can be only accessed by local process. */ -typedef struct m_host *m_host_t; +typedef struct msg_host *msg_host_t; /* ******************************** Task ************************************ */ @@ -143,6 +143,7 @@ typedef struct s_smx_process *msg_process_t; /* Compatibility typedefs */ typedef msg_process_t m_process_t; +typedef msg_host_t m_host_t; #ifdef MSG_USE_DEPRECATED typedef int m_channel_t; diff --git a/include/msg/msg.h b/include/msg/msg.h index c0b5c6ccd0..3fb95bab17 100644 --- a/include/msg/msg.h +++ b/include/msg/msg.h @@ -81,21 +81,21 @@ XBT_PUBLIC(int) MSG_file_stat(msg_file_t fd, s_msg_stat_t *buf); /************************** Host handling ***********************************/ -XBT_PUBLIC(MSG_error_t) MSG_host_set_data(m_host_t host, void *data); -XBT_PUBLIC(void *) MSG_host_get_data(m_host_t host); -XBT_PUBLIC(const char *) MSG_host_get_name(m_host_t host); -XBT_PUBLIC(m_host_t) MSG_host_self(void); -XBT_PUBLIC(int) MSG_get_host_msgload(m_host_t host); +XBT_PUBLIC(MSG_error_t) MSG_host_set_data(msg_host_t host, void *data); +XBT_PUBLIC(void *) MSG_host_get_data(msg_host_t host); +XBT_PUBLIC(const char *) MSG_host_get_name(msg_host_t host); +XBT_PUBLIC(msg_host_t) MSG_host_self(void); +XBT_PUBLIC(int) MSG_get_host_msgload(msg_host_t host); /* int MSG_get_msgload(void); This function lacks specification; discard it */ -XBT_PUBLIC(double) MSG_get_host_speed(m_host_t h); -XBT_PUBLIC(int) MSG_host_is_avail(m_host_t h); -XBT_PUBLIC(void) __MSG_host_destroy(m_host_t host); +XBT_PUBLIC(double) MSG_get_host_speed(msg_host_t h); +XBT_PUBLIC(int) MSG_host_is_avail(msg_host_t h); +XBT_PUBLIC(void) __MSG_host_destroy(msg_host_t host); /*property handlers*/ -XBT_PUBLIC(xbt_dict_t) MSG_host_get_properties(m_host_t host); -XBT_PUBLIC(const char *) MSG_host_get_property_value(m_host_t host, +XBT_PUBLIC(xbt_dict_t) MSG_host_get_properties(msg_host_t host); +XBT_PUBLIC(const char *) MSG_host_get_property_value(msg_host_t host, const char *name); -XBT_PUBLIC(void) MSG_host_set_property_value(m_host_t host, +XBT_PUBLIC(void) MSG_host_set_property_value(msg_host_t host, const char *name, char *value, void_f_pvoid_t free_ctn); @@ -103,17 +103,17 @@ XBT_PUBLIC(void) MSG_host_set_property_value(m_host_t host, XBT_PUBLIC(void) MSG_create_environment(const char *file); XBT_PUBLIC(void) MSG_load_platform_script(const char *script_file); -XBT_PUBLIC(m_host_t) MSG_get_host_by_name(const char *name); +XBT_PUBLIC(msg_host_t) MSG_get_host_by_name(const char *name); XBT_PUBLIC(xbt_dynar_t) MSG_hosts_as_dynar(void); /************************** Process handling *********************************/ XBT_PUBLIC(msg_process_t) MSG_process_create(const char *name, xbt_main_func_t code, - void *data, m_host_t host); + void *data, msg_host_t host); XBT_PUBLIC(msg_process_t) MSG_process_create_with_arguments(const char *name, xbt_main_func_t code, void *data, - m_host_t host, + msg_host_t host, int argc, char **argv); XBT_PUBLIC(msg_process_t) MSG_process_create_with_environment(const char @@ -121,7 +121,7 @@ XBT_PUBLIC(msg_process_t) MSG_process_create_with_environment(const char xbt_main_func_t code, void *data, - m_host_t host, + msg_host_t host, int argc, char **argv, xbt_dict_t @@ -129,13 +129,13 @@ XBT_PUBLIC(msg_process_t) MSG_process_create_with_environment(const char XBT_PUBLIC(void) MSG_process_kill(msg_process_t process); XBT_PUBLIC(int) MSG_process_killall(int reset_PIDs); -XBT_PUBLIC(MSG_error_t) MSG_process_migrate(msg_process_t process, m_host_t host); +XBT_PUBLIC(MSG_error_t) MSG_process_migrate(msg_process_t process, msg_host_t host); XBT_PUBLIC(void *) MSG_process_get_data(msg_process_t process); XBT_PUBLIC(MSG_error_t) MSG_process_set_data(msg_process_t process, void *data); XBT_PUBLIC(void) MSG_process_set_data_cleanup(void_f_pvoid_t data_cleanup); -XBT_PUBLIC(m_host_t) MSG_process_get_host(msg_process_t process); +XBT_PUBLIC(msg_host_t) MSG_process_get_host(msg_process_t process); XBT_PUBLIC(msg_process_t) MSG_process_from_PID(int PID); XBT_PUBLIC(int) MSG_process_get_PID(msg_process_t process); XBT_PUBLIC(int) MSG_process_get_PPID(msg_process_t process); @@ -168,7 +168,7 @@ XBT_PUBLIC(m_gpu_task_t) MSG_gpu_task_create(const char *name, double collect_latency); XBT_PUBLIC(m_task_t) MSG_parallel_task_create(const char *name, int host_nb, - const m_host_t * host_list, + const msg_host_t * host_list, double *computation_amount, double *communication_amount, void *data); @@ -177,14 +177,14 @@ XBT_PUBLIC(void) MSG_task_set_data(m_task_t task, void *data); XBT_PUBLIC(void) MSG_task_set_copy_callback(void (*callback) ( m_task_t task, msg_process_t src, msg_process_t dst)); XBT_PUBLIC(msg_process_t) MSG_task_get_sender(m_task_t task); -XBT_PUBLIC(m_host_t) MSG_task_get_source(m_task_t task); +XBT_PUBLIC(msg_host_t) MSG_task_get_source(m_task_t task); XBT_PUBLIC(const char *) MSG_task_get_name(m_task_t task); XBT_PUBLIC(void) MSG_task_set_name(m_task_t task, const char *name); XBT_PUBLIC(MSG_error_t) MSG_task_cancel(m_task_t task); XBT_PUBLIC(MSG_error_t) MSG_task_destroy(m_task_t task); XBT_PUBLIC(MSG_error_t) MSG_task_receive_from_host(m_task_t * task, const char *alias, - m_host_t host); + msg_host_t host); XBT_PUBLIC(MSG_error_t) MSG_task_execute(m_task_t task); XBT_PUBLIC(MSG_error_t) MSG_parallel_task_execute(m_task_t task); @@ -203,7 +203,7 @@ XBT_PUBLIC(double) MSG_task_get_data_size(m_task_t task); XBT_PUBLIC(MSG_error_t) MSG_task_receive_ext(m_task_t * task, const char *alias, double timeout, - m_host_t host); + msg_host_t host); XBT_PUBLIC(MSG_error_t) MSG_task_receive_with_timeout(m_task_t * task, const char *alias, @@ -234,7 +234,7 @@ XBT_PUBLIC(MSG_error_t) MSG_comm_get_status(msg_comm_t comm); XBT_PUBLIC(int) MSG_task_listen(const char *alias); XBT_PUBLIC(int) MSG_task_listen_from_host(const char *alias, - m_host_t host); + msg_host_t host); XBT_PUBLIC(MSG_error_t) MSG_task_send_with_timeout(m_task_t task, const char *alias, @@ -254,7 +254,7 @@ XBT_PUBLIC(const char *) MSG_task_get_category (m_task_t task); /************************** Task handling ************************************/ XBT_PUBLIC(MSG_error_t) MSG_mailbox_get_task_ext(msg_mailbox_t mailbox, m_task_t * task, - m_host_t host, double timeout); + msg_host_t host, double timeout); XBT_PUBLIC(MSG_error_t) MSG_mailbox_put_with_timeout(msg_mailbox_t mailbox, m_task_t task, @@ -269,7 +269,7 @@ MSG_error_t MSG_action_trace_run(char *path); /* these are the functions which are deprecated. Do not use them, they may get removed in future releases */ XBT_PUBLIC(int) MSG_get_host_number(void); -XBT_PUBLIC(m_host_t *) MSG_get_host_table(void); +XBT_PUBLIC(msg_host_t *) MSG_get_host_table(void); #define MSG_TIMEOUT_FAILURE MSG_TIMEOUT #define MSG_TASK_CANCELLED MSG_TASK_CANCELED @@ -284,23 +284,23 @@ XBT_PUBLIC(MSG_error_t) MSG_task_get_with_timeout(m_task_t * task, m_channel_t channel, double max_duration); XBT_PUBLIC(MSG_error_t) MSG_task_get_from_host(m_task_t * task, - int channel, m_host_t host); + int channel, msg_host_t host); XBT_PUBLIC(MSG_error_t) MSG_task_get_ext(m_task_t * task, int channel, double max_duration, - m_host_t host); -XBT_PUBLIC(MSG_error_t) MSG_task_put(m_task_t task, m_host_t dest, + msg_host_t host); +XBT_PUBLIC(MSG_error_t) MSG_task_put(m_task_t task, msg_host_t dest, m_channel_t channel); XBT_PUBLIC(MSG_error_t) MSG_task_put_bounded(m_task_t task, - m_host_t dest, + msg_host_t dest, m_channel_t channel, double max_rate); XBT_PUBLIC(MSG_error_t) MSG_task_put_with_timeout(m_task_t task, - m_host_t dest, + msg_host_t dest, m_channel_t channel, double max_duration); XBT_PUBLIC(int) MSG_task_Iprobe(m_channel_t channel); XBT_PUBLIC(int) MSG_task_probe_from(m_channel_t channel); -XBT_PUBLIC(int) MSG_task_probe_from_host(int channel, m_host_t host); +XBT_PUBLIC(int) MSG_task_probe_from_host(int channel, msg_host_t host); XBT_PUBLIC(MSG_error_t) MSG_set_channel_number(int number); XBT_PUBLIC(int) MSG_get_channel_number(void); @@ -318,7 +318,7 @@ XBT_PUBLIC(int) MSG_get_channel_number(void); */ typedef struct msg_vm *msg_vm_t; /* This function should not be called directly, but rather from MSG_vm_start_from_template that does not exist yet*/ -XBT_PUBLIC(msg_vm_t) MSG_vm_start(m_host_t location, int coreAmount); +XBT_PUBLIC(msg_vm_t) MSG_vm_start(msg_host_t location, int coreAmount); XBT_PUBLIC(int) MSG_vm_is_suspended(msg_vm_t); XBT_PUBLIC(int) MSG_vm_is_running(msg_vm_t); @@ -326,7 +326,7 @@ XBT_PUBLIC(int) MSG_vm_is_running(msg_vm_t); XBT_PUBLIC(void) MSG_vm_bind(msg_vm_t vm, msg_process_t process); XBT_PUBLIC(void) MSG_vm_unbind(msg_vm_t vm, msg_process_t process); // simple wrapper over process_kill -XBT_PUBLIC(void) MSG_vm_migrate(msg_vm_t vm, m_host_t destination); +XBT_PUBLIC(void) MSG_vm_migrate(msg_vm_t vm, msg_host_t destination); XBT_PUBLIC(void) MSG_vm_suspend(msg_vm_t vm); // \forall p in VM, MSG_process_suspend(p) // Freeze the processes diff --git a/src/bindings/lua/lua_host.c b/src/bindings/lua/lua_host.c index 133bcca68e..3090b4b141 100644 --- a/src/bindings/lua/lua_host.c +++ b/src/bindings/lua/lua_host.c @@ -23,12 +23,12 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(lua_host, bindings, "Lua bindings (host module)" * \param index an index in the Lua stack * \return the C host corresponding to this Lua host */ -m_host_t sglua_check_host(lua_State * L, int index) +msg_host_t sglua_check_host(lua_State * L, int index) { - m_host_t *pi, ht; + msg_host_t *pi, ht; luaL_checktype(L, index, LUA_TTABLE); lua_getfield(L, index, "__simgrid_host"); - pi = (m_host_t *) luaL_checkudata(L, lua_gettop(L), HOST_MODULE_NAME); + pi = (msg_host_t *) luaL_checkudata(L, lua_gettop(L), HOST_MODULE_NAME); if (pi == NULL) luaL_typerror(L, index, HOST_MODULE_NAME); ht = *pi; @@ -50,12 +50,12 @@ static int l_host_get_by_name(lua_State * L) { const char *name = luaL_checkstring(L, 1); XBT_DEBUG("Getting Host from name..."); - m_host_t msg_host = MSG_get_host_by_name(name); + msg_host_t msg_host = MSG_get_host_by_name(name); if (!msg_host) { luaL_error(L, "null Host : MSG_get_host_by_name failed"); } lua_newtable(L); /* create a table, put the userdata on top of it */ - m_host_t *lua_host = (m_host_t *) lua_newuserdata(L, sizeof(m_host_t)); + msg_host_t *lua_host = (msg_host_t *) lua_newuserdata(L, sizeof(msg_host_t)); *lua_host = msg_host; luaL_getmetatable(L, HOST_MODULE_NAME); lua_setmetatable(L, -2); @@ -75,7 +75,7 @@ static int l_host_get_by_name(lua_State * L) */ static int l_host_get_name(lua_State * L) { - m_host_t ht = sglua_check_host(L, 1); + msg_host_t ht = sglua_check_host(L, 1); lua_pushstring(L, MSG_host_get_name(ht)); return 1; } @@ -107,9 +107,9 @@ static int l_host_at(lua_State * L) { int index = luaL_checkinteger(L, 1); xbt_dynar_t hosts = MSG_hosts_as_dynar(); - m_host_t host = xbt_dynar_get_as(hosts,index - 1,m_host_t);// lua indexing start by 1 (lua[1] <=> C[0]) + msg_host_t host = xbt_dynar_get_as(hosts,index - 1,msg_host_t);// lua indexing start by 1 (lua[1] <=> C[0]) lua_newtable(L); /* create a table, put the userdata on top of it */ - m_host_t *lua_host = (m_host_t *) lua_newuserdata(L, sizeof(m_host_t)); + msg_host_t *lua_host = (msg_host_t *) lua_newuserdata(L, sizeof(msg_host_t)); *lua_host = host; luaL_getmetatable(L, HOST_MODULE_NAME); lua_setmetatable(L, -2); @@ -128,10 +128,10 @@ static int l_host_at(lua_State * L) static int l_host_self(lua_State * L) { /* -- */ - m_host_t host = MSG_host_self(); + msg_host_t host = MSG_host_self(); lua_newtable(L); /* table */ - m_host_t* lua_host = (m_host_t*) lua_newuserdata(L, sizeof(m_host_t)); + msg_host_t* lua_host = (msg_host_t*) lua_newuserdata(L, sizeof(msg_host_t)); /* table ud */ *lua_host = host; luaL_getmetatable(L, HOST_MODULE_NAME); @@ -154,7 +154,7 @@ static int l_host_self(lua_State * L) */ static int l_host_get_property_value(lua_State * L) { - m_host_t ht = sglua_check_host(L, 1); + msg_host_t ht = sglua_check_host(L, 1); const char *prop = luaL_checkstring(L, 2); lua_pushstring(L,MSG_host_get_property_value(ht,prop)); return 1; @@ -183,7 +183,7 @@ static int l_host_sleep(lua_State *L) */ static int l_host_destroy(lua_State *L) { - m_host_t ht = sglua_check_host(L, 1); + msg_host_t ht = sglua_check_host(L, 1); __MSG_host_destroy(ht); return 0; } diff --git a/src/bindings/lua/lua_platf.c b/src/bindings/lua/lua_platf.c index 15f54ee7ac..a2ebe1130b 100644 --- a/src/bindings/lua/lua_platf.c +++ b/src/bindings/lua/lua_platf.c @@ -375,7 +375,7 @@ int console_set_function(lua_State *L) { lua_pop(L, 1); // FIXME: hackish to go under MSG that way - m_host_t host = xbt_lib_get_or_null(host_lib,host_id,MSG_HOST_LEVEL); + msg_host_t host = xbt_lib_get_or_null(host_lib,host_id,MSG_HOST_LEVEL); if (!host) { XBT_ERROR("no host '%s' found",host_id); return -1; @@ -414,7 +414,7 @@ int console_host_set_property(lua_State *L) { lua_pop(L, 1); // FIXME: hackish to go under MSG that way - m_host_t host = xbt_lib_get_or_null(host_lib,name,MSG_HOST_LEVEL); + msg_host_t host = xbt_lib_get_or_null(host_lib,name,MSG_HOST_LEVEL); if (!host) { XBT_ERROR("no host '%s' found",name); return -1; diff --git a/src/bindings/lua/lua_private.h b/src/bindings/lua/lua_private.h index 6a242e201e..e0babb2767 100644 --- a/src/bindings/lua/lua_private.h +++ b/src/bindings/lua/lua_private.h @@ -19,7 +19,7 @@ msg_comm_t sglua_check_comm(lua_State* L, int index); void sglua_push_comm(lua_State* L, msg_comm_t comm); void sglua_register_host_functions(lua_State* L); -m_host_t sglua_check_host(lua_State* L, int index); +msg_host_t sglua_check_host(lua_State* L, int index); void sglua_register_process_functions(lua_State* L); diff --git a/src/instr/instr_msg_process.c b/src/instr/instr_msg_process.c index e101491298..94e19706d4 100644 --- a/src/instr/instr_msg_process.c +++ b/src/instr/instr_msg_process.c @@ -24,7 +24,7 @@ char *instr_process_id_2 (const char *process_name, int process_pid, char *str, /* * Instrumentation functions to trace MSG processes (msg_process_t) */ -void TRACE_msg_process_change_host(msg_process_t process, m_host_t old_host, m_host_t new_host) +void TRACE_msg_process_change_host(msg_process_t process, msg_host_t old_host, msg_host_t new_host) { if (TRACE_msg_process_is_enabled()){ static long long int counter = 0; @@ -54,7 +54,7 @@ void TRACE_msg_process_change_host(msg_process_t process, m_host_t old_host, m_h } } -void TRACE_msg_process_create (const char *process_name, int process_pid, m_host_t host) +void TRACE_msg_process_create (const char *process_name, int process_pid, msg_host_t host) { if (TRACE_msg_process_is_enabled()){ int len = INSTR_DEFAULT_STR_SIZE; diff --git a/src/instr/instr_private.h b/src/instr/instr_private.h index ba347a5c2d..bac966de1d 100644 --- a/src/instr/instr_private.h +++ b/src/instr/instr_private.h @@ -117,9 +117,9 @@ void TRACE_msg_task_put_end(void); /* declaration of instrumentation functions from msg_process_instr.c */ char *instr_process_id (msg_process_t proc, char *str, int len); char *instr_process_id_2 (const char *process_name, int process_pid, char *str, int len); -void TRACE_msg_process_change_host(msg_process_t process, m_host_t old_host, - m_host_t new_host); -void TRACE_msg_process_create (const char *process_name, int process_pid, m_host_t host); +void TRACE_msg_process_change_host(msg_process_t process, msg_host_t old_host, + msg_host_t new_host); +void TRACE_msg_process_create (const char *process_name, int process_pid, msg_host_t host); void TRACE_msg_process_kill(msg_process_t process); void TRACE_msg_process_suspend(msg_process_t process); void TRACE_msg_process_resume(msg_process_t process); diff --git a/src/msg/msg_gos.c b/src/msg/msg_gos.c index a5839c38e5..c84dca9645 100644 --- a/src/msg/msg_gos.c +++ b/src/msg/msg_gos.c @@ -173,7 +173,7 @@ MSG_error_t MSG_process_sleep(double nb_sec) * * \param task a memory location for storing a #m_task_t. * \param alias name of the mailbox to receive the task from - * \param host a #m_host_t host from where the task was sent + * \param host a #msg_host_t host from where the task was sent * * \return Returns * #MSG_OK if the task was successfully received, @@ -181,7 +181,7 @@ MSG_error_t MSG_process_sleep(double nb_sec) */ MSG_error_t MSG_task_receive_from_host(m_task_t * task, const char *alias, - m_host_t host) + msg_host_t host) { return MSG_task_receive_ext(task, alias, -1, host); } @@ -239,7 +239,7 @@ MSG_task_receive_with_timeout(m_task_t * task, const char *alias, * \param task a memory location for storing a #m_task_t. * \param alias name of the mailbox to receive the task from * \param timeout is the maximum wait time for completion (provide -1 for no timeout) - * \param host a #m_host_t host from where the task was sent + * \param host a #msg_host_t host from where the task was sent * * \return Returns * #MSG_OK if the task was successfully received, @@ -247,7 +247,7 @@ MSG_task_receive_with_timeout(m_task_t * task, const char *alias, */ MSG_error_t MSG_task_receive_ext(m_task_t * task, const char *alias, double timeout, - m_host_t host) + msg_host_t host) { XBT_DEBUG ("MSG_task_receive_ext: Trying to receive a message on mailbox '%s'", @@ -741,7 +741,7 @@ int MSG_task_listen(const char *alias) * given mailbox, 0 if there is no pending communication actions. * */ -int MSG_task_listen_from_host(const char *alias, m_host_t host) +int MSG_task_listen_from_host(const char *alias, msg_host_t host) { return MSG_mailbox_get_count_host_waiting_tasks(MSG_mailbox_get_by_alias @@ -849,7 +849,7 @@ MSG_error_t MSG_get_errno(void) * #MSG_TRANSFER_FAILURE if the transfer could not be properly done * (network failure, dest failure) or #MSG_OK if it succeeded. */ -MSG_error_t MSG_task_put(m_task_t task, m_host_t dest, m_channel_t channel) +MSG_error_t MSG_task_put(m_task_t task, msg_host_t dest, m_channel_t channel) { XBT_WARN("DEPRECATED! Now use MSG_task_send"); return MSG_task_put_with_timeout(task, dest, channel, -1.0); @@ -862,7 +862,7 @@ MSG_error_t MSG_task_put(m_task_t task, m_host_t dest, m_channel_t channel) * \sa MSG_task_put */ MSG_error_t -MSG_task_put_bounded(m_task_t task, m_host_t dest, m_channel_t channel, +MSG_task_put_bounded(m_task_t task, msg_host_t dest, m_channel_t channel, double maxrate) { XBT_WARN("DEPRECATED! Now use MSG_task_send_bounded"); @@ -901,7 +901,7 @@ this function was called was shut down, (network failure, dest failure, timeout...) or #MSG_OK if the communication succeeded. */ MSG_error_t -MSG_task_put_with_timeout(m_task_t task, m_host_t dest, +MSG_task_put_with_timeout(m_task_t task, msg_host_t dest, m_channel_t channel, double timeout) { XBT_WARN("DEPRECATED! Now use MSG_task_send_with_timeout"); @@ -976,7 +976,7 @@ int MSG_task_Iprobe(m_channel_t channel) * \return the number of tasks waiting to be received on \a channel and sent by \a host. */ -int MSG_task_probe_from_host(int channel, m_host_t host) +int MSG_task_probe_from_host(int channel, msg_host_t host) { XBT_WARN("DEPRECATED! Now use MSG_task_listen_from_host"); xbt_assert((channel >= 0) @@ -1005,7 +1005,7 @@ int MSG_task_probe_from_host(int channel, m_host_t host) * \return a #MSG_error_t indicating whether the operation was successful (#MSG_OK), or why it failed otherwise. */ MSG_error_t -MSG_task_get_from_host(m_task_t * task, m_channel_t channel, m_host_t host) +MSG_task_get_from_host(m_task_t * task, m_channel_t channel, msg_host_t host) { XBT_WARN("DEPRECATED! Now use MSG_task_receive_from_host"); return MSG_task_get_ext(task, channel, -1, host); @@ -1057,7 +1057,7 @@ MSG_task_get_with_timeout(m_task_t * task, m_channel_t channel, MSG_error_t MSG_task_get_ext(m_task_t * task, m_channel_t channel, double timeout, - m_host_t host) + msg_host_t host) { XBT_WARN("DEPRECATED! Now use MSG_task_receive_ext"); xbt_assert((channel >= 0) diff --git a/src/msg/msg_host.c b/src/msg/msg_host.c index bb33cfc369..5c697a7d7e 100644 --- a/src/msg/msg_host.c +++ b/src/msg/msg_host.c @@ -14,7 +14,7 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(msg); /** @addtogroup m_host_management * \htmlonly \endhtmlonly - * (#m_host_t) and the functions for managing it. + * (#msg_host_t) and the functions for managing it. * * A location (or host) is any possible place where * a process may run. Thus it may be represented as a @@ -22,14 +22,14 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(msg); * mailboxes to enable running process to communicate with * remote ones, and some private data that can be only * accessed by local process. - * \see m_host_t + * \see msg_host_t */ /********************************* Host **************************************/ -m_host_t __MSG_host_create(smx_host_t workstation) +msg_host_t __MSG_host_create(smx_host_t workstation) { const char *name = SIMIX_host_get_name(workstation); - m_host_t host = xbt_new0(s_m_host_t, 1); + msg_host_t host = xbt_new0(s_msg_host_t, 1); s_msg_vm_t vm; // simply to compute the offset host->smx_host = workstation; @@ -57,25 +57,25 @@ m_host_t __MSG_host_create(smx_host_t workstation) } /** \ingroup msg_host_management - * \brief Finds a m_host_t using its name. + * \brief Finds a msg_host_t using its name. * * This is a name directory service * \param name the name of an host. * \return the corresponding host */ -m_host_t MSG_get_host_by_name(const char *name) +msg_host_t MSG_get_host_by_name(const char *name) { - return (m_host_t) xbt_lib_get_or_null(host_lib,name,MSG_HOST_LEVEL); + return (msg_host_t) xbt_lib_get_or_null(host_lib,name,MSG_HOST_LEVEL); } /** \ingroup m_host_management * - * \brief Set the user data of a #m_host_t. + * \brief Set the user data of a #msg_host_t. * * This functions checks whether some data has already been associated to \a host or not and attach \a data to \a host if it is possible. */ -MSG_error_t MSG_host_set_data(m_host_t host, void *data) +MSG_error_t MSG_host_set_data(msg_host_t host, void *data) { SIMIX_host_set_data(host->smx_host,data); @@ -84,24 +84,24 @@ MSG_error_t MSG_host_set_data(m_host_t host, void *data) /** \ingroup m_host_management * - * \brief Return the user data of a #m_host_t. + * \brief Return the user data of a #msg_host_t. * * This functions checks whether \a host is a valid pointer or not and return the user data associated to \a host if it is possible. */ -void *MSG_host_get_data(m_host_t host) +void *MSG_host_get_data(msg_host_t host) { return SIMIX_host_get_data(host->smx_host); } /** \ingroup m_host_management * - * \brief Return the name of the #m_host_t. + * \brief Return the name of the #msg_host_t. * * This functions checks whether \a host is a valid pointer or not and return its name. */ -const char *MSG_host_get_name(m_host_t host) { +const char *MSG_host_get_name(msg_host_t host) { return SIMIX_host_get_name(host->smx_host); } @@ -109,7 +109,7 @@ const char *MSG_host_get_name(m_host_t host) { * * \brief Return the location on which the current process is executed. */ -m_host_t MSG_host_self(void) +msg_host_t MSG_host_self(void) { return MSG_process_get_host(NULL); } @@ -117,7 +117,7 @@ m_host_t MSG_host_self(void) /* * \brief Destroys a host (internal call only) */ -void __MSG_host_destroy(m_host_t host) { +void __MSG_host_destroy(msg_host_t host) { #ifdef MSG_USE_DEPRECATED if (msg_global->max_channel > 0) @@ -137,7 +137,7 @@ int MSG_get_host_number(void) return xbt_lib_length(host_lib); } -m_host_t *MSG_get_host_table(void) +msg_host_t *MSG_get_host_table(void) { void **array; int i = 0; @@ -155,7 +155,7 @@ m_host_t *MSG_get_host_table(void) array[i++] = data[MSG_HOST_LEVEL]; } - return (m_host_t *)array; + return (msg_host_t *)array; } #endif @@ -166,7 +166,7 @@ xbt_dynar_t MSG_hosts_as_dynar(void) { xbt_lib_cursor_t cursor; char *key; void **data; - xbt_dynar_t res = xbt_dynar_new(sizeof(m_host_t),NULL); + xbt_dynar_t res = xbt_dynar_new(sizeof(msg_host_t),NULL); xbt_lib_foreach(host_lib, cursor, key, data) { if(routing_get_network_element_type(key) == SURF_NETWORK_ELEMENT_HOST) @@ -177,9 +177,9 @@ xbt_dynar_t MSG_hosts_as_dynar(void) { /** \ingroup m_host_management * \brief Return the number of MSG tasks currently running on a - * #m_host_t. The external load is not taken in account. + * #msg_host_t. The external load is not taken in account. */ -int MSG_get_host_msgload(m_host_t h) +int MSG_get_host_msgload(msg_host_t h) { xbt_assert((h != NULL), "Invalid parameters"); xbt_die( "Not implemented yet"); @@ -191,7 +191,7 @@ int MSG_get_host_msgload(m_host_t h) * \brief Return the speed of the processor (in flop/s), regardless of the current load on the machine. */ -double MSG_get_host_speed(m_host_t h) +double MSG_get_host_speed(msg_host_t h) { xbt_assert((h != NULL), "Invalid parameters"); @@ -205,7 +205,7 @@ double MSG_get_host_speed(m_host_t h) * \param name a property name * \return value of a property (or NULL if property not set) */ -const char *MSG_host_get_property_value(m_host_t host, const char *name) +const char *MSG_host_get_property_value(msg_host_t host, const char *name) { return xbt_dict_get_or_null(MSG_host_get_properties(host), name); } @@ -216,7 +216,7 @@ const char *MSG_host_get_property_value(m_host_t host, const char *name) * \param host a host * \return a dict containing the properties */ -xbt_dict_t MSG_host_get_properties(m_host_t host) +xbt_dict_t MSG_host_get_properties(msg_host_t host) { xbt_assert((host != NULL), "Invalid parameters (host is NULL)"); @@ -231,7 +231,7 @@ xbt_dict_t MSG_host_get_properties(m_host_t host) * \param value what to change the property to * \param free_ctn the freeing function to use to kill the value on need */ -void MSG_host_set_property_value(m_host_t host, const char *name, char *value,void_f_pvoid_t free_ctn) { +void MSG_host_set_property_value(msg_host_t host, const char *name, char *value,void_f_pvoid_t free_ctn) { xbt_dict_set(MSG_host_get_properties(host), name, value,free_ctn); } @@ -243,7 +243,7 @@ void MSG_host_set_property_value(m_host_t host, const char *name, char *value,vo * \param host host to test * \return Returns 1 if host is available, 0 otherwise */ -int MSG_host_is_avail(m_host_t host) +int MSG_host_is_avail(msg_host_t host) { xbt_assert((host != NULL), "Invalid parameters (host is NULL)"); return (simcall_host_get_state(host->smx_host)); diff --git a/src/msg/msg_mailbox.c b/src/msg/msg_mailbox.c index dfd97d72fc..e93ee5740f 100644 --- a/src/msg/msg_mailbox.c +++ b/src/msg/msg_mailbox.c @@ -39,7 +39,7 @@ m_task_t MSG_mailbox_get_head(msg_mailbox_t mailbox) int MSG_mailbox_get_count_host_waiting_tasks(msg_mailbox_t mailbox, - m_host_t host) + msg_host_t host) { return simcall_rdv_comm_count_by_host(mailbox, host->smx_host); @@ -58,7 +58,7 @@ msg_mailbox_t MSG_mailbox_get_by_alias(const char *alias) MSG_error_t MSG_mailbox_get_task_ext(msg_mailbox_t mailbox, m_task_t * task, - m_host_t host, double timeout) + msg_host_t host, double timeout) { xbt_ex_t e; MSG_error_t ret = MSG_OK; @@ -178,7 +178,7 @@ MSG_mailbox_put_with_timeout(msg_mailbox_t mailbox, m_task_t task, } #ifdef MSG_USE_DEPRECATED -msg_mailbox_t MSG_mailbox_get_by_channel(m_host_t host, +msg_mailbox_t MSG_mailbox_get_by_channel(msg_host_t host, m_channel_t channel) { XBT_WARN("DEPRECATED! Now use MSG_mailbox_get_by_alias"); diff --git a/src/msg/msg_mailbox.h b/src/msg/msg_mailbox.h index c59c17f800..1b01692f5b 100644 --- a/src/msg/msg_mailbox.h +++ b/src/msg/msg_mailbox.h @@ -92,7 +92,7 @@ XBT_PUBLIC(m_task_t) */ XBT_PUBLIC(int) MSG_mailbox_get_count_host_waiting_tasks(msg_mailbox_t mailbox, - m_host_t host); + msg_host_t host); #ifdef MSG_USE_DEPRECATED /* \brief MSG_mailbox_get_by_channel - get a mailbox of the specified host from its channel. @@ -109,7 +109,7 @@ MSG_mailbox_get_count_host_waiting_tasks(msg_mailbox_t mailbox, * */ XBT_PUBLIC(msg_mailbox_t) - MSG_mailbox_get_by_channel(m_host_t host, m_channel_t channel); + MSG_mailbox_get_by_channel(msg_host_t host, m_channel_t channel); #endif SG_END_DECL() diff --git a/src/msg/msg_private.h b/src/msg/msg_private.h index 16e1281d80..2b3e69b60a 100644 --- a/src/msg/msg_private.h +++ b/src/msg/msg_private.h @@ -30,7 +30,7 @@ typedef struct simdata_task { double computation_amount; /* Computation size */ msg_process_t sender; msg_process_t receiver; - m_host_t source; + msg_host_t source; double priority; double rate; int isused; /* Indicates whether the task is used in SIMIX currently */ @@ -58,10 +58,10 @@ typedef struct simdata_gpu_task { /******************************* Process *************************************/ typedef struct simdata_process { - m_host_t m_host; /* the host on which the process is running */ + msg_host_t m_host; /* the host on which the process is running */ int PID; /* used for debugging purposes */ int PPID; /* The parent PID */ - m_host_t put_host; /* used for debugging purposes */ + msg_host_t put_host; /* used for debugging purposes */ #ifdef MSG_USE_DEPRECATED m_channel_t put_channel; /* used for debugging purposes */ #endif @@ -80,7 +80,7 @@ typedef struct process_arg { const char *name; xbt_main_func_t code; void *data; - m_host_t m_host; + msg_host_t m_host; int argc; char **argv; double kill_time; @@ -102,7 +102,7 @@ typedef struct msg_vm { s_xbt_swag_hookup_t host_vms_hookup; xbt_dynar_t processes; e_msg_vm_state_t state; - m_host_t location; + msg_host_t location; int coreAmount; } s_msg_vm_t; @@ -138,8 +138,8 @@ XBT_PUBLIC_DATA(MSG_Global_t) msg_global; # define MSG_RETURN(val) return(val) #endif -m_host_t __MSG_host_create(smx_host_t workstation); -void __MSG_host_destroy(m_host_t host); +msg_host_t __MSG_host_create(smx_host_t workstation); +void __MSG_host_destroy(msg_host_t host); void __MSG_display_process_status(void); diff --git a/src/msg/msg_process.c b/src/msg/msg_process.c index f279dab9c5..6c87550a9e 100644 --- a/src/msg/msg_process.c +++ b/src/msg/msg_process.c @@ -67,7 +67,7 @@ void MSG_process_create_from_SIMIX(smx_process_t* process, const char *name, const char *hostname, double kill_time, int argc, char **argv, xbt_dict_t properties, int auto_restart) { - m_host_t host = MSG_get_host_by_name(hostname); + msg_host_t host = MSG_get_host_by_name(hostname); msg_process_t p = MSG_process_create_with_environment(name, code, data, host, argc, argv, properties); @@ -87,7 +87,7 @@ void MSG_process_create_from_SIMIX(smx_process_t* process, const char *name, */ msg_process_t MSG_process_create(const char *name, xbt_main_func_t code, void *data, - m_host_t host) + msg_host_t host) { return MSG_process_create_with_environment(name, code, data, host, -1, NULL, NULL); @@ -120,7 +120,7 @@ msg_process_t MSG_process_create(const char *name, msg_process_t MSG_process_create_with_arguments(const char *name, xbt_main_func_t code, - void *data, m_host_t host, + void *data, msg_host_t host, int argc, char **argv) { return MSG_process_create_with_environment(name, code, data, host, @@ -154,7 +154,7 @@ msg_process_t MSG_process_create_with_arguments(const char *name, */ msg_process_t MSG_process_create_with_environment(const char *name, xbt_main_func_t code, - void *data, m_host_t host, + void *data, msg_host_t host, int argc, char **argv, xbt_dict_t properties) { @@ -222,14 +222,14 @@ void MSG_process_kill(msg_process_t process) * \brief Migrates a process to another location. * * This function checks whether \a process and \a host are valid pointers - and change the value of the #m_host_t on which \a process is running. + and change the value of the #msg_host_t on which \a process is running. */ -MSG_error_t MSG_process_migrate(msg_process_t process, m_host_t host) +MSG_error_t MSG_process_migrate(msg_process_t process, msg_host_t host) { simdata_process_t simdata = simcall_process_get_data(process); simdata->m_host = host; #ifdef HAVE_TRACING - m_host_t now = simdata->m_host; + msg_host_t now = simdata->m_host; TRACE_msg_process_change_host(process, now, host); #endif simcall_process_change_host(process, host->smx_host); @@ -281,10 +281,10 @@ XBT_PUBLIC(void) MSG_process_set_data_cleanup(void_f_pvoid_t data_cleanup) { /** \ingroup m_process_management * \brief Return the location on which a process is running. * \param process a process (NULL means the current one) - * \return the m_host_t corresponding to the location on which \a + * \return the msg_host_t corresponding to the location on which \a * process is running. */ -m_host_t MSG_process_get_host(msg_process_t process) +msg_host_t MSG_process_get_host(msg_process_t process) { simdata_process_t simdata; if (process == NULL) { diff --git a/src/msg/msg_task.c b/src/msg/msg_task.c index 1462a8279c..ab9cc8016b 100644 --- a/src/msg/msg_task.c +++ b/src/msg/msg_task.c @@ -84,7 +84,7 @@ m_task_t MSG_task_create(const char *name, double compute_duration, * \param name a name for the object. It is for user-level information and can be NULL. * \param host_nb the number of hosts implied in the parallel task. - * \param host_list an array of \p host_nb m_host_t. + * \param host_list an array of \p host_nb msg_host_t. * \param computation_amount an array of \p host_nb doubles. computation_amount[i] is the total number of operations that have to be performed on host_list[i]. @@ -97,7 +97,7 @@ m_task_t MSG_task_create(const char *name, double compute_duration, */ m_task_t MSG_parallel_task_create(const char *name, int host_nb, - const m_host_t * host_list, + const msg_host_t * host_list, double *computation_amount, double *communication_amount, void *data) { @@ -219,9 +219,9 @@ msg_process_t MSG_task_get_sender(m_task_t task) /** \ingroup m_task_management * \brief Return the source of a #m_task_t. * - * This functions returns the #m_host_t from which this task was sent + * This functions returns the #msg_host_t from which this task was sent */ -m_host_t MSG_task_get_source(m_task_t task) +msg_host_t MSG_task_get_source(m_task_t task) { xbt_assert(task, "Invalid parameters"); return ((simdata_task_t) task->simdata)->source; diff --git a/src/msg/msg_vm.c b/src/msg/msg_vm.c index 79c8c3263f..4b9e0ad518 100644 --- a/src/msg/msg_vm.c +++ b/src/msg/msg_vm.c @@ -17,7 +17,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_vm, msg, * to add extra constraints on the execution, but the argument is ignored for now. */ -msg_vm_t MSG_vm_start(m_host_t location, int coreAmount) { +msg_vm_t MSG_vm_start(msg_host_t location, int coreAmount) { msg_vm_t res = xbt_new0(s_msg_vm_t,1); res->all_vms_hookup.prev = NULL; res->host_vms_hookup.prev = NULL; @@ -99,7 +99,7 @@ void MSG_vm_unbind(msg_vm_t vm, msg_process_t process) { * MSG_task_send() before or after, depending on whether you want to do cold or hot * migration. */ -void MSG_vm_migrate(msg_vm_t vm, m_host_t destination) { +void MSG_vm_migrate(msg_vm_t vm, msg_host_t destination) { unsigned int cpt; msg_process_t process; xbt_dynar_foreach(vm->processes,cpt,process) { diff --git a/teshsuite/simdag/platforms/basic_tracing.c b/teshsuite/simdag/platforms/basic_tracing.c index 7804aecf3f..cd2907c48b 100644 --- a/teshsuite/simdag/platforms/basic_tracing.c +++ b/teshsuite/simdag/platforms/basic_tracing.c @@ -24,12 +24,12 @@ int main(int argc, char **argv) { int res; xbt_dynar_t all_hosts; - m_host_t first_host; + msg_host_t first_host; MSG_init(&argc, argv); MSG_create_environment(argv[1]); MSG_function_register("host", host); all_hosts = MSG_hosts_as_dynar(); - first_host = xbt_dynar_pop_as(all_hosts,m_host_t); + first_host = xbt_dynar_pop_as(all_hosts,msg_host_t); MSG_process_create( "host", host, NULL, first_host); xbt_dynar_free(&all_hosts); -- 2.20.1