Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
sanitize logging channel naming
[simgrid.git] / src / amok / Bandwidth / bandwidth.c
index a6fbf24..6c318b1 100644 (file)
@@ -13,7 +13,7 @@
 #include "amok/Bandwidth/bandwidth_private.h"
 #include "gras/messages.h"
 
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(bw,amok,"Bandwidth testing");
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(amok_bw,amok,"Bandwidth testing");
 
 
 /******************************
@@ -98,7 +98,7 @@ void amok_bw_bw_leave() {
  * \brief bandwidth measurement between localhost and \e peer
  * 
  * \arg peer: A (regular) socket at which the the host with which we should conduct the experiment can be contacted
- * \arg buf_size: Size of the socket buffer
+ * \arg buf_size: Size of the socket buffer. If 0, a sain default is used (32k, but may change)
  * \arg exp_size: Total size of data sent across the network
  * \arg msg_size: Size of each message sent. Ie, (\e expSize % \e msgSize) messages will be sent.
  * \arg sec: where the result (in seconds) should be stored.
@@ -281,7 +281,7 @@ int amok_bw_cb_bw_handshake(gras_msg_cb_ctx_t  ctx,
  * \arg to_port: port on which the second process is listening (for messages, do not 
  * give a measurement socket here. The needed measurement sockets will be created 
  * automatically and negociated between the peers)
- * \arg buf_size: Size of the socket buffer
+ * \arg buf_size: Size of the socket buffer. If 0, a sain default is used (32k, but may change)
  * \arg exp_size: Total size of data sent across the network
  * \arg msg_size: Size of each message sent. (\e expSize % \e msgSize) messages will be sent.
  * \arg sec: where the result (in seconds) should be stored.
@@ -315,8 +315,10 @@ void amok_bw_request(const char* from_name,unsigned int from_port,
   sock = gras_socket_client(from_name,from_port);
   gras_msg_rpccall(sock,240,gras_msgtype_by_name("BW request"),&request, &result);
   
-  *sec=result->sec;
-  *bw =result->bw;
+  if (sec)
+    *sec=result->sec;
+  if (bw)
+    *bw =result->bw;
 
   VERB6("BW test between %s:%d and %s:%d took %f sec, achieving %f kb/s",
        from_name,from_port, to_name,to_port,
@@ -344,6 +346,7 @@ int amok_bw_cb_bw_request(gras_msg_cb_ctx_t ctx,
 
   gras_os_sleep(1);
   gras_socket_close(peer);
+  free(request->host.name);
   free(request);
   free(result);