Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove duplicated code.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Thu, 30 Jan 2014 15:16:43 +0000 (16:16 +0100)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Thu, 30 Jan 2014 17:07:48 +0000 (18:07 +0100)
14 files changed:
include/simgrid/simix.h
src/msg/msg_gos.c
src/msg/msg_mailbox.c
src/simix/simcalls.in
src/simix/simcalls_generated_args_getter_setter.h
src/simix/simcalls_generated_body.c
src/simix/simcalls_generated_case.c
src/simix/simcalls_generated_enum.h
src/simix/simcalls_generated_res_getter_setter.h
src/simix/simcalls_generated_string.c
src/simix/smx_network.c
src/simix/smx_network_private.h
src/simix/smx_user.c
src/smpi/smpi_base.c

index f33177f..6bd38df 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2010, 2012-2013. The SimGrid Team.
+/* Copyright (c) 2007-2010, 2012-2014. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -429,24 +429,14 @@ XBT_PUBLIC(smx_action_t) simcall_comm_isend(smx_rdv_t rdv, double task_size,
                                               void *data, int detached);
 
 XBT_PUBLIC(void) simcall_comm_recv(smx_rdv_t rdv, void *dst_buff,
-                                     size_t * dst_buff_size,
-                                     int (*match_fun)(void *, void *, smx_action_t),
-                                     void *data, double timeout);
+                                   size_t * dst_buff_size,
+                                   int (*match_fun)(void *, void *, smx_action_t),
+                                   void *data, double timeout, double rate);
 
 XBT_PUBLIC(smx_action_t) simcall_comm_irecv(smx_rdv_t rdv, void *dst_buff,
-                                              size_t * dst_buff_size,
-                                              int (*match_fun)(void *, void *, smx_action_t),
-                                              void *data);
-
-XBT_PUBLIC(void) simcall_comm_recv_bounded(smx_rdv_t rdv, void *dst_buff,
-                                     size_t * dst_buff_size,
-                                     int (*match_fun)(void *, void *, smx_action_t),
-                                     void *data, double timeout, double rate);
-
-XBT_PUBLIC(smx_action_t) simcall_comm_irecv_bounded(smx_rdv_t rdv, void *dst_buff,
-                                              size_t * dst_buff_size,
-                                              int (*match_fun)(void *, void *, smx_action_t),
-                                              void *data, double rate);
+                                            size_t * dst_buff_size,
+                                            int (*match_fun)(void *, void *, smx_action_t),
+                                            void *data, double rate);
 
 XBT_PUBLIC(void) simcall_comm_destroy(smx_action_t comm);
 XBT_PUBLIC(smx_action_t) simcall_comm_iprobe(smx_rdv_t rdv, int src, int tag,
index 8f561fd..b80ae0f 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004-2013. The SimGrid Team.
+/* Copyright (c) 2004-2014. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -156,7 +156,7 @@ msg_error_t MSG_process_sleep(double nb_sec)
   /*proc->simdata->waiting_action = act_sleep;
 
   FIXME: check if not setting the waiting_action breaks something on msg
-  
+
   proc->simdata->waiting_action = NULL;*/
 
   TRY {
@@ -232,7 +232,7 @@ MSG_task_receive_from_host(msg_task_t * task, const char *alias,
  */
 msg_error_t
 MSG_task_receive_from_host_bounded(msg_task_t * task, const char *alias,
-                           msg_host_t host, double rate)
+                                   msg_host_t host, double rate)
 {
   return MSG_task_receive_ext_bounded(task, alias, -1, host, rate);
 }
@@ -267,7 +267,8 @@ msg_error_t MSG_task_receive(msg_task_t * task, const char *alias)
  * #MSG_OK if the task was successfully received,
  * #MSG_HOST_FAILURE, or #MSG_TRANSFER_FAILURE otherwise.
  */
-msg_error_t MSG_task_receive_bounded(msg_task_t * task, const char *alias, double rate)
+msg_error_t MSG_task_receive_bounded(msg_task_t * task, const char *alias,
+                                     double rate)
 {
   return MSG_task_receive_with_timeout_bounded(task, alias, -1, rate);
 }
@@ -309,9 +310,9 @@ MSG_task_receive_with_timeout(msg_task_t * task, const char *alias,
  */
 msg_error_t
 MSG_task_receive_with_timeout_bounded(msg_task_t * task, const char *alias,
-                              double timeout,double rate)
+                                      double timeout,double rate)
 {
-  return MSG_task_receive_ext_bounded(task, alias, timeout, NULL,rate);
+  return MSG_task_receive_ext_bounded(task, alias, timeout, NULL, rate);
 }
 
 /** \ingroup msg_task_usage
@@ -373,15 +374,76 @@ MSG_task_receive_ext(msg_task_t * task, const char *alias, double timeout,
  */
 msg_error_t
 MSG_task_receive_ext_bounded(msg_task_t * task, const char *alias, double timeout,
-                     msg_host_t host, double rate)
+                             msg_host_t host, double rate)
 {
   XBT_DEBUG
       ("MSG_task_receive_ext: Trying to receive a message on mailbox '%s'",
        alias);
   return MSG_mailbox_get_task_ext_bounded(MSG_mailbox_get_by_alias(alias), task,
-                                  host, timeout, rate);
+                                          host, timeout, rate);
 }
 
+/* Internal function used to factorize code between
+ * MSG_task_isend_with_matching() and MSG_task_dsend().
+ */
+static XBT_INLINE
+msg_comm_t MSG_task_isend_internal(msg_task_t task, const char *alias,
+                                   int (*match_fun)(void*,void*, smx_action_t),
+                                   void *match_data, void_f_pvoid_t cleanup,
+                                   int detached)
+{
+  simdata_task_t t_simdata = NULL;
+  msg_process_t process = MSG_process_self();
+  msg_mailbox_t mailbox = MSG_mailbox_get_by_alias(alias);
+
+#ifdef HAVE_TRACING
+  int call_end = TRACE_msg_task_put_start(task);
+#endif
+
+  /* Prepare the task to send */
+  t_simdata = task->simdata;
+  t_simdata->sender = process;
+  t_simdata->source = ((simdata_process_t) SIMIX_process_self_get_data(process))->m_host;
+
+  xbt_assert(t_simdata->isused == 0,
+              "This task is still being used somewhere else. You cannot send it now. Go fix your code!");
+
+  t_simdata->isused = 1;
+  t_simdata->comm = NULL;
+  msg_global->sent_msg++;
+
+  /* Send it by calling SIMIX network layer */
+  smx_action_t act = simcall_comm_isend(mailbox, t_simdata->message_size,
+                                        t_simdata->rate, task, sizeof(void *),
+                                        match_fun, cleanup, match_data,detached);
+  t_simdata->comm = act; /* FIXME: is the field t_simdata->comm still useful? */
+
+  msg_comm_t comm;
+  if (detached) {
+    comm = NULL;
+  } else {
+    comm = xbt_new0(s_msg_comm_t, 1);
+    comm->task_sent = task;
+    comm->task_received = NULL;
+    comm->status = MSG_OK;
+    comm->s_comm = act;
+  }
+
+#ifdef HAVE_TRACING
+    if (TRACE_is_enabled()) {
+      simcall_set_category(comm->s_comm, task->category);
+    }
+#endif
+
+#ifdef HAVE_TRACING
+  if (call_end)
+    TRACE_msg_task_put_end();
+#endif
+
+  return comm;
+}
+
+
 /** \ingroup msg_task_usage
  * \brief Sends a task on a mailbox.
  *
@@ -394,7 +456,7 @@ MSG_task_receive_ext_bounded(msg_task_t * task, const char *alias, double timeou
  */
 msg_comm_t MSG_task_isend(msg_task_t task, const char *alias)
 {
-  return MSG_task_isend_with_matching(task,alias,NULL,NULL);
+  return MSG_task_isend_internal(task, alias, NULL, NULL, NULL, 0);
 }
 
 /** \ingroup msg_task_usage
@@ -409,10 +471,11 @@ msg_comm_t MSG_task_isend(msg_task_t task, const char *alias)
  * \param maxrate the maximum communication rate for sending this task .
  * \return the msg_comm_t communication created
  */
-msg_comm_t MSG_task_isend_bounded(msg_task_t task, const char *alias, double maxrate)
+msg_comm_t MSG_task_isend_bounded(msg_task_t task, const char *alias,
+                                  double maxrate)
 {
   task->simdata->rate = maxrate;
-  return MSG_task_isend_with_matching(task,alias,NULL,NULL);
+  return MSG_task_isend_internal(task, alias, NULL, NULL, NULL, 0);
 }
 
 
@@ -431,51 +494,12 @@ msg_comm_t MSG_task_isend_bounded(msg_task_t task, const char *alias, double max
  * \param match_data user provided data passed to match_fun
  * \return the msg_comm_t communication created
  */
-XBT_INLINE msg_comm_t MSG_task_isend_with_matching(msg_task_t task, const char *alias,
-    int (*match_fun)(void*,void*, smx_action_t),
-    void *match_data)
+msg_comm_t MSG_task_isend_with_matching(msg_task_t task, const char *alias,
+                                        int (*match_fun)(void*, void*,
+                                                         smx_action_t),
+                                        void *match_data)
 {
-  simdata_task_t t_simdata = NULL;
-  msg_process_t process = MSG_process_self();
-  msg_mailbox_t mailbox = MSG_mailbox_get_by_alias(alias);
-
-#ifdef HAVE_TRACING
-  int call_end = TRACE_msg_task_put_start(task);
-#endif
-
-  /* Prepare the task to send */
-  t_simdata = task->simdata;
-  t_simdata->sender = process;
-  t_simdata->source = ((simdata_process_t) SIMIX_process_self_get_data(process))->m_host;
-
-  xbt_assert(t_simdata->isused == 0,
-              "This task is still being used somewhere else. You cannot send it now. Go fix your code!");
-
-  t_simdata->isused = 1;
-  t_simdata->comm = NULL;
-  msg_global->sent_msg++;
-
-  /* Send it by calling SIMIX network layer */
-  msg_comm_t comm = xbt_new0(s_msg_comm_t, 1);
-  comm->task_sent = task;
-  comm->task_received = NULL;
-  comm->status = MSG_OK;
-  comm->s_comm =
-    simcall_comm_isend(mailbox, t_simdata->message_size,
-                         t_simdata->rate, task, sizeof(void *), match_fun, NULL, match_data, 0);
-  t_simdata->comm = comm->s_comm; /* FIXME: is the field t_simdata->comm still useful? */
-#ifdef HAVE_TRACING
-    if (TRACE_is_enabled()) {
-      simcall_set_category(comm->s_comm, task->category);
-    }
-#endif
-
-#ifdef HAVE_TRACING
-  if (call_end)
-    TRACE_msg_task_put_end();
-#endif
-
-  return comm;
+  return MSG_task_isend_internal(task, alias, match_fun, match_data, NULL, 0);
 }
 
 /** \ingroup msg_task_usage
@@ -497,43 +521,9 @@ XBT_INLINE msg_comm_t MSG_task_isend_with_matching(msg_task_t task, const char *
  */
 void MSG_task_dsend(msg_task_t task, const char *alias, void_f_pvoid_t cleanup)
 {
-  simdata_task_t t_simdata = NULL;
-  msg_process_t process = MSG_process_self();
-  msg_mailbox_t mailbox = MSG_mailbox_get_by_alias(alias);
-
-  /* Prepare the task to send */
-  t_simdata = task->simdata;
-  t_simdata->sender = process;
-  t_simdata->source = ((simdata_process_t) SIMIX_process_self_get_data(process))->m_host;
-
-  xbt_assert(t_simdata->isused == 0,
-              "This task is still being used somewhere else. You cannot send it now. Go fix your code!");
-
-  t_simdata->isused = 1;
-  t_simdata->comm = NULL;
-  msg_global->sent_msg++;
-
-#ifdef HAVE_TRACING
-  int call_end = TRACE_msg_task_put_start(task);
-#endif
-
-  /* Send it by calling SIMIX network layer */
-  smx_action_t comm = simcall_comm_isend(mailbox, t_simdata->message_size,
-                       t_simdata->rate, task, sizeof(void *), NULL, cleanup, NULL, 1);
-  t_simdata->comm = comm;
-#ifdef HAVE_TRACING
-    if (TRACE_is_enabled()) {
-      simcall_set_category(comm, task->category);
-    }
-#endif
-
-#ifdef HAVE_TRACING
-  if (call_end)
-    TRACE_msg_task_put_end();
-#endif
+  MSG_task_isend_internal(task, alias, NULL, NULL, cleanup, 1);
 }
 
-
 /** \ingroup msg_task_usage
  * \brief Sends a task on a mailbox with a maximal rate.
  *
@@ -551,46 +541,13 @@ void MSG_task_dsend(msg_task_t task, const char *alias, void_f_pvoid_t cleanup)
  * communication fails, e.g. MSG_task_destroy
  * (if NULL, no function will be called)
  * \param maxrate the maximum communication rate for sending this task
- * 
+ *
  */
-void MSG_task_dsend_bounded(msg_task_t task, const char *alias, void_f_pvoid_t cleanup, double maxrate)
+void MSG_task_dsend_bounded(msg_task_t task, const char *alias,
+                            void_f_pvoid_t cleanup, double maxrate)
 {
   task->simdata->rate = maxrate;
-  
-  simdata_task_t t_simdata = NULL;
-  msg_process_t process = MSG_process_self();
-  msg_mailbox_t mailbox = MSG_mailbox_get_by_alias(alias);
-
-  /* Prepare the task to send */
-  t_simdata = task->simdata;
-  t_simdata->sender = process;
-  t_simdata->source = ((simdata_process_t) SIMIX_process_self_get_data(process))->m_host;
-
-  xbt_assert(t_simdata->isused == 0,
-              "This task is still being used somewhere else. You cannot send it now. Go fix your code!");
-
-  t_simdata->isused = 1;
-  t_simdata->comm = NULL;
-  msg_global->sent_msg++;
-
-#ifdef HAVE_TRACING
-  int call_end = TRACE_msg_task_put_start(task);
-#endif
-
-  /* Send it by calling SIMIX network layer */
-  smx_action_t comm = simcall_comm_isend(mailbox, t_simdata->message_size,
-                       t_simdata->rate, task, sizeof(void *), NULL, cleanup, NULL, 1);
-  t_simdata->comm = comm;
-#ifdef HAVE_TRACING
-    if (TRACE_is_enabled()) {
-      simcall_set_category(comm, task->category);
-    }
-#endif
-
-#ifdef HAVE_TRACING
-  if (call_end)
-    TRACE_msg_task_put_end();
-#endif
+  MSG_task_dsend(task, alias, cleanup);
 }
 
 /** \ingroup msg_task_usage
@@ -598,32 +555,14 @@ void MSG_task_dsend_bounded(msg_task_t task, const char *alias, void_f_pvoid_t c
  *
  * This is a non blocking function: use MSG_comm_wait() or MSG_comm_test()
  * to end the communication.
- * 
+ *
  * \param task a memory location for storing a #msg_task_t. has to be valid until the end of the communication.
  * \param name of the mailbox to receive the task on
  * \return the msg_comm_t communication created
  */
 msg_comm_t MSG_task_irecv(msg_task_t *task, const char *name)
 {
-  smx_rdv_t rdv = MSG_mailbox_get_by_alias(name);
-
-  /* FIXME: these functions are not traceable */
-
-  /* Sanity check */
-  xbt_assert(task, "Null pointer for the task storage");
-
-  if (*task)
-    XBT_CRITICAL
-        ("MSG_task_irecv() was asked to write in a non empty task struct.");
-
-  /* Try to receive it by calling SIMIX network layer */
-  msg_comm_t comm = xbt_new0(s_msg_comm_t, 1);
-  comm->task_sent = NULL;
-  comm->task_received = task;
-  comm->status = MSG_OK;
-  comm->s_comm = simcall_comm_irecv(rdv, task, NULL, NULL, NULL);
-
-  return comm;
+  return MSG_task_irecv_bounded(task, name, -1.0);
 }
 
 /** \ingroup msg_task_usage
@@ -635,10 +574,9 @@ msg_comm_t MSG_task_irecv(msg_task_t *task, const char *name)
  * \param rate limit the bandwidth to the given rate
  * \return the msg_comm_t communication created
  */
-msg_comm_t MSG_task_irecv_bounded(msg_task_t *task, const char *name, double rate)
+msg_comm_t MSG_task_irecv_bounded(msg_task_t *task, const char *name,
+                                  double rate)
 {
-
-
   smx_rdv_t rdv = MSG_mailbox_get_by_alias(name);
 
   /* FIXME: these functions are not traceable */
@@ -655,7 +593,7 @@ msg_comm_t MSG_task_irecv_bounded(msg_task_t *task, const char *name, double rat
   comm->task_sent = NULL;
   comm->task_received = task;
   comm->status = MSG_OK;
-  comm->s_comm = simcall_comm_irecv_bounded(rdv, task, NULL, NULL, NULL, rate);
+  comm->s_comm = simcall_comm_irecv(rdv, task, NULL, NULL, NULL, rate);
 
   return comm;
 }
@@ -773,7 +711,7 @@ void MSG_comm_destroy(msg_comm_t comm)
  *
  * It takes two parameters.
  * \param comm the communication to wait.
- * \param timeout Wait until the communication terminates or the timeout 
+ * \param timeout Wait until the communication terminates or the timeout
  * occurs. You can provide a -1 timeout to obtain an infinite timeout.
  * \return msg_error_t
  */
index 6082642..b8b63a2 100644 (file)
@@ -1,6 +1,6 @@
 /* Mailboxes in MSG */
 
-/* Copyright (c) 2008-2013. The SimGrid Team.
+/* Copyright (c) 2008-2014. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -87,58 +87,10 @@ void MSG_mailbox_set_async(const char *alias){
  * #MSG_HOST_FAILURE, or #MSG_TRANSFER_FAILURE otherwise.
  */
 msg_error_t
-MSG_mailbox_get_task_ext(msg_mailbox_t mailbox, msg_task_t * task,
+MSG_mailbox_get_task_ext(msg_mailbox_t mailbox, msg_task_t *task,
                          msg_host_t host, double timeout)
 {
-  xbt_ex_t e;
-  msg_error_t ret = MSG_OK;
-  /* We no longer support getting a task from a specific host */
-  if (host)
-    THROW_UNIMPLEMENTED;
-
-#ifdef HAVE_TRACING
-  TRACE_msg_task_get_start();
-  double start_time = MSG_get_clock();
-#endif
-
-  /* Sanity check */
-  xbt_assert(task, "Null pointer for the task storage");
-
-  if (*task)
-    XBT_WARN
-        ("Asked to write the received task in a non empty struct -- proceeding.");
-
-  /* Try to receive it by calling SIMIX network layer */
-  TRY {
-    simcall_comm_recv(mailbox, task, NULL, NULL, NULL, timeout);
-    XBT_DEBUG("Got task %s from %p",(*task)->name,mailbox);
-    (*task)->simdata->isused=0;
-  }
-  CATCH(e) {
-    switch (e.category) {
-    case cancel_error:
-      ret = MSG_HOST_FAILURE;
-      break;
-    case network_error:
-      ret = MSG_TRANSFER_FAILURE;
-      break;
-    case timeout_error:
-      ret = MSG_TIMEOUT;
-      break;
-    default:
-      RETHROW;
-    }
-    xbt_ex_free(e);
-  }
-
-#ifdef HAVE_TRACING
-  if (ret != MSG_HOST_FAILURE &&
-      ret != MSG_TRANSFER_FAILURE &&
-      ret != MSG_TIMEOUT) {
-    TRACE_msg_task_get_end(start_time, *task);
-  }
-#endif
-  MSG_RETURN(ret);
+  return MSG_mailbox_get_task_ext_bounded(mailbox, task, host, timeout, -1.0);
 }
 
 /** \ingroup msg_mailbox_management
@@ -156,7 +108,7 @@ MSG_mailbox_get_task_ext(msg_mailbox_t mailbox, msg_task_t * task,
  */
 msg_error_t
 MSG_mailbox_get_task_ext_bounded(msg_mailbox_t mailbox, msg_task_t * task,
-                         msg_host_t host, double timeout, double rate)
+                                 msg_host_t host, double timeout, double rate)
 {
   xbt_ex_t e;
   msg_error_t ret = MSG_OK;
@@ -178,7 +130,7 @@ MSG_mailbox_get_task_ext_bounded(msg_mailbox_t mailbox, msg_task_t * task,
 
   /* Try to receive it by calling SIMIX network layer */
   TRY {
-    simcall_comm_recv_bounded(mailbox, task, NULL, NULL, NULL, timeout, rate);
+    simcall_comm_recv(mailbox, task, NULL, NULL, NULL, timeout, rate);
     XBT_DEBUG("Got task %s from %p",(*task)->name,mailbox);
     (*task)->simdata->isused=0;
   }
index 874b0bb..2729ab5 100644 (file)
@@ -73,10 +73,8 @@ rdv_get_receiver True (void*, smx_process_t) (rdv, void*, smx_rdv_t)
 comm_iprobe True (void*, smx_action_t) (rdv, void*, smx_rdv_t) (src, int) (tag, int) (match_fun, FPtr, simix_match_func_t) (data, void*)
 comm_send False (void) (rdv, void*, smx_rdv_t) (task_size, double) (rate, double) (src_buff, void*) (src_buff_size, size_t) (match_fun, FPtr, simix_match_func_t) (data, void*) (timeout, double)
 comm_isend True (void*, smx_action_t) (rdv, void*, smx_rdv_t) (task_size, double) (rate, double) (src_buff, void*) (src_buff_size, size_t) (match_fun, FPtr, simix_match_func_t) (clean_fun, FPtr, simix_clean_func_t) (data, void*) (detached, int)
-comm_recv False (void) (rdv, void*, smx_rdv_t) (dst_buff, void*) (dst_buff_size, void*, size_t*) (match_fun, FPtr, simix_match_func_t) (data, void*) (timeout, double)
-comm_irecv True (void*, smx_action_t) (rdv, void*, smx_rdv_t) (dst_buff, void*) (dst_buff_size, void*, size_t*) (match_fun, FPtr, simix_match_func_t) (data, void*)
-comm_recv_bounded False (void) (rdv, void*, smx_rdv_t) (dst_buff, void*) (dst_buff_size, void*, size_t*) (match_fun, FPtr, simix_match_func_t) (data, void*) (timeout, double) (rate, double)
-comm_irecv_bounded True (void*, smx_action_t) (rdv, void*, smx_rdv_t) (dst_buff, void*) (dst_buff_size, void*, size_t*) (match_fun, FPtr, simix_match_func_t) (data, void*) (rate, double)
+comm_recv False (void) (rdv, void*, smx_rdv_t) (dst_buff, void*) (dst_buff_size, void*, size_t*) (match_fun, FPtr, simix_match_func_t) (data, void*) (timeout, double) (rate, double)
+comm_irecv True (void*, smx_action_t) (rdv, void*, smx_rdv_t) (dst_buff, void*) (dst_buff_size, void*, size_t*) (match_fun, FPtr, simix_match_func_t) (data, void*) (rate, double)
 comm_destroy True (void) (comm, void*, smx_action_t)
 comm_cancel True (void) (comm, void*, smx_action_t)
 comm_waitany False (int) (comms, void*, xbt_dynar_t)
index 0db1cc8..48a1241 100644 (file)
@@ -846,6 +846,12 @@ static inline double simcall_comm_recv__get__timeout(smx_simcall_t simcall){
 static inline void simcall_comm_recv__set__timeout(smx_simcall_t simcall, double arg){
     simcall->args[5].d = arg;
 }
+static inline double simcall_comm_recv__get__rate(smx_simcall_t simcall){
+  return  simcall->args[6].d;
+}
+static inline void simcall_comm_recv__set__rate(smx_simcall_t simcall, double arg){
+    simcall->args[6].d = arg;
+}
 static inline smx_rdv_t simcall_comm_irecv__get__rdv(smx_simcall_t simcall){
   return (smx_rdv_t) simcall->args[0].dp;
 }
@@ -876,82 +882,10 @@ static inline void* simcall_comm_irecv__get__data(smx_simcall_t simcall){
 static inline void simcall_comm_irecv__set__data(smx_simcall_t simcall, void* arg){
     simcall->args[4].dp = arg;
 }
-static inline smx_rdv_t simcall_comm_recv_bounded__get__rdv(smx_simcall_t simcall){
-  return (smx_rdv_t) simcall->args[0].dp;
-}
-static inline void simcall_comm_recv_bounded__set__rdv(smx_simcall_t simcall, void* arg){
-    simcall->args[0].dp = arg;
-}
-static inline void* simcall_comm_recv_bounded__get__dst_buff(smx_simcall_t simcall){
-  return  simcall->args[1].dp;
-}
-static inline void simcall_comm_recv_bounded__set__dst_buff(smx_simcall_t simcall, void* arg){
-    simcall->args[1].dp = arg;
-}
-static inline size_t* simcall_comm_recv_bounded__get__dst_buff_size(smx_simcall_t simcall){
-  return (size_t*) simcall->args[2].dp;
-}
-static inline void simcall_comm_recv_bounded__set__dst_buff_size(smx_simcall_t simcall, void* arg){
-    simcall->args[2].dp = arg;
-}
-static inline simix_match_func_t simcall_comm_recv_bounded__get__match_fun(smx_simcall_t simcall){
-  return (simix_match_func_t) simcall->args[3].fp;
-}
-static inline void simcall_comm_recv_bounded__set__match_fun(smx_simcall_t simcall, FPtr arg){
-    simcall->args[3].fp = arg;
-}
-static inline void* simcall_comm_recv_bounded__get__data(smx_simcall_t simcall){
-  return  simcall->args[4].dp;
-}
-static inline void simcall_comm_recv_bounded__set__data(smx_simcall_t simcall, void* arg){
-    simcall->args[4].dp = arg;
-}
-static inline double simcall_comm_recv_bounded__get__timeout(smx_simcall_t simcall){
-  return  simcall->args[5].d;
-}
-static inline void simcall_comm_recv_bounded__set__timeout(smx_simcall_t simcall, double arg){
-    simcall->args[5].d = arg;
-}
-static inline double simcall_comm_recv_bounded__get__rate(smx_simcall_t simcall){
-  return  simcall->args[6].d;
-}
-static inline void simcall_comm_recv_bounded__set__rate(smx_simcall_t simcall, double arg){
-    simcall->args[6].d = arg;
-}
-static inline smx_rdv_t simcall_comm_irecv_bounded__get__rdv(smx_simcall_t simcall){
-  return (smx_rdv_t) simcall->args[0].dp;
-}
-static inline void simcall_comm_irecv_bounded__set__rdv(smx_simcall_t simcall, void* arg){
-    simcall->args[0].dp = arg;
-}
-static inline void* simcall_comm_irecv_bounded__get__dst_buff(smx_simcall_t simcall){
-  return  simcall->args[1].dp;
-}
-static inline void simcall_comm_irecv_bounded__set__dst_buff(smx_simcall_t simcall, void* arg){
-    simcall->args[1].dp = arg;
-}
-static inline size_t* simcall_comm_irecv_bounded__get__dst_buff_size(smx_simcall_t simcall){
-  return (size_t*) simcall->args[2].dp;
-}
-static inline void simcall_comm_irecv_bounded__set__dst_buff_size(smx_simcall_t simcall, void* arg){
-    simcall->args[2].dp = arg;
-}
-static inline simix_match_func_t simcall_comm_irecv_bounded__get__match_fun(smx_simcall_t simcall){
-  return (simix_match_func_t) simcall->args[3].fp;
-}
-static inline void simcall_comm_irecv_bounded__set__match_fun(smx_simcall_t simcall, FPtr arg){
-    simcall->args[3].fp = arg;
-}
-static inline void* simcall_comm_irecv_bounded__get__data(smx_simcall_t simcall){
-  return  simcall->args[4].dp;
-}
-static inline void simcall_comm_irecv_bounded__set__data(smx_simcall_t simcall, void* arg){
-    simcall->args[4].dp = arg;
-}
-static inline double simcall_comm_irecv_bounded__get__rate(smx_simcall_t simcall){
+static inline double simcall_comm_irecv__get__rate(smx_simcall_t simcall){
   return  simcall->args[5].d;
 }
-static inline void simcall_comm_irecv_bounded__set__rate(smx_simcall_t simcall, double arg){
+static inline void simcall_comm_irecv__set__rate(smx_simcall_t simcall, double arg){
     simcall->args[5].d = arg;
 }
 static inline smx_action_t simcall_comm_destroy__get__comm(smx_simcall_t simcall){
index fe4a838..7ad2b3a 100644 (file)
     }    
     return self->simcall.result.dp;
   }
-  inline static void simcall_BODY_comm_recv(smx_rdv_t rdv, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, void* data, double timeout) {
+  inline static void simcall_BODY_comm_recv(smx_rdv_t rdv, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, void* data, double timeout, double rate) {
     smx_process_t self = SIMIX_process_self();
     self->simcall.call = SIMCALL_COMM_RECV;
     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
     self->simcall.args[3].fp = (FPtr) match_fun;
     self->simcall.args[4].dp = (void*) data;
     self->simcall.args[5].d = (double) timeout;
-    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_pre(&self->simcall, 0);
-    }    
-    
-  }
-  inline static smx_action_t simcall_BODY_comm_irecv(smx_rdv_t rdv, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, void* data) {
-    smx_process_t self = SIMIX_process_self();
-    self->simcall.call = SIMCALL_COMM_IRECV;
-    memset(&self->simcall.result, 0, sizeof(self->simcall.result));
-    memset(self->simcall.args, 0, sizeof(self->simcall.args));
-    self->simcall.args[0].dp = (void*) rdv;
-    self->simcall.args[1].dp = (void*) dst_buff;
-    self->simcall.args[2].dp = (void*) dst_buff_size;
-    self->simcall.args[3].fp = (FPtr) match_fun;
-    self->simcall.args[4].dp = (void*) data;
-    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_pre(&self->simcall, 0);
-    }    
-    return self->simcall.result.dp;
-  }
-  inline static void simcall_BODY_comm_recv_bounded(smx_rdv_t rdv, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, void* data, double timeout, double rate) {
-    smx_process_t self = SIMIX_process_self();
-    self->simcall.call = SIMCALL_COMM_RECV_BOUNDED;
-    memset(&self->simcall.result, 0, sizeof(self->simcall.result));
-    memset(self->simcall.args, 0, sizeof(self->simcall.args));
-    self->simcall.args[0].dp = (void*) rdv;
-    self->simcall.args[1].dp = (void*) dst_buff;
-    self->simcall.args[2].dp = (void*) dst_buff_size;
-    self->simcall.args[3].fp = (FPtr) match_fun;
-    self->simcall.args[4].dp = (void*) data;
-    self->simcall.args[5].d = (double) timeout;
     self->simcall.args[6].d = (double) rate;
     if (self != simix_global->maestro_process) {
       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
     }    
     
   }
-  inline static smx_action_t simcall_BODY_comm_irecv_bounded(smx_rdv_t rdv, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, void* data, double rate) {
+  inline static smx_action_t simcall_BODY_comm_irecv(smx_rdv_t rdv, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, void* data, double rate) {
     smx_process_t self = SIMIX_process_self();
-    self->simcall.call = SIMCALL_COMM_IRECV_BOUNDED;
+    self->simcall.call = SIMCALL_COMM_IRECV;
     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
     memset(self->simcall.args, 0, sizeof(self->simcall.args));
     self->simcall.args[0].dp = (void*) rdv;
index d984219..9e3a364 100644 (file)
@@ -372,20 +372,11 @@ case SIMCALL_COMM_ISEND:
       break;  
 
 case SIMCALL_COMM_RECV:
-       SIMIX_pre_comm_recv(simcall , (smx_rdv_t) simcall->args[0].dp,  simcall->args[1].dp, (size_t*) simcall->args[2].dp, (simix_match_func_t) simcall->args[3].fp,  simcall->args[4].dp,  simcall->args[5].d);
+       SIMIX_pre_comm_recv(simcall , (smx_rdv_t) simcall->args[0].dp,  simcall->args[1].dp, (size_t*) simcall->args[2].dp, (simix_match_func_t) simcall->args[3].fp,  simcall->args[4].dp,  simcall->args[5].d,  simcall->args[6].d);
        break;  
 
 case SIMCALL_COMM_IRECV:
-      simcall->result.dp = SIMIX_pre_comm_irecv(simcall , (smx_rdv_t) simcall->args[0].dp,  simcall->args[1].dp, (size_t*) simcall->args[2].dp, (simix_match_func_t) simcall->args[3].fp,  simcall->args[4].dp);
-      SIMIX_simcall_answer(simcall);
-      break;  
-
-case SIMCALL_COMM_RECV_BOUNDED:
-       SIMIX_pre_comm_recv_bounded(simcall , (smx_rdv_t) simcall->args[0].dp,  simcall->args[1].dp, (size_t*) simcall->args[2].dp, (simix_match_func_t) simcall->args[3].fp,  simcall->args[4].dp,  simcall->args[5].d,  simcall->args[6].d);
-       break;  
-
-case SIMCALL_COMM_IRECV_BOUNDED:
-      simcall->result.dp = SIMIX_pre_comm_irecv_bounded(simcall , (smx_rdv_t) simcall->args[0].dp,  simcall->args[1].dp, (size_t*) simcall->args[2].dp, (simix_match_func_t) simcall->args[3].fp,  simcall->args[4].dp,  simcall->args[5].d);
+      simcall->result.dp = SIMIX_pre_comm_irecv(simcall , (smx_rdv_t) simcall->args[0].dp,  simcall->args[1].dp, (size_t*) simcall->args[2].dp, (simix_match_func_t) simcall->args[3].fp,  simcall->args[4].dp,  simcall->args[5].d);
       SIMIX_simcall_answer(simcall);
       break;  
 
index 4336f1b..06c77a9 100644 (file)
@@ -81,8 +81,6 @@ SIMCALL_COMM_SEND,
 SIMCALL_COMM_ISEND,
 SIMCALL_COMM_RECV,
 SIMCALL_COMM_IRECV,
-SIMCALL_COMM_RECV_BOUNDED,
-SIMCALL_COMM_IRECV_BOUNDED,
 SIMCALL_COMM_DESTROY,
 SIMCALL_COMM_CANCEL,
 SIMCALL_COMM_WAITANY,
index f526cd8..0c79e3a 100644 (file)
@@ -319,14 +319,6 @@ static inline void simcall_comm_irecv__set__result(smx_simcall_t simcall, void*
 }
 
 
-static inline smx_action_t simcall_comm_irecv_bounded__get__result(smx_simcall_t simcall){
-  return (smx_action_t) simcall->result.dp;
-}
-static inline void simcall_comm_irecv_bounded__set__result(smx_simcall_t simcall, void* result){
-    simcall->result.dp = result;
-}
-
-
 
 
 static inline int simcall_comm_waitany__get__result(smx_simcall_t simcall){
index 2c4d1e2..de3896a 100644 (file)
@@ -81,8 +81,6 @@
 [SIMCALL_COMM_ISEND] = "SIMCALL_COMM_ISEND",
 [SIMCALL_COMM_RECV] = "SIMCALL_COMM_RECV",
 [SIMCALL_COMM_IRECV] = "SIMCALL_COMM_IRECV",
-[SIMCALL_COMM_RECV_BOUNDED] = "SIMCALL_COMM_RECV_BOUNDED",
-[SIMCALL_COMM_IRECV_BOUNDED] = "SIMCALL_COMM_IRECV_BOUNDED",
 [SIMCALL_COMM_DESTROY] = "SIMCALL_COMM_DESTROY",
 [SIMCALL_COMM_CANCEL] = "SIMCALL_COMM_CANCEL",
 [SIMCALL_COMM_WAITANY] = "SIMCALL_COMM_WAITANY",
index 6188ec6..dd3660a 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009-2013. The SimGrid Team.
+/* Copyright (c) 2009-2014. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -453,20 +453,11 @@ smx_action_t SIMIX_comm_isend(smx_process_t src_proc, smx_rdv_t rdv,
 }
 
 void SIMIX_pre_comm_recv(smx_simcall_t simcall, smx_rdv_t rdv,
-                                  void *dst_buff, size_t *dst_buff_size,
-                                  int (*match_fun)(void *, void *, smx_action_t),
-                                 void *data, double timeout){
+                         void *dst_buff, size_t *dst_buff_size,
+                         int (*match_fun)(void *, void *, smx_action_t),
+                         void *data, double timeout, double rate)
+{
   smx_action_t comm = SIMIX_comm_irecv(simcall->issuer, rdv, dst_buff,
-                                      dst_buff_size, match_fun, data);
-  simcall->mc_value = 0;
-  SIMIX_pre_comm_wait(simcall, comm, timeout);
-}
-
-void SIMIX_pre_comm_recv_bounded(smx_simcall_t simcall, smx_rdv_t rdv,
-                                  void *dst_buff, size_t *dst_buff_size,
-                                  int (*match_fun)(void *, void *, smx_action_t),
-                                 void *data, double timeout, double rate){
-  smx_action_t comm = SIMIX_comm_irecv_bounded(simcall->issuer, rdv, dst_buff,
                                       dst_buff_size, match_fun, data, rate);
   simcall->mc_value = 0;
   SIMIX_pre_comm_wait(simcall, comm, timeout);
@@ -475,107 +466,16 @@ void SIMIX_pre_comm_recv_bounded(smx_simcall_t simcall, smx_rdv_t rdv,
 smx_action_t SIMIX_pre_comm_irecv(smx_simcall_t simcall, smx_rdv_t rdv,
                                   void *dst_buff, size_t *dst_buff_size,
                                   int (*match_fun)(void *, void *, smx_action_t),
-                                 void *data){
-  return SIMIX_comm_irecv(simcall->issuer, rdv, dst_buff, dst_buff_size,
-                         match_fun, data);
-}
-
-smx_action_t SIMIX_comm_irecv(smx_process_t dst_proc, smx_rdv_t rdv,
-                              void *dst_buff, size_t *dst_buff_size,
-                              int (*match_fun)(void *, void *, smx_action_t), void *data)
+                                 void *data, double rate)
 {
-  XBT_DEBUG("recv from %p %p\n", rdv, rdv->comm_fifo);
-  smx_action_t this_action = SIMIX_comm_new(SIMIX_COMM_RECEIVE);
-
-  smx_action_t other_action;
-  //communication already done, get it inside the fifo of completed comms
-  //permanent receive v1
-  //int already_received=0;
-  if(rdv->permanent_receiver && xbt_fifo_size(rdv->done_comm_fifo)!=0){
-
-    XBT_DEBUG("We have a comm that has probably already been received, trying to match it, to skip the communication\n");
-    //find a match in the already received fifo
-    other_action = SIMIX_fifo_get_comm(rdv->done_comm_fifo, SIMIX_COMM_SEND, match_fun, data, this_action);
-    //if not found, assume the receiver came first, register it to the mailbox in the classical way
-    if (!other_action)  {
-      XBT_DEBUG("We have messages in the permanent receive list, but not the one we are looking for, pushing request into fifo\n");
-      other_action = this_action;
-      SIMIX_rdv_push(rdv, this_action);
-    }else{
-      if(other_action->comm.surf_comm &&       SIMIX_comm_get_remains(other_action)==0.0)
-      {
-        XBT_DEBUG("comm %p has been already sent, and is finished, destroy it\n",&(other_action->comm));
-        other_action->state = SIMIX_DONE;
-        other_action->comm.type = SIMIX_COMM_DONE;
-        other_action->comm.rdv = NULL;
-        //SIMIX_comm_destroy(this_action);
-        //--smx_total_comms; // this creation was a pure waste
-        //already_received=1;
-        //other_action->comm.refcount--;
-      }/*else{
-         XBT_DEBUG("Not yet finished, we have to wait %d\n", xbt_fifo_size(rdv->comm_fifo));
-         }*/
-      other_action->comm.refcount--;
-      SIMIX_comm_destroy(this_action);
-      --smx_total_comms; // this creation was a pure waste
-    }
-  }else{
-    /* Prepare an action describing us, so that it gets passed to the user-provided filter of other side */
-
-    /* Look for communication action matching our needs. We also provide a description of
-     * ourself so that the other side also gets a chance of choosing if it wants to match with us.
-     *
-     * If it is not found then push our communication into the rendez-vous point */
-    other_action = SIMIX_fifo_get_comm(rdv->comm_fifo, SIMIX_COMM_SEND, match_fun, data, this_action);
-
-    if (!other_action) {
-      XBT_DEBUG("Receive pushed first %d\n", xbt_fifo_size(rdv->comm_fifo));
-      other_action = this_action;
-      SIMIX_rdv_push(rdv, this_action);
-    } else {
-      SIMIX_comm_destroy(this_action);
-      --smx_total_comms; // this creation was a pure waste
-      other_action->state = SIMIX_READY;
-      other_action->comm.type = SIMIX_COMM_READY;
-      //other_action->comm.refcount--;
-    }
-    xbt_fifo_push(dst_proc->comms, other_action);
-  }
-
-  /* Setup communication action */
-  other_action->comm.dst_proc = dst_proc;
-  other_action->comm.dst_buff = dst_buff;
-  other_action->comm.dst_buff_size = dst_buff_size;
-  other_action->comm.dst_data = data;
-
-  other_action->comm.match_fun = match_fun;
-
-
-  /*if(already_received)//do the actual copy, because the first one after the comm didn't have all the info
-    SIMIX_comm_copy_data(other_action);*/
-
-
-  if (MC_is_active()) {
-    other_action->state = SIMIX_RUNNING;
-    return other_action;
-  }
-
-  SIMIX_comm_start(other_action);
-  // }
-  return other_action;
-}
-
-smx_action_t SIMIX_pre_comm_irecv_bounded(smx_simcall_t simcall, smx_rdv_t rdv,
-                                  void *dst_buff, size_t *dst_buff_size,
-                                  int (*match_fun)(void *, void *, smx_action_t),
-                                 void *data, double rate){
-  return SIMIX_comm_irecv_bounded(simcall->issuer, rdv, dst_buff, dst_buff_size,
+  return SIMIX_comm_irecv(simcall->issuer, rdv, dst_buff, dst_buff_size,
                          match_fun, data, rate);
 }
 
-smx_action_t SIMIX_comm_irecv_bounded(smx_process_t dst_proc, smx_rdv_t rdv,
+smx_action_t SIMIX_comm_irecv(smx_process_t dst_proc, smx_rdv_t rdv,
                               void *dst_buff, size_t *dst_buff_size,
-                              int (*match_fun)(void *, void *, smx_action_t), void *data, double rate)
+                              int (*match_fun)(void *, void *, smx_action_t),
+                              void *data, double rate)
 {
   XBT_DEBUG("recv from %p %p\n", rdv, rdv->comm_fifo);
   smx_action_t this_action = SIMIX_comm_new(SIMIX_COMM_RECEIVE);
@@ -641,8 +541,9 @@ smx_action_t SIMIX_comm_irecv_bounded(smx_process_t dst_proc, smx_rdv_t rdv,
   other_action->comm.dst_buff_size = dst_buff_size;
   other_action->comm.dst_data = data;
 
-  if (rate < other_action->comm.rate || other_action->comm.rate == -1.0)
-         other_action->comm.rate = rate;
+  if (rate != -1.0 &&
+      (other_action->comm.rate == -1.0 || rate < other_action->comm.rate))
+    other_action->comm.rate = rate;
 
   other_action->comm.match_fun = match_fun;
 
index fecdd3e..fb04ba4 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2010, 2012-2013. The SimGrid Team.
+/* Copyright (c) 2007-2010, 2012-2014. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -43,10 +43,8 @@ smx_action_t SIMIX_comm_isend(smx_process_t src_proc, smx_rdv_t rdv,
                               int detached);
 smx_action_t SIMIX_comm_irecv(smx_process_t dst_proc, smx_rdv_t rdv,
                               void *dst_buff, size_t *dst_buff_size,
-                              int (*)(void *, void *, smx_action_t), void *data);
-smx_action_t SIMIX_comm_irecv_bounded(smx_process_t dst_proc, smx_rdv_t rdv,
-                              void *dst_buff, size_t *dst_buff_size,
-                              int (*)(void *, void *, smx_action_t), void *data, double rate);
+                              int (*)(void *, void *, smx_action_t),
+                              void *data, double rate);
 void SIMIX_comm_destroy(smx_action_t action);
 void SIMIX_comm_destroy_internal_actions(smx_action_t action);
 smx_action_t SIMIX_comm_iprobe(smx_process_t dst_proc, smx_rdv_t rdv, int src,
@@ -89,20 +87,12 @@ smx_action_t SIMIX_pre_comm_isend(smx_simcall_t simcall, smx_rdv_t rdv,
                                   void (*clean_fun)(void *), 
                                  void *data, int detached);
 void SIMIX_pre_comm_recv(smx_simcall_t simcall, smx_rdv_t rdv,
-                                  void *dst_buff, size_t *dst_buff_size,
-                                  int (*match_fun)(void *, void *, smx_action_t),
-                                 void *data, double timeout);
-void SIMIX_pre_comm_recv_bounded(smx_simcall_t simcall, smx_rdv_t rdv,
-                                  void *dst_buff, size_t *dst_buff_size,
-                                  int (*match_fun)(void *, void *, smx_action_t),
-                                 void *data, double timeout, double rate);
+                         void *dst_buff, size_t *dst_buff_size,
+                         int (*match_fun)(void *, void *, smx_action_t),
+                         void *data, double timeout, double rate);
 smx_action_t SIMIX_pre_comm_irecv(smx_simcall_t simcall, smx_rdv_t rdv,
                                   void *dst_buff, size_t *dst_buff_size,
                                   int (*match_fun)(void *, void *, smx_action_t),
-                                 void *data);
-smx_action_t SIMIX_pre_comm_irecv_bounded(smx_simcall_t simcall, smx_rdv_t rdv,
-                                  void *dst_buff, size_t *dst_buff_size,
-                                  int (*match_fun)(void *, void *, smx_action_t),
                                  void *data, double rate);
 void SIMIX_pre_comm_destroy(smx_simcall_t simcall, smx_action_t action);
 void SIMIX_pre_comm_cancel(smx_simcall_t simcall, smx_action_t action);
index e15fa42..54acb6f 100644 (file)
@@ -1,6 +1,6 @@
 /* smx_user.c - public interface to simix                                   */
 
-/* Copyright (c) 2010-2013. The SimGrid Team.
+/* Copyright (c) 2010-2014. The SimGrid Team.
    All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -1006,70 +1006,38 @@ smx_action_t simcall_comm_isend(smx_rdv_t rdv, double task_size, double rate,
                                  src_buff_size, match_fun,
                                  clean_fun, data, detached);
 }
+
 /**
  * \ingroup simix_comm_management
  */
 void simcall_comm_recv(smx_rdv_t rdv, void *dst_buff, size_t * dst_buff_size,
-                         int (*match_fun)(void *, void *, smx_action_t), void *data, double timeout)
+                       int (*match_fun)(void *, void *, smx_action_t),
+                       void *data, double timeout, double rate)
 {
   xbt_assert(isfinite(timeout), "timeout is not finite!");
   xbt_assert(rdv, "No rendez-vous point defined for recv");
 
   if (MC_is_active()) {
     /* the model-checker wants two separate simcalls */
-    smx_action_t comm = NULL; /* MC needs the comm to be set to NULL during the simcall */
-    comm = simcall_comm_irecv(rdv, dst_buff, dst_buff_size,
-        match_fun, data);
+    smx_action_t comm = simcall_comm_irecv(rdv, dst_buff, dst_buff_size,
+                                           match_fun, data, rate);
     simcall_comm_wait(comm, timeout);
-    comm = NULL;
   }
   else {
     simcall_BODY_comm_recv(rdv, dst_buff, dst_buff_size,
-                           match_fun, data, timeout);
-  }
-}
-/**
- * \ingroup simix_comm_management
- */
-smx_action_t simcall_comm_irecv(smx_rdv_t rdv, void *dst_buff, size_t *dst_buff_size,
-                                  int (*match_fun)(void *, void *, smx_action_t), void *data)
-{
-  xbt_assert(rdv, "No rendez-vous point defined for irecv");
-
-  return simcall_BODY_comm_irecv(rdv, dst_buff, dst_buff_size, 
-                                 match_fun, data);
-}
-
-
-/**
- * \ingroup simix_comm_management
- */
-void simcall_comm_recv_bounded(smx_rdv_t rdv, void *dst_buff, size_t * dst_buff_size,
-                         int (*match_fun)(void *, void *, smx_action_t), void *data, double timeout, double rate)
-{
-  xbt_assert(isfinite(timeout), "timeout is not finite!");
-  xbt_assert(rdv, "No rendez-vous point defined for recv");
-
-  if (MC_is_active()) {
-    /* the model-checker wants two separate simcalls */
-    smx_action_t comm = simcall_comm_irecv_bounded(rdv, dst_buff, dst_buff_size,
-        match_fun, data, rate);
-    simcall_comm_wait(comm, timeout);
-  }
-  else {
-    simcall_BODY_comm_recv_bounded(rdv, dst_buff, dst_buff_size,
                            match_fun, data, timeout, rate);
   }
 }
 /**
  * \ingroup simix_comm_management
  */
-smx_action_t simcall_comm_irecv_bounded(smx_rdv_t rdv, void *dst_buff, size_t *dst_buff_size,
-                                  int (*match_fun)(void *, void *, smx_action_t), void *data, double rate)
+smx_action_t simcall_comm_irecv(smx_rdv_t rdv, void *dst_buff, size_t *dst_buff_size,
+                                int (*match_fun)(void *, void *, smx_action_t),
+                                void *data, double rate)
 {
   xbt_assert(rdv, "No rendez-vous point defined for irecv");
 
-  return simcall_BODY_comm_irecv_bounded(rdv, dst_buff, dst_buff_size,
+  return simcall_BODY_comm_irecv(rdv, dst_buff, dst_buff_size,
                                  match_fun, data, rate);
 }
 
index 952db70..9109101 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2013. The SimGrid Team.
+/* Copyright (c) 2007-2014. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -331,7 +331,9 @@ void smpi_mpi_start(MPI_Request request)
     request->real_size=request->size;
     smpi_datatype_use(request->old_type);
     smpi_comm_use(request->comm);
-    request->action = simcall_comm_irecv(mailbox, request->buf, &request->real_size, &match_recv, request);
+    request->action = simcall_comm_irecv(mailbox, request->buf,
+                                         &request->real_size, &match_recv,
+                                         request, -1.0);
 
     //integrate pseudo-timing for buffering of small messages, do not bother to execute the simcall if 0
     double sleeptime = request->detached ? smpi_or(request->size) : 0.0;