From: Martin Quinson Date: Thu, 11 Jun 2015 18:02:46 +0000 (+0200) Subject: tiny small cleanup of a messssy code X-Git-Tag: v3_12~616 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/c3104b0fa063f22f3ce92b1f2e4116eb06915d55 tiny small cleanup of a messssy code --- diff --git a/include/simgrid/simix.h b/include/simgrid/simix.h index 6eb6aaac91..c16e39d1cc 100644 --- a/include/simgrid/simix.h +++ b/include/simgrid/simix.h @@ -264,7 +264,7 @@ XBT_PUBLIC(void) SIMIX_process_set_function(const char* process_host, XBT_PUBLIC(smx_host_t) SIMIX_host_get_by_name(const char *name); XBT_PUBLIC(smx_host_t) SIMIX_host_self(void); XBT_PUBLIC(const char*) SIMIX_host_self_get_name(void); -XBT_PUBLIC(const char*) SIMIX_host_get_name(smx_host_t host); /* FIXME: make private: only the name of SIMIX_host_self() should be public without request */ +#define SIMIX_host_get_name(h) sg_host_name(h) /* DEPRECATED: SIMIX_host_get_name */ XBT_PUBLIC(void) SIMIX_host_on(smx_host_t host); XBT_PUBLIC(void) SIMIX_host_off(smx_host_t host, smx_process_t issuer); XBT_PUBLIC(void) SIMIX_host_self_set_data(void *data); diff --git a/src/simix/smx_host.c b/src/simix/smx_host.c index c11c7046ba..4d4818e5d0 100644 --- a/src/simix/smx_host.c +++ b/src/simix/smx_host.c @@ -177,31 +177,19 @@ const char* SIMIX_host_self_get_name(void) return SIMIX_host_get_name(host); } -const char* SIMIX_host_get_name(smx_host_t host){ - xbt_assert((host != NULL), "Invalid parameters"); - - return sg_host_name(host); -} - xbt_dict_t SIMIX_host_get_properties(smx_host_t host){ - xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)"); - return surf_resource_get_properties(surf_workstation_resource_priv(host)); } double SIMIX_host_get_speed(smx_host_t host){ - xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)"); return surf_workstation_get_speed(host, 1.0); } int SIMIX_host_get_core(smx_host_t host){ - xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)"); - return surf_workstation_get_core(host); } xbt_swag_t SIMIX_host_get_process_list(smx_host_t host){ - xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)"); smx_host_priv_t host_priv = SIMIX_host_priv(host); return host_priv->process_list; @@ -209,32 +197,23 @@ xbt_swag_t SIMIX_host_get_process_list(smx_host_t host){ double SIMIX_host_get_available_speed(smx_host_t host){ - xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)"); - return surf_workstation_get_available_speed(host); } double SIMIX_host_get_current_power_peak(smx_host_t host) { - xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)"); return surf_workstation_get_current_power_peak(host); } double SIMIX_host_get_power_peak_at(smx_host_t host, int pstate_index) { - xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)"); - return surf_workstation_get_power_peak_at(host, pstate_index); } int SIMIX_host_get_nb_pstates(smx_host_t host) { - xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)"); - return surf_workstation_get_nb_pstates(host); } void SIMIX_host_set_pstate(smx_host_t host, int pstate_index) { - xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)"); - surf_workstation_set_pstate(host, pstate_index); } int SIMIX_host_get_pstate(smx_host_t host) { @@ -242,7 +221,6 @@ int SIMIX_host_get_pstate(smx_host_t host) { } double SIMIX_host_get_consumed_energy(smx_host_t host) { - xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)"); return surf_workstation_get_consumed_energy(host); } double SIMIX_host_get_wattmin_at(smx_host_t host,int pstate) { @@ -253,8 +231,6 @@ double SIMIX_host_get_wattmax_at(smx_host_t host,int pstate) { } int SIMIX_host_get_state(smx_host_t host){ - xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)"); - return surf_resource_get_state(surf_workstation_resource_priv(host)); } diff --git a/src/surf/workstation_interface.hpp b/src/surf/workstation_interface.hpp index eb6c8dc004..63943e48bc 100644 --- a/src/surf/workstation_interface.hpp +++ b/src/surf/workstation_interface.hpp @@ -137,7 +137,7 @@ public: class Workstation : public Resource { public: /** - * @brief Workstation consrtuctor + * @brief Workstation constructor */ Workstation();