Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Propagate the s/network_link/link/ from the XML to the C code (hope I didn't break...
[simgrid.git] / src / surf / surf_private.h
1 /*      $Id$     */
2
3 /* Copyright (c) 2004 Arnaud Legrand. All rights reserved.                  */
4
5 /* This program is free software; you can redistribute it and/or modify it
6  * under the terms of the license (GNU LGPL) which comes with this package. */
7
8 #ifndef _SURF_SURF_PRIVATE_H
9 #define _SURF_SURF_PRIVATE_H
10
11 #include "surf/surf.h"
12 #include "surf/maxmin.h"
13 #include "surf/trace_mgr.h"
14 #include "xbt/log.h"
15 #include "surf/surfxml_parse_private.h"
16
17 #define NO_MAX_DURATION -1.0
18 #define SG_TCP_CTE_GAMMA 20000.0
19
20 xbt_dict_t current_property_set;
21
22 extern const char *surf_action_state_names[6];
23
24 typedef enum {
25   SURF_LINK_ON = 1,     /* Ready        */
26   SURF_LINK_OFF = 0     /* Running      */
27 } e_surf_link_state_t;
28
29 typedef enum {
30   SURF_LINK_SHARED = 1,
31   SURF_LINK_FATPIPE = 0
32 } e_surf_link_sharing_policy_t;
33
34 typedef struct surf_model_private {
35   int (*resource_used) (void *resource_id);
36   /* Share the resources to the actions and return in hom much time
37      the next action may terminate */
38   double (*share_resources) (double now);
39   /* Update the actions' state */
40   void (*update_actions_state) (double now, double delta);
41   void (*update_resource_state) (void *id, tmgr_trace_event_t event_type,
42                                  double value);
43   void (*finalize) (void);
44 } s_surf_model_private_t;
45
46 /* #define pub2priv(r) ((surf_model_private_t) ((char *)(r) -(sizeof(struct surf_model_private_part)))) */
47 /* #define priv2pub(r) ((void *) ((char *)(r) +(sizeof(struct surf_model_private_part)))) */
48
49 extern int use_sdp_solver;
50 extern int use_lagrange_solver;
51
52 double generic_maxmin_share_resources(xbt_swag_t running_actions,
53                                        size_t offset,
54                                        lmm_system_t sys,
55                                        void (*solve)(lmm_system_t));
56
57 /* Generic functions common to all modelss */
58 e_surf_action_state_t surf_action_get_state(surf_action_t action);
59 double surf_action_get_start_time(surf_action_t action);
60 double surf_action_get_finish_time(surf_action_t action);
61 void surf_action_free(surf_action_t * action);
62 void surf_action_change_state(surf_action_t action,
63                               e_surf_action_state_t state);
64 void surf_action_set_data(surf_action_t action,
65                           void *data);
66 FILE * surf_fopen(const char *name, const char *mode);
67
68 extern tmgr_history_t history;
69 extern xbt_dynar_t surf_path;
70
71 /*
72  * Returns the initial path. On Windows the initial path is
73  * the current directory for the current process in the other
74  * case the function returns "./" that represents the current
75  * directory on Unix/Linux platforms.
76  */
77 const char* __surf_get_initial_path(void);
78
79 /* The __surf_is_absolute_file_path() returns 1 if
80  * file_path is a absolute file path, in the other
81  * case the function returns 0.
82  */
83 int __surf_is_absolute_file_path(const char* file_path);
84
85 #endif                          /* _SURF_SURF_PRIVATE_H */