X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/5bcfbaff5a82e40d9a5d1861f073fc0befbd7f1b..fc1551b7a3cbbcdb9fb48500f70683318c87c47b:/include/simgrid/platf.h diff --git a/include/simgrid/platf.h b/include/simgrid/platf.h index c6ec0f6c17..89df78dc4a 100644 --- a/include/simgrid/platf.h +++ b/include/simgrid/platf.h @@ -11,7 +11,40 @@ #include /* our toolbox */ +typedef struct tmgr_trace *tmgr_trace_t; /**< Opaque structure defining an availability trace */ + +/** Defines whether a given resource is working or not */ +typedef enum { + SURF_RESOURCE_ON = 1, /**< Up & ready */ + SURF_RESOURCE_OFF = 0 /**< Down & broken */ +} e_surf_resource_state_t; + + +/* + * Platform creation functions. Instead of passing 123 arguments to the creation functions + * (one for each possible XML attribute), we pass structures containing them all. It removes the + * chances of switching arguments by error, and reduce the burden when we add a new attribute: + * old models can just continue to ignore it without having to update their headers. + * + * It shouldn't be too costly at runtime, provided that structures living on the stack are + * used, instead of malloced structures. + */ + +typedef struct s_surf_parsing_host_arg { + char* V_host_id; //id + double V_host_power_peak; //power + int V_host_core; //core + double V_host_power_scale; //availability + tmgr_trace_t V_host_power_trace; //availability file + e_surf_resource_state_t V_host_state_initial; //state + tmgr_trace_t V_host_state_trace; //state file + const char* V_host_coord; +} s_surf_parsing_host_arg_t, *surf_parsing_host_arg_t; + + XBT_PUBLIC(void) sg_platf_new_AS_open(const char *id, const char *mode); XBT_PUBLIC(void) sg_platf_new_AS_close(void); +XBT_PUBLIC(void) sg_platf_new_host(surf_parsing_host_arg_t h); + #endif /* SG_PLATF_H */