xbt_swag_t getProcessList();
double getCurrentPowerPeak();
double getPowerPeakAt(int pstate_index);
- void setPstate(int pstate_index);
+ void setPState(int pstate_index);
+ int getPState();
double getWattMinAt(int pstate);
double getWattMaxAt(int pstate);
void getParams(vm_params_t params);
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(void) sg_host_set_pstate(sg_host_t host,int pstate);
XBT_PUBLIC(double) sg_host_get_consumed_energy(sg_host_t host);
SG_END_DECL()
XBT_PUBLIC(double) MSG_host_get_power_peak_at(msg_host_t h, int pstate);
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);
+#define MSG_host_get_pstate(h) sg_host_get_pstate(h)
+#define MSG_host_set_pstate(h, pstate) sg_host_set_pstate(h, pstate)
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, vm_params_t params);
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(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);
return sg_host_get_nb_pstates(host);
}
-/** \ingroup m_host_management
- * \brief Sets the speed of the processor (in flop/s) at a given pstate. See also @ref SURF_plugin_energy.
- *
- * \param host host to test
- * \param pstate_index pstate to switch to
- */
-void MSG_host_set_pstate(msg_host_t host, int pstate_index) {
- xbt_assert((host != NULL), "Invalid parameters (host is NULL)");
- host->setPstate(pstate_index);
-}
-/** \ingroup m_host_management
- * \brief Gets the pstate at which the given host is currently running. See also @ref SURF_plugin_energy.
- *
- * \param host host to test
- */
-int MSG_host_get_pstate(msg_host_t host) {
- return sg_host_get_pstate(host);
-}
-
/** \ingroup m_host_management
* \brief Return the total energy consumed by a host (in Joules). See also @ref SURF_plugin_energy.
*
* See also @ref SURF_plugin_energy.
*/
int sg_host_get_pstate(sg_host_t host) {
- return host->p_cpu->getPState();
+ return host->getPState();
+}
+/** @brief Sets the pstate at which that host should run.
+ *
+ * See also @ref SURF_plugin_energy.
+ */
+void sg_host_set_pstate(sg_host_t host,int pstate) {
+ host->setPState(pstate);
}
namespace simgrid {
return host;
}
-/** Set the pstate at which the host should run */
-void Host::setPstate(int pstate_index)
+/** @brief Set the pstate at which the host should run */
+void Host::setPState(int pstate_index)
{
simgrid::simix::kernel(std::bind(
&simgrid::surf::Cpu::setPState, p_cpu, pstate_index
));
}
+/** @brief Retrieve the pstate at which the host is currently running */
+int Host::getPState()
+{
+ return p_cpu->getPState();
+}
/** Get the amount of watt dissipated at the given pstate when the host is idling */
double Host::getWattMinAt(int pstate)
return host->getPowerPeakAt(pstate_index);
}
-/** \ingroup simix_host_management
- * \deprecated */
-void simcall_host_set_pstate(sg_host_t host, int pstate_index)
-{
- host->setPstate(pstate_index);
-}
-
/** \ingroup simix_host_management
* \deprecated */
double simcall_host_get_wattmin_at(msg_host_t host, int pstate)
*/
void smpi_set_host_pstate(int pstate_index)
{
- simcall_host_set_pstate(SIMIX_host_self(), pstate_index);
+ sg_host_set_pstate(SIMIX_host_self(), pstate_index);
}
/**
* \brief Gets the pstate at which the processor currently running