\include msg/app-masterworker/app-masterworker_d.xml
-\subsubsection MSG_ex_asynchronous_communications Asynchronous communications
-
-Simulation of asynchronous communications between a sender and a receiver using a realistic platform and
-an external description of the deployment.
-
- - \ref MSG_ext_async_code
- - \ref MSG_ext_async_preliminary
- - \ref MSG_ext_async_Sender
- - \ref MSG_ext_async_Receiver
- - \ref MSG_ext_async_Main
- - \ref MSG_ext_async_fct_Waitall
- - \ref MSG_ext_async_fct_Waitany
-
-<hr>
-
-\dontinclude msg/async-wait/async-wait.c
-
-\paragraph MSG_ext_async_code Code of the application
-
-\paragraph MSG_ext_async_preliminary Preliminary declarations
-\skip include
-\until Sender
-
-\paragraph MSG_ext_async_Sender Sender function
-
-A host can send an asynchronous message with \c MSG_task_isend(). As this function is non-blocking, we have to call
-\c MSG_comm_test() to know if the communication is complete and evenetually destroy it with a call to
-\c MSG_comm_destroy(). It is also possible to call \c MSG_comm_wait() which provides a shortcut.
-
- C style arguments (argc/argv) are interpreted as:
- - the number of tasks to distribute
- - the computation size of each task
- - the size of the files associated to each task
- - the number of receivers that will accept those tasks
- - the time to sleep at the beginning of the function. This time defines the process sleep time:
- - if time = 0, use MSG_comm_wait()
- - if time > 0, use MSG_comm_test()
-
-\until Receiver
-
-\paragraph MSG_ext_async_Receiver Receiver function
-
-This function executes tasks when it receives them. As the receiving is asynchronous, we have to test the completion of
-the communication with \c MSG_comm_test() or wait for it with \c MSG_comm_wait().
-
- C style arguments (argc/argv) are interpreted as:
- - the id to use for received the communication.
- - the time to sleep at the beginning of the function
- - This time defined the process sleep time
- - if time = 0 use of MSG_comm_wait()
- - if time > 0 use of MSG_comm_test()
-
-\until return
-\until }
-
-\paragraph MSG_ext_async_Main Main function
-
-This function is the core of the simulation and is divided only into 3 parts:
- -# Simulation settings : MSG_create_environment() loads a platform description
- -# Application deployment : create the processes on the right locations with MSG_launch_application()
- -# The simulation is run with #MSG_main()
-
- Its arguments are:
- - <i>platform_file</i>: the name of a file containing an valid platform description.
- - <i>application_file</i>: the name of a file containing a valid application deployment.
-
-\until return
-\until }
-
-\dontinclude msg/async-waitall/async-waitall.c
-
-\paragraph MSG_ext_async_fct_Waitall Waitall function
-
-The use of MSG_comm_waitall() allows a process to send all the tasks and then wait for the completion of all in one call.
-
-\skipline static
-\until return
-\until }
-
-\paragraph MSG_ext_async_fct_Waitany Waitany function
-
-The MSG_comm_waitany() function returns the place of the first message send or receive from a xbt_dynar.
-
-\skipline static
-\until return
-\until }
-
*/
Most processes are started from the deployment XML file, but they
can also be used with the @ref MSG_process_create() function.
- - <b>Controling the process life cycle from the XML</b>.
- @ref examples/msg/process-startkilltime/process-startkilltime.c \n
- You can specify a start time and a kill time in the deployment
- file. See all *_d.xml files in this directory.
-
@section msg_ex_tracing Tracing and visualization features
Tracing can be activated by various configuration options which
@ref examples/msg/task-priority/task-priority.c \n
Demonstrates the use of @ref MSG_task_set_priority to change the
computation priority of a given task.
-
- - <b>User-defined properties</b>.
- @ref examples/msg/platform-properties/platform-properties.c \n
- Attaching arbitrary information to host, processes and
- such, and retrieving them with @ref MSG_host_get_properties,
- @ref MSG_host_get_property_value, @ref MSG_process_get_properties, and
- @ref MSG_process_get_property_value. Also make sure to read the
- platform and deployment XML files to see how to declare these data.
TODO: Document the many other examples that we have
*/
@example examples/msg/app-masterworker/app-masterworker.c
@example examples/msg/process-create/process-create.c
-@example examples/msg/process-startkilltime/process-startkilltime.c
@example examples/msg/trace-platform/trace-platform.c
@example examples/msg/trace-categories/trace-categories.c
@example examples/msg/network-ns3/network-ns3.c
-@example examples/msg/io-storage/io-storage.c
@example examples/msg/io-file/io-file.c
-@example examples/msg/io-remote/io-remote.c
@example examples/msg/task-priority/task-priority.c
-@example examples/msg/platform-properties/platform-properties.c
*/
Even if it is not completely rock stable yet, it may well already fit
your needs. You are welcome to try it and report any interface
glitches that you see. Be however warned that the interface may change
-until its final release. You will have to adapt your code on the way.
+until the 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.
- @ref s4u_ex_actors
- @ref s4u_ex_synchro
- @ref s4u_ex_actions
+ - @ref s4u_ex_platf
- @ref s4u_ex_io
- @ref s4u_ex_energy
+TODO: document here the examples about plugins
+
@section s4u_ex_basics Basics of SimGrid simulation
- <b>Creating actors:</b> @ref examples/s4u/actor-create/s4u-actor-create.cpp and
Illustrates how to have non-blocking communications, that are
communications running in the background leaving the process free
to do something else during their completion. The main functions
- involved are @ref simgrid::s4u::Comm::put_async and
+ involved are @ref simgrid::s4u::Mailbox::put_async and
@ref simgrid::s4u::Comm::wait().
- <b>Waiting for all communications in a set</b>.
- <b>Creating actors</b>.
@ref examples/s4u/actor-create/s4u-actor-create.cpp \n
- Most actors are started from the deployment XML file, but they exist other methods.
+ Most actors are started from the deployment XML file, but there is other methods.
+ This example show them all.
- <b>Actors using CPU time</b>.
@ref examples/s4u/actor-execute/s4u-actor-execute.cpp \n
The computations done in your program are not reported to the
simulated world, unless you explicitely request the simulator to pause
the actor until a given amount of flops gets computed on its simulated
- host.
+ host. Some executions can be given an higher priority so that they
+ get more resources.
- <b>Daemonize actors</b>
@ref examples/s4u/actor-daemon/s4u-actor-daemon.cpp \n
- <b>Suspend and Resume actors</b>.
@ref examples/s4u/actor-suspend/s4u-actor-suspend.cpp \n
Actors can be suspended and resumed during their executions
- thanks to the @ref suspend and @ref resume methods.
+ thanks to the @ref simgrid::s4u::Actor::suspend and @ref simgrid::s4u::Actor::resume methods.
- <b>Priority actors</b>.
@ref examples/s4u/actor-priority/s4u-actor-priority.cpp \n
Actors can be launched according their priorities thanks to the @ref
- execution method.
+ simgrid::s4u::this_actor::execute() method.
- <b>Kill actors</b>.
@ref examples/s4u/actor-kill/s4u-actor-kill.cpp \n
- Actors can forcefully stop other actors with the @ref kill method.
+ Actors can forcefully stop other actors with the @ref
+ simgrid::s4u::Actor::kill() method.
- <b>Controling the actor life cycle from the XML</b>.
@ref examples/s4u/actor-lifetime/s4u-actor-lifetime.cpp
- <b>Migrating Actors</b>.
@ref examples/s4u/actor-migration/s4u-actor-migration.cpp \n
- Actors can move or be moved from a host to another with the @ref migrate method.
+ Actors can move or be moved from a host to another with the @ref
+ simgrid::s4u::this_actor::migrate() method.
- <b>Yielding to other actor</b>.
- @ref examples/s4u/actor-yield/s4u-actor-yield.c\n
+ @ref examples/s4u/actor-yield/s4u-actor-yield.cpp\n
The simgrid::s4u::this_actor::yield() function interrupts the
execution of the current actor, leaving a chance to the other actors
that are ready to run at this timestamp.
Presents a set of event handlers reproducing classical I/O
primitives (open, read, close).
+@section s4u_ex_platf Interacting with the platform
+
+ - <b>User-defined properties</b>.
+ @ref examples/s4u/platform-properties/s4u-platform-properties.cpp and
+ @ref examples/s4u/platform-properties/s4u-platform-properties_d.xml and
+ @ref examples/platforms/prop.xml \n
+ You can attach arbitrary information to most platform elements from
+ the XML file, and then interact with these values from your
+ program. Note that the changes are not written into the XML file: they
+ will only last until the end of your simulation.
+ - simgrid::s4u::Actor::getProperty() and simgrid::s4u::Actor::setProperty()
+ - simgrid::s4u::Host::getProperty() and simgrid::s4u::Host::setProperty()
+ - simgrid::s4u::Link::getProperty() and simgrid::s4u::Link::setProperty()
+ - simgrid::s4u::NetZone::getProperty() and simgrid::s4u::NetZone::setProperty()
+
@section s4u_ex_io Simulating disks and files
The examples of this section demonstrate how to interact with the
simulated storages.
- <b>Access to raw storage devices </b>.
- @ref examples/s4u/io-raw-storage/s4u-io-raw-storage.cpp \n
+ @ref examples/s4u/io-storage-raw/s4u-io-storage-raw.cpp \n
This example illustrates how to simply read and write data on a
simulated storage resource.
@ref examples/s4u/energy-pstate/s4u-energy-pstate.cpp and
@ref examples/platforms/energy_platform.xml \n
Show how define a set of pstates for a host and how the current
- pstate can be accessed/changed with @ref getPstateSpeed and @ref sg_host_set_pstate.
+ pstate can be accessed/changed with @ref simgrid::s4u::Host::getPstateSpeed and @ref simgrid::s4u::Host::setPstate.
See also the platform XML file for have a details on how to declare the CPU capacity for each pstate.
*/
@example examples/s4u/actor-lifetime/s4u-actor-lifetime.cpp
@example examples/s4u/actor-lifetime/s4u-actor-lifetime_d.xml
@example examples/s4u/actor-migration/s4u-actor-migration.cpp
+@example examples/s4u/actor-priority/s4u-actor-priority.cpp
@example examples/s4u/actor-suspend/s4u-actor-suspend.cpp
+@example examples/s4u/actor-yield/s4u-actor-yield.cpp
@example examples/s4u/app-token-ring/s4u-app-token-ring.cpp
@example examples/s4u/app-masterworker/s4u-app-masterworker.cpp
@example examples/s4u/app-pingpong/s4u-app-pingpong.cpp
+@example examples/s4u/async-wait/s4u-async-wait.cpp
+@example examples/s4u/async-waitall/s4u-async-waitall.cpp
+@example examples/s4u/async-waitany/s4u-async-waitany.cpp
@example examples/s4u/energy-pstate/s4u-energy-pstate.cpp
-@example examples/platforms/energy_platform.xml
@example examples/s4u/io-file-remote/s4u-io-file-remote.cpp
-@example examples/s4u/io-raw-storage/s4u-io-raw-storage.cpp
+@example examples/s4u/io-storage-raw/s4u-io-storage-raw.cpp \n
@example examples/s4u/mutex/s4u-mutex.cpp
+@example examples/s4u/platform-properties/s4u-platform-properties.cpp
+@example examples/s4u/platform-properties/s4u-platform-properties_d.xml
+@example examples/platforms/energy_platform.xml
+@example examples/platforms/prop.xml
*/
\ No newline at end of file