From 51c23076e2b42ff07dc167dea1cb0e3a4ab3cf68 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sat, 26 May 2018 16:35:35 +0200 Subject: [PATCH] rename the plugins from the command line, and document it --- ChangeLog | 16 +++++++++---- doc/doxygen/options.doc | 35 +++++++++++++++++----------- examples/smpi/energy/energy.tesh | 2 +- examples/smpi/energy/f77/energy.tesh | 2 +- examples/smpi/energy/f90/energy.tesh | 2 +- src/surf/surf_interface.cpp | 6 ++--- 6 files changed, 38 insertions(+), 25 deletions(-) diff --git a/ChangeLog b/ChangeLog index 71afbb0eaa..59b8de448a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,23 +4,29 @@ TRACE - Change --cfg=tracing/msg/vm to --cfg=tracing/vm as virtual machine behavior tracing is no longer limited to MSG - S4U: +S4U: - Introduced new function simgrid::s4u::Host::get_actor_count. This function returns the number of actors running on a specific host. - Simix: +Plugins: + - Allow to run the Link energy plugin from the command line with + --cfg=plugin:link_energy + - Rename Energy plugin into host_energy + - Rename Load plugin into host_load + +simix: - Add parameter --cfg=simix/breakpoint to raise a SIGTRAP at given time. - SMPI: +SMPI: - Replay: The replay file has been re-written in C++. - Replay: Tags used for messages sent via MPI_Send / MPI_Recv are now supported. They are stored in the trace and used when replayed. - XBT: +XBT: - Config: the C API is now deprecated (will be removed in 3.23), and the C++ API has been slightly improved. - Fixed bugs: +Fixed bugs: - #143: Setting a breakpoint at a given time - #258: daemonized actors hang after all non-daemonized actors have completed diff --git a/doc/doxygen/options.doc b/doc/doxygen/options.doc index dff9c9c7ed..c643c23c6c 100644 --- a/doc/doxygen/options.doc +++ b/doc/doxygen/options.doc @@ -254,24 +254,31 @@ when using SimDag. \subsection options_generic_plugin Plugins -SimGrid supports the use of plugins; currently, no known plugins -can be activated but there are use-cases where you may want to write -your own plugin (for instance, for logging). - -Plugins can for instance define own classes that inherit from -existing classes (for instance, a class "CpuEnergy" inherits from -"Cpu" to assess energy consumption). - -The plugin connects to the code by registering callbacks using -``signal.connect(callback)`` (see file ``src/surf/plugins/energy.cpp`` for -details). +SimGrid plugins allow to extend the framework without changing its +source code directly. Read the source code of the existing plugins to +learn how to do so (in ``src/plugins``), and ask your questions to the +usual channels (Stack Overflow, Mailing list, IRC). The basic idea is +that plugins usually register callbacks to some signals of interest. +If they need to store some information about a given object (Link, CPU +or Actor), they do so through the use of a dedicated object extension. + +Some of the existing plugins can be activated from the command line, +meaning that you can activate them from the command line without any +modification to your simulation code. For example, you can activate +the host energy plugin by adding the following to your command line: \verbatim - --cfg=plugin:Energy + --cfg=plugin:host_energy \endverbatim -\note - This option is case-sensitive: Energy and energy are not the same! +Here is the full list of plugins that can be activated this way: + + - \b host_energy: keeps track of the energy dissipated by + computations. More details in @ref plugin_energy. + - \b link_energy: keeps track of the energy dissipated by + communications. More details in @ref SURF_plugin_energy. + - \b host_load: keeps track of the computational load. + More details in @ref plugin_load. \subsection options_model_optim Optimization level of the platform models diff --git a/examples/smpi/energy/energy.tesh b/examples/smpi/energy/energy.tesh index ee5fa2e08f..1895a49d55 100644 --- a/examples/smpi/energy/energy.tesh +++ b/examples/smpi/energy/energy.tesh @@ -1,5 +1,5 @@ p Test smpi bindings for dvfs functions (C example) -$ ${bindir:=.}/../smpi_script/bin/smpirun -np 2 -hostfile ${srcdir:=.}/hostfile -platform ${platfdir}/energy_platform.xml --cfg=smpi/simulate-computation:no ${bindir:=.}/../examples/smpi/energy/smpi_energy --cfg=plugin:Energy --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning +$ ${bindir:=.}/../smpi_script/bin/smpirun -np 2 -hostfile ${srcdir:=.}/hostfile -platform ${platfdir}/energy_platform.xml --cfg=smpi/simulate-computation:no ${bindir:=.}/../examples/smpi/energy/smpi_energy --cfg=plugin:host_energy --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning > [0.000000] [rank 0] Pstates: 3; Powers: 100000000, 50000000, 20000000 > [0.000000] [rank 1] Pstates: 3; Powers: 100000000, 50000000, 20000000 > [0.000000] [rank 0] Current pstate: 0; Current power: 100000000 diff --git a/examples/smpi/energy/f77/energy.tesh b/examples/smpi/energy/f77/energy.tesh index a3391a6ebd..c9de94b728 100644 --- a/examples/smpi/energy/f77/energy.tesh +++ b/examples/smpi/energy/f77/energy.tesh @@ -1,6 +1,6 @@ p Test smpi bindings for dvfs functions (Fortran 77 example) -$ ../../../smpi_script/bin/smpirun -np 2 -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../platforms/energy_platform.xml --cfg=smpi/simulate-computation:no ${bindir:=.}/f77/sef --cfg=plugin:Energy --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning +$ ../../../smpi_script/bin/smpirun -np 2 -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../platforms/energy_platform.xml --cfg=smpi/simulate-computation:no ${bindir:=.}/f77/sef --cfg=plugin:host_energy --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning > [ 0.00000000] [rank 0] 3 pstates available > [ 0.00000000] [rank 1] 3 pstates available > [ 0.00000000] [rank 0] Power: 100000000.0000 diff --git a/examples/smpi/energy/f90/energy.tesh b/examples/smpi/energy/f90/energy.tesh index 9c9f9478c5..5394bfcd07 100644 --- a/examples/smpi/energy/f90/energy.tesh +++ b/examples/smpi/energy/f90/energy.tesh @@ -1,6 +1,6 @@ p Test smpi bindings for dvfs functions (Fortran 90 example) -$ ../../../smpi_script/bin/smpirun -np 2 -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../platforms/energy_platform.xml --cfg=smpi/simulate-computation:no ${bindir:=.}/f90/sef90 --cfg=plugin:Energy --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning +$ ../../../smpi_script/bin/smpirun -np 2 -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../platforms/energy_platform.xml --cfg=smpi/simulate-computation:no ${bindir:=.}/f90/sef90 --cfg=plugin:host_energy --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning > [ 0.00000000] [rank 0] 3 pstates available > [ 0.00000000] [rank 1] 3 pstates available > [ 0.00000000] [rank 0] Power: 100000000.0000 diff --git a/src/surf/surf_interface.cpp b/src/surf/surf_interface.cpp index 8697e7766e..85b2bd3cdd 100644 --- a/src/surf/surf_interface.cpp +++ b/src/surf/surf_interface.cpp @@ -40,9 +40,9 @@ extern std::map storage_types; #include // FIXME: this plug-in should not be linked to the core s_surf_model_description_t surf_plugin_description[] = { - {"Host_Energy", "Cpu energy consumption.", &sg_host_energy_plugin_init}, - {"Link_Energy", "Link energy consumption.", &sg_link_energy_plugin_init}, - {"Load", "Cpu load.", &sg_host_load_plugin_init}, + {"host_energy", "Cpu energy consumption.", &sg_host_energy_plugin_init}, + {"link_energy", "Link energy consumption.", &sg_link_energy_plugin_init}, + {"host_load", "Cpu load.", &sg_host_load_plugin_init}, {nullptr, nullptr, nullptr} /* this array must be nullptr terminated */ }; -- 2.20.1