From: mquinson Date: Thu, 30 Nov 2006 14:05:39 +0000 (+0000) Subject: cap the increment of the experience size to avoid choosing a value stupidly too large... X-Git-Tag: v3.3~2411 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/b51ad8027b725a8a510d5cf4f621f633822108e0?ds=sidebyside cap the increment of the experience size to avoid choosing a value stupidly too large based on a wrong experiment; Add a check that the exp_size do not overlap MAXINT to make sure we don't do anything stupid git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@2948 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/amok/Bandwidth/bandwidth.c b/src/amok/Bandwidth/bandwidth.c index ce282efb88..2d4d547758 100644 --- a/src/amok/Bandwidth/bandwidth.c +++ b/src/amok/Bandwidth/bandwidth.c @@ -185,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->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->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; - request->exp_size = request->msg_size * nb_messages; + 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=%ld msg_size=%ld (got %fkb/s)", + 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); }