Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
7ee42c59a14882337209acf73eb76e1ef7c8c3ab
[simgrid.git] / src / surf / surf_private.h
1 /* Authors: Arnaud Legrand                                                  */
2
3 /* This program is free software; you can redistribute it and/or modify it
4    under the terms of the license (GNU LGPL) which comes with this package. */
5
6 #ifndef _SURF_SURF_PRIVATE_H
7 #define _SURF_SURF_PRIVATE_H
8
9 #include "surf/surf.h"
10 #include "surf/maxmin.h"
11 #include "surf/trace_mgr.h"
12 #include "xbt/log.h"
13 #include "surf/surf_parse.h"
14
15 typedef struct surf_resource_private {
16   int (*resource_used)(void *resource_id);
17   /* Share the resources to the actions and return in hom much time
18       the next action may terminate */
19   xbt_heap_float_t(*share_resources) (xbt_heap_float_t now);    
20   /* Update the actions' state */
21   void (*update_actions_state) (xbt_heap_float_t now, xbt_heap_float_t delta);
22   void (*update_resource_state) (void *id,tmgr_trace_event_t event_type, xbt_maxmin_float_t value);
23   void (*finalize)(void);
24 } s_surf_resource_private_t;
25
26 /* #define pub2priv(r) ((surf_resource_private_t) ((char *)(r) -(sizeof(struct surf_resource_private_part)))) */
27 /* #define priv2pub(r) ((void *) ((char *)(r) +(sizeof(struct surf_resource_private_part)))) */
28
29 /* Generic functions common to all ressources */
30 e_surf_action_state_t surf_action_get_state(surf_action_t action);
31 void surf_action_free(surf_action_t * action);
32 void surf_action_change_state(surf_action_t action, e_surf_action_state_t state);
33
34 extern xbt_dynar_t resource_list;
35 extern lmm_system_t maxmin_system;
36 extern tmgr_history_t history;
37
38 #endif                          /* _SURF_SURF_PRIVATE_H */