X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/a2d9f61a7443c403dc00bcddfd1610bfd0ea1590..b51ad8027b725a8a510d5cf4f621f633822108e0:/src/amok/Bandwidth/bandwidth.c diff --git a/src/amok/Bandwidth/bandwidth.c b/src/amok/Bandwidth/bandwidth.c index 79ab6443c1..2d4d547758 100644 --- a/src/amok/Bandwidth/bandwidth.c +++ b/src/amok/Bandwidth/bandwidth.c @@ -135,6 +135,8 @@ void amok_bw_test(gras_socket_t peer, bw_request_t request,request_ack; xbt_ex_t e; int first_pass; + int nb_messages = (exp_size % msg_size == 0) ? + (exp_size / msg_size) : (exp_size / msg_size + 1); for (port = 5000; port < 10000 && measMasterIn == NULL; port++) { TRY { @@ -151,7 +153,7 @@ void amok_bw_test(gras_socket_t peer, request=xbt_new0(s_bw_request_t,1); request->buf_size=buf_size; - request->exp_size=exp_size; + request->exp_size=msg_size * nb_messages; request->msg_size=msg_size; request->peer.name = NULL; request->peer.port = gras_socket_my_port(measMasterIn); @@ -183,18 +185,28 @@ void amok_bw_test(gras_socket_t peer, do { if (first_pass == 0) { double meas_duration=*sec; - if (*sec != 0.0 ) { - request->exp_size = request->exp_size * (min_duration / meas_duration) * 1.1; - request->msg_size = request->msg_size * (min_duration / meas_duration) * 1.1; + double increase; + if (*sec != 0.0 ) { + increase = (min_duration / meas_duration) * 1.1; } else { - request->exp_size = request->exp_size * 4; - request->msg_size = request->msg_size * 4; + increase = 4; } - + /* Do not increase the exp size too fast since our decision would be based on wrong measurements*/ + if (increase > 20) + increase = 20; + + request->msg_size = request->msg_size * increase; + + /* Do not do too large experiments messages or the sensors will start to swap to store one of them */ if (request->msg_size > 64*1024*1024) request->msg_size = 64*1024*1024; - VERB5("The experiment was too short (%f sec<%f sec). Redo it with exp_size=%ld msg_size=%ld (got %fkb/s)", + if (request->exp_size > request->msg_size * nb_messages) + CRITICAL0("overflow on the experiment size! You must have a *really* fat pipe. Please fix your platform"); + else + request->exp_size = request->msg_size * nb_messages; + + VERB5("The experiment was too short (%f sec<%f sec). Redo it with exp_size=%lu msg_size=%lu (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); }