Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Taking in account the fact that some resource may have no action terminated.
[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   /* Share the resources to the actions and return in hom much time
17       the next action may terminate */
18   xbt_heap_float_t(*share_resources) (xbt_heap_float_t now);    
19   /* Update the actions' state */
20   void (*update_actions_state) (xbt_heap_float_t now, xbt_heap_float_t delta);
21   void (*update_resource_state) (void *id,tmgr_trace_event_t event_type, xbt_maxmin_float_t value);
22   void (*finalize)(void);
23 } s_surf_resource_private_t;
24
25 /* #define pub2priv(r) ((surf_resource_private_t) ((char *)(r) -(sizeof(struct surf_resource_private_part)))) */
26 /* #define priv2pub(r) ((void *) ((char *)(r) +(sizeof(struct surf_resource_private_part)))) */
27
28 /* Generic functions common to all ressources */
29 e_surf_action_state_t surf_action_get_state(surf_action_t action);
30 void surf_action_free(surf_action_t * action);
31 void surf_action_change_state(surf_action_t action, e_surf_action_state_t state);
32
33 extern xbt_dynar_t resource_list;
34 extern lmm_system_t maxmin_system;
35 extern tmgr_history_t history;
36
37 #endif                          /* _SURF_SURF_PRIVATE_H */