Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
regenerate with flexml 1.9.2 (fix to my recent changes by ... agier ;)
[simgrid.git] / src / amok / Bandwidth / saturate.c
index 9b94199..0f61258 100644 (file)
@@ -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)