Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
separate the energy plugin from surf in the doc + improvements
authorMartin Quinson <martin.quinson@loria.fr>
Tue, 20 Jun 2017 06:50:31 +0000 (08:50 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Tue, 20 Jun 2017 09:29:19 +0000 (11:29 +0200)
doc/doxygen/module-surf.doc
src/bindings/java/org/simgrid/msg/Host.java
src/msg/msg_host.cpp
src/simgrid/host.cpp
src/surf/plugins/host_energy.cpp
src/surf/plugins/host_load.cpp

index 50c52f7..55af981 100644 (file)
@@ -14,7 +14,7 @@
    - \ref SURF_vm_interface
    - \ref SURF_lmm
    - \ref SURF_callbacks
-   - \ref SURF_plugin_energy
+   - \ref plugin_energy
    
 
 */
 */
 
 /**
-@defgroup SURF_plugin_energy   SURF Energy Plugin
+@defgroup plugin_energy   Energy Plugin
 @ingroup SURF_API
 @brief Describes how to use the energy plugin.
 */
index 4676242..a5f32b1 100644 (file)
@@ -1,7 +1,6 @@
 /* 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. */
@@ -150,9 +149,9 @@ public class Host {
        /** 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);
        
 
index 6c7c2fe..407e5a2 100644 (file)
@@ -74,7 +74,7 @@ msg_host_t MSG_host_self()
  *
  * \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)
@@ -86,7 +86,7 @@ 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)
@@ -192,7 +192,8 @@ void MSG_host_set_property_value(msg_host_t host, const char* name, char* value)
 /** @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
@@ -205,7 +206,8 @@ int MSG_host_is_on(msg_host_t host)
 /** @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)
 {
@@ -213,7 +215,7 @@ 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
@@ -225,7 +227,7 @@ double MSG_host_get_power_peak_at(msg_host_t host, int pstate_index) {
 }
 
 /** \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
  */
index dd03b1f..5db33f1 100644 (file)
@@ -157,7 +157,7 @@ double sg_host_get_available_speed(sg_host_t host)
 
 /** @brief Returns the number of power states for a host.
  *
- *  See also @ref SURF_plugin_energy.
+ *  See also @ref plugin_energy.
  */
 int sg_host_get_nb_pstates(sg_host_t host) {
   return host->pstatesCount();
@@ -165,14 +165,14 @@ int sg_host_get_nb_pstates(sg_host_t host) {
 
 /** @brief Gets the pstate at which that host currently runs.
  *
- *  See also @ref SURF_plugin_energy.
+ *  See also @ref plugin_energy.
  */
 int sg_host_get_pstate(sg_host_t host) {
   return host->pstate();
 }
 /** @brief Sets the pstate at which that host should run.
  *
- *  See also @ref SURF_plugin_energy.
+ *  See also @ref plugin_energy.
  */
 void sg_host_set_pstate(sg_host_t host,int pstate) {
   host->setPstate(pstate);
index 9167876..42efb75 100644 (file)
 #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:
 
@@ -60,10 +61,10 @@ This is enough to compute the consumption as a function of the amount of loaded
 
 ### 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?
 
@@ -78,7 +79,7 @@ If you insist on passing 3 parameters in this case, then you must have the same
 </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:
@@ -426,7 +427,7 @@ static void onSimulationEnd()
 /* **************************** 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().
  */
@@ -445,7 +446,8 @@ void sg_host_energy_plugin_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).
@@ -460,13 +462,12 @@ void sg_host_energy_update_all()
   });
 }
 
-/** @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)
 {
@@ -475,14 +476,18 @@ 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(),
@@ -490,7 +495,9 @@ double sg_host_get_wattmax_at(sg_host_t host, int pstate)
   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(),
index 024b629..7005e62 100644 (file)
 #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 {
@@ -141,7 +141,7 @@ static void onActionStateChange(simgrid::surf::CpuAction* action, simgrid::surf:
 /* **************************** 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.
  */
@@ -160,7 +160,7 @@ void sg_host_load_plugin_init()
 
 /** @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)
 {