Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
remove some half baken functions cluttering the mailboxes
authorMartin Quinson <martin.quinson@loria.fr>
Thu, 21 Apr 2016 19:31:58 +0000 (21:31 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Thu, 21 Apr 2016 19:37:49 +0000 (21:37 +0200)
15 files changed:
ChangeLog
include/simgrid/msg.h
include/simgrid/simix.h
src/bindings/java/jmsg_task.cpp
src/bindings/java/org/simgrid/msg/Task.java
src/msg/msg_gos.cpp
src/msg/msg_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 7eed1ff..1c45681 100644 (file)
--- 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.
      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 
    - 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 
index 7642313..ea973f2 100644 (file)
@@ -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(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);
 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);
 
  */
 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,
 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,
index db7b2d4..4ac35a1 100644 (file)
@@ -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(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);
 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);
index d904fb3..b6b45ee 100644 (file)
@@ -652,24 +652,6 @@ JNIEXPORT jboolean JNICALL Java_org_simgrid_msg_Task_listen(JNIEnv * env, jclass
   return (jboolean) rv;
 }
 
   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;
 JNIEXPORT jint JNICALL Java_org_simgrid_msg_Task_listenFrom(JNIEnv * env, jclass cls, jstring jalias)
 {
   int rv;
index ac034b6..5007cc4 100644 (file)
@@ -358,11 +358,6 @@ public class Task {
         */
        public native static boolean listen(String mailbox);
 
         */
        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
         */
        /**
         * Class initializer, to initialize various JNI stuff
         */
index 5329078..ff0daa1 100644 (file)
@@ -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);
 }
 
   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.
  *
 /** \ingroup msg_task_usage
  * \brief Look if there is a communication on a mailbox and return the PID of the sender process.
  *
index 11d04ec..122c0ae 100644 (file)
@@ -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);
 }
 
   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);
 msg_mailbox_t MSG_mailbox_get_by_alias(const char *alias)
 {
   msg_mailbox_t mailbox = simcall_mbox_get_by_name(alias);
index bf6e99b..3058bad 100644 (file)
@@ -751,19 +751,6 @@ smx_mailbox_t simcall_mbox_get_by_name(const char *name)
   return SIMIX_mbox_get_by_name(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
 /**
  *  \ingroup simix_mbox_management
  *  \brief returns the communication at the head of the rendez-vous
index 962e9b9..fe2c29c 100644 (file)
@@ -445,25 +445,6 @@ static inline void simcall_mbox_create__set__result(smx_simcall_t simcall, void*
     simcall->result.dp = result;
 }
 
     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;
 }
 static inline smx_mailbox_t simcall_mbox_get_head__get__mbox(smx_simcall_t simcall) {
   return (smx_mailbox_t) simcall->args[0].dp;
 }
index fe0f6ac..bfc0c86 100644 (file)
@@ -654,28 +654,6 @@ inline static smx_mailbox_t simcall_BODY_mbox_create(const char* name) {
     return (smx_mailbox_t) self->simcall.result.dp;
   }
   
     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();
 
 inline static smx_synchro_t simcall_BODY_mbox_get_head(smx_mailbox_t mbox) {
     smx_process_t self = SIMIX_process_self();
 
index 951f227..f2af98f 100644 (file)
@@ -47,7 +47,6 @@ typedef enum {
   SIMCALL_PROCESS_AUTO_RESTART_SET,
   SIMCALL_PROCESS_RESTART,
   SIMCALL_MBOX_CREATE,
   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,
   SIMCALL_MBOX_GET_HEAD,
   SIMCALL_MBOX_SET_RECEIVER,
   SIMCALL_MBOX_GET_RECEIVER,
index 5e59209..3498a66 100644 (file)
@@ -52,7 +52,6 @@ const char* simcall_names[] = {
   "SIMCALL_PROCESS_AUTO_RESTART_SET",
   "SIMCALL_PROCESS_RESTART",
   "SIMCALL_MBOX_CREATE",
   "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",
   "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;  
 
       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);
 case SIMCALL_MBOX_GET_HEAD:
       simcall->result.dp = SIMIX_mbox_get_head((smx_mailbox_t) simcall->args[0].dp);
       SIMIX_simcall_answer(simcall);
index 7da760d..8a0b4b3 100644 (file)
@@ -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 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)
 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)
index 94df88e..6401465 100644 (file)
@@ -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);
 }
 
   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(
 smx_synchro_t SIMIX_mbox_get_head(smx_mailbox_t mbox)
 {
   return (smx_synchro_t) xbt_fifo_get_item_content(
index 80adafe..c3f85b6 100644 (file)
@@ -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 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);
 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);