Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add the 2 new C examples to the doc; use sg_comm_wait_any in example instead of sg_co...
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Tue, 4 Feb 2020 10:13:36 +0000 (11:13 +0100)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Tue, 4 Feb 2020 10:13:36 +0000 (11:13 +0100)
docs/source/app_s4u.rst
examples/README.rst
examples/c/async-waitany/async-waitany.c
include/simgrid/comm.h
src/s4u/s4u_Comm.cpp

index 1991185..d1d5128 100644 (file)
@@ -988,7 +988,7 @@ See :ref:`s4u_receiving_actor`.
 
    .. group-tab:: C
 
-      .. autodoxymethod:: ::sg_mailbox_set_receiver(const char *alias)
+      .. autodoxymethod:: sg_mailbox_set_receiver(const char *alias)
                   
 .. _API_s4u_Resource:
 
index 810c7b9..d02d508 100644 (file)
@@ -54,6 +54,13 @@ Starting and Stoping Actors
           - Directly with :py:func:`simgrid.Actor.create()`
           - From XML with :py:func:`simgrid.Engine.register_actor()` and then :py:func:`simgrid.Engine.load_deployment()`
              
+       .. example-tab:: examples/c/actor-create/actor-create.c
+       
+          You create actors either:
+            
+          - 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
        
           The following file is used in both C++ and Python.
@@ -268,6 +275,10 @@ Communications on the Network
       .. example-tab:: examples/python/async-waitany/async-waitany.py
 
          See also :py:func:`simgrid.Comm.wait_any()`.
+        
+      .. example-tab:: examples/c/async-waitany/async-waitany.c
+
+         See also :cpp:func:`sg_comm_wait_any`.
      
 .. _s4u_ex_execution:
 
index cfe9127..73eaae3 100644 (file)
@@ -63,7 +63,7 @@ static int sender(int argc, char* argv[])
    * Even in this simple example, the pending comms do not terminate in the exact same order of creation.
    */
   while (pending_comms_count != 0) {
-    int changed_pos = sg_comm_wait_any_for(pending_comms, pending_comms_count, -1);
+    int changed_pos = sg_comm_wait_any(pending_comms, pending_comms_count);
     memmove(pending_comms + changed_pos, pending_comms + changed_pos + 1,
             sizeof(sg_comm_t) * (pending_comms_count - changed_pos - 1));
     pending_comms_count--;
index 933cd70..e3b3cd1 100644 (file)
@@ -13,6 +13,7 @@
 SG_BEGIN_DECL
 
 XBT_PUBLIC int sg_comm_wait_any_for(sg_comm_t* comms, size_t count, double timeout);
+XBT_PUBLIC int sg_comm_wait_any(sg_comm_t* comms, size_t count);
 
 SG_END_DECL
 
index 9eabf30..49edc9f 100644 (file)
@@ -254,6 +254,10 @@ Actor* Comm::get_sender()
 } // namespace s4u
 } // namespace simgrid
 /* **************************** Public C interface *************************** */
+int sg_comm_wait_any(sg_comm_t* comms, size_t count)
+{
+  return sg_comm_wait_any_for(comms, count, -1);
+}
 int sg_comm_wait_any_for(sg_comm_t* comms, size_t count, double timeout)
 {
   std::vector<simgrid::s4u::CommPtr> s4u_comms;