From: Martin Quinson Date: Mon, 20 Jul 2015 23:27:19 +0000 (+0200) Subject: Remove a bunch of stuff from Host that was delegated to cpu anyway X-Git-Tag: v3_12~449 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/782f94b6c47b6e7722212befa54969f5a6b9a0fc Remove a bunch of stuff from Host that was delegated to cpu anyway - getSpeed() - getAvailableSpeed() - getCore() - getCurrentPowerPeak(); - getPowerPeakAt(pstate_index); - getNbPstates(); - {set,get}Pstate() --- diff --git a/src/include/surf/surf.h b/src/include/surf/surf.h index d0f362e3c0..c081bcbbab 100644 --- a/src/include/surf/surf.h +++ b/src/include/surf/surf.h @@ -328,16 +328,16 @@ XBT_PUBLIC(double) surf_host_get_speed(surf_resource_t resource, double load); * @param resource The surf host * @return [description] */ -XBT_PUBLIC(double) surf_host_get_available_speed(surf_resource_t resource); +XBT_PUBLIC(double) surf_host_get_available_speed(surf_resource_t host); /** @brief Get the number of cores of the cpu associated to a host */ -XBT_PUBLIC(int) surf_host_get_core(surf_resource_t resource); +XBT_PUBLIC(int) surf_host_get_core(surf_resource_t host); /** @brief Create a computation action on the given host */ -XBT_PUBLIC(surf_action_t) surf_host_execute(surf_resource_t resource, double size); +XBT_PUBLIC(surf_action_t) surf_host_execute(surf_resource_t host, double size); /** @brief Create a sleep action on the given host */ -XBT_PUBLIC(surf_action_t) surf_host_sleep(surf_resource_t resource, double duration); +XBT_PUBLIC(surf_action_t) surf_host_sleep(surf_resource_t host, double duration); /** @brief Create a file opening action on the given host */ XBT_PUBLIC(surf_action_t) surf_host_open(surf_resource_t host, const char* fullpath); diff --git a/src/surf/host_interface.cpp b/src/surf/host_interface.cpp index 4382e94ea5..956a0b641b 100644 --- a/src/surf/host_interface.cpp +++ b/src/surf/host_interface.cpp @@ -106,42 +106,6 @@ void Host::setState(e_surf_resource_state_t state){ p_cpu->setState(state); } -int Host::getCore(){ - return p_cpu->getCore(); -} - -double Host::getSpeed(double load){ - return p_cpu->getSpeed(load); -} - -double Host::getAvailableSpeed(){ - return p_cpu->getAvailableSpeed(); -} - -double Host::getCurrentPowerPeak() -{ - return p_cpu->getCurrentPowerPeak(); -} - -double Host::getPowerPeakAt(int pstate_index) -{ - return p_cpu->getPowerPeakAt(pstate_index); -} - -int Host::getNbPstates() -{ - return p_cpu->getNbPstates(); -} - -void Host::setPstate(int pstate_index) -{ - p_cpu->setPstate(pstate_index); -} -int Host::getPstate() -{ - return p_cpu->getPstate(); -} - xbt_dict_t Host::getProperties() { return p_cpu->getProperties(); diff --git a/src/surf/host_interface.hpp b/src/surf/host_interface.hpp index 0fd2d15afe..b4513294d8 100644 --- a/src/surf/host_interface.hpp +++ b/src/surf/host_interface.hpp @@ -143,40 +143,6 @@ public: */ virtual Action *sleep(double duration)=0; - /** - * @brief Get the number of cores of the associated Cpu - * - * @return The number of cores of the associated Cpu - * @see Cpu - */ - virtual int getCore(); - - /** - * @brief Get the speed of the associated Cpu - * - * @param load [TODO] - * @return The speed of the associated Cpu - * @see Cpu - */ - virtual double getSpeed(double load); - - /** - * @brief Get the available speed of the associated Cpu - * @details [TODO] - * - * @return The available speed of the associated Cpu - * @see Cpu - */ - virtual double getAvailableSpeed(); - - /** @brief Get the associated Cpu power peak */ - virtual double getCurrentPowerPeak(); - - virtual double getPowerPeakAt(int pstate_index); - virtual int getNbPstates(); - virtual void setPstate(int pstate_index); - virtual int getPstate(); - /** @brief Return the storage of corresponding mount point */ virtual Storage *findStorageOnMountList(const char* storage); diff --git a/src/surf/surf_c_bindings.cpp b/src/surf/surf_c_bindings.cpp index 9c172d4aa3..a149c669db 100644 --- a/src/surf/surf_c_bindings.cpp +++ b/src/surf/surf_c_bindings.cpp @@ -266,43 +266,43 @@ void surf_resource_set_state(surf_cpp_resource_t resource, e_surf_resource_state resource->setState(state); } -surf_action_t surf_host_sleep(surf_resource_t resource, double duration){ - return get_casted_host(resource)->sleep(duration); +surf_action_t surf_host_sleep(surf_resource_t host, double duration){ + return get_casted_host(host)->sleep(duration); } -double surf_host_get_speed(surf_resource_t resource, double load){ - return get_casted_host(resource)->getSpeed(load); +double surf_host_get_speed(surf_resource_t host, double load){ + return sg_host_surfcpu(host)->getSpeed(load); } -double surf_host_get_available_speed(surf_resource_t resource){ - return get_casted_host(resource)->getAvailableSpeed(); +double surf_host_get_available_speed(surf_resource_t host){ + return sg_host_surfcpu(host)->getAvailableSpeed(); } -int surf_host_get_core(surf_resource_t resource){ - return get_casted_host(resource)->getCore(); +int surf_host_get_core(surf_resource_t host){ + return sg_host_surfcpu(host)->getCore(); } -surf_action_t surf_host_execute(surf_resource_t resource, double size){ - return get_casted_host(resource)->execute(size); +surf_action_t surf_host_execute(surf_resource_t host, double size){ + return get_casted_host(host)->execute(size); } -double surf_host_get_current_power_peak(surf_resource_t resource){ - return get_casted_host(resource)->getCurrentPowerPeak(); +double surf_host_get_current_power_peak(surf_resource_t host){ + return sg_host_surfcpu(host)->getCurrentPowerPeak(); } -double surf_host_get_power_peak_at(surf_resource_t resource, int pstate_index){ - return get_casted_host(resource)->getPowerPeakAt(pstate_index); +double surf_host_get_power_peak_at(surf_resource_t host, int pstate_index){ + return sg_host_surfcpu(host)->getPowerPeakAt(pstate_index); } -int surf_host_get_nb_pstates(surf_resource_t resource){ - return get_casted_host(resource)->getNbPstates(); +int surf_host_get_nb_pstates(surf_resource_t host){ + return sg_host_surfcpu(host)->getNbPstates(); } -void surf_host_set_pstate(surf_resource_t resource, int pstate_index){ - get_casted_host(resource)->setPstate(pstate_index); +void surf_host_set_pstate(surf_resource_t host, int pstate_index){ + sg_host_surfcpu(host)->setPstate(pstate_index); } -int surf_host_get_pstate(surf_resource_t resource){ - return get_casted_host(resource)->getPstate(); +int surf_host_get_pstate(surf_resource_t host){ + return sg_host_surfcpu(host)->getPstate(); } double surf_host_get_wattmin_at(surf_resource_t resource, int pstate){ xbt_assert(surf_energy!=NULL, "The Energy plugin is not active. Please call sg_energy_plugin_init() during initialization.");