2 @defgroup MSG_API MSG: Simulate CSP Algorithms
3 @brief Simple programming environment
5 MSG is a simple API to write algorithms organized with Concurrent
6 Sequential Processes (CSP) that interact by exchanging messages. It
7 constitutes a convenient simplification of the reality of distributed
8 systems. It can be used to build rather realistic simulations, but
9 remains simple to use: most unpleasant technical elements can be
10 abstracted away rather easily.
12 If you are unsure, then you probably want to use MSG. Otherwise, you
13 may want to use one of the following:
15 - MSG in Java instead of C: @ref MSG_Java.
16 - If you want to use DAGs: @ref SD_API.
17 - If you want to study a MPI application: @ref SMPI_API.
19 \section MSG_funct Offered functionalities
21 - \ref m_process_management
22 - \ref m_host_management
23 - \ref m_task_management
24 - \ref msg_mailbox_management
29 - \ref msg_trace_driven
35 @defgroup msg_simulation Main MSG simulation Functions
37 @brief How to setup and control your simulation.
39 The basic workflow is the following (check the \ref msg_examples for
42 -# Initialize the library with #MSG_init
43 -# Create a platform (usually by parsing a file with
44 #MSG_create_environment)
45 -# Register the functions that your processes are supposed to run with
46 #MSG_function_register (and maybe #MSG_function_register_default)
47 -# Launch your processes from a deployment file with #MSG_launch_application
48 -# Run the simulation with #MSG_main
51 /** @defgroup m_process_management Process Management Functions
53 * @brief This section describes the process structure of MSG
54 * (#msg_process_t) and the functions for managing it.
57 /** @defgroup m_host_management Host Management Functions
59 * @brief Host structure of MSG
62 /** @defgroup m_task_management Task Management Functions
64 * @brief Task structure of MSG (#msg_task_t) and associated functions. See
65 * \ref msg_task_usage to see how to put the tasks in action.
68 /** @defgroup msg_mailbox_management Mailbox Management Functions
70 * @brief Functions associated to mailboxes.
73 /** @defgroup msg_task_usage Task Actions
75 * @brief This section describes the functions that can be used
76 * by a process to execute, communicate or otherwise handle some task.
79 /** @defgroup msg_synchro Explicit Synchronization Functions
81 * @brief Explicit synchronization mechanisms: semaphores (#msg_sem_t) and friends.
83 * In some situations, these things are very helpful to synchronize processes without message exchanges.
86 /** @defgroup msg_VMs VMs
88 * @brief Interface created to mimic IaaS clouds.
90 * With it, you can create virtual machines to put your processes
91 * into, and interact directly with the VMs to manage groups of
96 /** @defgroup msg_storage_management Storage Management Functions
98 * @brief Storage structure of MSG (#msg_storage_t) and associated functions, inspired from POSIX.
101 /** @defgroup msg_file File Management Functions
103 @brief MSG files (#msg_file_t) and associated functions, inspired from POSIX.
107 @defgroup msg_trace_driven Trace-driven simulations
109 @brief This section describes the functions allowing to build trace-driven simulations.
111 This is very handy when you want to test an algorithm or protocol that
112 does nothing unless it receives some events from outside. For example,
113 a P2P protocol reacts to requests from the user, but does nothing if
114 there is no such event.
116 In such situations, SimGrid allows to write your protocol in your C
117 file, and the events to react to in a separate text file. Declare a
118 function handling each of the events that you want to accept in your
119 trace files, register them using #xbt_replay_action_register in your main,
120 and then use #MSG_action_trace_run to launch the simulation. You can
121 either have one trace file containing all your events, or a file per
124 Check the examples in <b>examples/msg/actions/actions.c</b> for details.