X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/ec16845133f5f1b5262d2d77d8ba22824fa8a446..37a138f717b56a413e0fca7d1a68823744341471:/src/amok/Bandwidth/saturate.c diff --git a/src/amok/Bandwidth/saturate.c b/src/amok/Bandwidth/saturate.c index 9b941995c4..0f61258d14 100644 --- a/src/amok/Bandwidth/saturate.c +++ b/src/amok/Bandwidth/saturate.c @@ -129,7 +129,7 @@ static int amok_bw_cb_sat_start(gras_msg_cb_ctx_t ctx, void *payload) * 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) { @@ -142,7 +142,7 @@ void amok_bw_saturate_begin(const char *to_name, unsigned int to_port, s_gras_msg_t msg_got; - unsigned int packet_sent = 0; + volatile unsigned int packet_sent = 0; double start, elapsed = -1; /* timer */ double bw; @@ -263,10 +263,10 @@ static int amok_bw_cb_sat_begin(gras_msg_cb_ctx_t ctx, void *payload) 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 */ , @@ -294,7 +294,7 @@ static int amok_bw_cb_sat_begin(gras_msg_cb_ctx_t ctx, void *payload) 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"); } @@ -330,16 +330,14 @@ static int amok_bw_cb_sat_begin(gras_msg_cb_ctx_t ctx, void *payload) 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)