Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'v3_9_x'
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Wed, 30 Jan 2013 11:33:26 +0000 (12:33 +0100)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Wed, 30 Jan 2013 11:33:26 +0000 (12:33 +0100)
CMakeLists.txt
ChangeLog
NEWS
examples/simdag/test_simdag_tracing.tesh
include/msg/msg.h
src/instr/instr_interface.c
src/msg/msg_gos.c
src/xbt/xbt_main.c

index 4945197..b9c2a97 100644 (file)
@@ -53,9 +53,10 @@ set(CMAKE_Fortran_LINK_FLAGS "" CACHE TYPE INTERNAL FORCE)
 # 3.7.{0,1} -> release 3.7, 3.7.1
 # 3.8.{0,1} -> release 3.8, 3.8.1
 # 3.9.0 -> release 3.9
+# 3.10.0 -> release 3.10
 
 set(SIMGRID_VERSION_MAJOR "3")
-set(SIMGRID_VERSION_MINOR "9")
+set(SIMGRID_VERSION_MINOR "10")
 set(SIMGRID_VERSION_PATCH "0")
 
 if(${SIMGRID_VERSION_PATCH} EQUAL "0")
index 181c147..d7b768a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+SimGrid (3.10) NOT RELEASED; urgency=low
+
+ (to complete)
+
+-- $date Da SimGrid team <simgrid-devel@lists.gforge.inria.fr>
+
 SimGrid (3.9) stable; urgency=low
 
  The Grasgory release: GRAS is really dead now.
diff --git a/NEWS b/NEWS
index d7f271c..1f8b413 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,10 @@
+                    _               _____  _  ___
+__   _____ _ __ ___(_) ___  _ __   |___ / / |/ _ \
+\ \ / / _ \ '__/ __| |/ _ \| '_ \    |_ \ | | | | |
+ \ V /  __/ |  \__ \ | (_) | | | |  ___) || | |_| |
+  \_/ \___|_|  |___/_|\___/|_| |_| |____(_)_|\___/
+
+(to complete)
                     _               _____ ___
 __   _____ _ __ ___(_) ___  _ __   |___ // _ \
 \ \ / / _ \ '__/ __| |/ _ \| '_ \    |_ \ (_) |
@@ -10,7 +17,6 @@ The "Grasgory" release. Major changes:
  * Gras was completely removed from this version.
  * Documentation reorganization to ease browsing it.
  * New default value for the TCP_gamma parameter: 4MiB
-
                     _               _____  ___   _
 __   _____ _ __ ___(_) ___  _ __   |___ / ( _ ) / |
 \ \ / / _ \ '__/ __| |/ _ \| '_ \    |_ \ / _ \ | |
index 3fc9699..34b8439 100644 (file)
@@ -248,12 +248,12 @@ $ tail -n +3 ./simgrid.trace
 > 16 0 7 0 topology 21 22
 > 15 0 8 0 topology 21 23
 > 16 0 8 0 topology 8 23
-> 1 9 3 btaskA "0.000000 0.000985 0.041631"
-> 1 10 1 ptaskA "0.000000 0.000985 0.041631"
-> 1 11 3 btaskB "0.176643 0.364602 0.091331"
-> 1 12 1 ptaskB "0.176643 0.364602 0.091331"
-> 1 13 3 btaskC "0.092298 0.487217 0.526750"
-> 1 14 1 ptaskC "0.092298 0.487217 0.526750"
+> 1 9 3 btaskA "0.800026 0.545312 0.857926"
+> 1 10 1 ptaskA "0.800026 0.545312 0.857926"
+> 1 11 3 btaskB "0.904944 0.089118 0.069832"
+> 1 12 1 ptaskB "0.904944 0.089118 0.069832"
+> 1 13 3 btaskC "0.696799 0.247098 0.497311"
+> 1 14 1 ptaskC "0.696799 0.247098 0.497311"
 > 7 8.800300 1 10
 > 7 8.800300 1 1
 > 7 8.800300 1 3
index 41b9483..5f0077e 100644 (file)
@@ -224,12 +224,14 @@ XBT_PUBLIC(msg_error_t)
 #define MSG_task_recv(t,a) MSG_task_receive(t,a)
 
 XBT_PUBLIC(msg_comm_t) MSG_task_isend(msg_task_t task, const char *alias);
+XBT_PUBLIC(msg_comm_t) MSG_task_isend_bounded(msg_task_t task, const char *alias, double maxrate);
 XBT_PUBLIC(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);
 
 XBT_PUBLIC(void) MSG_task_dsend(msg_task_t task, const char *alias, void_f_pvoid_t cleanup);
+XBT_PUBLIC(void) MSG_task_dsend_bounded(msg_task_t task, const char *alias, void_f_pvoid_t cleanup, double maxrate);
 XBT_PUBLIC(msg_comm_t) MSG_task_irecv(msg_task_t * task, const char *alias);
 XBT_PUBLIC(int) MSG_comm_test(msg_comm_t comm);
 XBT_PUBLIC(int) MSG_comm_testany(xbt_dynar_t comms);
@@ -249,6 +251,10 @@ XBT_PUBLIC(int) MSG_task_listen_from_host(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);
index 3c06b95..e18be1f 100644 (file)
@@ -111,7 +111,7 @@ void TRACE_category_with_color (const char *category, const char *color)
     snprintf (final_color, INSTR_DEFAULT_STR_SIZE, "%s", color);
   }
 
-  XBT_DEBUG("CAT,declare %s, %s", category, final_color);
+  XBT_DEBUG("CAT,declare %s, \"%s\" \"%s\"", category, color, final_color);
 
   //define the type of this category on top of hosts and links
   instr_new_variable_type (category, final_color);
index bcc59e1..d5ba36e 100644 (file)
@@ -271,6 +271,25 @@ msg_comm_t MSG_task_isend(msg_task_t task, const char *alias)
   return MSG_task_isend_with_matching(task,alias,NULL,NULL);
 }
 
+/** \ingroup msg_task_usage
+ * \brief Sends a task on a mailbox with a maximum rate
+ *
+ * This is a non blocking function: use MSG_comm_wait() or MSG_comm_test()
+ * to end the communication. The maxrate parameter allows the application
+ * to limit the bandwidth utilization of network links when sending the task.
+ *
+ * \param task a #msg_task_t to send on another location.
+ * \param alias name of the mailbox to sent the task to
+ * \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)
+{
+  task->simdata->rate = maxrate;
+  return MSG_task_isend_with_matching(task,alias,NULL,NULL);
+}
+
+
 /** \ingroup msg_task_usage
  * \brief Sends a task on a mailbox, with support for matching requests
  *
@@ -388,6 +407,66 @@ void MSG_task_dsend(msg_task_t task, const char *alias, void_f_pvoid_t cleanup)
 #endif
 }
 
+
+/** \ingroup msg_task_usage
+ * \brief Sends a task on a mailbox with a maximal rate.
+ *
+ * This is a non blocking detached send function.
+ * Think of it as a best effort send. Keep in mind that the third parameter
+ * is only called if the communication fails. If the communication does work,
+ * it is responsibility of the receiver code to free anything related to
+ * the task, as usual. More details on this can be obtained on
+ * <a href="http://lists.gforge.inria.fr/pipermail/simgrid-user/2011-November/002649.html">this thread</a>
+ * in the SimGrid-user mailing list archive.
+ *
+ * \param task a #msg_task_t to send on another location.
+ * \param alias name of the mailbox to sent the task to
+ * \param cleanup a function to destroy the task if the
+ * 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)
+{
+  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
+}
+
 /** \ingroup msg_task_usage
  * \brief Starts listening for receiving a task from an asynchronous communication.
  *
@@ -744,6 +823,29 @@ MSG_task_send_with_timeout(msg_task_t task, const char *alias,
                                       task, timeout);
 }
 
+/** \ingroup msg_task_usage
+ * \brief Sends a task to a mailbox with a timeout and with a maximum rate
+ *
+ * This is a blocking function, the execution flow will be blocked
+ * until the task is sent or the timeout is achieved.
+ *
+ * \param task the task to be sent
+ * \param alias the mailbox name to where the task is sent
+ * \param timeout is the maximum wait time for completion (if -1, this call is the same as #MSG_task_send)
+ * \param maxrate the maximum communication rate for sending this task
+ *
+ * \return Returns #MSG_OK if the task was successfully sent,
+ * #MSG_HOST_FAILURE, or #MSG_TRANSFER_FAILURE, or #MSG_TIMEOUT otherwise.
+ */
+msg_error_t
+MSG_task_send_with_timeout_bounded(msg_task_t task, const char *alias,
+                           double timeout, double maxrate)
+{
+  task->simdata->rate = maxrate;
+  return MSG_mailbox_put_with_timeout(MSG_mailbox_get_by_alias(alias),
+                                      task, timeout);
+}
+
 /** \ingroup msg_task_usage
  * \brief Check if there is a communication going on in a mailbox.
  *
index 89a67a6..e09d03d 100644 (file)
@@ -35,6 +35,7 @@ int xbt_initialized = 0;
  */
 static void xbt_preinit(void) _XBT_GNUC_CONSTRUCTOR(200);
 static void xbt_postexit(void);
+static unsigned int seed = 2147483647;
 
 #ifdef _XBT_WIN32
 # undef _XBT_NEED_INIT_PRAGMA
@@ -118,8 +119,9 @@ void xbt_init(int *argc, char **argv)
     xbt_dynar_push(xbt_cmdline,&(argv[i]));
   }
 
-  srand((unsigned int) time(NULL));
-
+  srand(seed);
+  srand48(seed);
+  
   xbt_log_init(argc, argv);
 }