From aca82eb79d2576bb0696a8ee66a27e60f64aa62b Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Thu, 21 Apr 2016 21:31:58 +0200 Subject: [PATCH] remove some half baken functions cluttering the mailboxes --- ChangeLog | 6 ++++++ include/simgrid/msg.h | 9 --------- include/simgrid/simix.h | 1 - src/bindings/java/jmsg_task.cpp | 18 ----------------- src/bindings/java/org/simgrid/msg/Task.java | 5 ----- src/msg/msg_gos.cpp | 14 ------------- src/msg/msg_mailbox.cpp | 5 ----- src/simix/libsmx.cpp | 13 ------------ src/simix/popping_accessors.h | 19 ------------------ src/simix/popping_bodies.cpp | 22 --------------------- src/simix/popping_enum.h | 1 - src/simix/popping_generated.cpp | 6 ------ src/simix/simcalls.in | 1 - src/simix/smx_network.cpp | 14 ------------- src/simix/smx_network_private.h | 1 - 15 files changed, 6 insertions(+), 129 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7eed1ffe53..1c45681e19 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,12 @@ SimGrid (3.13) UNRELEASED; urgency=low Lua can still be used to describe platforms - Removed Java kernel plug-ins. Will be reintroduced after the ongoing major internals reorg. + - In MSG + - the following functions were removed. + They were too specific and should be reimplemented in a generic + way, with filter function. + - MSG_task_listen_from_host + - MSG_mailbox_get_count_host_waiting_tasks - In SimDag - the SD_application_reinit function was removed. It was a noop for a while. - The ACCESS_MODE of SD_workstation has been removed. This feature was not really usable and should soon be diff --git a/include/simgrid/msg.h b/include/simgrid/msg.h index 7642313895..ea973f2a0f 100644 --- a/include/simgrid/msg.h +++ b/include/simgrid/msg.h @@ -440,7 +440,6 @@ XBT_PUBLIC(msg_task_t) MSG_comm_get_task(msg_comm_t comm); 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, msg_host_t host); XBT_PUBLIC(msg_error_t) MSG_task_send_with_timeout(msg_task_t task, const char *alias, double timeout); XBT_PUBLIC(msg_error_t) MSG_task_send_with_timeout_bounded(msg_task_t task, const char *alias, double timeout, double maxrate); XBT_PUBLIC(msg_error_t) MSG_task_send(msg_task_t task, const char *alias); @@ -487,14 +486,6 @@ XBT_PUBLIC(void) MSG_mailbox_set_async(const char *alias); */ XBT_PUBLIC(msg_task_t) MSG_mailbox_get_head(msg_mailbox_t mailbox); -/* @brief MSG_mailbox_get_count_host_waiting_tasks - * Return the number of tasks waiting to be received in a mailbox and sent by a host. - * @param mailbox The mailbox concerned by the operation. - * @param host The host containing the processes that sended the tasks. - * @return The number of tasks in the mailbox specified by the parameter mailbox and sended by all the - * processes located on the host specified by the parameter host. - */ -XBT_PUBLIC(int) MSG_mailbox_get_count_host_waiting_tasks(msg_mailbox_t mailbox, msg_host_t host); XBT_PUBLIC(msg_error_t) MSG_mailbox_get_task_ext(msg_mailbox_t mailbox, msg_task_t * task, msg_host_t host, double timeout); XBT_PUBLIC(msg_error_t) MSG_mailbox_get_task_ext_bounded(msg_mailbox_t mailbox, msg_task_t *task, msg_host_t host, diff --git a/include/simgrid/simix.h b/include/simgrid/simix.h index db7b2d471b..4ac35a10f8 100644 --- a/include/simgrid/simix.h +++ b/include/simgrid/simix.h @@ -367,7 +367,6 @@ XBT_PUBLIC(e_smx_state_t) simcall_process_sleep(double duration); XBT_PUBLIC(smx_mailbox_t) simcall_mbox_create(const char *name); XBT_PUBLIC(smx_mailbox_t) simcall_mbox_get_by_name(const char *name); -XBT_PUBLIC(int) simcall_mbox_comm_count_by_host(smx_mailbox_t mbox, sg_host_t host); XBT_PUBLIC(smx_synchro_t) simcall_mbox_get_head(smx_mailbox_t mbox); XBT_PUBLIC(smx_process_t) simcall_mbox_get_receiver(smx_mailbox_t mbox); XBT_PUBLIC(void) simcall_mbox_set_receiver(smx_mailbox_t mbox , smx_process_t process); diff --git a/src/bindings/java/jmsg_task.cpp b/src/bindings/java/jmsg_task.cpp index d904fb3910..b6b45eed90 100644 --- a/src/bindings/java/jmsg_task.cpp +++ b/src/bindings/java/jmsg_task.cpp @@ -652,24 +652,6 @@ JNIEXPORT jboolean JNICALL Java_org_simgrid_msg_Task_listen(JNIEnv * env, jclass return (jboolean) rv; } -JNIEXPORT jint JNICALL Java_org_simgrid_msg_Task_listenFromHost(JNIEnv * env, jclass cls, jstring jalias, jobject jhost) -{ - int rv; - const char *alias; - - msg_host_t host = jhost_get_native(env, jhost); - - if (!host) { - jxbt_throw_notbound(env, "host", jhost); - return -1; - } - alias = env->GetStringUTFChars(jalias, 0); - rv = MSG_task_listen_from_host(alias, host); - env->ReleaseStringUTFChars(jalias, alias); - - return (jint) rv; -} - JNIEXPORT jint JNICALL Java_org_simgrid_msg_Task_listenFrom(JNIEnv * env, jclass cls, jstring jalias) { int rv; diff --git a/src/bindings/java/org/simgrid/msg/Task.java b/src/bindings/java/org/simgrid/msg/Task.java index ac034b6c0a..5007cc4646 100644 --- a/src/bindings/java/org/simgrid/msg/Task.java +++ b/src/bindings/java/org/simgrid/msg/Task.java @@ -358,11 +358,6 @@ public class Task { */ public native static boolean listen(String mailbox); - /** - * Counts the number of tasks waiting to be received on the \a mailbox identified by the specified alia and sended by the specified \a host. - */ - public native static int listenFromHost(String alias, Host host); - /** * Class initializer, to initialize various JNI stuff */ diff --git a/src/msg/msg_gos.cpp b/src/msg/msg_gos.cpp index 5329078ccb..ff0daa10b8 100644 --- a/src/msg/msg_gos.cpp +++ b/src/msg/msg_gos.cpp @@ -829,20 +829,6 @@ int MSG_task_listen(const char *alias) return !MSG_mailbox_is_empty(rdv) || (rdv->permanent_receiver && xbt_fifo_size(rdv->done_comm_fifo)!=0); } -/** \ingroup msg_task_usage - * \brief Check the number of communication actions of a given host pending in a mailbox. - * - * \param alias the name of the mailbox to be considered - * \param host the host to check for communication - * - * \return Returns the number of pending communication actions of the host in the given mailbox, 0 if there is no - * pending communication actions. - */ -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(alias), host); -} - /** \ingroup msg_task_usage * \brief Look if there is a communication on a mailbox and return the PID of the sender process. * diff --git a/src/msg/msg_mailbox.cpp b/src/msg/msg_mailbox.cpp index 11d04eca03..122c0aeebc 100644 --- a/src/msg/msg_mailbox.cpp +++ b/src/msg/msg_mailbox.cpp @@ -31,11 +31,6 @@ msg_task_t MSG_mailbox_get_head(msg_mailbox_t mailbox) return (msg_task_t) simcall_comm_get_src_data(comm); } -int MSG_mailbox_get_count_host_waiting_tasks(msg_mailbox_t mailbox, msg_host_t host) -{ - return simcall_mbox_comm_count_by_host(mailbox, host); -} - msg_mailbox_t MSG_mailbox_get_by_alias(const char *alias) { msg_mailbox_t mailbox = simcall_mbox_get_by_name(alias); diff --git a/src/simix/libsmx.cpp b/src/simix/libsmx.cpp index bf6e99b049..3058bad804 100644 --- a/src/simix/libsmx.cpp +++ b/src/simix/libsmx.cpp @@ -751,19 +751,6 @@ smx_mailbox_t simcall_mbox_get_by_name(const char *name) return SIMIX_mbox_get_by_name(name); } -/** - * \ingroup simix_mbox_management - * \brief Counts the number of communication synchros of a given host pending - * on a rendez-vous point. - * \param mbox The rendez-vous point - * \param host The host to be counted - * \return The number of comm synchros pending in the mbox - */ -int simcall_mbox_comm_count_by_host(smx_mailbox_t mbox, sg_host_t host) -{ - return simcall_BODY_mbox_comm_count_by_host(mbox, host); -} - /** * \ingroup simix_mbox_management * \brief returns the communication at the head of the rendez-vous diff --git a/src/simix/popping_accessors.h b/src/simix/popping_accessors.h index 962e9b9c6a..fe2c29cf82 100644 --- a/src/simix/popping_accessors.h +++ b/src/simix/popping_accessors.h @@ -445,25 +445,6 @@ static inline void simcall_mbox_create__set__result(smx_simcall_t simcall, void* simcall->result.dp = result; } -static inline smx_mailbox_t simcall_mbox_comm_count_by_host__get__mbox(smx_simcall_t simcall) { - return (smx_mailbox_t) simcall->args[0].dp; -} -static inline void simcall_mbox_comm_count_by_host__set__mbox(smx_simcall_t simcall, void* arg) { - simcall->args[0].dp = arg; -} -static inline sg_host_t simcall_mbox_comm_count_by_host__get__host(smx_simcall_t simcall) { - return (sg_host_t) simcall->args[1].dp; -} -static inline void simcall_mbox_comm_count_by_host__set__host(smx_simcall_t simcall, void* arg) { - simcall->args[1].dp = arg; -} -static inline unsigned int simcall_mbox_comm_count_by_host__get__result(smx_simcall_t simcall){ - return simcall->result.ui; -} -static inline void simcall_mbox_comm_count_by_host__set__result(smx_simcall_t simcall, unsigned int result){ - simcall->result.ui = result; -} - static inline smx_mailbox_t simcall_mbox_get_head__get__mbox(smx_simcall_t simcall) { return (smx_mailbox_t) simcall->args[0].dp; } diff --git a/src/simix/popping_bodies.cpp b/src/simix/popping_bodies.cpp index fe0f6ac323..bfc0c86062 100644 --- a/src/simix/popping_bodies.cpp +++ b/src/simix/popping_bodies.cpp @@ -654,28 +654,6 @@ inline static smx_mailbox_t simcall_BODY_mbox_create(const char* name) { return (smx_mailbox_t) self->simcall.result.dp; } -inline static unsigned int simcall_BODY_mbox_comm_count_by_host(smx_mailbox_t mbox, sg_host_t host) { - smx_process_t self = SIMIX_process_self(); - - /* Go to that function to follow the code flow through the simcall barrier */ - if (0) SIMIX_mbox_comm_count_by_host(mbox, host); - /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */ - - self->simcall.call = SIMCALL_MBOX_COMM_COUNT_BY_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*) mbox; - self->simcall.args[1].dp = (void*) host; - 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); - } - return (unsigned int) self->simcall.result.ui; - } - inline static smx_synchro_t simcall_BODY_mbox_get_head(smx_mailbox_t mbox) { smx_process_t self = SIMIX_process_self(); diff --git a/src/simix/popping_enum.h b/src/simix/popping_enum.h index 951f227f35..f2af98f360 100644 --- a/src/simix/popping_enum.h +++ b/src/simix/popping_enum.h @@ -47,7 +47,6 @@ typedef enum { SIMCALL_PROCESS_AUTO_RESTART_SET, SIMCALL_PROCESS_RESTART, SIMCALL_MBOX_CREATE, - SIMCALL_MBOX_COMM_COUNT_BY_HOST, SIMCALL_MBOX_GET_HEAD, SIMCALL_MBOX_SET_RECEIVER, SIMCALL_MBOX_GET_RECEIVER, diff --git a/src/simix/popping_generated.cpp b/src/simix/popping_generated.cpp index 5e5920942a..3498a660bd 100644 --- a/src/simix/popping_generated.cpp +++ b/src/simix/popping_generated.cpp @@ -52,7 +52,6 @@ const char* simcall_names[] = { "SIMCALL_PROCESS_AUTO_RESTART_SET", "SIMCALL_PROCESS_RESTART", "SIMCALL_MBOX_CREATE", - "SIMCALL_MBOX_COMM_COUNT_BY_HOST", "SIMCALL_MBOX_GET_HEAD", "SIMCALL_MBOX_SET_RECEIVER", "SIMCALL_MBOX_GET_RECEIVER", @@ -258,11 +257,6 @@ case SIMCALL_MBOX_CREATE: SIMIX_simcall_answer(simcall); break; -case SIMCALL_MBOX_COMM_COUNT_BY_HOST: - simcall->result.ui = SIMIX_mbox_comm_count_by_host((smx_mailbox_t) simcall->args[0].dp,(sg_host_t) simcall->args[1].dp); - SIMIX_simcall_answer(simcall); - break; - case SIMCALL_MBOX_GET_HEAD: simcall->result.dp = SIMIX_mbox_get_head((smx_mailbox_t) simcall->args[0].dp); SIMIX_simcall_answer(simcall); diff --git a/src/simix/simcalls.in b/src/simix/simcalls.in index 7da760d37c..8a0b4b3a06 100644 --- a/src/simix/simcalls.in +++ b/src/simix/simcalls.in @@ -79,7 +79,6 @@ Proc - process_auto_restart_set (void) (process, void*, smx_process_t) (auto_res Func H process_restart (void*, smx_process_t) (process, void*, smx_process_t) Func - mbox_create (void*, smx_mailbox_t) (name, const char*) -Func - mbox_comm_count_by_host (unsigned int) (mbox, void*, smx_mailbox_t) (host, void*, sg_host_t) Func - mbox_get_head (void*, smx_synchro_t) (mbox, void*, smx_mailbox_t) Proc - mbox_set_receiver (void) (mbox, void*, smx_mailbox_t) (receiver, void*, smx_process_t) Func - mbox_get_receiver (void*, smx_process_t) (mbox, void*, smx_mailbox_t) diff --git a/src/simix/smx_network.cpp b/src/simix/smx_network.cpp index 94df88e3e0..64014651ad 100644 --- a/src/simix/smx_network.cpp +++ b/src/simix/smx_network.cpp @@ -73,20 +73,6 @@ smx_mailbox_t SIMIX_mbox_get_by_name(const char *name) return (smx_mailbox_t) xbt_dict_get_or_null(mailboxes, name); } -int SIMIX_mbox_comm_count_by_host(smx_mailbox_t mbox, sg_host_t host) -{ - smx_synchro_t comm = NULL; - xbt_fifo_item_t item = NULL; - int count = 0; - - xbt_fifo_foreach(mbox->comm_fifo, item, comm, smx_synchro_t) { - if (comm->comm.src_proc->host == host) - count++; - } - - return count; -} - smx_synchro_t SIMIX_mbox_get_head(smx_mailbox_t mbox) { return (smx_synchro_t) xbt_fifo_get_item_content( diff --git a/src/simix/smx_network_private.h b/src/simix/smx_network_private.h index 80adafe7fb..c3f85b60c2 100644 --- a/src/simix/smx_network_private.h +++ b/src/simix/smx_network_private.h @@ -26,7 +26,6 @@ XBT_PRIVATE void SIMIX_mailbox_exit(void); XBT_PRIVATE smx_mailbox_t SIMIX_mbox_create(const char *name); XBT_PRIVATE smx_mailbox_t SIMIX_mbox_get_by_name(const char *name); XBT_PRIVATE void SIMIX_mbox_remove(smx_mailbox_t mbox, smx_synchro_t comm); -XBT_PRIVATE int SIMIX_mbox_comm_count_by_host(smx_mailbox_t mbox, sg_host_t host); XBT_PRIVATE smx_synchro_t SIMIX_mbox_get_head(smx_mailbox_t mbox); XBT_PRIVATE void SIMIX_mbox_set_receiver(smx_mailbox_t mbox, smx_process_t proc); XBT_PRIVATE smx_process_t SIMIX_mbox_get_receiver(smx_mailbox_t mbox); -- 2.20.1