Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
various documentation improvements
authorMartin Quinson <martin.quinson@loria.fr>
Sun, 7 Aug 2016 14:47:17 +0000 (16:47 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Sun, 7 Aug 2016 15:54:05 +0000 (17:54 +0200)
- Re-add all code in Doxygen after recent directories creation
- Add a (very empty) list of S4U examples
- Fix some warnings and errors in doxygen markup
- Fix the scripts checking the integrity of the log channel hierarchy
- Move the doc of the s4u::Mutex and simgrid::chrono to the right
  location out of Gabriel's blog entry

18 files changed:
doc/Doxyfile.in
doc/doxygen/FAQ.doc
doc/doxygen/deployment.doc
doc/doxygen/examples.doc
doc/doxygen/module-msg.doc
doc/doxygen/platform.doc
doc/doxygen/uhood_switch.doc
examples/msg/README.doc
examples/s4u/README.doc [new file with mode: 0644]
include/simgrid/kernel/future.hpp
include/simgrid/s4u/Mutex.hpp
include/simgrid/s4u/file.hpp
include/simgrid/s4u/host.hpp
include/xbt/functional.hpp
src/mc/compare.cpp
src/smpi/smpi_global.cpp
src/xbt/log.c
tools/doxygen/xbt_log_extract_hierarchy.pl

index b60cc4f..c7a21e8 100644 (file)
@@ -671,7 +671,6 @@ INPUT                  = doxygen/index.doc \
                             doxygen/inside_release.doc \
                         doxygen/community.doc \
                            doxygen/community_contact.doc \
                             doxygen/inside_release.doc \
                         doxygen/community.doc \
                            doxygen/community_contact.doc \
-                          doxygen/community_contributing.doc \
                           doxygen/community_extend.doc \
                            doxygen/community_giveback.doc \
                         doxygen/FAQ.doc \
                           doxygen/community_extend.doc \
                            doxygen/community_giveback.doc \
                         doxygen/FAQ.doc \
@@ -685,23 +684,28 @@ INPUT                  = doxygen/index.doc \
                            doxygen/module-smpi.doc \
                            doxygen/module-trace.doc \
                          @CMAKE_HOME_DIRECTORY@/doc/doxygen/logcategories.doc \
                            doxygen/module-smpi.doc \
                            doxygen/module-trace.doc \
                          @CMAKE_HOME_DIRECTORY@/doc/doxygen/logcategories.doc \
-                         @CMAKE_HOME_DIRECTORY@/src/instr/ \
                          @CMAKE_HOME_DIRECTORY@/include/ \
                          @CMAKE_HOME_DIRECTORY@/include/xbt \
                          @CMAKE_HOME_DIRECTORY@/include/simgrid \
                          @CMAKE_HOME_DIRECTORY@/include/simgrid/s4u \
                          @CMAKE_HOME_DIRECTORY@/src/include/surf \
                          @CMAKE_HOME_DIRECTORY@/include/ \
                          @CMAKE_HOME_DIRECTORY@/include/xbt \
                          @CMAKE_HOME_DIRECTORY@/include/simgrid \
                          @CMAKE_HOME_DIRECTORY@/include/simgrid/s4u \
                          @CMAKE_HOME_DIRECTORY@/src/include/surf \
-                         @CMAKE_HOME_DIRECTORY@/src/xbt/ \
+                         @CMAKE_HOME_DIRECTORY@/src/msg/ \
+                         @CMAKE_HOME_DIRECTORY@/src/kernel/ \
+                         @CMAKE_HOME_DIRECTORY@/src/kernel/activity/ \
+                         @CMAKE_HOME_DIRECTORY@/src/kernel/context/ \
+                         @CMAKE_HOME_DIRECTORY@/src/kernel/routing/ \
+                         @CMAKE_HOME_DIRECTORY@/src/instr/ \
                          @CMAKE_HOME_DIRECTORY@/src/surf/ \
                          @CMAKE_HOME_DIRECTORY@/src/surf/plugins/ \
                          @CMAKE_HOME_DIRECTORY@/src/s4u/ \
                          @CMAKE_HOME_DIRECTORY@/src/surf/ \
                          @CMAKE_HOME_DIRECTORY@/src/surf/plugins/ \
                          @CMAKE_HOME_DIRECTORY@/src/s4u/ \
-                         @CMAKE_HOME_DIRECTORY@/src/msg/ \
                          @CMAKE_HOME_DIRECTORY@/src/smpi/ \
                          @CMAKE_HOME_DIRECTORY@/src/simdag \
                          @CMAKE_HOME_DIRECTORY@/src/simix \
                          @CMAKE_HOME_DIRECTORY@/src/smpi/ \
                          @CMAKE_HOME_DIRECTORY@/src/simdag \
                          @CMAKE_HOME_DIRECTORY@/src/simix \
+                         @CMAKE_HOME_DIRECTORY@/src/xbt/ \
                          @CMAKE_BINARY_DIR@/include \
                          @CMAKE_BINARY_DIR@/src \
                          @CMAKE_BINARY_DIR@/include \
                          @CMAKE_BINARY_DIR@/src \
-                         @CMAKE_HOME_DIRECTORY@/examples/msg/README.doc
+                         @CMAKE_HOME_DIRECTORY@/examples/msg/README.doc \
+                         @CMAKE_HOME_DIRECTORY@/examples/s4u/README.doc
 
 # This tag can be used to specify the character encoding of the source files
 # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
 
 # This tag can be used to specify the character encoding of the source files
 # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
@@ -725,7 +729,7 @@ FILE_PATTERNS          =
 # should be searched for input files as well. Possible values are YES and NO.
 # If left blank NO is used.
 
 # should be searched for input files as well. Possible values are YES and NO.
 # If left blank NO is used.
 
-RECURSIVE              = NO
+RECURSIVE              = YES
 
 # The EXCLUDE tag can be used to specify files and/or directories that should be
 # excluded from the INPUT source files. This way you can easily exclude a
 
 # The EXCLUDE tag can be used to specify files and/or directories that should be
 # excluded from the INPUT source files. This way you can easily exclude a
@@ -763,6 +767,7 @@ EXCLUDE_SYMBOLS        =
 
 EXAMPLE_PATH           = ./ \
                          @CMAKE_HOME_DIRECTORY@/src/surf/ \
 
 EXAMPLE_PATH           = ./ \
                          @CMAKE_HOME_DIRECTORY@/src/surf/ \
+                         @CMAKE_HOME_DIRECTORY@/src/surf/xml/ \
                          @CMAKE_HOME_DIRECTORY@/src/xbt/ \
                          @CMAKE_HOME_DIRECTORY@/examples \
                          @CMAKE_HOME_DIRECTORY@/doc/example_lists
                          @CMAKE_HOME_DIRECTORY@/src/xbt/ \
                          @CMAKE_HOME_DIRECTORY@/examples \
                          @CMAKE_HOME_DIRECTORY@/doc/example_lists
index 704cb5a..3dd9b11 100644 (file)
@@ -11,7 +11,7 @@ slides</a>, or to these
 <a href="http://graal.ens-lyon.fr/~alegrand/articles/Simgrid-Introduction.pdf">"obsolete" slides</a>)
 may give you some insights on what SimGrid can help you to do and what
 are its limitations. Then you definitely should read the \ref
 <a href="http://graal.ens-lyon.fr/~alegrand/articles/Simgrid-Introduction.pdf">"obsolete" slides</a>)
 may give you some insights on what SimGrid can help you to do and what
 are its limitations. Then you definitely should read the \ref
-MSG_examples. 
+msg_examples. 
 
 If you are stuck at any point and if this FAQ cannot help you, please drop us a
 mail to the user mailing list: <simgrid-user@lists.gforge.inria.fr>.
 
 If you are stuck at any point and if this FAQ cannot help you, please drop us a
 mail to the user mailing list: <simgrid-user@lists.gforge.inria.fr>.
@@ -140,7 +140,7 @@ MSG_task_isend() and MSG_task_irecv();
 MSG_comm_test(), MSG_comm_wait(), MSG_comm_waitall() and MSG_comm_waitany();
 MSG_comm_destroy(). 
 
 MSG_comm_test(), MSG_comm_wait(), MSG_comm_waitall() and MSG_comm_waitany();
 MSG_comm_destroy(). 
 
-There is even a specific example section on \ref MSG_ex_asynchronous_communications.
+There is even a specific example section on \ref msg_ex_asynchronous_communications.
 
 \subsubsection faq_MIA_thread_synchronization I need to synchronize my MSG processes
 
 
 \subsubsection faq_MIA_thread_synchronization I need to synchronize my MSG processes
 
index 8ee6d60..d4d4613 100644 (file)
@@ -34,7 +34,7 @@ attributes are mandatory; however, there are some optional attributes to the pro
 
 #### Examples ####
 
 
 #### Examples ####
 
-Almost any @ref MSG_examples include a deployment file.
+Almost any @ref msg_examples include a deployment file.
 
 ### The argument tag ###
 
 
 ### The argument tag ###
 
index c3305ca..fa63ced 100644 (file)
@@ -3,7 +3,7 @@
 \tableofcontents
 
 SimGrid comes with many examples provided in the examples/ directory.
 \tableofcontents
 
 SimGrid comes with many examples provided in the examples/ directory.
-Those examples are described in section \ref MSG_examples. Those
+Those examples are described in section \ref msg_examples. Those
 examples are commented and should be easy to understand. for a first
 step into SimGrid we also provide some more detailed examples in the
 sections below. 
 examples are commented and should be easy to understand. for a first
 step into SimGrid we also provide some more detailed examples in the
 sections below. 
index e2f57c0..8f4ae03 100644 (file)
@@ -27,7 +27,7 @@ may want to use one of the following:
    - \ref msg_VMs
    - \ref msg_synchro
    - \ref msg_trace_driven
    - \ref msg_VMs
    - \ref msg_synchro
    - \ref msg_trace_driven
-   - \ref MSG_examples
+   - \ref msg_examples
 
 */ 
 
 
 */ 
 
@@ -36,7 +36,7 @@ may want to use one of the following:
 @ingroup MSG_API
 @brief How to setup and control your simulation.
 
 @ingroup MSG_API
 @brief How to setup and control your simulation.
 
-The basic workflow is the following (check the \ref MSG_examples for
+The basic workflow is the following (check the \ref msg_examples for
 details).
 
  -# Initialize the library with #MSG_init
 details).
 
  -# Initialize the library with #MSG_init
index 038de80..7f4b8f2 100644 (file)
@@ -332,7 +332,7 @@ limiter_link      | no        | int    | Bandwidth for limiter link (if any). Th
 loopback_bw       | no      | int    | Bandwidth for loopback (if any). See <b>link</b> section for syntax/details. If loopback_bw and loopback_lat (see below) attributes are omitted, no loopback link is created and all intra-node communication will use the main network link of the node. Loopback link is a \ref pf_sharing_policy_fatpipe "\b FATPIPE".
 loopback_lat      | no      | int    | Latency for loopback (if any). See <b>link</b> section for syntax/details. See loopback_bw for more info.
 topology          | no      | FLAT\|TORUS\|FAT_TREE\|DRAGONFLY (default: FLAT) | Network topology to use. SimGrid currently supports FLAT (with or without backbone, as described before), <a href="http://en.wikipedia.org/wiki/Torus_interconnect">TORUS </a>, FAT_TREE, and DRAGONFLY attributes for this tag.
 loopback_bw       | no      | int    | Bandwidth for loopback (if any). See <b>link</b> section for syntax/details. If loopback_bw and loopback_lat (see below) attributes are omitted, no loopback link is created and all intra-node communication will use the main network link of the node. Loopback link is a \ref pf_sharing_policy_fatpipe "\b FATPIPE".
 loopback_lat      | no      | int    | Latency for loopback (if any). See <b>link</b> section for syntax/details. See loopback_bw for more info.
 topology          | no      | FLAT\|TORUS\|FAT_TREE\|DRAGONFLY (default: FLAT) | Network topology to use. SimGrid currently supports FLAT (with or without backbone, as described before), <a href="http://en.wikipedia.org/wiki/Torus_interconnect">TORUS </a>, FAT_TREE, and DRAGONFLY attributes for this tag.
-topo_parameters   | no      | string | Specific parameters to pass for the topology defined in the topology tag. For torus networks, comma-separated list of the number of nodes in each dimension of the torus. For fat trees, refer to \ref simgrid::surf::AsClusterFatTree "AsClusterFatTree documentation". For dragonfly, refer to \ref simgrid::surf::AsClusterDragonfly "AsClusterDragonfly documentation".
+topo_parameters   | no      | string | Specific parameters to pass for the topology defined in the topology tag. For torus networks, comma-separated list of the number of nodes in each dimension of the torus. For fat trees, refer to \ref simgrid::kernel::routing::AsClusterFatTree "AsClusterFatTree documentation". For dragonfly, refer to \ref simgrid::kernel::routing::AsClusterDragonfly "AsClusterDragonfly documentation".
 
 
 the router name is defined as the resulting String in the following
 
 
 the router name is defined as the resulting String in the following
index 814bf1c..bc6b8f3 100644 (file)
@@ -1,5 +1,7 @@
 /*! @page uhood_switch Process Synchronizations and Context Switching
 
 /*! @page uhood_switch Process Synchronizations and Context Switching
 
+@tableofcontents
+
 @section uhood_switch_DES SimGrid as an Operating System
 
 SimGrid is a discrete event simulator of distributed systems: it does
 @section uhood_switch_DES SimGrid as an Operating System
 
 SimGrid is a discrete event simulator of distributed systems: it does
@@ -96,7 +98,7 @@ producer calls `promise.set_value(42)` or `promise.set_exception(e)`
 in order to <em>set the result</em> which will be made available to
 the consumer by `future.get()`.
 
 in order to <em>set the result</em> which will be made available to
 the consumer by `future.get()`.
 
-### Which future do we need?
+@subsection uhood_switch_futures_needs Which future do we need?
 
 The blocking API provided by the standard C++11 futures does not suit
 our needs since the simulation kernel <em>cannot</em> block, and since
 
 The blocking API provided by the standard C++11 futures does not suit
 our needs since the simulation kernel <em>cannot</em> block, and since
@@ -129,7 +131,7 @@ API, with a few differences:
  - Some features of the standard (such as shared futures) are not
    needed in our context, and thus not considered here.
 
  - Some features of the standard (such as shared futures) are not
    needed in our context, and thus not considered here.
 
-### Implementing `Future` and `Promise`
+@subsection uhood_switch_futures_implem Implementing `Future` and `Promise`
 
 The `simgrid::kernel::Future` and `simgrid::kernel::Promise` use a
 shared state defined as follows:
 
 The `simgrid::kernel::Future` and `simgrid::kernel::Promise` use a
 shared state defined as follows:
@@ -272,14 +274,31 @@ T simgrid::kernel::FutureState<T>::get()
 }
 @endcode
 
 }
 @endcode
 
-## Generic simcalls
+@section uhood_switch_simcalls Implementing the simcalls
+
+So a simcall is a way for the actor to push a request to the
+simulation kernel and yield the control until the request is
+fulfilled. The performance requirements are very high because
+the actors usually do an inordinate amount of simcalls during the
+simulation. 
+
+As for real syscalls, the basic idea is to write the wanted call and
+its arguments in a memory area that is specific to the actor, and
+yield the control to the simulation kernel. Once in kernel mode, the
+simcalls of each demanding actor are evaluated sequentially in a
+strictly reproducible order. This makes the whole simulation
+reproducible.
 
 
-### Motivation
 
 
-Simcalls are not so easy to understand and adding a new one is not so easy
-either. In order to add one simcall, one has to first
-add it to the [list of simcalls](https://github.com/simgrid/simgrid/blob/4ae2fd01d8cc55bf83654e29f294335e3cb1f022/src/simix/simcalls.in)
-which looks like this:
+@subsection uhood_switch_simcalls_v2 The historical way
+
+In the very first implementation, everything was written by hand and
+highly optimized, making our software very hard to maintain and
+evolve. We decided to sacrifice some performance for
+maintainability. In a second try (that is still in use in SimGrid
+v3.13), we had a lot of boiler code generated from a python script,
+taking the [list of simcalls](https://github.com/simgrid/simgrid/blob/4ae2fd01d8cc55bf83654e29f294335e3cb1f022/src/simix/simcalls.in)
+as input. It looks like this:
 
 @code{cpp}
 # This looks like C++ but it is a basic IDL-like language
 
 @code{cpp}
 # This looks like C++ but it is a basic IDL-like language
@@ -342,9 +361,9 @@ union u_smx_scalar {
 };
 @endcode
 
 };
 @endcode
 
-Then one has to call (manually:cry:) a
-[Python script](https://github.com/simgrid/simgrid/blob/4ae2fd01d8cc55bf83654e29f294335e3cb1f022/src/simix/simcalls.py)
-which generates a bunch of C++ files:
+When manually calling the relevant [Python
+script](https://github.com/simgrid/simgrid/blob/4ae2fd01d8cc55bf83654e29f294335e3cb1f022/src/simix/simcalls.py),
+this generates a bunch of C++ files:
 
 * an enum of all the [simcall numbers](https://github.com/simgrid/simgrid/blob/4ae2fd01d8cc55bf83654e29f294335e3cb1f022/src/simix/popping_enum.h#L19);
 
 
 * an enum of all the [simcall numbers](https://github.com/simgrid/simgrid/blob/4ae2fd01d8cc55bf83654e29f294335e3cb1f022/src/simix/popping_enum.h#L19);
 
@@ -360,7 +379,7 @@ which generates a bunch of C++ files:
 
 Then one has to write the code of the kernel side handler for the simcall
 and the code of the simcall itself (which calls the code-generated
 
 Then one has to write the code of the kernel side handler for the simcall
 and the code of the simcall itself (which calls the code-generated
-marshaling/unmarshaling stuff):sob:.
+marshaling/unmarshaling stuff).
 
 In order to simplify this process, we added two generic simcalls which can be
 used to execute a function in the simulation kernel:
 
 In order to simplify this process, we added two generic simcalls which can be
 used to execute a function in the simulation kernel:
@@ -428,7 +447,7 @@ xbt_dict_t Host::properties() {
 }
 @endcode
 
 }
 @endcode
 
-### Blocking simcall
+### Blocking simcall {#uhood_switch_v2_blocking}
 
 The second generic simcall (`simcall_run_blocking()`) executes a function in
 the SimGrid simulation kernel immediately but does not wake up the calling actor
 
 The second generic simcall (`simcall_run_blocking()`) executes a function in
 the SimGrid simulation kernel immediately but does not wake up the calling actor
@@ -500,12 +519,12 @@ int res = simgrid::simix::kernelSync([&] {
 });
 @endcode
 
 });
 @endcode
 
-### Asynchronous operations
+### Asynchronous operations {#uhood_switch_v2_async}
 
 We can write the related `kernelAsync()` which wakes up the actor immediately
 and returns a future to the actor. As this future is used in the actor context,
 it is a different future
 
 We can write the related `kernelAsync()` which wakes up the actor immediately
 and returns a future to the actor. As this future is used in the actor context,
 it is a different future
-(`simgrid::simix::Future` instead of `simgrid::kernel::Furuere`)
+(`simgrid::simix::Future` instead of `simgrid::kernel::Future`)
 which implements a C++11 `std::future` wait-based API:
 
 @code{cpp}
 which implements a C++11 `std::future` wait-based API:
 
 @code{cpp}
@@ -600,97 +619,6 @@ The semantic is equivalent but this form would require two simcalls
 instead of one to do the same job (one in `kernelAsync()` and one in
 `.get()`).
 
 instead of one to do the same job (one in `kernelAsync()` and one in
 `.get()`).
 
-## Representing the simulated time
-
-SimGrid uses `double` for representing the simulated time:
-
-* durations are expressed in seconds;
-
-* timepoints are expressed as seconds from the beginning of the simulation.
-
-In contrast, all the C++ APIs use `std::chrono::duration` and
-`std::chrono::time_point`. They are used in:
-
-* `std::this_thread::wait_for()` and `std::this_thread::wait_until()`;
-
-* `future.wait_for()` and `future.wait_until()`;
-
-* `condvar.wait_for()` and `condvar.wait_until()`.
-
-We can define `future.wait_for(duration)` and `future.wait_until(timepoint)`
-for our futures but for better compatibility with standard C++ code, we might
-want to define versions expecting `std::chrono::duration` and
-`std::chrono::time_point`.
-
-For time points, we need to define a clock (which meets the
-[TrivialClock](http://en.cppreference.com/w/cpp/concept/TrivialClock)
-requirements, see
-[`[time.clock.req]`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4296.pdf#page=642)
-working in the simulated time in the C++14 standard):
-
-@code{cpp}
-struct SimulationClock {
-  using rep        = double;
-  using period     = std::ratio<1>;
-  using duration   = std::chrono::duration<rep, period>;
-  using time_point = std::chrono::time_point<SimulationClock, duration>;
-  static constexpr bool is_steady = true;
-  static time_point now()
-  {
-    return time_point(duration(SIMIX_get_clock()));
-  }
-};
-@endcode
-
-A time point in the simulation is a time point using this clock:
-
-@code{cpp}
-template<class Duration>
-using SimulationTimePoint =
-  std::chrono::time_point<SimulationClock, Duration>;
-@endcode
-
-This is used for example in `simgrid::s4u::this_actor::sleep_for()` and
-`simgrid::s4u::this_actor::sleep_until()`:
-
-@code{cpp}
-void sleep_for(double duration)
-{
-  if (duration > 0)
-    simcall_process_sleep(duration);
-}
-
-void sleep_until(double timeout)
-{
-  double now = SIMIX_get_clock();
-  if (timeout > now)
-    simcall_process_sleep(timeout - now);
-}
-
-template<class Rep, class Period>
-void sleep_for(std::chrono::duration<Rep, Period> duration)
-{
-  auto seconds =
-    std::chrono::duration_cast<SimulationClockDuration>(duration);
-  this_actor::sleep_for(seconds.count());
-}
-
-template<class Duration>
-void sleep_until(const SimulationTimePoint<Duration>& timeout_time)
-{
-  auto timeout_native =
-    std::chrono::time_point_cast<SimulationClockDuration>(timeout_time);
-  this_actor::sleep_until(timeout_native.time_since_epoch().count());
-}
-@endcode
-
-Which means it is possible to use (since C++14):
-
-@code{cpp}
-using namespace std::chrono_literals;
-simgrid::s4u::actor::sleep_for(42s);
-@endcode
-
 ## Mutexes and condition variables
 
 ## Mutexes
 ## Mutexes and condition variables
 
 ## Mutexes
index baefe26..ef998ed 100644 (file)
@@ -2,7 +2,7 @@ This file follows the Doxygen syntax to be included in the
 documentation, but it should remain readable directly.
 
 /** 
 documentation, but it should remain readable directly.
 
 /** 
- @defgroup MSG_examples MSG examples
+ @defgroup msg_examples MSG examples
  @ingroup MSG_API
  @brief Find the MSG example fitting your needs from the extensive set provided in the archive.
 
  @ingroup MSG_API
  @brief Find the MSG example fitting your needs from the extensive set provided in the archive.
 
@@ -38,12 +38,12 @@ documentation, but it should remain readable directly.
    @ref examples/msg/app-masterworker/app-masterworker.c\n
    Another good old example, where one Master process has a bunch of
    task to dispatch to a set of several Worker processes. It is fully
    @ref examples/msg/app-masterworker/app-masterworker.c\n
    Another good old example, where one Master process has a bunch of
    task to dispatch to a set of several Worker processes. It is fully
-   commented in @ref MSG_ex_master_worker.
+   commented in @ref msg_ex_master_worker.
 
 @section msg_ex_async Asynchronous communications
 
 In addition to the fully documented example of @ref
 
 @section msg_ex_async Asynchronous communications
 
 In addition to the fully documented example of @ref
-MSG_ex_asynchronous_communications, there are several other examples
+msg_ex_asynchronous_communications, there are several other examples
 shipped in the archive:
   
  - <b>Basic asynchronous communications</b>. 
 shipped in the archive:
   
  - <b>Basic asynchronous communications</b>. 
diff --git a/examples/s4u/README.doc b/examples/s4u/README.doc
new file mode 100644 (file)
index 0000000..6aaef6a
--- /dev/null
@@ -0,0 +1,31 @@
+S4U (Simgrid for you) is the next interface of SimGrid, expected to be released with SimGrid 4.0.
+
+Even if it's in a very preliminary state so far, you are welcome to
+try it and report any interface glitches that you see. Be however
+warned that the interface will be modified until its final release. 
+You will have to adapt your code on the way.
+
+This file follows the Doxygen syntax to be included in the
+documentation, but it should remain readable directly.
+
+/** 
+ @defgroup s4u_examples S4U examples
+ @ingroup s4u_api
+ @brief Find the S4U example fitting your needs in the archive.
+
+  - @ref s4u_ex_basics
+                   
+@section s4u_ex_basics Basic examples and features
+
+@section s4u_ex_synchro Inter-Actor Synchronization 
+
+ - <b>Mutex</b>.
+   @ref examples/s4u/mutex/s4u_mutex.cpp\n
+   Shows how to use simgrid::s4u::Mutex synchronization objects
+                        
+*/
+
+/**
+@example examples/s4u/mutex/s4u_mutex.cpp
+
+*/
\ No newline at end of file
index 034963d..da5bd08 100644 (file)
@@ -422,7 +422,7 @@ Future<T> unwrapFuture(Future<Future<T>> future)
   return std::move(result);
 }
 
   return std::move(result);
 }
 
-/** Producer side of a @simgrid::kernel::Future
+/** Producer side of a @ref simgrid::kernel::Future
  *
  *  A @ref Promise is connected to some `Future` and can be used to
  *  set its result.
  *
  *  A @ref Promise is connected to some `Future` and can be used to
  *  set its result.
index 241ae36..0b3ebc8 100644 (file)
@@ -19,14 +19,24 @@ namespace s4u {
 
 class ConditionVariable;
 
 
 class ConditionVariable;
 
+/** @brief A classical mutex, but blocking in the simulation world
+ *
+ * It is strictly impossible to use a real mutex (such as
+ * [std::mutex](http://en.cppreference.com/w/cpp/thread/mutex)
+ * or [pthread_mutex_t](http://pubs.opengroup.org/onlinepubs/007908775/xsh/pthread_mutex_lock.html)),
+ * because it would block the whole simulation.
+ * Instead, you should use the present class, that is a drop-in replacement of
+ * [std::mutex](http://en.cppreference.com/w/cpp/thread/mutex).
+ *
+ */
 XBT_PUBLIC_CLASS Mutex {
 friend ConditionVariable;
 private:
   friend simgrid::simix::Mutex;
   simgrid::simix::Mutex* mutex_;
   Mutex(simgrid::simix::Mutex* mutex) : mutex_(mutex) {}
 XBT_PUBLIC_CLASS Mutex {
 friend ConditionVariable;
 private:
   friend simgrid::simix::Mutex;
   simgrid::simix::Mutex* mutex_;
   Mutex(simgrid::simix::Mutex* mutex) : mutex_(mutex) {}
-public:
 
 
+  /* refcounting of the intrusive_ptr is delegated to the implementation object */
   friend void intrusive_ptr_add_ref(Mutex* mutex)
   {
     xbt_assert(mutex);
   friend void intrusive_ptr_add_ref(Mutex* mutex)
   {
     xbt_assert(mutex);
@@ -37,12 +47,16 @@ public:
     xbt_assert(mutex);
     SIMIX_mutex_unref(mutex->mutex_);
   }
     xbt_assert(mutex);
     SIMIX_mutex_unref(mutex->mutex_);
   }
+public:
   using Ptr = boost::intrusive_ptr<Mutex>;
 
   // No copy:
   using Ptr = boost::intrusive_ptr<Mutex>;
 
   // No copy:
+  /** You cannot create a new mutex by copying an existing one. Use MutexPtr instead */
   Mutex(Mutex const&) = delete;
   Mutex(Mutex const&) = delete;
+  /** You cannot create a new mutex by value assignment either. Use MutexPtr instead */
   Mutex& operator=(Mutex const&) = delete;
 
   Mutex& operator=(Mutex const&) = delete;
 
+  /** Constructs a new mutex */
   static Ptr createMutex();
 
 public:
   static Ptr createMutex();
 
 public:
index 1c3adc8..5c1565c 100644 (file)
@@ -20,7 +20,7 @@ class Storage;
  *
  * Used to simulate the time it takes to access to a file, but does not really store any information.
  *
  *
  * Used to simulate the time it takes to access to a file, but does not really store any information.
  *
- * They are located on @link{simgrid::s4u::Storage}, that are accessed from a given @link{simgrid::s4u::Host} through mountpoints.
+ * They are located on @link{simgrid::s4u::Storage} that are accessed from a given @link{simgrid::s4u::Host} through mountpoints.
  * For now, you cannot change the mountpoints programatically, and must declare them from your platform file.
  */
 XBT_PUBLIC_CLASS File {
  * For now, you cannot change the mountpoints programatically, and must declare them from your platform file.
  */
 XBT_PUBLIC_CLASS File {
index af1df88..e3f39ba 100644 (file)
@@ -28,7 +28,7 @@ namespace s4u {
 
 /** @ingroup s4u_api
  *
 
 /** @ingroup s4u_api
  *
- * @tableofcontents
+ * @tableofcontents 
  *
  * An host represents some physical resource with computing and networking capabilities.
  *
  *
  * An host represents some physical resource with computing and networking capabilities.
  *
index 5f530ea..7596ef6 100644 (file)
@@ -78,7 +78,7 @@ constexpr auto apply(F&& f, Tuple&& t, simgrid::xbt::index_sequence<I...>)
  *
  *  auto args = std::make_tuple(1, false);
  *  int res = apply(foo, args);
  *
  *  auto args = std::make_tuple(1, false);
  *  int res = apply(foo, args);
- *  @encode
+ *  @endcode
  **/
 template <class F, class Tuple>
 constexpr auto apply(F&& f, Tuple&& t)
  **/
 template <class F, class Tuple>
 constexpr auto apply(F&& f, Tuple&& t)
index 1596039..3781e78 100644 (file)
@@ -1,10 +1,9 @@
-/* Copyright (c) 2008-2016. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2008-2016. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-/** \file mc_compare.cpp Memory snapshooting and comparison                 */
+/** \file compare.cpp Memory snapshooting and comparison                    */
 
 #include <cinttypes>
 
 
 #include <cinttypes>
 
index d7eec99..6c3a3fc 100644 (file)
@@ -691,6 +691,7 @@ static void smpi_init_logs(){
   XBT_LOG_CONNECT(smpi_dvfs);
   XBT_LOG_CONNECT(smpi_group);
   XBT_LOG_CONNECT(smpi_kernel);
   XBT_LOG_CONNECT(smpi_dvfs);
   XBT_LOG_CONNECT(smpi_group);
   XBT_LOG_CONNECT(smpi_kernel);
+  XBT_LOG_CONNECT(smpi_memory);
   XBT_LOG_CONNECT(smpi_mpi);
   XBT_LOG_CONNECT(smpi_mpi_dt);
   XBT_LOG_CONNECT(smpi_pmpi);
   XBT_LOG_CONNECT(smpi_mpi);
   XBT_LOG_CONNECT(smpi_mpi_dt);
   XBT_LOG_CONNECT(smpi_pmpi);
index b5c048c..0848481 100644 (file)
@@ -114,6 +114,7 @@ static void xbt_log_connect_categories(void)
   XBT_LOG_CONNECT(xbt_lib);
   XBT_LOG_CONNECT(xbt_mallocator);
   XBT_LOG_CONNECT(xbt_matrix);
   XBT_LOG_CONNECT(xbt_lib);
   XBT_LOG_CONNECT(xbt_mallocator);
   XBT_LOG_CONNECT(xbt_matrix);
+  XBT_LOG_CONNECT(xbt_memory_map);
   XBT_LOG_CONNECT(xbt_parmap);
   XBT_LOG_CONNECT(xbt_sync);
   XBT_LOG_CONNECT(xbt_sync_os);
   XBT_LOG_CONNECT(xbt_parmap);
   XBT_LOG_CONNECT(xbt_sync);
   XBT_LOG_CONNECT(xbt_sync_os);
@@ -173,8 +174,10 @@ static void xbt_log_connect_categories(void)
   XBT_LOG_CONNECT(mc_comm_pattern);
   XBT_LOG_CONNECT(mc_process);
   XBT_LOG_CONNECT(mc_protocol);
   XBT_LOG_CONNECT(mc_comm_pattern);
   XBT_LOG_CONNECT(mc_process);
   XBT_LOG_CONNECT(mc_protocol);
-  XBT_LOG_CONNECT(mc_RegionSnaphot);
+  XBT_LOG_CONNECT(mc_Channel);
   XBT_LOG_CONNECT(mc_ModelChecker);
   XBT_LOG_CONNECT(mc_ModelChecker);
+  XBT_LOG_CONNECT(mc_RegionSnaphot);
+  XBT_LOG_CONNECT(mc_Session);
   XBT_LOG_CONNECT(mc_state);
 #endif
   XBT_LOG_CONNECT(mc_global);
   XBT_LOG_CONNECT(mc_state);
 #endif
   XBT_LOG_CONNECT(mc_global);
@@ -193,6 +196,15 @@ static void xbt_log_connect_categories(void)
   XBT_LOG_CONNECT(msg_task);
   XBT_LOG_CONNECT(msg_vm);
 
   XBT_LOG_CONNECT(msg_task);
   XBT_LOG_CONNECT(msg_vm);
 
+  /* s4u */
+  XBT_LOG_CONNECT(s4u);
+  XBT_LOG_CONNECT(s4u_activity);
+  XBT_LOG_CONNECT(s4u_actor);
+  XBT_LOG_CONNECT(s4u_as);
+  XBT_LOG_CONNECT(s4u_channel);
+  XBT_LOG_CONNECT(s4u_comm);
+  XBT_LOG_CONNECT(s4u_file);
+   
   /* sg */
   XBT_LOG_CONNECT(sg_host);
 
   /* sg */
   XBT_LOG_CONNECT(sg_host);
 
@@ -254,6 +266,9 @@ static void xbt_log_connect_categories(void)
   XBT_LOG_CONNECT(surf_vm);
   XBT_LOG_CONNECT(surf_host);
 
   XBT_LOG_CONNECT(surf_vm);
   XBT_LOG_CONNECT(surf_host);
 
+  /* routing */
+  XBT_LOG_CONNECT(AsImpl);
+   
 #endif /* simgrid_EXPORTS */
 }
 
 #endif /* simgrid_EXPORTS */
 }
 
index 28db032..adc5dfe 100755 (executable)
@@ -94,6 +94,7 @@ while (my $file=<FILES>) {
     chomp $file;
     parse_file($file);         
 }
     chomp $file;
     parse_file($file);         
 }
+parse_file("../include/xbt/sysdep.h"); 
 close FILES;
 
 # Display the tree, looking for disconnected elems    
 close FILES;
 
 # Display the tree, looking for disconnected elems