Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[trace] always set initial value for variables, if not, we get an invalid trace file
[simgrid.git] / examples / msg / icomms / peer2.c
index 0c28719..651e3db 100644 (file)
 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test,
                              "Messages specific for this msg example");
 
+/** @addtogroup MSG_examples
+ * 
+ * - <b>msg/icomms/peer2.c</b>: demonstrates the @ref MSG_comm_waitall function
+ */
+
 int sender(int argc, char *argv[]);
 int receiver(int argc, char *argv[]);
 
@@ -62,20 +67,20 @@ int sender(int argc, char *argv[])
 int receiver(int argc, char *argv[])
 {
   m_task_t task = NULL;
-  MSG_error_t res;
+  _XBT_GNUC_UNUSED MSG_error_t res;
   int id = -1;
   char mailbox[80];
   msg_comm_t res_irecv;
-  int read;
+  _XBT_GNUC_UNUSED int read;
   read = sscanf(argv[1], "%d", &id);
-  xbt_assert1(read, "Invalid argument %s\n", argv[1]);
+  xbt_assert(read, "Invalid argument %s\n", argv[1]);
   MSG_process_sleep(10);
   sprintf(mailbox, "receiver-%d", id);
   while (1) {
     res_irecv = MSG_task_irecv(&(task), mailbox);
     XBT_INFO("Wait to receive a task");
     res = MSG_comm_wait(res_irecv, -1);
-    xbt_assert0(res == MSG_OK, "MSG_task_get failed");
+    xbt_assert(res == MSG_OK, "MSG_task_get failed");
     XBT_INFO("Received \"%s\"", MSG_task_get_name(task));
     if (!strcmp(MSG_task_get_name(task), "finalize")) {
       MSG_task_destroy(task);
@@ -100,7 +105,6 @@ MSG_error_t test_all(const char *platform_file,
 
   /* MSG_config("workstation/model","KCCFLN05"); */
   {                             /*  Simulation setting */
-    MSG_set_channel_number(0);
     MSG_create_environment(platform_file);
   }
   {                             /*   Application deployment */