Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
update surf doc to kill some more doc warnings
[simgrid.git] / examples / msg / alias / masterslave_forwarder_with_alias.c
index b1aae7f..050cfd9 100644 (file)
 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test,
                              "Messages specific for this msg example");
 
-
-typedef enum {
-  PORT_22 = 0,
-  MAX_CHANNEL
-} channel_t;
-
 int master(int argc, char *argv[]);
 int slave(int argc, char *argv[]);
 int forwarder(int argc, char *argv[]);
@@ -38,16 +32,15 @@ int master(int argc, char *argv[])
   int number_of_tasks = 0;
   double task_comp_size = 0;
   double task_comm_size = 0;
-
-
   int i;
+  int read;
 
-  xbt_assert1(sscanf(argv[1], "%d", &number_of_tasks),
-              "Invalid argument %s\n", argv[1]);
-  xbt_assert1(sscanf(argv[2], "%lg", &task_comp_size),
-              "Invalid argument %s\n", argv[2]);
-  xbt_assert1(sscanf(argv[3], "%lg", &task_comm_size),
-              "Invalid argument %s\n", argv[3]);
+  read = sscanf(argv[1], "%d", &number_of_tasks);
+  xbt_assert(read, "Invalid argument %s\n", argv[1]);
+  read = sscanf(argv[2], "%lg", &task_comp_size);
+  xbt_assert(read, "Invalid argument %s\n", argv[2]);
+  read = sscanf(argv[3], "%lg", &task_comm_size);
+  xbt_assert(read, "Invalid argument %s\n", argv[3]);
 
   {
     /*  Task creation */
@@ -116,7 +109,7 @@ int slave(int argc, char *argv[])
 
   while (1) {
     res = MSG_task_receive(&(task), MSG_host_get_name(MSG_host_self()));
-    xbt_assert0(res == MSG_OK, "MSG_task_receive failed");
+    xbt_assert(res == MSG_OK, "MSG_task_receive failed");
 
     XBT_INFO("Received \"%s\"", MSG_task_get_name(task));
 
@@ -199,7 +192,6 @@ MSG_error_t test_all(const char *platform_file,
   MSG_error_t res = MSG_OK;
 
   {                             /*  Simulation setting */
-    MSG_set_channel_number(MAX_CHANNEL);
     MSG_paje_output("msg_test.trace");
     MSG_create_environment(platform_file);
   }