Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
start documenting the C API in sphinx
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Sat, 2 Nov 2019 00:12:59 +0000 (01:12 +0100)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Sat, 2 Nov 2019 09:42:12 +0000 (10:42 +0100)
docs/Build.sh
docs/ignored_symbols
docs/source/Doxyfile
docs/source/app_s4u.rst
docs/source/platform.rst
include/simgrid/engine.h
include/simgrid/s4u/Engine.hpp
src/s4u/s4u_Engine.cpp

index d51e6ed..7e1e60c 100755 (executable)
@@ -41,6 +41,18 @@ perl -pe 's/(xlink:href="(?:http|.*\.html))/target="_top" $1/' \
 echo "List of missing references:"
 for f in $( (grep '<name>' build/xml/msg_8h.xml; \
              grep '<name>' build/xml/namespacesimgrid_1_1s4u.xml; \
+            grep '<name>' build/xml/actor_8h.xml ; \
+            grep '<name>' build/xml/barrier_8h.xml ; \
+            grep '<name>' build/xml/cond_8h.xml ; \
+            grep '<name>' build/xml/engine_8h.xml ; \
+            grep '<name>' build/xml/host_8h.xml ; \
+            grep '<name>' build/xml/link_8h.xml ; \
+            grep '<name>' build/xml/mailbox_8h.xml ; \
+            grep '<name>' build/xml/msg_8h.xml ; \
+            grep '<name>' build/xml/mutex_8h.xml ; \
+            grep '<name>' build/xml/semaphore_8h.xml ; \
+            grep '<name>' build/xml/vm_8h.xml ; \
+            grep '<name>' build/xml/zone_8h.xml ; \
              grep '<innerclass refid=' build/xml/namespacesimgrid_1_1s4u.xml ; \
             ) | sed 's/<[^>]*>//g' | sort )
 do
index f8f9244..d039c80 100644 (file)
@@ -15,4 +15,5 @@ MSG_init_nocheck
 intrusive_ptr_release
 intrusive_ptr_add_ref
 get_filtered_netzones_recursive
-simgrid::s4u::Storage
\ No newline at end of file
+simgrid::s4u::Storage
+simgrid::s4u::Activity_T
index 95c020c..464237c 100644 (file)
@@ -2,6 +2,18 @@
 INPUT                  = ../../include/simgrid/forward.h
 INPUT                 += ../../include/simgrid/s4u
 INPUT                 += ../../include/simgrid/msg.h
+INPUT                 += ../../include/simgrid/actor.h
+INPUT                 += ../../include/simgrid/barrier.h
+INPUT                 += ../../include/simgrid/cond.h
+INPUT                 += ../../include/simgrid/engine.h
+INPUT                 += ../../include/simgrid/host.h
+#INPUT                 += ../../include/simgrid/instr.h
+INPUT                 += ../../include/simgrid/link.h
+INPUT                 += ../../include/simgrid/mailbox.h
+INPUT                 += ../../include/simgrid/mutex.h
+INPUT                 += ../../include/simgrid/semaphore.h
+INPUT                 += ../../include/simgrid/vm.h
+INPUT                 += ../../include/simgrid/zone.h
 INPUT                 += ../../src/msg/
 INPUT                 += ../../src/plugins/
 RECURSIVE              = YES
@@ -31,6 +43,8 @@ SKIP_FUNCTION_MACROS   = NO
 PREDEFINED             += \
     __cplusplus \
     DOXYGEN \
+    SG_BEGIN_DECL= \
+    SG_END_DECL= \
     XBT_PUBLIC= \
     XBT_EXPORT_NO_IMPORT= \
     XBT_IMPORT_NO_EXPORT= \
index 885a6a9..e422a70 100644 (file)
@@ -601,11 +601,37 @@ s4u::VirtualMachine
    :protected-members:
    :undoc-members:
 
+C API Reference
+***************
+
+==============
+Main functions
+==============
+
+.. doxygenfunction:: simgrid_init
+.. doxygenfunction:: simgrid_get_clock
+.. doxygenfunction:: simgrid_load_deployment
+.. doxygenfunction:: simgrid_load_platform
+.. doxygenfunction:: simgrid_register_default
+.. doxygenfunction:: simgrid_register_function
+.. doxygenfunction:: simgrid_run
+
+==================
+Condition Variable
+==================
+
+See also the :ref:`C++ API <API_s4u_ConditionVariable>`.
+
+.. doxygenfunction:: sg_cond_init
+.. doxygenfunction:: sg_cond_notify_all
+.. doxygenfunction:: sg_cond_notify_one
+.. doxygenfunction:: sg_cond_wait
+.. doxygenfunction:: sg_cond_wait_for
 
 Python API Reference
 ********************
 
-The Python API is generated with pybind11. It closely mimicks the C++
+The Python API is automatically generated with pybind11. It closely mimicks the C++
 API, to which you should refer for more information.
 
 ==========
index bc020e7..7d18c8a 100644 (file)
@@ -1,5 +1,3 @@
-.. _platform:
-
 .. raw:: html
 
    <object id="TOC" data="graphical-toc.svg" width="100%" type="image/svg+xml"></object>
@@ -12,6 +10,8 @@
    <br/>
    <br/>
 
+.. _platform:
+
 Describing your Simulated Platform
 ##################################
 
index d4caeec..2add055 100644 (file)
@@ -8,17 +8,46 @@
 
 #include <simgrid/forward.h>
 
-/* C interface */
-SG_BEGIN_DECL
+SG_BEGIN_DECL /* C interface */
+/** Initialize the SimGrid engine, taking the command line parameters of your main function. */
 XBT_PUBLIC void simgrid_init(int* argc, char** argv);
+
+/** Creates a new platform, including hosts, links, and the routing table.
+ *
+ * \rst
+ * See also: :ref:`platform`.
+ * \endrst
+ */
 XBT_PUBLIC void simgrid_load_platform(const char* filename);
+/** Load a deployment file and launch the actors that it contains
+ *
+ * \rst
+ * See also: :ref:`deploy`.
+ * \endrst
+ */
 XBT_PUBLIC void simgrid_load_deployment(const char* filename);
+/** Run the simulation after initialization */
 XBT_PUBLIC void simgrid_run();
+/** Registers the main function of an actor that will be launched from the deployment file */
 XBT_PUBLIC void simgrid_register_function(const char* name, int (*code)(int, char**));
+/** Registers a function as the default main function of actors
+ *
+ * It will be used as fallback when the function requested from the deployment file was not registered.
+ * It is used for trace-based simulations (see examples/s4u/replay-comms and similar).
+ */
 XBT_PUBLIC void simgrid_register_default(int (*code)(int, char**));
+/** Retrieve the simulation time (in seconds) */
 XBT_PUBLIC double simgrid_get_clock();
 
+/** @brief Allow other libraries to react to the --help flag, too
+ *
+ * When finding --help on the command line, simgrid usually stops right after displaying its help message.
+ * If you are writing a library using simgrid, you may want to display your own help message before everything stops.
+ * If so, just call this function before having simgrid parsing the command line, and you will be given the control
+ * even if the user is asking for help.
+ */
 XBT_PUBLIC void sg_config_continue_after_help();
+
 SG_END_DECL
 
 #endif /* INCLUDE_SIMGRID_ENGINE_H_ */
index ea53d1c..1741d9a 100644 (file)
@@ -36,7 +36,7 @@ public:
   /** Finalize the default engine and all its dependencies */
   static void shutdown();
 
-  /** @brief Run the simulation */
+  /** @brief Run the simulation after initialization */
   void run();
 
   /** @brief Retrieve the simulation time (in seconds) */
@@ -44,23 +44,10 @@ public:
   /** @brief Retrieve the engine singleton */
   static s4u::Engine* get_instance();
 
-  /** @brief Load a platform file describing the environment
-   *
-   * The environment is either a XML file following the simgrid.dtd formalism, or a lua file.
-   * Some examples can be found in the directory examples/platforms.
-   */
   void load_platform(const std::string& platf);
 
-  /** Registers the main function of an actor that will be launched from the deployment file */
   void register_function(const std::string& name, int (*code)(int, char**));
-  /** Registers the main function of an actor that will be launched from the deployment file */
   void register_function(const std::string& name, void (*code)(std::vector<std::string>));
-
-  /** Registers a function as the default main function of actors
-   *
-   * It will be used as fallback when the function requested from the deployment file was not registered.
-   * It is used for trace-based simulations (see examples/s4u/replay-comms and similar).
-   */
   void register_default(int (*code)(int, char**));
 
   template <class F> void register_actor(const std::string& name)
@@ -80,7 +67,6 @@ public:
     });
   }
 
-  /** @brief Load a deployment file and launch the actors that it contains */
   void load_deployment(const std::string& deploy);
 
 protected:
index 1d12c11..8b05e04 100644 (file)
@@ -74,16 +74,11 @@ double Engine::get_clock()
 }
 
 /**
- * @brief A platform loader.
+ * Creates a new platform, including hosts, links, and the routing table.
  *
- * Creates a new platform, including hosts, links, and the routing_table.
- * @param platf a filename of the XML description of a platform. This file follows this DTD :
- *
- *     @include src/surf/xml/simgrid.dtd
- *
- * Here is a small example of such a platform
- *
- *     @include examples/platforms/small_platform.xml
+ * \rst
+ * See also: :ref:`platform`.
+ * \endrst
  */
 void Engine::load_platform(const std::string& platf)
 {
@@ -98,23 +93,36 @@ void Engine::load_platform(const std::string& platf)
   XBT_DEBUG("PARSE TIME: %g", (end - start));
 }
 
+/** Registers the main function of an actor that will be launched from the deployment file */
 void Engine::register_function(const std::string& name, int (*code)(int, char**))
 {
   SIMIX_function_register(name, code);
 }
+/** Registers the main function of an actor that will be launched from the deployment file */
 void Engine::register_function(const std::string& name, void (*code)(std::vector<std::string>))
 {
   SIMIX_function_register(name, code);
 }
+/** Registers a function as the default main function of actors
+ *
+ * It will be used as fallback when the function requested from the deployment file was not registered.
+ * It is used for trace-based simulations (see examples/s4u/replay-comms and similar).
+ */
 void Engine::register_default(int (*code)(int, char**))
 {
   SIMIX_function_register_default(code);
 }
+/** Load a deployment file and launch the actors that it contains
+ *
+ * \rst
+ * See also: :ref:`deploy`.
+ * \endrst
+ */
 void Engine::load_deployment(const std::string& deploy)
 {
   SIMIX_launch_application(deploy);
 }
-/** @brief Returns the amount of hosts in the platform */
+/** Returns the amount of hosts in the platform */
 size_t Engine::get_host_count()
 {
   return pimpl->hosts_.size();