* 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,
+ volatile unsigned int msg_size, double duration,
/*out */ double *elapsed_res, double *bw_res)
{
s_gras_msg_t msg_got;
- unsigned int packet_sent = 0;
+ volatile unsigned int packet_sent = 0;
double start, elapsed = -1; /* timer */
double bw;
sat_request_t answer = xbt_new0(s_sat_request_t, 1);
volatile int saturate_further = 1;
xbt_ex_t e;
- gras_socket_t measMaster = NULL, meas = NULL;
- gras_socket_t from = gras_msg_cb_ctx_from(ctx);
+ volatile gras_socket_t measMaster = NULL, meas = NULL;
+ volatile gras_socket_t from = gras_msg_cb_ctx_from(ctx);
- int port = 6000;
+ volatile int port = 6000;
while (port <= 10000 && measMaster == NULL) {
TRY {
measMaster = gras_socket_server_ext(port, 0 /*bufsize: auto */ ,
meas = gras_socket_meas_accept(measMaster);
XBT_DEBUG("saturation handshake answered");
}
- CATCH(e) {
+ CATCH_ANONYMOUS {
gras_socket_close(measMaster);
RETHROWF("Error during saturation handshake: %s");
}
void amok_bw_saturate_stop(const char *from_name, unsigned int from_port,
/*out */ double *time, double *bw)
{
- xbt_ex_t e;
-
gras_socket_t sock = gras_socket_client(from_name, from_port);
bw_res_t answer;
XBT_VERB("Ask %s:%d to stop the saturation", from_name, from_port);
TRY {
gras_msg_rpccall(sock, 60, "amok_bw_sat stop", NULL, &answer);
- } CATCH(e) {
- RETHROWF("Cannot ask %s:%d to stop saturation: %s", from_name,
- from_port);
+ }
+ CATCH_ANONYMOUS {
+ RETHROWF("Cannot ask %s:%d to stop saturation: %s", from_name, from_port);
}
gras_socket_close(sock);
if (time)