Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
0b5854abd8b6a017e8404d3cdf4e2e60faee5291
[simgrid.git] / src / amok / Bandwidth / bandwidth_private.h
1 /* bandwidth - network bandwidth tests facilities                           */
2
3 /* module's private interface masked even to other parts of AMOK.           */
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
11 #ifndef AMOK_BANDWIDTH_PRIVATE_H
12 #define AMOK_BANDWIDTH_PRIVATE_H
13
14 #include "gras.h"
15 #include "amok/bandwidth.h"
16
17 void amok_bw_bw_init(void);     /* Must be called only once per node */
18 void amok_bw_bw_join(void);     /* Each process must run it */
19 void amok_bw_bw_leave(void);    /* Each process must run it */
20
21 void amok_bw_sat_init(void);    /* Must be called only once per node */
22 void amok_bw_sat_join(void);    /* Each process must run it */
23 void amok_bw_sat_leave(void);   /* Each process must run it */
24
25 /***
26  * Plain bandwidth measurement stuff
27  ***/
28
29 /* Request for a BW experiment.
30  * If peer==NULL, it should be between the sender and the receiver.
31  * If not, it should be between between the receiver and peer (3-tiers).
32  */
33 typedef struct {
34   s_xbt_peer_t peer;            /* peer+raw socket to use */
35   unsigned long int buf_size;
36   unsigned long int msg_size;
37   unsigned long int msg_amount;
38   double min_duration;
39 } s_bw_request_t, *bw_request_t;
40
41 /* Result of a BW experiment (payload when answering). */
42 typedef struct {
43   unsigned int timestamp;
44   double sec;
45   double bw;
46 } s_bw_res_t, *bw_res_t;
47
48
49 /***
50  * Saturation stuff
51  ***/
52
53 /* Description of a saturation experiment (payload asking some peer to collaborate for that)
54  */
55 typedef struct {
56   s_xbt_peer_t peer;            /* peer+raw socket to use */
57   unsigned int msg_size;
58   unsigned int duration;
59 } s_sat_request_t, *sat_request_t;
60
61 void amok_bw_sat_start(const char *from_name, unsigned int from_port,
62                        const char *to_name, unsigned int to_port,
63                        unsigned int msg_size, unsigned int duration);
64
65 #endif /* AMOK_BANDWIDTH_PRIVATE_H */