Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Added round trip time contraint to the SDP program, this parameter
[simgrid.git] / src / gras / Msg / sg_msg.c
index e6338e1..67b2d8b 100644 (file)
@@ -31,6 +31,7 @@ void gras_msg_send_ext(gras_socket_t   sock,
   gras_msg_t msg;
   int whole_payload_size=0; /* msg->payload_size is used to memcpy the payload. 
                                This is used to report the load onto the simulator. It also counts the size of pointed stuff */
+  char *name;
 
   xbt_assert1(!gras_socket_is_meas(sock), 
              "Asked to send a message on the measurement socket %p", sock);
@@ -61,11 +62,24 @@ void gras_msg_send_ext(gras_socket_t   sock,
 
   msg->kind = kind;
 
-  task=MSG_task_create(msgtype->name,0,
-                      ((double)whole_payload_size),msg);
+  if (XBT_LOG_ISENABLED(gras_msg,xbt_log_priority_verbose)) {
+     asprintf(&name,"type:'%s';kind:'%s';ID %lu from %s:%d to %s:%d",
+             msg->type->name, e_gras_msg_kind_names[msg->kind], msg->ID,
+             gras_os_myname(),gras_os_myport(),
+             gras_socket_peer_name(sock), gras_socket_peer_port(sock));
+     task=MSG_task_create(name,0,
+                         ((double)whole_payload_size),msg);
+     free(name);
+  } else {
+     task=MSG_task_create(msg->type->name,0,
+                         ((double)whole_payload_size),msg);
+  }
+   
 
-  if (MSG_task_put(task, sock_data->to_host,sock_data->to_chan) != MSG_OK) 
-    THROW0(system_error,0,"Problem during the MSG_task_put");
+  DEBUG1("Prepare to send a message to %s",
+        MSG_host_get_name (sock_data->to_host));
+  if (MSG_task_put_with_timeout(task, sock_data->to_host,sock_data->to_chan,60.0) != MSG_OK) 
+    THROW0(system_error,0,"Problem during the MSG_task_put with timeout 60");
 
   VERB5("Sent to %s(%d) a message type '%s' kind '%s' ID %lu",
        MSG_host_get_name(sock_data->to_host),sock_data->to_PID,