3 /* amok_bandwidth - Bandwidth test facilities */
5 /* Copyright (c) 2004 Martin Quinson. All rights reserved. */
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. */
10 #ifndef AMOK_BANDWIDTH_H
11 #define AMOK_BANDWIDTH_H
13 #include "amok/base.h"
17 void amok_bw_init(void);
18 void amok_bw_exit(void);
22 /* ***************************************************************************
24 * ***************************************************************************/
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)
34 * Conduct a bandwidth test from the local process to the given peer.
35 * This call is blocking until the end of the experiment.
37 xbt_error_t amok_bw_test(gras_socket_t peer,
38 unsigned int buf_size,unsigned int exp_size,unsigned int msg_size,
39 /*OUT*/ double *sec, double *bw);
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
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)
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.
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);
65 /* ***************************************************************************
67 * ***************************************************************************/
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
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.
80 * Ask the process 'from_name:from_port' to start to saturate the link between itself
81 * and to_name:to_name.
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);
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
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
96 * Ask the process 'from_name:from_port' to stop saturating the link between itself
97 * and to_name:to_name.
99 xbt_error_t grasbw_saturate_stop(const char* from_name,unsigned int from_port,
100 const char* to_name,unsigned int to_port);
104 #endif /* AMOK_BANDWIDTH_H */