Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Taking latencies into account to bound the effective bandwidth.
[simgrid.git] / include / amok / bandwidth.h
1 /* $Id$ */
2
3 /* amok_bandwidth - Bandwidth test facilities                               */
4
5 /* Authors: Martin Quinson                                                  */
6 /* Copyright (C) 2003, 2004 the OURAGAN project.                            */
7
8 /* This program is free software; you can redistribute it and/or modify it
9    under the terms of the license (GNU LGPL) which comes with this package. */
10
11 #ifndef AMOK_BANDWIDTH_H
12 #define AMOK_BANDWIDTH_H
13
14 #include "amok/base.h"
15
16 /* module handling */
17
18 void amok_bw_init(void);
19 void amok_bw_exit(void);
20    
21
22
23 /* ***************************************************************************
24  * Bandwidth tests
25  * ***************************************************************************/
26 /**
27  * amok_bw_test:
28  * @peer: A (regular) socket at which the the host with which we should conduct the experiment can be contacted
29  * @buf_size: Size of the socket buffer
30  * @exp_size: Total size of data sent across the network
31  * @msg_size: Size of each message sent. Ie, (@expSize % @msgSize) messages will be sent.
32  * @sec: where the result (in seconds) should be stored.
33  * @bw: observed Bandwidth (in Mb/s) 
34  *
35  * Conduct a bandwidth test from the local process to the given peer.
36  * This call is blocking until the end of the experiment.
37  */
38 xbt_error_t amok_bw_test(gras_socket_t peer,
39                           unsigned int buf_size,unsigned int exp_size,unsigned int msg_size,
40                           /*OUT*/ double *sec, double *bw);
41
42 #if 0   
43 /**
44  * grasbw_request:
45  * @from_name: Name of the host we are asking to do a experiment with (to_name:to_port)
46  * @from_port: port on which the process we are asking for an experiment is listening for message
47  * @to_name: Name of the host with which we should conduct the experiment
48  * @to_port: port on which the peer process is listening (for message, do not 
49  * give a raw socket here. The needed raw socket will be negociated between 
50  * the peers)
51  * @bufSize: Size of the socket buffer
52  * @expSize: Total size of data sent across the network
53  * @msgSize: Size of each message sent. Ie, (@expSize % @msgSize) messages will be sent.
54  * @sec: where the result (in seconds) should be stored.
55  * @bw: observed Bandwidth (in Mb/s)
56  *
57  * Conduct a bandwidth test from the process from_host:from_port to to_host:to_port.
58  * This call is blocking until the end of the experiment.
59  */
60 xbt_error_t grasbw_request(const char* from_name,unsigned int from_port,
61                            const char* to_name,unsigned int to_port,
62                            unsigned int bufSize,unsigned int expSize,unsigned int msgSize,
63                            /*OUT*/ double *sec, double*bw);
64
65
66 /* ***************************************************************************
67  * Link saturation
68  * ***************************************************************************/
69
70 /**
71  * grasbw_saturate_start:
72  * @from_name: Name of the host we are asking to do a experiment with (to_name:to_port)
73  * @from_port: port on which the process we are asking for an experiment is listening
74  * (for message, do not give a raw socket here. The needed raw socket will be negociated 
75  * between the peers)
76  * @to_name: Name of the host with which we should conduct the experiment
77  * @to_port: port on which the peer process is listening for message
78  * @msgSize: Size of each message sent.
79  * @timeout: How long in maximum should be the saturation.
80  *
81  * Ask the process 'from_name:from_port' to start to saturate the link between itself
82  * and to_name:to_name.
83  */
84 xbt_error_t grasbw_saturate_start(const char* from_name,unsigned int from_port,
85                                   const char* to_name,unsigned int to_port,
86                                   unsigned int msgSize, unsigned int timeout);
87
88 /**
89  * grasbw_saturate_stop:
90  * @from_name: Name of the host we are asking to do a experiment with (to_name:to_port)
91  * @from_port: port on which the process we are asking for an experiment is listening
92  * (for message, do not give a raw socket here. The needed raw socket will be negociated 
93  * between the peers)
94  * @to_name: Name of the host with which we should conduct the experiment
95  * @to_port: port on which the peer process is listening for message
96  *
97  * Ask the process 'from_name:from_port' to stop saturating the link between itself
98  * and to_name:to_name.
99  */
100 xbt_error_t grasbw_saturate_stop(const char* from_name,unsigned int from_port,
101                                  const char* to_name,unsigned int to_port);
102
103
104 #endif /* if 0 */
105 #endif /* AMOK_BANDWIDTH_H */