X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/63c219ee10cf464f95ad9888e0814439445b53f8..fcd1f70709a193338f818adff2b3b1fa08e307ab:/docs/source/Plugins.rst
diff --git a/docs/source/Plugins.rst b/docs/source/Plugins.rst
index bfff73da95..2fae39481b 100644
--- a/docs/source/Plugins.rst
+++ b/docs/source/Plugins.rst
@@ -12,16 +12,17 @@ SimGrid Plugins
elem.style="opacity:0.93999999;fill:#ff0000;fill-opacity:0.1;stroke:#000000;stroke-width:0.35277778;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1";
}
-
-
+
+
You can extend SimGrid without modifying it, thanks to our plugin
mechanism. This page describes how to write your own plugin, and
documents some of the plugins distributed with SimGrid:
+ - :ref:`Host Load `: monitors the load of the compute units.
- :ref:`Host Energy `: models the energy dissipation of the compute units.
- :ref:`Link Energy `: models the energy dissipation of the network.
- - :ref:`Host Load `: monitors the load of the compute units.
+ - :ref:`WiFi Energy `: models the energy dissipation of wifi links.
You can activate these plugins with the :ref:`--cfg=plugin ` command
line option, for example with ``--cfg=plugin:host_energy``. You can get the full
@@ -32,17 +33,17 @@ Defining a Plugin
A plugin can get some additional code executed within the SimGrid
kernel, and attach the data needed by that code to the SimGrid
-objects.
+objects.
-The host load plugin in
+The host load plugin in
`src/plugins/host_load.cpp `_
constitutes a good introductory example. It defines a class
-```HostLoad``` that is meant to be attached to each host. This class
-contains a ```EXTENSION_ID``` field that is mandatory to our extension
-mechanism. Then, the function ```sg_host_load_plugin_init```
+``HostLoad`` that is meant to be attached to each host. This class
+contains a ``EXTENSION_ID`` field that is mandatory to our extension
+mechanism. Then, the function ``sg_host_load_plugin_init``
initializes the plugin. It first calls
:cpp:func:`simgrid::s4u::Host::extension_create()` to register its
-extension to the ```s4u::Host``` objects, and then attaches some
+extension to the ``s4u::Host`` objects, and then attaches some
callbacks to signals.
You can attach your own extension to most kinds of s4u object:
@@ -52,46 +53,64 @@ You can attach your own extension to most kinds of s4u object:
:cpp:class:`Links `. If you need to extend another
kind of objects, please let us now.
+.. cpp:class:: template simgrid::xbt::signal
+
+ A signal/slot mechanism, where you can attach callbacks to a given signal, and then fire the signal.
+
+ The template parameter is the function signature of the signal (the return value currently ignored).
+
+.. cpp:function::: template unsigned int simgrid::xbt::signal::connect(U slot)
+
+ Add a new callback to this signal.
+
+.. cpp:function:: template simgrid::xbt::signal::operator()(P... args)
+
+ Fire that signal, invoking all callbacks.
+
Partial list of existing signals in s4u:
-- :cpp:member:`Actor::on_creation `
- :cpp:member:`Actor::on_suspend `
- :cpp:member:`Actor::on_resume `
- :cpp:member:`Actor::on_sleep `
- :cpp:member:`Actor::on_wake_up `
- :cpp:member:`Actor::on_migration_start `
- :cpp:member:`Actor::on_migration_end `
- :cpp:member:`Actor::on_termination `
- :cpp:member:`Actor::on_destruction `
-- :cpp:member:`Comm::on_sender_start `
- :cpp:member:`Comm::on_receiver_start `
- :cpp:member:`Comm::on_completion `
-- :cpp:member:`Engine::on_platform_creation `
- :cpp:member:`Engine::on_platform_created `
- :cpp:member:`Engine::on_time_advance `
- :cpp:member:`Engine::on_simulation_end `
- :cpp:member:`Engine::on_deadlock `
-- :cpp:member:`Exec::on_start `
- :cpp:member:`Exec::on_completion `
-- :cpp:member:`Host::on_creation `
- :cpp:member:`Host::on_destruction `
- :cpp:member:`Host::on_state_change `
- :cpp:member:`Host::on_speed_change `
-- :cpp:member:`Link::on_creation `
- :cpp:member:`Link::on_destruction `
- :cpp:member:`Link::on_state_change `
- :cpp:member:`Link::on_speed_change `
- :cpp:member:`Link::on_communicate `
- :cpp:member:`Link::on_communication_state_change `
-- :cpp:member:`Netzone::on_creation `
- :cpp:member:`Netzone::on_seal `
- :cpp:member:`Netzone::on_route_creation `
-- :cpp:member:`VirtualMachine::on_start `
- :cpp:member:`VirtualMachine::on_started `
- :cpp:member:`VirtualMachine::on_suspend `
- :cpp:member:`VirtualMachine::on_resume `
- :cpp:member:`VirtualMachine::on_migration_start `
- :cpp:member:`VirtualMachine::on_migration_end `
+- :cpp:func:`Actor::on_creation `
+ :cpp:func:`Actor::on_suspend `
+ :cpp:func:`Actor::on_resume `
+ :cpp:func:`Actor::on_sleep `
+ :cpp:func:`Actor::on_wake_up `
+ :cpp:func:`Actor::on_host_change `
+ :cpp:func:`Actor::on_termination `
+ :cpp:func:`Actor::on_destruction `
+- :cpp:func:`Comm::on_send `
+ :cpp:func:`Comm::on_recv `
+ :cpp:func:`Comm::on_completion `
+- :cpp:func:`CommImpl::on_start `
+ :cpp:func:`CommImpl::on_completion `
+- :cpp:func:`Disk::on_creation `
+ :cpp:func:`Disk::on_destruction `
+ :cpp:func:`Disk::on_state_change `
+- :cpp:func:`Engine::on_platform_creation `
+ :cpp:func:`Engine::on_platform_created `
+ :cpp:func:`Engine::on_time_advance `
+ :cpp:func:`Engine::on_simulation_end `
+ :cpp:func:`Engine::on_deadlock `
+- :cpp:func:`Exec::on_start `
+ :cpp:func:`Exec::on_completion `
+- :cpp:func:`Host::on_creation `
+ :cpp:func:`Host::on_destruction `
+ :cpp:func:`Host::on_state_change `
+ :cpp:func:`Host::on_speed_change `
+- :cpp:func:`Io::on_start `
+ :cpp:func:`Io::on_completion `
+- :cpp:func:`Link::on_creation `
+ :cpp:func:`Link::on_destruction `
+ :cpp:func:`Link::on_state_change `
+ :cpp:func:`Link::on_speed_change `
+ :cpp:func:`Link::on_communication_state_change `
+- :cpp:func:`NetZone::on_creation `
+ :cpp:func:`NetZone::on_seal `
+- :cpp:func:`VirtualMachine::on_start `
+ :cpp:func:`VirtualMachine::on_started `
+ :cpp:func:`VirtualMachine::on_suspend `
+ :cpp:func:`VirtualMachine::on_resume `
+ :cpp:func:`VirtualMachine::on_migration_start `
+ :cpp:func:`VirtualMachine::on_migration_end `
Existing Plugins
****************
@@ -104,7 +123,7 @@ to explore the other ones.
Host Energy
===========
-.. doxygengroup:: Plugin_host_energy
+.. doxygengroup:: plugin_host_energy
@@ -113,7 +132,14 @@ Host Energy
Link Energy
===========
-.. doxygengroup:: Plugin_link_energy
+.. doxygengroup:: plugin_link_energy
+
+.. _plugin_link_energy_wifi:
+
+WiFi Energy
+===========
+
+.. doxygengroup:: plugin_link_energy_wifi
@@ -122,7 +148,7 @@ Link Energy
Host Load
=========
-.. doxygengroup:: Plugin_host_load
+.. doxygengroup:: plugin_host_load
@@ -131,8 +157,20 @@ Host Load
File System
===========
-.. doxygengroup:: Plugin_filesystem
+.. doxygengroup:: plugin_filesystem
+.. _plugin_battery:
-.. LocalWords: SimGrid
+Battery
+===========
+
+.. doxygengroup:: plugin_battery
+.. _plugin_operation:
+
+Operation
+===========
+
+.. doxygengroup:: plugin_operation
+
+.. LocalWords: SimGrid