~ubuntu-branches/ubuntu/raring/simgrid/raring

« back to all changes in this revision

Viewing changes to src/surf/surf_private.h

  • Committer: Package Import Robot
  • Author(s): Martin Quinson
  • Date: 2013-01-31 00:24:51 UTC
  • mfrom: (10.1.6 sid)
  • Revision ID: package-import@ubuntu.com-20130131002451-krejhf7w7h24lpsc
Tags: 3.9~rc1-1
* New upstream release: the "Grasgory" release. Major changes:
  - Gras was completely removed from this version.
  - Documentation reorganization to ease browsing it.
  - New default value for the TCP_gamma parameter: 4MiB

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
#define NO_MAX_DURATION -1.0
19
19
 
20
 
/* user-visible parameters */
21
 
extern double sg_tcp_gamma;
22
 
extern double sg_sender_gap;
23
 
extern double sg_latency_factor;
24
 
extern double sg_bandwidth_factor;
25
 
extern double sg_weight_S_parameter;
26
 
extern int sg_maxmin_selective_update;
27
 
extern int sg_network_crosstraffic;
28
 
#ifdef HAVE_GTNETS
29
 
extern double sg_gtnets_jitter;
30
 
extern int sg_gtnets_jitter_seed;
31
 
#endif
32
 
 
 
20
extern xbt_dict_t watched_hosts_lib;
33
21
 
34
22
extern const char *surf_action_state_names[6];
35
23
 
62
50
                                      size_t offset,
63
51
                                      lmm_system_t sys,
64
52
                                      void (*solve) (lmm_system_t));
65
 
void generic_update_action_remaining_lazy( surf_action_t action, double now);
 
53
double generic_share_resources_lazy(double now, surf_model_t model);
66
54
 
67
55
/* Generic functions common to all models */
68
56
void surf_action_init(void);
92
80
                                    const char *category);
93
81
#endif
94
82
double surf_action_get_remains(surf_action_t action);
 
83
void generic_update_action_remaining_lazy( surf_action_lmm_t action, double now);
 
84
void generic_update_actions_state_lazy(double now, double delta, surf_model_t model);
 
85
void generic_update_actions_state_full(double now, double delta, surf_model_t model);
95
86
 
96
87
FILE *surf_fopen(const char *name, const char *mode);
97
88
 
98
89
extern tmgr_history_t history;
99
 
extern xbt_dynar_t surf_path;
100
90
 
101
 
void surf_config_init(int *argc, char **argv);
102
 
void surf_config_finalize(void);
103
 
void surf_config(const char *name, va_list pa);
 
91
//void surf_config_init(int *argc, char **argv);
 
92
//void surf_config_finalize(void);
 
93
//void surf_config(const char *name, va_list pa);
104
94
 
105
95
void net_action_recycle(surf_action_t action);
106
96
double net_action_get_remains(surf_action_t action);
108
98
int net_get_link_latency_limited(surf_action_t action);
109
99
#endif
110
100
 
111
 
/*
112
 
 * Returns the initial path. On Windows the initial path is
113
 
 * the current directory for the current process in the other
114
 
 * case the function returns "./" that represents the current
115
 
 * directory on Unix/Linux platforms.
116
 
 */
117
 
const char *__surf_get_initial_path(void);
118
 
 
119
101
/* The __surf_is_absolute_file_path() returns 1 if
120
102
 * file_path is a absolute file path, in the other
121
103
 * case the function returns 0.
128
110
  e_surf_network_element_type_t rc_type;
129
111
  int id;
130
112
  char *name;
131
 
} s_network_element_t;
 
113
} s_routing_edge_t;
132
114
 
133
115
/*
134
116
 * Link of lenght 1, alongside with its source and destination. This is mainly usefull in the bindings to gtnets and ns3
150
132
  void (*end) (AS_t as);
151
133
} s_routing_model_description_t, *routing_model_description_t;
152
134
 
153
 
typedef struct s_route {
154
 
  xbt_dynar_t link_list;
155
 
  sg_routing_edge_t src_gateway;
156
 
  sg_routing_edge_t dst_gateway;
157
 
} s_route_t, *route_t;
158
 
 
159
135
/* This enum used in the routing structure helps knowing in which situation we are. */
160
136
typedef enum {
161
137
  SURF_ROUTING_NULL = 0,   /**< Undefined type                                   */
165
141
 
166
142
typedef struct s_as {
167
143
  xbt_dynar_t index_network_elm;
168
 
  xbt_dict_t bypassRoutes;              /* store bypass routes */
 
144
  xbt_dict_t bypassRoutes;    /* store bypass routes */
169
145
  routing_model_description_t model_desc;
170
146
  e_surf_routing_hierarchy_t hierarchy;
171
147
  char *name;
174
150
  sg_routing_edge_t net_elem;
175
151
  xbt_dynar_t link_up_down_list;
176
152
 
177
 
  void (*get_route_and_latency) (AS_t as, sg_routing_edge_t src, sg_routing_edge_t dst, route_t into, double *latency);
 
153
  void (*get_route_and_latency) (AS_t as, sg_routing_edge_t src, sg_routing_edge_t dst, sg_platf_route_cbarg_t into, double *latency);
178
154
 
179
155
  xbt_dynar_t(*get_onelink_routes) (AS_t as);
180
 
  route_t(*get_bypass_route) (AS_t as, sg_routing_edge_t src, sg_routing_edge_t dst, double *lat);
 
156
  sg_platf_route_cbarg_t(*get_bypass_route) (AS_t as, sg_routing_edge_t src, sg_routing_edge_t dst, double *lat);
181
157
  void (*finalize) (AS_t as);
182
158
 
183
159
 
187
163
   * Of course, only the routing model of this AS is informed, not every ones */
188
164
  int (*parse_PU) (AS_t as, sg_routing_edge_t elm); /* A host or a router, whatever */
189
165
  int (*parse_AS) (AS_t as, sg_routing_edge_t elm);
190
 
  void (*parse_route) (AS_t as, const char *src,
191
 
                     const char *dst, route_t route);
192
 
  void (*parse_ASroute) (AS_t as, const char *src,
193
 
                       const char *dst, route_t route);
194
 
  void (*parse_bypassroute) (AS_t as, const char *src,
195
 
                           const char *dst, route_t e_route);
 
166
  void (*parse_route) (AS_t as, sg_platf_route_cbarg_t route);
 
167
  void (*parse_ASroute) (AS_t as, sg_platf_route_cbarg_t route);
 
168
  void (*parse_bypassroute) (AS_t as, sg_platf_route_cbarg_t e_route);
 
169
 
196
170
} s_as_t;
197
171
 
198
172
struct s_routing_platf {
205
179
XBT_PUBLIC(void) routing_model_create(void *loopback);
206
180
XBT_PUBLIC(void) routing_exit(void);
207
181
XBT_PUBLIC(void) storage_register_callbacks(void);
 
182
/* ***************************************** */
 
183
/* TUTORIAL: New TAG                         */
 
184
XBT_PUBLIC(void) gpu_register_callbacks(void);
 
185
/* ***************************************** */
 
186
 
208
187
XBT_PUBLIC(void) routing_register_callbacks(void);
209
 
XBT_PUBLIC(void) generic_free_route(route_t route); // FIXME rename to routing_route_free
 
188
XBT_PUBLIC(void) generic_free_route(sg_platf_route_cbarg_t route); // FIXME rename to routing_route_free
210
189
 // FIXME: make previous function private to routing again?
211
190
 
212
191
 
216
195
/**
217
196
 * Resource protected methods
218
197
 */
219
 
static XBT_INLINE xbt_dict_t surf_resource_properties(const void *resource);
220
 
 
221
198
XBT_PUBLIC(void) surfxml_bufferstack_push(int new);
222
199
XBT_PUBLIC(void) surfxml_bufferstack_pop(int new);
223
200
 
224
201
XBT_PUBLIC_DATA(int) surfxml_bufferstack_size;
225
202
 
 
203
/********** Tracing **********/
 
204
/* from surf_instr.c */
 
205
void TRACE_surf_host_set_power(double date, const char *resource, double power);
 
206
void TRACE_surf_link_set_bandwidth(double date, const char *resource, double bandwidth);
 
207
void TRACE_surf_link_set_latency(double date, const char *resource, double latency);
 
208
 
 
209
 
226
210
#endif                          /* _SURF_SURF_PRIVATE_H */