X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/8a8d03a93bcef51c75700ed3e828b68233f01292..dfea14b90aac7133b6763cdc867c6c7b812ffa3d:/src/amok/Bandwidth/bandwidth.c diff --git a/src/amok/Bandwidth/bandwidth.c b/src/amok/Bandwidth/bandwidth.c index 6e202dd1ae..01d11279c4 100644 --- a/src/amok/Bandwidth/bandwidth.c +++ b/src/amok/Bandwidth/bandwidth.c @@ -13,7 +13,7 @@ #include "amok/Bandwidth/bandwidth_private.h" #include "gras/messages.h" -XBT_LOG_NEW_DEFAULT_SUBCATEGORY(bw,amok,"Bandwidth testing"); +XBT_LOG_NEW_DEFAULT_SUBCATEGORY(amok_bw,amok,"Bandwidth testing"); /****************************** @@ -140,7 +140,7 @@ void amok_bw_test(gras_socket_t peer, request->msg_size=msg_size; request->host.name = NULL; request->host.port = gras_socket_my_port(measMasterIn); - VERB5("Handshaking with %s:%d to connect it back on my %d (expsize=%ld byte= %ld b)", + DEBUG5("Handshaking with %s:%d to connect it back on my %d (expsize=%ld byte= %ld b)", gras_socket_peer_name(peer),gras_socket_peer_port(peer), request->host.port, buf_size,request->buf_size); @@ -202,7 +202,7 @@ int amok_bw_cb_bw_handshake(gras_msg_cb_ctx_t ctx, xbt_ex_t e; int port; - VERB5("Handshaked to connect to %s:%d (sizes: buf=%lu exp=%lu msg=%lu)", + DEBUG5("Handshaked to connect to %s:%d (sizes: buf=%lu exp=%lu msg=%lu)", gras_socket_peer_name(expeditor),request->host.port, request->buf_size,request->exp_size,request->msg_size); @@ -320,9 +320,9 @@ void amok_bw_request(const char* from_name,unsigned int from_port, if (bw) *bw =result->bw; - VERB6("BW test between %s:%d and %s:%d took %f sec, achieving %f kb/s", + VERB6("BW test (%s:%d -> %s:%d) took %f sec (%f kb/s)", from_name,from_port, to_name,to_port, - *sec,((double)*bw)/1024.0); + result->sec,((double)result->bw)/1024.0); gras_socket_close(sock); free(result); @@ -335,8 +335,12 @@ int amok_bw_cb_bw_request(gras_msg_cb_ctx_t ctx, /* specification of the test to run, and our answer */ bw_request_t request = *(bw_request_t*)payload; bw_res_t result = xbt_new0(s_bw_res_t,1); - gras_socket_t peer; + gras_socket_t peer,asker; + asker=gras_msg_cb_ctx_from(ctx); + VERB4("Asked by %s:%d to conduct a bw XP with %s:%d", + gras_socket_peer_name(asker),gras_socket_peer_port(asker), + request->host.name,request->host.port); peer = gras_socket_client(request->host.name,request->host.port); amok_bw_test(peer, request->buf_size,request->exp_size,request->msg_size, @@ -345,7 +349,7 @@ int amok_bw_cb_bw_request(gras_msg_cb_ctx_t ctx, gras_msg_rpcreturn(240,ctx,&result); gras_os_sleep(1); - gras_socket_close(peer); + gras_socket_close(peer); /* FIXME: it should be blocking in RL until everything is sent */ free(request->host.name); free(request); free(result);