From: Martin Quinson Date: Thu, 18 Feb 2021 18:24:15 +0000 (+0100) Subject: Fix a bunch of errors in the documentation X-Git-Tag: v3.27~332 X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/177dc24777869d0311494d830c9cce5992d3cc56 Fix a bunch of errors in the documentation --- diff --git a/docs/source/Plugins.rst b/docs/source/Plugins.rst index 9fe6949b91..44e4b31295 100644 --- a/docs/source/Plugins.rst +++ b/docs/source/Plugins.rst @@ -19,9 +19,10 @@ 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 @@ -127,6 +128,13 @@ Link Energy .. doxygengroup:: plugin_link_energy +.. _plugin_link_energy_wifi: + +WiFi Energy +=========== + +.. doxygengroup:: plugin_link_energy_wifi + .. _plugin_host_load: @@ -145,6 +153,8 @@ File System .. doxygengroup:: plugin_filesystem +.. doxygentypedef:: sg_file_t +.. doxygentypedef:: const_sg_file_t .. LocalWords: SimGrid diff --git a/docs/source/app_msg.rst b/docs/source/app_msg.rst index 472f4ec961..0e5a943440 100644 --- a/docs/source/app_msg.rst +++ b/docs/source/app_msg.rst @@ -125,6 +125,7 @@ Task Management Task structure of MSG :cpp:type:`msg_task_t` and associated functions. .. doxygentypedef:: msg_task_t +.. doxygentypedef:: const_msg_task_t .. doxygendefine:: MSG_TASK_UNINITIALIZED .. doxygenfunction:: MSG_parallel_task_create diff --git a/docs/source/app_s4u.rst b/docs/source/app_s4u.rst index a605c7ac4e..f43e02d5ed 100644 --- a/docs/source/app_s4u.rst +++ b/docs/source/app_s4u.rst @@ -409,6 +409,8 @@ Basic management from simgrid import Actor + .. autoclass:: simgrid.Actor + .. group-tab:: C .. code:: C @@ -591,6 +593,7 @@ Reacting to the end of actors .. group-tab:: C + .. doxygenfunction:: sg_actor_on_exit .. doxygenfunction:: sg_actor_join(const_sg_actor_t actor, double timeout) .. doxygenfunction:: sg_actor_set_auto_restart(sg_actor_t actor, int auto_restart) @@ -748,6 +751,12 @@ Exiting .. autofunction:: simgrid.this_actor.exit .. autofunction:: simgrid.this_actor.on_exit + .. group-tab:: c + + See also :cpp:func:`sg_actor_on_exit`. + + .. doxygenfunction:: sg_actor_exit + .. _API_s4u_Engine: ==================== @@ -925,15 +934,24 @@ Basic management .. group-tab:: Python + .. code-block:: C++ + + #include + + .. autoclass:: simgrid.Mailbox + .. automethod:: simgrid.Mailbox.by_name + .. group-tab:: C + .. code-block:: C #include - .. doxygenfunction:: sg_mailbox_by_name(const char *alias) + .. doxygentypedef:: sg_mailbox_t + .. doxygentypedef:: const_sg_mailbox_t - .. group-tab:: C + .. doxygenfunction:: sg_mailbox_by_name(const char *alias) Querying info ------------- @@ -1799,6 +1817,17 @@ Basic management from simgrid import Comm + .. autoclass:: simgrid.Comm + + .. group-tab:: c + + .. code:: c + + #include + + .. doxygentypedef:: sg_comm_t + .. doxygentypedef:: const_sg_comm_t + Querying info ------------- @@ -1813,6 +1842,7 @@ Querying info .. doxygenfunction:: simgrid::s4u::Comm::set_dst_data(void **buff, size_t size) .. doxygenfunction:: simgrid::s4u::Comm::detach() .. doxygenfunction:: simgrid::s4u::Comm::detach(void(*clean_function)(void *)) + .. doxygenfunction:: simgrid::s4u::Comm::set_payload_size(double bytes) .. doxygenfunction:: simgrid::s4u::Comm::set_rate(double rate) .. doxygenfunction:: simgrid::s4u::Comm::set_src_data(void *buff) .. doxygenfunction:: simgrid::s4u::Comm::set_src_data(void *buff, size_t size) @@ -1878,13 +1908,18 @@ Basic management .. code:: Python from simgrid import Exec - + + .. autoclass:: simgrid.Exec + .. group-tab:: C .. code-block:: C #include + .. doxygentypedef:: sg_exec_t + .. doxygentypedef:: const_sg_exec_t + Querying info ------------- @@ -2139,6 +2174,7 @@ Basic management #include .. doxygentypedef:: sg_cond_t + .. doxygentypedef:: const_sg_cond_t .. doxygenfunction:: sg_cond_init .. doxygenfunction:: sg_cond_destroy diff --git a/docs/source/conf.py b/docs/source/conf.py index d97d329aef..1a815327d6 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -82,16 +82,24 @@ nitpick_ignore = [ ('cpp:identifier', 'kernel::profile'), ('cpp:identifier', 'kernel::resource'), ('cpp:identifier', 'kernel::routing'), + ('cpp:identifier', 'sg_msg_Comm'), + ('cpp:identifier', 'sg_msg_Task'), ('cpp:identifier', 'simgrid'), ('cpp:identifier', 'simgrid::s4u'), + ('cpp:identifier', 'simgrid::s4u::this_actor'), + ('cpp:identifier', 'simgrid::s4u::Activity_T'), + ('cpp:identifier', 'simgrid::s4u::Activity_T'), ('cpp:identifier', 'simgrid::xbt'), ('cpp:identifier', 'this_actor'), ('cpp:identifier', 's4u'), ('cpp:identifier', 's4u_Actor'), ('cpp:identifier', 's4u_Barrier'), + ('cpp:identifier', 's4u_Comm'), ('cpp:identifier', 's4u_ConditionVariable'), + ('cpp:identifier', 's4u_Exec'), ('cpp:identifier', 's4u_Host'), ('cpp:identifier', 's4u_NetZone'), + ('cpp:identifier', 's4u_Mailbox'), ('cpp:identifier', 's4u_Mutex'), ('cpp:identifier', 's4u_Link'), ('cpp:identifier', 's4u_Semaphore'), diff --git a/examples/README.rst b/examples/README.rst index 678b1ba5d3..70c03593c6 100644 --- a/examples/README.rst +++ b/examples/README.rst @@ -59,7 +59,7 @@ Starting and Stopping Actors You create actors either: - - Directly with :cpp:func:`sg_actor_create()` followed by :cpp:func:`sg_actor_start`. + - Directly with :cpp:func:`sg_actor_create` followed by :cpp:func:`sg_actor_start`. - From XML with :cpp:func:`simgrid_register_function` and then :cpp:func:`simgrid_load_deployment`. .. example-tab:: examples/python/actor-create/actor-create_d.xml diff --git a/include/simgrid/forward.h b/include/simgrid/forward.h index 70dfbde755..a8f7cd38a6 100644 --- a/include/simgrid/forward.h +++ b/include/simgrid/forward.h @@ -263,7 +263,9 @@ typedef s4u_Link* sg_link_t; typedef const s4u_Link* const_sg_link_t; typedef s4u_Disk* sg_disk_t; typedef const s4u_Disk* const_sg_disk_t; +/** Pointer to a SimGrid file object */ typedef s4u_File* sg_file_t; +/** Constant pointer to a SimGrid file object */ typedef const s4u_File* const_sg_file_t; typedef s4u_VM* sg_vm_t; typedef const s4u_VM* const_sg_vm_t; diff --git a/include/simgrid/plugins/energy.h b/include/simgrid/plugins/energy.h index 4614a367e8..1667c0a1ed 100644 --- a/include/simgrid/plugins/energy.h +++ b/include/simgrid/plugins/energy.h @@ -27,6 +27,8 @@ XBT_PUBLIC double sg_link_get_consumed_energy(const_sg_link_t link); XBT_PUBLIC int sg_link_energy_is_inited(); +/** @ingroup plugin_link_energy_wifi + * @brief Initialize the wifi energy plugin */ XBT_PUBLIC void sg_wifi_energy_plugin_init(); #if SIMGRID_HAVE_MSG diff --git a/include/simgrid/s4u/Comm.hpp b/include/simgrid/s4u/Comm.hpp index 0f27f0acb0..45094324e8 100644 --- a/include/simgrid/s4u/Comm.hpp +++ b/include/simgrid/s4u/Comm.hpp @@ -84,34 +84,42 @@ public: /** Specify the data to send. * + * @beginrst * This is way will get actually copied over to the receiver. - * That's completely unrelated from the simulated size (given with @ref Comm::set_payload_size()): + * That's completely unrelated from the simulated size (given by :cpp:func:`simgrid::s4u::Comm::set_payload_size`): * you can send a short buffer in your simulator, that represents a very large message * in the simulated world, or the opposite. + * @endrst */ CommPtr set_src_data(void* buff); - /** Specify the size of the data to send. Not to be mixed with @ref Comm::set_payload_size() + /** Specify the size of the data to send (not to be mixed with set_payload_size()) * - * That's the size of the data to actually copy in the simulator (ie, the data passed with Activity::set_src_data()). - * That's completely unrelated from the simulated size (given with @ref Comm::set_payload_size()): - * you can send a short buffer in your simulator, that represents a very large message - * in the simulated world, or the opposite. + * @beginrst + * That's the size of the data to actually copy in the simulator (ie, the data passed with + * :cpp:func:`simgrid::s4u::Comm::set_src_data`). That's completely unrelated from the simulated size (given by + * :cpp:func:`simgrid::s4u::Comm::set_payload_size`)): you can send a short buffer in your simulator, that represents + * a very large message in the simulated world, or the opposite. + * @endrst */ CommPtr set_src_data_size(size_t size); - /* Specify the amount of bytes which exchange should be simulated. Not to be mixed with @ref Comm::set_src_data_size() + /** Specify the amount of bytes which exchange should be simulated (not to be mixed with set_src_data_size()) * - * That's the size of the simulated data, that's completely related from the actual data size (given with @ref - * Comm::set_src_data_size()). + * @beginrst + * That's the size of the simulated data, that's completely related from the actual data size (given by + * :cpp:func:`simgrid::s4u::Comm::set_src_data_size`). + * @endrst */ CommPtr set_payload_size(double bytes); - /** Specify the data to send and its size. Don't mix the size with @ref Comm::set_payload_size() + /** Specify the data to send and its size (not to be mixed with set_payload_size()) * + * @beginrst * This is way will get actually copied over to the receiver. - * That's completely unrelated from the simulated size (given with @ref Comm::set_payload_size()): + * That's completely unrelated from the simulated size (given by :cpp:func:`simgrid::s4u::Comm::set_payload_size`): * you can send a short buffer in your simulator, that represents a very large message * in the simulated world, or the opposite. + * @endrst */ CommPtr set_src_data(void* buff, size_t size); diff --git a/include/xbt/signal.hpp b/include/xbt/signal.hpp index 6824eee203..ef4ec9cf35 100644 --- a/include/xbt/signal.hpp +++ b/include/xbt/signal.hpp @@ -13,40 +13,38 @@ namespace simgrid { namespace xbt { - template class signal; - - /** A signal/slot mechanism - * - * The template parameter is the function signature of the signal. - * The return value currently ignored. - */ - template - class signal { - using callback_type = std::function; - std::map handlers_; - unsigned int callback_sequence_id = 0; - - public: - /** Add a new callback to this signal */ - template unsigned int connect(U slot) - { - handlers_.insert({callback_sequence_id, std::move(slot)}); - return callback_sequence_id++; - } - /** Fire that signal, invoking all callbacks */ - R operator()(P... args) const - { - for (auto const& handler : handlers_) - handler.second(args...); - } - /** Remove a callback */ - void disconnect(unsigned int id) { handlers_.erase(id); } - /** Remove all callbacks */ - void disconnect_slots() { handlers_.clear(); } - /** Get the amount of callbacks */ - int get_slot_count() { return handlers_.size(); } - }; - +template class signal; + +/** @brief + * 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). + */ +template class signal { + using callback_type = std::function; + std::map handlers_; + unsigned int callback_sequence_id = 0; + +public: + /** Add a new callback to this signal */ + template unsigned int connect(U slot) + { + handlers_.insert({callback_sequence_id, std::move(slot)}); + return callback_sequence_id++; + } + /** Fire that signal, invoking all callbacks */ + R operator()(P... args) const + { + for (auto const& handler : handlers_) + handler.second(args...); + } + /** Remove a callback */ + void disconnect(unsigned int id) { handlers_.erase(id); } + /** Remove all callbacks */ + void disconnect_slots() { handlers_.clear(); } + /** Get the amount of callbacks */ + int get_slot_count() { return handlers_.size(); } +}; } } diff --git a/src/plugins/link_energy_wifi.cpp b/src/plugins/link_energy_wifi.cpp index 1e9a7d8fa3..2dc82a0ce0 100644 --- a/src/plugins/link_energy_wifi.cpp +++ b/src/plugins/link_energy_wifi.cpp @@ -20,7 +20,7 @@ #include SIMGRID_REGISTER_PLUGIN(link_energy_wifi, "Energy wifi test", &sg_wifi_energy_plugin_init); -/** @degroup plugin_link_energy_wifi Plugin WiFi energy +/** @defgroup plugin_link_energy_wifi Plugin WiFi energy * * This is the WiFi energy plugin, accounting for the dissipated energy of WiFi links. */