X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/bd82ebda0248c3578d25352e6f4729d0e9f4c66c..cf9419413aee24d54dbbbc6199278df283449546:/src/amok/Bandwidth/bandwidth.c diff --git a/src/amok/Bandwidth/bandwidth.c b/src/amok/Bandwidth/bandwidth.c index 8ccb58f8f7..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");