From: Martin Quinson Date: Mon, 9 May 2016 15:41:01 +0000 (+0200) Subject: mbox: kill a getter simcall X-Git-Tag: v3_14~1254 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/9e467e2e13466a59c6909ae19783cd83591829ad mbox: kill a getter simcall --- diff --git a/include/simgrid/simix.h b/include/simgrid/simix.h index cf5f064043..a01895f96b 100644 --- a/include/simgrid/simix.h +++ b/include/simgrid/simix.h @@ -352,7 +352,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(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); /***** Communication simcalls *****/ diff --git a/src/s4u/s4u_mailbox.cpp b/src/s4u/s4u_mailbox.cpp index e8df673c95..93a0c6931e 100644 --- a/src/s4u/s4u_mailbox.cpp +++ b/src/s4u/s4u_mailbox.cpp @@ -6,6 +6,7 @@ #include "xbt/log.h" #include "src/msg/msg_private.h" +#include "src/simix/smx_network_private.h" #include "simgrid/s4u/mailbox.hpp" @@ -48,8 +49,9 @@ bool s4u::Mailbox::empty() { void s4u::Mailbox::setReceiver(smx_process_t process) { simcall_mbox_set_receiver(pimpl_, process); } +/** @brief get the receiver (process associated to the mailbox) */ smx_process_t s4u::Mailbox::receiver() { - return simcall_mbox_get_receiver(pimpl_); + return pimpl_->permanent_receiver; } /*------- C functions -------*/ diff --git a/src/simix/libsmx.cpp b/src/simix/libsmx.cpp index b1563f0042..d57407175c 100644 --- a/src/simix/libsmx.cpp +++ b/src/simix/libsmx.cpp @@ -696,11 +696,6 @@ void simcall_mbox_set_receiver(smx_mailbox_t mbox, smx_process_t process) simcall_BODY_mbox_set_receiver(mbox, process); } -smx_process_t simcall_mbox_get_receiver(smx_mailbox_t mbox) -{ - return simcall_BODY_mbox_get_receiver(mbox); -} - /** * \ingroup simix_comm_management */ diff --git a/src/simix/popping_accessors.h b/src/simix/popping_accessors.h index f91ec832ad..0070fcc8e1 100644 --- a/src/simix/popping_accessors.h +++ b/src/simix/popping_accessors.h @@ -445,19 +445,6 @@ static inline void simcall_mbox_set_receiver__set__receiver(smx_simcall_t simcal simcall->args[1].dp = arg; } -static inline smx_mailbox_t simcall_mbox_get_receiver__get__mbox(smx_simcall_t simcall) { - return (smx_mailbox_t) simcall->args[0].dp; -} -static inline void simcall_mbox_get_receiver__set__mbox(smx_simcall_t simcall, void* arg) { - simcall->args[0].dp = arg; -} -static inline smx_process_t simcall_mbox_get_receiver__get__result(smx_simcall_t simcall){ - return (smx_process_t) simcall->result.dp; -} -static inline void simcall_mbox_get_receiver__set__result(smx_simcall_t simcall, void* result){ - simcall->result.dp = result; -} - static inline smx_mailbox_t simcall_comm_iprobe__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 0b3bf0510b..2d6f513c14 100644 --- a/src/simix/popping_bodies.cpp +++ b/src/simix/popping_bodies.cpp @@ -655,27 +655,6 @@ inline static void simcall_BODY_mbox_set_receiver(smx_mailbox_t mbox, smx_proces } -inline static smx_process_t simcall_BODY_mbox_get_receiver(smx_mailbox_t mbox) { - smx_process_t self = SIMIX_process_self(); - - /* Go to that function to follow the code flow through the simcall barrier */ - if (0) SIMIX_mbox_get_receiver(mbox); - /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */ - - self->simcall.call = SIMCALL_MBOX_GET_RECEIVER; - 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; - 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 (smx_process_t) self->simcall.result.dp; - } - inline static smx_synchro_t simcall_BODY_comm_iprobe(smx_mailbox_t mbox, int type, int src, int tag, simix_match_func_t match_fun, void* data) { smx_process_t self = SIMIX_process_self(); diff --git a/src/simix/popping_enum.h b/src/simix/popping_enum.h index 3da7977eb5..6e122686bd 100644 --- a/src/simix/popping_enum.h +++ b/src/simix/popping_enum.h @@ -47,7 +47,6 @@ typedef enum { SIMCALL_MBOX_CREATE, SIMCALL_MBOX_GET_HEAD, SIMCALL_MBOX_SET_RECEIVER, - SIMCALL_MBOX_GET_RECEIVER, SIMCALL_COMM_IPROBE, SIMCALL_COMM_SEND, SIMCALL_COMM_ISEND, diff --git a/src/simix/popping_generated.cpp b/src/simix/popping_generated.cpp index d73d79846d..628f4f2766 100644 --- a/src/simix/popping_generated.cpp +++ b/src/simix/popping_generated.cpp @@ -52,7 +52,6 @@ const char* simcall_names[] = { "SIMCALL_MBOX_CREATE", "SIMCALL_MBOX_GET_HEAD", "SIMCALL_MBOX_SET_RECEIVER", - "SIMCALL_MBOX_GET_RECEIVER", "SIMCALL_COMM_IPROBE", "SIMCALL_COMM_SEND", "SIMCALL_COMM_ISEND", @@ -252,11 +251,6 @@ case SIMCALL_MBOX_SET_RECEIVER: SIMIX_simcall_answer(simcall); break; -case SIMCALL_MBOX_GET_RECEIVER: - simcall->result.dp = SIMIX_mbox_get_receiver((smx_mailbox_t) simcall->args[0].dp); - SIMIX_simcall_answer(simcall); - break; - case SIMCALL_COMM_IPROBE: simcall->result.dp = simcall_HANDLER_comm_iprobe(simcall , (smx_mailbox_t) simcall->args[0].dp, simcall->args[1].i, simcall->args[2].i, simcall->args[3].i, (simix_match_func_t) simcall->args[4].fp, simcall->args[5].dp); SIMIX_simcall_answer(simcall); diff --git a/src/simix/simcalls.in b/src/simix/simcalls.in index b345e4f4e7..b7db01ea77 100644 --- a/src/simix/simcalls.in +++ b/src/simix/simcalls.in @@ -79,7 +79,6 @@ 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_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) Func H comm_iprobe (void*, smx_synchro_t) (mbox, void*, smx_mailbox_t) (type, int) (src, int) (tag, int) (match_fun, FPtr, simix_match_func_t) (data, void*) Blck H comm_send (void) (sender, void*, smx_process_t) (mbox, void*, smx_mailbox_t) (task_size, double) (rate, double) (src_buff, void*) (src_buff_size, size_t) (match_fun, FPtr, simix_match_func_t) (copy_data_fun, FPtr, simix_copy_data_func_t) (data, void*) (timeout, double) diff --git a/src/simix/smx_network.cpp b/src/simix/smx_network.cpp index 9272704bb6..54367da711 100644 --- a/src/simix/smx_network.cpp +++ b/src/simix/smx_network.cpp @@ -74,16 +74,6 @@ smx_synchro_t SIMIX_mbox_get_head(smx_mailbox_t mbox) return mbox->comm_queue->empty()? nullptr:mbox->comm_queue->front(); } -/** - * \brief get the receiver (process associated to the mailbox) - * \param mbox The rendez-vous point - * \return process The receiving process (NULL if not set) - */ -smx_process_t SIMIX_mbox_get_receiver(smx_mailbox_t mbox) -{ - return mbox->permanent_receiver; -} - /** * \brief set the receiver of the rendez vous point to allow eager sends * \param mbox The rendez-vous point diff --git a/src/simix/smx_network_private.h b/src/simix/smx_network_private.h index 8e54a8a725..f6281161ba 100644 --- a/src/simix/smx_network_private.h +++ b/src/simix/smx_network_private.h @@ -28,7 +28,6 @@ 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 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); XBT_PRIVATE smx_synchro_t SIMIX_comm_irecv(smx_process_t dst_proc, smx_mailbox_t mbox, void *dst_buff, size_t *dst_buff_size, int (*)(void *, void *, smx_synchro_t),