Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Do obey messages asking to stop the saturation
[simgrid.git] / src / amok / Bandwidth / saturate.c
index 9ec7094..b43c60e 100644 (file)
@@ -186,7 +186,7 @@ void amok_bw_saturate_begin(const char* to_name,unsigned int to_port,
     elapsed=gras_os_time()-start;
     VERB2("elapsed %f duration %f",elapsed, duration);
 
-  } while (duration==0 || (saturate_further && elapsed < duration));
+  } while (saturate_further && (duration!=0 && elapsed < duration));
 
   bw = ((double)(packet_sent*msg_size)) / elapsed;
 
@@ -288,6 +288,8 @@ void amok_bw_saturate_stop(const char* from_name,unsigned int from_port,
 
   gras_socket_t sock = gras_socket_client(from_name,from_port);
   bw_res_t answer;
+  VERB2("Ask %s:%d to stop the saturation",
+       from_name,from_port);
   gras_msg_rpccall(sock,60,gras_msgtype_by_name("amok_bw_sat stop"),NULL,&answer);
   gras_socket_close(sock);
   if (time) *time=answer->sec;