X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/9072f634ac2f4bdece800197ad4ad73ec96fd1d8..9b72cc80fe8e0eaef8f75eaac26dbfe270418e77:/include/simgrid/msg.h diff --git a/include/simgrid/msg.h b/include/simgrid/msg.h index e2d19deab4..a2c656dbae 100644 --- a/include/simgrid/msg.h +++ b/include/simgrid/msg.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2004-2014. The SimGrid Team. +/* Copyright (c) 2004-2015. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -33,8 +33,6 @@ typedef struct As *msg_as_t; /* ******************************** Host ************************************ */ -extern int MSG_HOST_LEVEL; - /** @brief Host datatype. @ingroup m_host_management @@ -45,10 +43,9 @@ extern int MSG_HOST_LEVEL; some private data that can be only accessed by local process. */ -typedef xbt_dictelm_t msg_host_t; -typedef s_xbt_dictelm_t s_msg_host_t; +typedef sg_host_t msg_host_t; -typedef struct msg_host_priv { +typedef struct s_msg_host_priv { int dp_enabled; xbt_dict_t dp_objs; double dp_updated_by_deleted_tasks; @@ -59,13 +56,7 @@ typedef struct msg_host_priv { #ifdef MSG_USE_DEPRECATED msg_mailbox_t *mailboxes; /**< the channels */ #endif -} s_msg_host_priv_t, *msg_host_priv_t; - -static inline msg_host_priv_t MSG_host_priv(msg_host_t host){ - return (msg_host_priv_t )xbt_lib_get_level(host, MSG_HOST_LEVEL); -} - - +} s_msg_host_priv_t; /* ******************************** Task ************************************ */ @@ -90,11 +81,6 @@ typedef struct msg_task *msg_task_t; /* ******************************** VM ************************************* */ typedef msg_host_t msg_vm_t; -typedef msg_host_priv_t msg_vm_priv_t; - -static inline msg_vm_priv_t MSG_vm_priv(msg_vm_t vm){ - return (msg_vm_priv_t) xbt_lib_get_level(vm, MSG_HOST_LEVEL); -} /** ******************************** File ************************************ */ @@ -289,7 +275,6 @@ XBT_PUBLIC(msg_error_t) MSG_file_move(msg_file_t fd, const char* fullpath); XBT_PUBLIC(msg_error_t) MSG_file_rcopy(msg_file_t fd, msg_host_t host, const char* fullpath); XBT_PUBLIC(msg_error_t) MSG_file_rmove(msg_file_t fd, msg_host_t host, const char* fullpath); /************************** Storage handling ***********************************/ -XBT_PUBLIC(msg_host_t) MSG_get_storage_by_name(const char *name); XBT_PUBLIC(const char *) MSG_storage_get_name(msg_storage_t storage); XBT_PUBLIC(sg_size_t) MSG_storage_get_free_size(msg_storage_t storage); XBT_PUBLIC(sg_size_t) MSG_storage_get_used_size(msg_storage_t storage); @@ -310,6 +295,8 @@ XBT_PUBLIC(xbt_dict_t) MSG_as_router_get_properties(const char* asr); XBT_PUBLIC(void) MSG_as_router_set_property_value(const char* asr, const char *name, char *value,void_f_pvoid_t free_ctn); /************************** Host handling ***********************************/ +XBT_PUBLIC(msg_host_t) MSG_host_get_by_name(const char *name); +#define MSG_get_host_by_name(n) MSG_host_get_by_name(n) /* Rewrite the old name into the new one transparently */ XBT_PUBLIC(msg_error_t) MSG_host_set_data(msg_host_t host, void *data); XBT_PUBLIC(void *) MSG_host_get_data(msg_host_t host); XBT_PUBLIC(const char *) MSG_host_get_name(msg_host_t host); @@ -322,7 +309,9 @@ XBT_PUBLIC(int) MSG_host_get_core_number(msg_host_t h); XBT_PUBLIC(xbt_swag_t) MSG_host_get_process_list(msg_host_t h); XBT_PUBLIC(int) MSG_host_is_on(msg_host_t h); XBT_PUBLIC(int) MSG_host_is_off(msg_host_t h); -XBT_PUBLIC(void) __MSG_host_priv_free(msg_host_priv_t priv); +XBT_PUBLIC(double) MSG_host_get_wattmin_at(msg_host_t host, int pstate); +XBT_PUBLIC(double) MSG_host_get_wattmax_at(msg_host_t host, int pstate); + XBT_PUBLIC(void) __MSG_host_destroy(msg_host_t host); XBT_PUBLIC(double) MSG_host_get_power_peak_at(msg_host_t h, int pstate); @@ -330,6 +319,13 @@ XBT_PUBLIC(double) MSG_host_get_current_power_peak(msg_host_t h); XBT_PUBLIC(int) MSG_host_get_nb_pstates(msg_host_t h); XBT_PUBLIC(void) MSG_host_set_pstate(msg_host_t h, int pstate); XBT_PUBLIC(int) MSG_host_get_pstate(msg_host_t host); +XBT_PUBLIC(xbt_dynar_t) MSG_hosts_as_dynar(void); +XBT_PUBLIC(int) MSG_get_host_number(void); +XBT_PUBLIC(void) MSG_host_get_params(msg_host_t ind_pm, ws_params_t params); +XBT_PUBLIC(void) MSG_host_set_params(msg_host_t ind_pm, ws_params_t params); +XBT_PUBLIC(xbt_dict_t) MSG_host_get_mounted_storage_list(msg_host_t host); +XBT_PUBLIC(xbt_dynar_t) MSG_host_get_attached_storage_list(msg_host_t host); +XBT_PUBLIC(xbt_dict_t) MSG_host_get_storage_content(msg_host_t host); XBT_PUBLIC(double) MSG_host_get_consumed_energy(msg_host_t h); @@ -344,14 +340,6 @@ XBT_PUBLIC(void) MSG_host_set_property_value(msg_host_t host, XBT_PUBLIC(void) MSG_create_environment(const char *file); -XBT_PUBLIC(msg_host_t) MSG_get_host_by_name(const char *name); -XBT_PUBLIC(xbt_dynar_t) MSG_hosts_as_dynar(void); -XBT_PUBLIC(int) MSG_get_host_number(void); -XBT_PUBLIC(void) MSG_host_get_params(msg_host_t ind_pm, ws_params_t params); -XBT_PUBLIC(void) MSG_host_set_params(msg_host_t ind_pm, ws_params_t params); -XBT_PUBLIC(xbt_dict_t) MSG_host_get_mounted_storage_list(msg_host_t host); -XBT_PUBLIC(xbt_dynar_t) MSG_host_get_attached_storage_list(msg_host_t host); -XBT_PUBLIC(xbt_dict_t) MSG_host_get_storage_content(msg_host_t host); /************************** Process handling *********************************/ XBT_PUBLIC(msg_process_t) MSG_process_create(const char *name, xbt_main_func_t code,