* launched. Sizes (both \a exp_size and \a msg_size) will be multiplicated by
* (\a min_duration / measured_duration) (plus 10% to be sure to eventually
* reach the \a min_duration). In that case, the reported bandwidth and
* launched. Sizes (both \a exp_size and \a msg_size) will be multiplicated by
* (\a min_duration / measured_duration) (plus 10% to be sure to eventually
* reach the \a min_duration). In that case, the reported bandwidth and
* because we need to malloc a block of this size in RL to conduct the
* experiment, and we still don't want to visit the swap.
*
* because we need to malloc a block of this size in RL to conduct the
* experiment, and we still don't want to visit the swap.
*
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;
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;
VERB5("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);
VERB5("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);
request=xbt_new0(s_bw_request_t,1);
request->buf_size=buf_size;
request->exp_size=exp_size;
request->msg_size=msg_size;
request->min_duration = min_duration;
request=xbt_new0(s_bw_request_t,1);
request->buf_size=buf_size;
request->exp_size=exp_size;
request->msg_size=msg_size;
request->min_duration = min_duration;
DEBUG4("Ask for a BW test between %s:%d and %s:%d", from_name,from_port, to_name,to_port);
DEBUG4("Ask for a BW test between %s:%d and %s:%d", from_name,from_port, to_name,to_port);
gras_msg_rpccall(sock,20*60,gras_msgtype_by_name("BW request"), &request, &result);
gras_msg_rpccall(sock,20*60,gras_msgtype_by_name("BW request"), &request, &result);
+ }CATCH(e){
+ if (e.value==1) THROW1(0,1,"%s",to_name);
+ THROW1(0,0,"%s",from_name);
+ }
bw_request_t request = *(bw_request_t*)payload;
bw_res_t result = xbt_new0(s_bw_res_t,1);
gras_socket_t peer,asker;
bw_request_t request = *(bw_request_t*)payload;
bw_res_t result = xbt_new0(s_bw_res_t,1);
gras_socket_t peer,asker;
asker=gras_msg_cb_ctx_from(ctx);
VERB4("Asked by %s:%d to conduct a bw XP with %s:%d",
gras_socket_peer_name(asker),gras_socket_peer_port(asker),
asker=gras_msg_cb_ctx_from(ctx);
VERB4("Asked by %s:%d to conduct a bw XP with %s:%d",
gras_socket_peer_name(asker),gras_socket_peer_port(asker),
request->peer.name,request->peer.port);
peer = gras_socket_client(request->peer.name,request->peer.port);
request->peer.name,request->peer.port);
peer = gras_socket_client(request->peer.name,request->peer.port);
amok_bw_test(peer,
request->buf_size,request->exp_size,request->msg_size,
request->min_duration,
&(result->sec),&(result->bw));
amok_bw_test(peer,
request->buf_size,request->exp_size,request->msg_size,
request->min_duration,
&(result->sec),&(result->bw));
gras_os_sleep(1);
gras_socket_close(peer); /* FIXME: it should be blocking in RL until everything is sent */
free(request->peer.name);
gras_os_sleep(1);
gras_socket_close(peer); /* FIXME: it should be blocking in RL until everything is sent */
free(request->peer.name);