3 /* amok_bandwidth - Bandwidth test facilities */
5 /* Authors: Martin Quinson */
6 /* Copyright (C) 2003, 2004 the OURAGAN project. */
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. */
11 #ifndef AMOK_BANDWIDTH_H
12 #define AMOK_BANDWIDTH_H
14 #include "amok/base.h"
18 void amok_bw_init(void);
19 void amok_bw_exit(void);
23 /* ***************************************************************************
25 * ***************************************************************************/
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)
35 * Conduct a bandwidth test from the local process to the given peer.
36 * This call is blocking until the end of the experiment.
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);
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
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)
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.
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);
66 /* ***************************************************************************
68 * ***************************************************************************/
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
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.
81 * Ask the process 'from_name:from_port' to start to saturate the link between itself
82 * and to_name:to_name.
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);
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
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
97 * Ask the process 'from_name:from_port' to stop saturating the link between itself
98 * and to_name:to_name.
100 xbt_error_t grasbw_saturate_stop(const char* from_name,unsigned int from_port,
101 const char* to_name,unsigned int to_port);
105 #endif /* AMOK_BANDWIDTH_H */