XBT_PUBLIC(int) sg_host_get_core(sg_host_t host);
XBT_PUBLIC(int) sg_host_get_state(sg_host_t host);
+XBT_PUBLIC(int) sg_host_get_nb_pstates(sg_host_t host);
XBT_PUBLIC(int) sg_host_get_pstate(sg_host_t host);
XBT_PUBLIC(double) sg_host_get_consumed_energy(sg_host_t host);
XBT_PUBLIC(double) simcall_host_get_current_power_peak(sg_host_t host);
XBT_PUBLIC(double) simcall_host_get_power_peak_at(sg_host_t host, int pstate_index);
-XBT_PUBLIC(int) simcall_host_get_nb_pstates(sg_host_t host);
XBT_PUBLIC(void) simcall_host_set_pstate(sg_host_t host, int pstate_index);
XBT_PUBLIC(double) simcall_host_get_wattmin_at(sg_host_t host, int pstate);
XBT_PUBLIC(double) simcall_host_get_wattmax_at(sg_host_t host, int pstate);
* \param host host to test
*/
int MSG_host_get_nb_pstates(msg_host_t host) {
-
- xbt_assert((host != NULL), "Invalid parameters (host is NULL)");
- return (simcall_host_get_nb_pstates(host));
+ return sg_host_get_nb_pstates(host);
}
/** \ingroup m_host_management
return surf_host_get_state(surf_host_resource_priv(host));
}
-/** @brief Returns the total energy consumed by the host (in Joules) */
+/** @brief Returns the total energy consumed by the host (in Joules).
+ *
+ * See also @ref SURF_plugin_energy.
+ */
double sg_host_get_consumed_energy(sg_host_t host) {
return surf_host_get_consumed_energy(host);
}
-/** @brief Gets the pstate at which that host currently runs */
+/** @brief Returns the number of power states for a host.
+ *
+ * See also @ref SURF_plugin_energy.
+ */
+int sg_host_get_nb_pstates(sg_host_t host) {
+ return surf_host_get_nb_pstates(host);
+}
+
+/** @brief Gets the pstate at which that host currently runs.
+ *
+ * See also @ref SURF_plugin_energy.
+ */
int sg_host_get_pstate(sg_host_t host) {
return surf_host_get_pstate(host);
}
return simcall_BODY_host_get_power_peak_at(host, pstate_index);
}
-/**
- * \ingroup simix_host_management
- * \brief Returns the number of power states for a host.
- *
- * \param host A SIMIX host
- * \return the number of power states
- */
-int simcall_host_get_nb_pstates(sg_host_t host)
-{
- return simcall_BODY_host_get_nb_pstates(host);
-}
-
/**
* \ingroup simix_host_management
* \brief Sets the pstate at which the host should run
simcall->result.d = result;
}
-static inline sg_host_t simcall_host_get_nb_pstates__get__host(smx_simcall_t simcall) {
- return (sg_host_t) simcall->args[0].dp;
-}
-static inline void simcall_host_get_nb_pstates__set__host(smx_simcall_t simcall, void* arg) {
- simcall->args[0].dp = arg;
-}
-static inline int simcall_host_get_nb_pstates__get__result(smx_simcall_t simcall){
- return simcall->result.i;
-}
-static inline void simcall_host_get_nb_pstates__set__result(smx_simcall_t simcall, int result){
- simcall->result.i = result;
-}
-
static inline sg_host_t simcall_host_get_wattmin_at__get__host(smx_simcall_t simcall) {
return (sg_host_t) simcall->args[0].dp;
}
return self->simcall.result.d;
}
-inline static int simcall_BODY_host_get_nb_pstates(sg_host_t host) {
- smx_process_t self = SIMIX_process_self();
-
- /* Go to that function to follow the code flow through the simcall barrier */
- if (0) SIMIX_host_get_nb_pstates(host);
- /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
-
- self->simcall.call = SIMCALL_HOST_GET_NB_PSTATES;
- memset(&self->simcall.result, 0, sizeof(self->simcall.result));
- memset(self->simcall.args, 0, sizeof(self->simcall.args));
- self->simcall.args[0].dp = (void*) host;
- if (self != simix_global->maestro_process) {
- XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
- SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
- SIMIX_process_yield(self);
- } else {
- SIMIX_simcall_handle(&self->simcall, 0);
- }
- return self->simcall.result.i;
- }
-
inline static double simcall_BODY_host_get_wattmin_at(sg_host_t host, int pstate_index) {
smx_process_t self = SIMIX_process_self();
SIMCALL_HOST_GET_PROCESS_LIST,
SIMCALL_HOST_GET_CURRENT_POWER_PEAK,
SIMCALL_HOST_GET_POWER_PEAK_AT,
- SIMCALL_HOST_GET_NB_PSTATES,
SIMCALL_HOST_GET_WATTMIN_AT,
SIMCALL_HOST_GET_WATTMAX_AT,
SIMCALL_HOST_SET_PSTATE,
[SIMCALL_HOST_GET_PROCESS_LIST] = "SIMCALL_HOST_GET_PROCESS_LIST",
[SIMCALL_HOST_GET_CURRENT_POWER_PEAK] = "SIMCALL_HOST_GET_CURRENT_POWER_PEAK",
[SIMCALL_HOST_GET_POWER_PEAK_AT] = "SIMCALL_HOST_GET_POWER_PEAK_AT",
- [SIMCALL_HOST_GET_NB_PSTATES] = "SIMCALL_HOST_GET_NB_PSTATES",
[SIMCALL_HOST_GET_WATTMIN_AT] = "SIMCALL_HOST_GET_WATTMIN_AT",
[SIMCALL_HOST_GET_WATTMAX_AT] = "SIMCALL_HOST_GET_WATTMAX_AT",
[SIMCALL_HOST_SET_PSTATE] = "SIMCALL_HOST_SET_PSTATE",
SIMIX_simcall_answer(simcall);
break;
-case SIMCALL_HOST_GET_NB_PSTATES:
- simcall->result.i = SIMIX_host_get_nb_pstates((sg_host_t) simcall->args[0].dp);
- SIMIX_simcall_answer(simcall);
- break;
-
case SIMCALL_HOST_GET_WATTMIN_AT:
simcall->result.d = SIMIX_host_get_wattmin_at((sg_host_t) simcall->args[0].dp, simcall->args[1].i);
SIMIX_simcall_answer(simcall);
Func - host_get_process_list (void*, xbt_swag_t) (host, void*, sg_host_t)
Func - host_get_current_power_peak (double) (host, void*, sg_host_t)
Func - host_get_power_peak_at (double) (host, void*, sg_host_t) (pstate_index, int)
-Func - host_get_nb_pstates (int) (host, void*, sg_host_t)
Func - host_get_wattmin_at (double) (host, void*, sg_host_t) (pstate_index, int)
Func - host_get_wattmax_at (double) (host, void*, sg_host_t) (pstate_index, int)
Proc - host_set_pstate (void) (host, void*, sg_host_t) (pstate_index, int)
return surf_host_get_power_peak_at(host, pstate_index);
}
-int SIMIX_host_get_nb_pstates(sg_host_t host) {
- return surf_host_get_nb_pstates(host);
-}
-
-
void SIMIX_host_set_pstate(sg_host_t host, int pstate_index) {
surf_host_set_pstate(host, pstate_index);
}
XBT_PRIVATE xbt_swag_t SIMIX_host_get_process_list(sg_host_t host);
XBT_PRIVATE double SIMIX_host_get_current_power_peak(sg_host_t host);
XBT_PRIVATE double SIMIX_host_get_power_peak_at(sg_host_t host, int pstate_index);
-XBT_PRIVATE int SIMIX_host_get_nb_pstates(sg_host_t host);
XBT_PRIVATE double SIMIX_host_get_wattmin_at(sg_host_t host,int pstate);
XBT_PRIVATE double SIMIX_host_get_wattmax_at(sg_host_t host,int pstate);
XBT_PRIVATE void SIMIX_host_set_pstate(sg_host_t host, int pstate_index);
}
/**
- * \brief Return the number of pstates defined for host
+ * \brief Return the number of pstates defined for the current host
*/
int smpi_get_host_nb_pstates(void)
{
- return simcall_host_get_nb_pstates(SIMIX_host_self());
+ return sg_host_get_nb_pstates(SIMIX_host_self());
}
/**