Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add a new function: MSG_task_get_with_timeout. That should be very convenient to...
[simgrid.git] / include / amok / bandwidth.h
1 /* $Id$ */
2
3 /* amok_bandwidth - Bandwidth test facilities                               */
4
5 /* Copyright (c) 2003-2005 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    
18 /** \addtogroup AMOK_bw
19  *  \brief Test the bandwidth between two nodes
20  *
21  *  This module allows you to retrieve the bandwidth between to arbitrary hosts, 
22  *  provided that they run some GRAS process which initialized this module.
23  *
24  *  The API is very simple. Use amok_bw_test() to get the BW between the local host
25  *  and the specified peer, or amok_bw_request() to get the BW between two remote 
26  *  hosts. The elapsed time, as long as the achieved bandwidth is returned in the 
27  *  last arguments of the functions.
28  *
29  *  All sizes are in kilo bytes.
30  *
31  *  \todo Cleanup and implement the link saturation stuff.
32  *
33  *  @{
34  */
35
36 void amok_bw_init(void);
37 void amok_bw_exit(void);
38
39 xbt_error_t amok_bw_test(gras_socket_t peer,
40                           unsigned long int buf_size,unsigned long int exp_size,unsigned long int msg_size,
41                           /*OUT*/ double *sec, double *bw);
42
43 xbt_error_t amok_bw_request(const char* from_name,unsigned int from_port,
44                            const char* to_name,unsigned int to_port,
45                            unsigned long int bufSize,unsigned long int expSize,unsigned long int msgSize,
46                            /*OUT*/ double *sec, double*bw);
47
48 /** @} */
49 #if 0   
50
51 /* ***************************************************************************
52  * Link saturation
53  * ***************************************************************************/
54
55 /**
56  * grasbw_saturate_start:
57  * @from_name: Name of the host we are asking to do a experiment with (to_name:to_port)
58  * @from_port: port on which the process we are asking for an experiment is listening
59  * (for message, do not give a raw socket here. The needed raw socket will be negociated 
60  * between the peers)
61  * @to_name: Name of the host with which we should conduct the experiment
62  * @to_port: port on which the peer process is listening for message
63  * @msgSize: Size of each message sent.
64  * @timeout: How long in maximum should be the saturation.
65  *
66  * Ask the process 'from_name:from_port' to start to saturate the link between itself
67  * and to_name:to_name.
68  */
69 xbt_error_t grasbw_saturate_start(const char* from_name,unsigned int from_port,
70                                   const char* to_name,unsigned int to_port,
71                                   unsigned int msgSize, unsigned int timeout);
72
73 /**
74  * grasbw_saturate_stop:
75  * @from_name: Name of the host we are asking to do a experiment with (to_name:to_port)
76  * @from_port: port on which the process we are asking for an experiment is listening
77  * (for message, do not give a raw socket here. The needed raw socket will be negociated 
78  * between the peers)
79  * @to_name: Name of the host with which we should conduct the experiment
80  * @to_port: port on which the peer process is listening for message
81  *
82  * Ask the process 'from_name:from_port' to stop saturating the link between itself
83  * and to_name:to_name.
84  */
85 xbt_error_t grasbw_saturate_stop(const char* from_name,unsigned int from_port,
86                                  const char* to_name,unsigned int to_port);
87
88
89 #endif /* if 0 */
90 #endif /* AMOK_BANDWIDTH_H */