X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/3e1f85ff47cd3650dcb4b1b7aedb802657221377..3a7bc2b51fce530a2664d62489a106ba66bb1227:/include/amok/bandwidth.h
diff --git a/include/amok/bandwidth.h b/include/amok/bandwidth.h
index 271bb9a707..13e45b3e19 100644
--- a/include/amok/bandwidth.h
+++ b/include/amok/bandwidth.h
@@ -10,16 +10,14 @@
#ifndef AMOK_BANDWIDTH_H
#define AMOK_BANDWIDTH_H
-#include "amok/base.h"
-
-/* module handling */
-
-
/** \addtogroup AMOK_bw
* \brief Test the bandwidth between two nodes
*
- * This module allows you to retrieve the bandwidth between to arbitrary hosts,
- * provided that they run some GRAS process which initialized this module.
+ * This module allows you to retrieve the bandwidth between to arbitrary hosts
+ * and saturating the links leading to them, provided that they run some GRAS
+ * process which initialized this module.
+ *
+ * \htmlonly
Bandwidth measurement
\endhtmlonly
*
* Retrieving the bandwidth is usually done by active measurment: one send
* a packet of known size, time how long it needs to go back and forth,
@@ -43,7 +41,7 @@
* get the BW between two remote hosts. The elapsed time, as long as the
* achieved bandwidth is returned in the last arguments of the functions.
*
- * All sizes are in kilo bytes. The \a buf_size is the size of the buffer
+ * All sizes are in bytes. The \a buf_size is the size of the buffer
* (this is a socket parameter set automatically). The \a exp_size is the
* amount of data to send during an experiment. \a msg_size is the size
* of each message sent. These values allow you to study phenomenon such
@@ -52,65 +50,78 @@
* buf_size=32k, msg_size=16k and exp_size=64k. That means that the
* socket will be prepared to accept 32k in its buffer and then four
* messages of 16k will be sent (so that the total amount of data equals
- * 64k). Of course, you can use other values if you want to.
+ * 64k). Of course, you can use other values if you want to.
+ *
+ * \htmlonly
+ *
+ * Fig 1: AMOK bandwidth measurement protocol.
+ * Link saturation
+ * \endhtmlonly
*
- * \todo Cleanup and implement the link saturation stuff.
+ * You sometimes want to try saturating some link during the network
+ * related experiments (at least, we did ;). This also can turn quite
+ * untrivial to do, unless you use this great module. You can either ask
+ * for the saturation between the current host and a distant one with
+ * amok_bw_saturate_begin() or between two distant hosts with
+ * amok_bw_saturate_start(). In any case, remember that gras actors
+ * (processes) are not interruptible. It means that an actor you
+ * instructed to participate to a link saturation experiment will not do
+ * anything else until it is to its end (either because the asked duration
+ * was done or because someone used amok_bw_saturate_stop() on the emitter
+ * end of the experiment).
+ *
+ * The following figure depicts the used protocol. Note that any
+ * handshaking messages internal messages are omitted for sake of
+ * simplicity. In this example, the experiment ends before the planned
+ * experiment duration is over because one host use the
+ * amok_bw_saturate_stop() function, but things are not really different
+ * if the experiment stops alone. Also, it is not mandatory that the host
+ * calling amok_bw_saturate_stop() is the same than the one which called
+ * amok_bw_saturate_start(), despite what is depicted here.
+ *
+ * \htmlonly
+ *
+ * Fig 2: AMOK link saturation protocol.
+ * \endhtmlonly
*
* @{
*/
-void amok_bw_init(void);
-void amok_bw_exit(void);
+/* module handling */
+
+XBT_PUBLIC(void) amok_bw_init(void);
+XBT_PUBLIC(void) amok_bw_exit(void);
-void amok_bw_test(gras_socket_t peer,
+XBT_PUBLIC(void) amok_bw_test(gras_socket_t peer,
unsigned long int buf_size,unsigned long int exp_size,unsigned long int msg_size,
+ double min_duration,
/*OUT*/ double *sec, double *bw);
-void amok_bw_request(const char* from_name,unsigned int from_port,
+XBT_PUBLIC(void) amok_bw_request(const char* from_name,unsigned int from_port,
const char* to_name,unsigned int to_port,
unsigned long int buf_size,unsigned long int exp_size,unsigned long int msg_size,
+ double min_duration,
/*OUT*/ double *sec, double*bw);
-/** @} */
-#if 0
+XBT_PUBLIC(double*) amok_bw_matrix(xbt_dynar_t hosts, /* dynar of xbt_host_t */
+ int buf_size_bw, int msg_size_bw, int msg_amount_bw, double min_duration);
/* ***************************************************************************
* Link saturation
* ***************************************************************************/
-/**
- * grasbw_saturate_start:
- * @from_name: Name of the host we are asking to do a experiment with (to_name:to_port)
- * @from_port: port on which the process we are asking for an experiment is listening
- * (for message, do not give a raw socket here. The needed raw socket will be negociated
- * between the peers)
- * @to_name: Name of the host with which we should conduct the experiment
- * @to_port: port on which the peer process is listening for message
- * @msgSize: Size of each message sent.
- * @timeout: How long in maximum should be the saturation.
- *
- * Ask the process 'from_name:from_port' to start to saturate the link between itself
- * and to_name:to_name.
- */
-void grasbw_saturate_start(const char* from_name,unsigned int from_port,
- const char* to_name,unsigned int to_port,
- unsigned int msgSize, unsigned int timeout);
-
-/**
- * grasbw_saturate_stop:
- * @from_name: Name of the host we are asking to do a experiment with (to_name:to_port)
- * @from_port: port on which the process we are asking for an experiment is listening
- * (for message, do not give a raw socket here. The needed raw socket will be negociated
- * between the peers)
- * @to_name: Name of the host with which we should conduct the experiment
- * @to_port: port on which the peer process is listening for message
- *
- * Ask the process 'from_name:from_port' to stop saturating the link between itself
- * and to_name:to_name.
- */
-void grasbw_saturate_stop(const char* from_name,unsigned int from_port,
- const char* to_name,unsigned int to_port);
+XBT_PUBLIC(void) amok_bw_saturate_start(const char* from_name,unsigned int from_port,
+ const char* to_name,unsigned int to_port,
+ unsigned int msg_size, double duration);
+
+XBT_PUBLIC(void) amok_bw_saturate_begin(const char* to_name,unsigned int to_port,
+ unsigned int msg_size, double duration,
+ /*out*/ double *elapsed, double *bw);
+
+XBT_PUBLIC(void) amok_bw_saturate_stop(const char* from_name,unsigned int from_port,
+ /*out*/ double *time, double *bw);
+
+/** @} */
-#endif /* if 0 */
#endif /* AMOK_BANDWIDTH_H */