Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
move some content from AsNone into As (AsNone should die)
[simgrid.git] / src / surf / surf_private.h
1 /* Copyright (c) 2004-2015. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 #ifndef _SURF_SURF_PRIVATE_H
8 #define _SURF_SURF_PRIVATE_H
9
10 #include <xbt/base.h>
11
12 #include "surf/surf.h"
13 #include "surf/maxmin.h"
14 #include "surf/trace_mgr.h"
15 #include "xbt/log.h"
16 #include "surf/surfxml_parse.h"
17 #include "surf/random_mgr.h"
18 #include "src/instr/instr_private.h"
19 #include "surf/surfxml_parse_values.h"
20
21 #define NO_MAX_DURATION -1.0
22
23 SG_BEGIN_DECL()
24
25 XBT_PUBLIC_DATA(xbt_dict_t) watched_hosts_lib;
26
27 extern XBT_PRIVATE const char *surf_action_state_names[6];
28
29 /** @ingroup SURF_interface
30  * @brief Possible update mechanisms
31  */
32 typedef enum {
33   UM_FULL,      /**< Full update mechanism: the remaining time of every action is recomputed at each step */
34   UM_LAZY,      /**< Lazy update mechanism: only the modified actions get recomputed.
35                      It may be slower than full if your system is tightly coupled to the point where every action
36                      gets recomputed anyway. In that case, you'd better not try to be cleaver with lazy and go for
37                      a simple full update.  */
38   UM_UNDEFINED  /**< Mechanism not defined */
39 } e_UM_t;
40
41 /* Generic functions common to all models */
42
43 XBT_PRIVATE FILE *surf_fopen(const char *name, const char *mode);
44
45 extern XBT_PRIVATE tmgr_history_t history;
46
47 /* The __surf_is_absolute_file_path() returns 1 if
48  * file_path is a absolute file path, in the other
49  * case the function returns 0.
50  */
51 XBT_PRIVATE int __surf_is_absolute_file_path(const char *file_path);
52
53 /**
54  * Routing logic
55  */
56
57 typedef struct s_model_type {
58   const char *name;
59   const char *desc;
60   AS_t (*create) ();
61   void (*end) (AS_t as);
62 } s_routing_model_description_t, *routing_model_description_t;
63
64 /* This enum used in the routing structure helps knowing in which situation we are. */
65 typedef enum {
66   SURF_ROUTING_NULL = 0,   /**< Undefined type                                   */
67   SURF_ROUTING_BASE,       /**< Base case: use simple link lists for routing     */
68   SURF_ROUTING_RECURSIVE   /**< Recursive case: also return gateway informations */
69 } e_surf_routing_hierarchy_t;
70
71 XBT_PUBLIC(void) routing_model_create(void *loopback);
72 XBT_PUBLIC(void) routing_exit(void);
73 XBT_PUBLIC(void) storage_register_callbacks(void);
74
75 XBT_PRIVATE void routing_new_cluster(sg_platf_cluster_cbarg_t cluster);
76
77 XBT_PUBLIC(void) routing_register_callbacks(void);
78 XBT_PUBLIC(void) generic_free_route(sg_platf_route_cbarg_t route); // FIXME rename to routing_route_free
79  // FIXME: make previous function private to routing again?
80
81
82 XBT_PUBLIC(void) routing_get_route_and_latency(sg_netcard_t src, sg_netcard_t dst,
83                               xbt_dynar_t * route, double *latency);
84
85 XBT_PUBLIC(void) generic_get_graph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges, AS_t rc);
86 /**
87  * Resource protected methods
88  */
89 XBT_PUBLIC(void) surfxml_bufferstack_push(int _new);
90 XBT_PUBLIC(void) surfxml_bufferstack_pop(int _new);
91 XBT_PUBLIC(void) parse_after_config(void);
92
93 XBT_PUBLIC_DATA(int) surfxml_bufferstack_size;
94
95 /********** Tracing **********/
96 /* from surf_instr.c */
97 void TRACE_surf_host_set_speed(double date, const char *resource, double power);
98 void TRACE_surf_link_set_bandwidth(double date, const char *resource, double bandwidth);
99
100 /********** Instr. **********/
101
102 XBT_PRIVATE void sg_instr_AS_begin(sg_platf_AS_cbarg_t AS);
103 XBT_PRIVATE void sg_instr_new_router(sg_platf_router_cbarg_t router);
104 XBT_PRIVATE void sg_instr_new_host(sg_platf_host_cbarg_t host);
105 XBT_PRIVATE void sg_instr_AS_end(void);
106
107 SG_END_DECL()
108
109 #endif                          /* _SURF_SURF_PRIVATE_H */