X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/d70fbb094c3a4cb6f19caf5177f6aea73e32a9e0..e5c854e45299864d618f3a522046db9d24e2e28b:/docs/source/Plugins.rst diff --git a/docs/source/Plugins.rst b/docs/source/Plugins.rst index 51e29438c9..5bc1614717 100644 --- a/docs/source/Plugins.rst +++ b/docs/source/Plugins.rst @@ -5,23 +5,28 @@ SimGrid Plugins .. raw:: html - + -
-
+
+
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. +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 +list of existing plugins with ``--cfg=plugin:help``. Defining a Plugin ***************** @@ -33,12 +38,12 @@ objects. 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: @@ -48,6 +53,20 @@ 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 ` @@ -55,12 +74,10 @@ Partial list of existing signals in s4u: :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_host_change ` :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_start ` :cpp:member:`Comm::on_completion ` - :cpp:member:`Engine::on_platform_creation ` :cpp:member:`Engine::on_platform_created ` @@ -79,9 +96,8 @@ Partial list of existing signals in s4u: :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:`NetZone::on_creation ` + :cpp:member:`NetZone::on_seal ` - :cpp:member:`VirtualMachine::on_start ` :cpp:member:`VirtualMachine::on_started ` :cpp:member:`VirtualMachine::on_suspend ` @@ -97,23 +113,47 @@ to explore the other ones. .. _plugin_host_energy: -Host Energy Plugin -================== +Host Energy +=========== + +.. doxygengroup:: plugin_host_energy + -.. doxygengroup:: Plugin_host_energy .. _plugin_link_energy: -Link Energy Plugin -================== +Link Energy +=========== + +.. doxygengroup:: plugin_link_energy + +.. _plugin_link_energy_wifi: + +WiFi Energy +=========== + +.. doxygengroup:: plugin_link_energy_wifi + -.. doxygengroup:: Plugin_link_energy .. _plugin_host_load: -Host Load Plugin -================ +Host Load +========= + +.. doxygengroup:: plugin_host_load -.. doxygengroup:: Plugin_host_load + + +.. _plugin_filesystem: + +File System +=========== + +.. doxygengroup:: plugin_filesystem + +.. doxygentypedef:: sg_file_t +.. doxygentypedef:: const_sg_file_t .. LocalWords: SimGrid +