Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
mbox: kill a getter simcall
authorMartin Quinson <martin.quinson@loria.fr>
Mon, 9 May 2016 15:41:01 +0000 (17:41 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Mon, 9 May 2016 15:41:01 +0000 (17:41 +0200)
include/simgrid/simix.h
src/s4u/s4u_mailbox.cpp
src/simix/libsmx.cpp
src/simix/popping_accessors.h
src/simix/popping_bodies.cpp
src/simix/popping_enum.h
src/simix/popping_generated.cpp
src/simix/simcalls.in
src/simix/smx_network.cpp
src/simix/smx_network_private.h

index cf5f064..a01895f 100644 (file)
@@ -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 *****/
index e8df673..93a0c69 100644 (file)
@@ -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 -------*/
index b1563f0..d574071 100644 (file)
@@ -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
  */
index f91ec83..0070fcc 100644 (file)
@@ -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;
 }
index 0b3bf05..2d6f513 100644 (file)
@@ -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();
 
index 3da7977..6e12268 100644 (file)
@@ -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,
index d73d798..628f4f2 100644 (file)
@@ -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);
index b345e4f..b7db01e 100644 (file)
@@ -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)
index 9272704..54367da 100644 (file)
@@ -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
index 8e54a8a..f628116 100644 (file)
@@ -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),