X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/58a5fef8735699a10762fe2bb8f1f938fba4b651..778f65057da68465382593cd036b6ee59ada54e9:/src/gras/Msg/sg_msg.c diff --git a/src/gras/Msg/sg_msg.c b/src/gras/Msg/sg_msg.c index e6338e157d..67b2d8b32b 100644 --- a/src/gras/Msg/sg_msg.c +++ b/src/gras/Msg/sg_msg.c @@ -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,