do {
if (*sec>0) {
double meas_duration=*sec;
- request->msg_size = request->msg_size * (min_duration / meas_duration);
+ request->exp_size = request->exp_size * (min_duration / meas_duration) * 1.1;
- DEBUG3("The experiment was too short (%f sec<%f sec). Redo it with msg_size=%ld",
- meas_duration,min_duration,request->msg_size);
+ 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);
gras_msg_rpccall(peer, 60, gras_msgtype_by_name("BW reask"),&request, NULL);
}
tooshort = 1;
free(request);
request = (bw_request_t)payload;
+ VERB0("Return the reasking RPC");
gras_msg_rpcreturn(60,ctx_reask,NULL);
}
gras_msg_cb_ctx_free(ctx_reask);
unsigned long int buf_size,
unsigned long int exp_size,
unsigned long int msg_size,
+ double min_duration,
/*OUT*/ double *sec, double*bw) {
gras_socket_t sock;
request->buf_size=buf_size;
request->exp_size=exp_size;
request->msg_size=msg_size;
+ request->min_duration = min_duration;
request->host.name = (char*)to_name;
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,240,gras_msgtype_by_name("BW request"), &request, &result);
if (sec)
*sec=result->sec;
peer = gras_socket_client(request->host.name,request->host.port);
amok_bw_test(peer,
request->buf_size,request->exp_size,request->msg_size,
- 0,
+ request->min_duration,
&(result->sec),&(result->bw));
gras_msg_rpcreturn(240,ctx,&result);
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) {
+ 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);
if (i!=j) {
/* Mesurements of Bandwidth */
amok_bw_request(h1->name,h1->port,h2->name,h2->port,
- buf_size_bw,exp_size_bw,msg_size_bw,&sec,&matrix_res[i*len + j]);
+ buf_size_bw,exp_size_bw,msg_size_bw,min_duration,
+ &sec,&matrix_res[i*len + j]);
}
}
}