X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/6a7e89de7375168a45eca76ca83d97fdc3b6582f..cf9419413aee24d54dbbbc6199278df283449546:/src/amok/Bandwidth/bandwidth.c diff --git a/src/amok/Bandwidth/bandwidth.c b/src/amok/Bandwidth/bandwidth.c index aea3093a5e..07794c5476 100644 --- a/src/amok/Bandwidth/bandwidth.c +++ b/src/amok/Bandwidth/bandwidth.c @@ -153,7 +153,7 @@ void amok_bw_test(gras_socket_t peer, buf_size,request->buf_size); TRY { - gras_msg_rpccall(peer,60, + gras_msg_rpccall(peer,15, gras_msgtype_by_name("BW handshake"),&request, &request_ack); } CATCH(e) { RETHROW0("Error encountered while sending the BW request: %s"); @@ -175,10 +175,13 @@ void amok_bw_test(gras_socket_t peer, if (*sec>0) { double meas_duration=*sec; request->exp_size = request->exp_size * (min_duration / meas_duration) * 1.1; + request->msg_size = request->msg_size * (min_duration / meas_duration) * 1.1; - DEBUG4("The experiment was too short (%f sec<%f sec). Redo it with exp_size=%ld (got %fkb/s)", - meas_duration,min_duration,request->exp_size,((double)exp_size) / *sec/1024); + + DEBUG5("The experiment was too short (%f sec<%f sec). Redo it with exp_size=%ld msg_size=%ld (got %fkb/s)", + meas_duration,min_duration,request->exp_size,request->msg_size,((double)exp_size) / *sec/1024); gras_msg_rpccall(peer, 60, gras_msgtype_by_name("BW reask"),&request, NULL); + DEBUG0("Peer is ready for another round of fun"); } *sec=gras_os_time(); @@ -195,10 +198,11 @@ void amok_bw_test(gras_socket_t peer, DEBUG0("Experiment done"); *sec = gras_os_time() - *sec; - *bw = ((double)exp_size) / *sec; + *bw = ((double)request->exp_size) / *sec; } while (*sec < min_duration); - DEBUG0("This measurement was long enough. Stop peer"); + DEBUG2("This measurement was long enough (%f sec; found %f b/s). Stop peer", + *sec,*bw); gras_msg_send(peer, gras_msgtype_by_name("BW stop"), NULL); free(request_ack); @@ -297,6 +301,7 @@ int amok_bw_cb_bw_handshake(gras_msg_cb_ctx_t ctx, void *payload; int msggot; TRY { + DEBUG0("Recv / Send the experiment"); gras_socket_meas_recv(measIn, 120,request->exp_size,request->msg_size); gras_socket_meas_send(measOut,120,1,1); DEBUG0("ACK sent"); @@ -375,7 +380,9 @@ void amok_bw_request(const char* from_name,unsigned int from_port, request->host.port = to_port; sock = gras_socket_client(from_name,from_port); - gras_msg_rpccall(sock,240,gras_msgtype_by_name("BW request"),&request, &result); + DEBUG4("Ask for a BW test between %s:%d and %s:%d", from_name,from_port, to_name,to_port); + + gras_msg_rpccall(sock,20*60,gras_msgtype_by_name("BW request"), &request, &result); if (sec) *sec=result->sec; @@ -420,11 +427,12 @@ int amok_bw_cb_bw_request(gras_msg_cb_ctx_t ctx, return 1; } +/** \brief builds a matrix of results of bandwidth measurement */ double * amok_bw_matrix(xbt_dynar_t hosts, int buf_size_bw, int exp_size_bw, int msg_size_bw, double min_duration) { double sec; - /* construct of matrixs for bandwith and Latency */ + /* construction of matrices for bandwith and latency */ int i,j,len=xbt_dynar_length(hosts);