Logo AND Algorithmique Numérique Distribuée

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