/* Bindings to the MSG hosts */
-/* Copyright (c) 2006-2014. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2006-2017. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
/** Changes the current pstate */
public native void setPstate(int pstate);
public native int getPstatesCount();
- /** Returns the speed of the processor (in flop/s) at the current pstate. See also @ref SURF_plugin_energy. */
+ /** Returns the speed of the processor (in flop/s) at the current pstate. See also @ref plugin_energy. */
public native double getCurrentPowerPeak();
- /** Returns the speed of the processor (in flop/s) at a given pstate. See also @ref SURF_plugin_energy. */
+ /** Returns the speed of the processor (in flop/s) at a given pstate. See also @ref plugin_energy. */
public native double getPowerPeakAt(int pstate);
*
* \brief Start the host if it is off
*
- * See also #MSG_host_is_on() and #MSG_host_is_off() to test the current state of the host and @ref SURF_plugin_energy
+ * See also #MSG_host_is_on() and #MSG_host_is_off() to test the current state of the host and @ref plugin_energy
* for more info on DVFS.
*/
void MSG_host_on(msg_host_t host)
*
* \brief Stop the host if it is on
*
- * See also #MSG_host_is_on() and #MSG_host_is_off() to test the current state of the host and @ref SURF_plugin_energy
+ * See also #MSG_host_is_on() and #MSG_host_is_off() to test the current state of the host and @ref plugin_energy
* for more info on DVFS.
*/
void MSG_host_off(msg_host_t host)
/** @ingroup m_host_management
* @brief Determine if a host is up and running.
*
- * See also #MSG_host_on() and #MSG_host_off() to switch the host ON and OFF and @ref SURF_plugin_energy for more info on DVFS.
+ * See also #MSG_host_on() and #MSG_host_off() to switch the host ON and OFF and @ref plugin_energy for more info on
+ * DVFS.
*
* @param host host to test
* @return Returns true if the host is up and running, and false if it's currently down
/** @ingroup m_host_management
* @brief Determine if a host is currently off.
*
- * See also #MSG_host_on() and #MSG_host_off() to switch the host ON and OFF and @ref SURF_plugin_energy for more info on DVFS.
+ * See also #MSG_host_on() and #MSG_host_off() to switch the host ON and OFF and @ref plugin_energy for more info on
+ * DVFS.
*/
int MSG_host_is_off(msg_host_t host)
{
}
/** \ingroup m_host_management
- * \brief Return the speed of the processor (in flop/s) at a given pstate. See also @ref SURF_plugin_energy.
+ * \brief Return the speed of the processor (in flop/s) at a given pstate. See also @ref plugin_energy.
*
* \param host host to test
* \param pstate_index pstate to test
}
/** \ingroup m_host_management
- * \brief Return the total count of pstates defined for a host. See also @ref SURF_plugin_energy.
+ * \brief Return the total count of pstates defined for a host. See also @ref plugin_energy.
*
* \param host host to test
*/
#include <utility>
#include <vector>
-/** @addtogroup SURF_plugin_energy
+/** @addtogroup plugin_energy
This is the energy plugin, enabling to account not only for computation time,
but also for the dissipated energy in the simulated platform.
-To activate this plugin, first call MSG_energy_plugin_init() before your #MSG_init(),
+To activate this plugin, first call sg_host_energy_plugin_init() before your #MSG_init(),
and then use MSG_host_get_consumed_energy() to retrieve the consumption of a given host.
When the host is on, this energy consumption naturally depends on both the
current CPU load and the host energy profile. According to our measurements,
the consumption is somehow linear in the amount of cores at full speed,
-with an abnormality when all the cores are idle.
+with an abnormality when all the cores are idle. The full details are in
+<a href="https://hal.inria.fr/hal-01523608">our scientific paper</a> on that topic.
As a result, our energy model takes 4 parameters:
### What if a given core is only at load 50%?
-Well, that's impossible in SimGrid because we recompute everything each time
+This is impossible in SimGrid because we recompute everything each time
that the CPU starts or stops doing something. So if a core is at load 50% over
a period, it means that it is at load 100% half of the time and at load 0% the
-rest of the time, and the model holds.
+rest of the time, and our model holds.
### What if the host has only one core?
</host>
\endcode
-### How does DVFS interact with the energy model?
+### How does DVFS interact with the host energy model?
If your host has several DVFS levels (several pstates), then you should
give the energetic profile of each pstate level:
/* **************************** Public interface *************************** */
SG_BEGIN_DECL()
-/** \ingroup SURF_plugin_energy
+/** \ingroup plugin_energy
* \brief Enable host energy plugin
* \details Enable energy plugin to get joules consumption of each cpu. Call this function before #MSG_init().
*/
simgrid::surf::CpuAction::onStateChange.connect(&onActionStateChange);
}
-/** @brief updates the consumption of all hosts
+/** @ingroup plugin_energy
+ * @brief updates the consumption of all hosts
*
* After this call, sg_host_get_consumed_energy() will not interrupt your process
* (until after the next clock update).
});
}
-/** @brief Returns the total energy consumed by the host so far (in Joules)
+/** @ingroup plugin_energy
+ * @brief Returns the total energy consumed by the host so far (in Joules)
*
* Please note that since the consumption is lazily updated, it may require a simcall to update it.
* The result is that the actor requesting this value will be interrupted,
* the value will be updated in kernel mode before returning the control to the requesting actor.
- *
- * See also @ref SURF_plugin_energy.
*/
double sg_host_get_consumed_energy(sg_host_t host)
{
return host->extension<HostEnergy>()->getConsumedEnergy();
}
-/** @brief Get the amount of watt dissipated at the given pstate when the host is idling */
+/** @ingroup plugin_energy
+ * @brief Get the amount of watt dissipated at the given pstate when the host is idling
+ */
double sg_host_get_wattmin_at(sg_host_t host, int pstate)
{
xbt_assert(HostEnergy::EXTENSION_ID.valid(),
"The Energy plugin is not active. Please call sg_energy_plugin_init() during initialization.");
return host->extension<HostEnergy>()->getWattMinAt(pstate);
}
-/** @brief Returns the amount of watt dissipated at the given pstate when the host burns CPU at 100% */
+/** @ingroup plugin_energy
+ * @brief Returns the amount of watt dissipated at the given pstate when the host burns CPU at 100%
+ */
double sg_host_get_wattmax_at(sg_host_t host, int pstate)
{
xbt_assert(HostEnergy::EXTENSION_ID.valid(),
return host->extension<HostEnergy>()->getWattMaxAt(pstate);
}
-/** @brief Returns the current consumption of the host */
+/** @ingroup plugin_energy
+ * @brief Returns the current consumption of the host
+ */
double sg_host_get_current_consumption(sg_host_t host)
{
xbt_assert(HostEnergy::EXTENSION_ID.valid(),
#include <utility>
#include <vector>
-/** @addtogroup SURF_plugin_load
+/** @addtogroup plugin_load
This plugin makes it very simple for users to obtain the current load for each host.
*/
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_plugin_load, surf, "Logging specific to the SURF HostLoad plugin");
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_plugin_load, surf, "Logging specific to the HostLoad plugin");
namespace simgrid {
namespace plugin {
/* **************************** Public interface *************************** */
SG_BEGIN_DECL()
-/** \ingroup SURF_plugin_load
+/** \ingroup plugin_load
* \brief Initializes the HostLoad plugin
* \details The HostLoad plugin provides an API to get the current load of each host.
*/
/** @brief Returns the current load of the host passed as argument
*
- * See also @ref SURF_plugin_load
+ * See also @ref plugin_load
*/
double sg_host_get_current_load(sg_host_t host)
{