1 /* Copyright (c) 2004-2014. The SimGrid Team.
2 * All rights reserved. */
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. */
7 #ifndef _SURF_SURF_PRIVATE_H
8 #define _SURF_SURF_PRIVATE_H
10 #include "surf/surf.h"
11 #include "surf/maxmin.h"
12 #include "surf/trace_mgr.h"
14 #include "surf/surfxml_parse.h"
15 #include "surf/random_mgr.h"
16 #include "instr/instr_private.h"
17 #include "surf/surfxml_parse_values.h"
19 #define NO_MAX_DURATION -1.0
23 extern xbt_dict_t watched_hosts_lib;
25 extern const char *surf_action_state_names[6];
27 /** @ingroup SURF_interface
28 * @brief Possible update mechanisms
31 UM_FULL, /**< [TODO] */
32 UM_LAZY, /**< [TODO] */
33 UM_UNDEFINED /**< Mechanism not defined */
36 /* Generic functions common to all models */
38 FILE *surf_fopen(const char *name, const char *mode);
40 extern tmgr_history_t history;
42 /* The __surf_is_absolute_file_path() returns 1 if
43 * file_path is a absolute file path, in the other
44 * case the function returns 0.
46 int __surf_is_absolute_file_path(const char *file_path);
52 typedef struct s_model_type {
56 void (*end) (AS_t as);
57 } s_routing_model_description_t, *routing_model_description_t;
59 /* This enum used in the routing structure helps knowing in which situation we are. */
61 SURF_ROUTING_NULL = 0, /**< Undefined type */
62 SURF_ROUTING_BASE, /**< Base case: use simple link lists for routing */
63 SURF_ROUTING_RECURSIVE /**< Recursive case: also return gateway informations */
64 } e_surf_routing_hierarchy_t;
66 XBT_PUBLIC(void) routing_model_create(void *loopback);
67 XBT_PUBLIC(void) routing_exit(void);
68 XBT_PUBLIC(void) storage_register_callbacks(void);
70 /* ***************************************** */
71 /* TUTORIAL: New TAG */
72 XBT_PUBLIC(void) gpu_register_callbacks(void);
73 /* ***************************************** */
75 XBT_PUBLIC(void) routing_register_callbacks(void);
76 XBT_PUBLIC(void) generic_free_route(sg_platf_route_cbarg_t route); // FIXME rename to routing_route_free
77 // FIXME: make previous function private to routing again?
80 XBT_PUBLIC(void) routing_get_route_and_latency(sg_routing_edge_t src, sg_routing_edge_t dst,
81 xbt_dynar_t * route, double *latency);
83 XBT_PUBLIC(void) generic_get_graph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges, AS_t rc);
85 * Resource protected methods
87 XBT_PUBLIC(void) surfxml_bufferstack_push(int _new);
88 XBT_PUBLIC(void) surfxml_bufferstack_pop(int _new);
89 XBT_PUBLIC(void) parse_after_config(void);
91 XBT_PUBLIC_DATA(int) surfxml_bufferstack_size;
93 /********** Tracing **********/
94 /* from surf_instr.c */
95 void TRACE_surf_host_set_power(double date, const char *resource, double power);
96 void TRACE_surf_link_set_bandwidth(double date, const char *resource, double bandwidth);
100 #endif /* _SURF_SURF_PRIVATE_H */