From ba479548b9ab30bbfa69c8215cca6f03512c2f5d Mon Sep 17 00:00:00 2001 From: mquinson Date: Mon, 10 Jul 2006 17:59:35 +0000 Subject: [PATCH] allow to autocompute msgsize to achieve Real Saturations git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@2529 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- src/amok/Bandwidth/saturate.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/amok/Bandwidth/saturate.c b/src/amok/Bandwidth/saturate.c index c0cf41b15f..efa150caa7 100644 --- a/src/amok/Bandwidth/saturate.c +++ b/src/amok/Bandwidth/saturate.c @@ -113,7 +113,10 @@ static int amok_bw_cb_sat_start(gras_msg_cb_ctx_t ctx, void *payload){ * is to have a remote host calling amok_bw_saturate_stop to this process. * * If duration=0, the experiment will never timeout (you then have to manually - * stop it) + * stop it). + * + * If msg_size=0, the size will be automatically computed to make sure that + * each of the messages occupy the connexion one second */ void amok_bw_saturate_begin(const char* to_name,unsigned int to_port, unsigned int msg_size, double duration, @@ -145,6 +148,18 @@ void amok_bw_saturate_begin(const char* to_name,unsigned int to_port, request->host.name = NULL; request->host.port = 0; + /* Size autodetection on need */ + if (!msg_size) { + double bw; + double sec; + amok_bw_test(peer_cmd, + 0,512*1024, 512*1024, /* 512k as first guess */ + 1, /* at least one sec */ + &sec, &bw); + request->msg_size = (int)bw; + } + + /* Launch the saturation */ ctx = gras_msg_rpc_async_call(peer_cmd, 60, gras_msgtype_by_name("amok_bw_sat begin"), &request); -- 2.20.1