Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix a bunch of errors in the documentation
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Thu, 18 Feb 2021 18:24:15 +0000 (19:24 +0100)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Fri, 19 Feb 2021 12:32:56 +0000 (13:32 +0100)
docs/source/Plugins.rst
docs/source/app_msg.rst
docs/source/app_s4u.rst
docs/source/conf.py
examples/README.rst
include/simgrid/forward.h
include/simgrid/plugins/energy.h
include/simgrid/s4u/Comm.hpp
include/xbt/signal.hpp
src/plugins/link_energy_wifi.cpp

index 9fe6949..44e4b31 100644 (file)
@@ -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 <plugin_host_load>`: monitors the load of the compute units.
   - :ref:`Host Energy <plugin_host_energy>`: models the energy dissipation of the compute units.
   - :ref:`Link Energy <plugin_link_energy>`: models the energy dissipation of the network.
-  - :ref:`Host Load <plugin_host_load>`: monitors the load of the compute units.
+  - :ref:`WiFi Energy <plugin_link_energy_wifi>`: models the energy dissipation of wifi links.
 
 You can activate these plugins with the :ref:`--cfg=plugin <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
 
index 472f4ec..0e5a943 100644 (file)
@@ -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
index a605c7a..f43e02d 100644 (file)
@@ -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 <simgrid/mailbox.h>
+
+      .. autoclass:: simgrid.Mailbox
+
       .. automethod:: simgrid.Mailbox.by_name
 
+   .. group-tab:: C
+
       .. code-block:: C
 
          #include <simgrid/s4u/mailbox.h>
       
-      .. 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 <simgrid/comm.h>
+
+      .. 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 <simgrid/exec.h>
 
+      .. doxygentypedef:: sg_exec_t
+      .. doxygentypedef:: const_sg_exec_t
+
 Querying info
 -------------
 
@@ -2139,6 +2174,7 @@ Basic management
             #include <simgrid/cond.h>
 
          .. doxygentypedef:: sg_cond_t
+         .. doxygentypedef:: const_sg_cond_t
          .. doxygenfunction:: sg_cond_init
          .. doxygenfunction:: sg_cond_destroy
 
index d97d329..1a81532 100644 (file)
@@ -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<Comm>'),
+  ('cpp:identifier', 'simgrid::s4u::Activity_T<Io>'),
   ('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'),
index 678b1ba..70c0359 100644 (file)
@@ -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
index 70dfbde..a8f7cd3 100644 (file)
@@ -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;
index 4614a36..1667c0a 100644 (file)
@@ -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
index 0f27f0a..4509432 100644 (file)
@@ -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);
 
index 6824eee..ef4ec9c 100644 (file)
 namespace simgrid {
 namespace xbt {
 
-  template<class S> class signal;
-
-  /** A signal/slot mechanism
-   *
-   *  The template parameter is the function signature of the signal.
-   *  The return value currently ignored.
-   */
-  template<class R, class... P>
-  class signal<R(P...)> {
-    using callback_type = std::function<R(P...)>;
-    std::map<unsigned int, callback_type> handlers_;
-    unsigned int callback_sequence_id = 0;
-
-  public:
-    /** Add a new callback to this signal */
-    template <class U> 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 S> 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 R, class... P> class signal<R(P...)> {
+  using callback_type = std::function<R(P...)>;
+  std::map<unsigned int, callback_type> handlers_;
+  unsigned int callback_sequence_id = 0;
+
+public:
+  /** Add a new callback to this signal */
+  template <class U> 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(); }
+};
 }
 }
 
index 1e9a7d8..2dc82a0 100644 (file)
@@ -20,7 +20,7 @@
 #include <map>
 
 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.
  */