2
2
<html xmlns="http://www.w3.org/1999/xhtml">
4
4
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
5
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
5
6
<title>SimGrid: Trace-driven simulations</title>
6
7
<link href="tabs.css" rel="stylesheet" type="text/css"/>
7
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
8
<link href="simgrid.css" rel="stylesheet" type="text/css">
8
<script type="text/javascript" src="jquery.js"></script>
9
<script type="text/javascript" src="dynsections.js"></script>
10
<link href="navtree.css" rel="stylesheet" type="text/css"/>
11
<script type="text/javascript" src="resize.js"></script>
12
<script type="text/javascript" src="navtree.js"></script>
13
<script type="text/javascript">
14
$(document).ready(initResizable);
16
<link href="search/search.css" rel="stylesheet" type="text/css"/>
17
<script type="text/javascript" src="search/search.js"></script>
18
<script type="text/javascript">
19
$(document).ready(function() { searchBox.OnSelectItem(0); });
21
<link href="stylesheet.css" rel="stylesheet" type="text/css" />
11
<!-- Generated by Doxygen 1.7.4 -->
24
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
13
25
<div id="titlearea">
14
26
<table cellspacing="0" cellpadding="0">
16
28
<tr style="height: 56px;">
17
29
<td style="padding-left: 0.5em;">
18
<div id="projectname">SimGrid <span id="projectnumber">3.7.1</span></div>
19
<div id="projectbrief">Scalable simulation of distributed systems</div>
30
<div id="projectname">SimGrid
31
 <span id="projectnumber">3.9</span>
33
<div id="projectbrief">Versatile Simulation of Distributed Systems</div>
25
<div id="navrow1" class="tabs">
39
<div id="navrow1" class="tabs">
26
40
<ul class="tablist">
27
<li><a href="index.html"><span>Main Page</span></a></li>
28
<li class="current"><a href="use.html"><span>Using SimGrid</span></a></li>
29
<li><a href="http://gforge.inria.fr/projects/simgrid"><span>Forge</span></a></li>
30
<li><a href="http://simgrid.gforge.inria.fr/"><span>Website</span></a></li>
31
<li><a href="pages.html"><span>Documentation index</span></a></li>
32
<li><a href="FAQ.html"><span>FAQ</span></a></li>
41
<li><a href="http://simgrid.gforge.inria.fr/"><span>Home page</span></a></li>
42
<li><a href="http://simgrid.gforge.inria.fr/documentation.html"><span>Online documentation</span></a></li>
43
<li><a href="https://gforge.inria.fr/projects/simgrid"><span>Dev's Corner</span></a></li>
44
<li> <div id="MSearchBox" class="MSearchBoxInactive">
46
<img id="MSearchSelect" src="search/mag_sel.png"
47
onmouseover="return searchBox.OnSearchSelectShow()"
48
onmouseout="return searchBox.OnSearchSelectHide()"
50
<input type="text" id="MSearchField" value="Search" accesskey="S"
51
onfocus="searchBox.OnSearchFieldFocus(true)"
52
onblur="searchBox.OnSearchFieldFocus(false)"
53
onkeyup="searchBox.OnSearchFieldChange(event)"/>
54
</span><span class="right">
55
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
34
<div class="tabs_group_use">
36
<li><a href="install.html"><span>Installing SimGrid</span></a></li>
37
<li class="current"><a href="modules.html"><span>Modules API</span></a></li>
38
<li><a href="options.html"><span>Options & configurations</span></a></li>
39
<li><a href="platform.html"><span>Platform Description</span></a></li>
40
<li><a href="tracing.html"><span>Tracing Simulations</span></a></li>
41
<li><a href="bindings.html"><span>Bindings</span></a></li>
42
<li><a href="pls.html"><span>Packet-Level Simulation</span></a></li>
47
<!-- POST-PROCESSED TABS -->
50
<li> <a href="group__API__index.html"><span>Full Index</span></a></li>
51
<li> <a href="group__XBT__API.html"><span>XBT</span></a></li>
52
<li class="current"> <a href="group__MSG__API.html"><span>MSG</span></a></li>
53
<li> <a href="group__SIMIX__API.html"><span>SIMIX</span></a></li>
54
<li> <a href="group__GRAS__API.html"><span>GRAS</span></a></li>
55
<li> <a href="group__AMOK__API.html"><span>AMOK</span></a></li>
56
<li> <a href="group__SMPI__API.html"><span>SMPI</span></a></li>
57
<li> <a href="group__SD__API.html"><span>SimDag</span></a></li>
58
<li> <a href="group__SURF__API.html"><span>SURF</span></a></li>
59
<li> <a href="group__TRACE__API.html"><span>TRACE</span></a></li>
63
<li> <a href="group__MSG__examples.html"><span>Examples</span></a></li>
64
<li> <a href="group__msg__simulation.html"><span>Simulation Control</span></a></li>
65
<li> <a href="group__m__process__management.html"><span>Processes</span></a></li>
66
<li> <a href="group__m__host__management.html"><span>Hosts</span></a></li>
67
<li> <a href="group__m__task__management.html"><span>Tasks</span></a></li>
68
<li> <a href="group__msg__task__usage.html"><span>Task Actions</span></a></li>
69
<li> <a href="group__msg__file__management.html"><span>Files</span></a></li>
70
<li class="current"> <a href="group__msg__trace__driven.html"><span>Trace-Driven</span></a></li>
71
<li> <a href="group__MSG__LUA.html"><span>LUA bindings</span></a></li>
72
<li> <a href="group__msg__deprecated__functions.html"><span>MSG Deprecated</span></a></li>
78
<!-- END OF POST-PROCESSED TABS -->
61
<!-- end header part -->
62
<!-- Generated by Doxygen 1.8.1.2 -->
63
<script type="text/javascript">
64
var searchBox = new SearchBox("searchBox", "search",false,'Search');
67
<div id="side-nav" class="ui-resizable side-nav-resizable">
69
<div id="nav-tree-contents">
70
<div id="nav-sync" class="sync"></div>
73
<div id="splitbar" style="-moz-user-select:none;"
74
class="ui-resizable-handle">
77
<script type="text/javascript">
78
$(document).ready(function(){initNavTree('group__msg__trace__driven.html','');});
80
<div id="doc-content">
81
<!-- window showing the filter options -->
82
<div id="MSearchSelectWindow"
83
onmouseover="return searchBox.OnSearchSelectShow()"
84
onmouseout="return searchBox.OnSearchSelectHide()"
85
onkeydown="return searchBox.OnSearchSelectKey(event)">
86
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark"> </span>Pages</a></div>
88
<!-- iframe showing the search results (closed by default) -->
89
<div id="MSearchResultsWindow">
90
<iframe src="javascript:void(0)" frameborder="0"
91
name="MSearchResults" id="MSearchResults">
80
95
<div class="header">
81
96
<div class="summary">
82
97
<a href="#func-members">Functions</a> </div>
83
98
<div class="headertitle">
84
99
<div class="title">Trace-driven simulations</div> </div>
85
<div class="ingroups"><a class="el" href="group__MSG__API.html">MSG</a></div></div>
100
<div class="ingroups"><a class="el" href="group__MSG__API.html">MSG</a></div></div><!--header-->
86
101
<div class="contents">
88
103
<p>This section describes the functions allowing to build trace-driven simulations.
89
104
<a href="#details">More...</a></p>
90
105
<table class="memberdecls">
91
<tr><td colspan="2"><h2><a name="func-members"></a>
106
<tr class="heading"><td colspan="2"><h2><a name="func-members"></a>
92
107
Functions</h2></td></tr>
93
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__msg__trace__driven.html#ga257090d08823abd94a06a2fed9bf84ff">MSG_action_register</a> (const char *action_name, msg_action_fun function)</td></tr>
94
<tr><td class="mdescLeft"> </td><td class="mdescRight">Registers a function to handle a kind of action. <a href="#ga257090d08823abd94a06a2fed9bf84ff"></a><br/></td></tr>
95
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__msg__trace__driven.html#ga97cfd42121c68d8d34c9203d1babcf07">MSG_action_unregister</a> (const char *action_name)</td></tr>
96
<tr><td class="mdescLeft"> </td><td class="mdescRight">Unregisters a function, which handled a kind of action. <a href="#ga97cfd42121c68d8d34c9203d1babcf07"></a><br/></td></tr>
97
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__msg__simulation.html#ga65ef31a33e9a49d675aae2bb6e1c9a04">MSG_error_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__msg__trace__driven.html#gafa55312e5f8e947c3311471643c5cc42">MSG_action_trace_run</a> (char *path)</td></tr>
98
<tr><td class="mdescLeft"> </td><td class="mdescRight">A trace loader. <a href="#gafa55312e5f8e947c3311471643c5cc42"></a><br/></td></tr>
108
<tr class="memitem:gaff3ae0c6d1fc712f2162cc199086731f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__msg__simulation.html#gaf79b56c0bd3b78b539b0cb4c12e56425">msg_error_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__msg__trace__driven.html#gaff3ae0c6d1fc712f2162cc199086731f">MSG_action_trace_run</a> (char *path)</td></tr>
109
<tr class="memdesc:gaff3ae0c6d1fc712f2162cc199086731f"><td class="mdescLeft"> </td><td class="mdescRight">A trace loader. <a href="#gaff3ae0c6d1fc712f2162cc199086731f"></a><br/></td></tr>
100
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
111
<a name="details" id="details"></a><h2>Detailed Description</h2>
101
112
<p>This section describes the functions allowing to build trace-driven simulations. </p>
102
113
<!-- DOXYGEN_NAVBAR_LABEL="Trace-Driven" --> <p>This is very handy when you want to test an algorithm or protocol that does nothing unless it receives some events from outside. For example, a P2P protocol reacts to requests from the user, but does nothing if there is no such event.</p>
103
<p>In such situations, SimGrid allows to write your protocol in your C file, and the events to react to in a separate text file. Declare a function handling each of the events that you want to accept in your trace files, register them using <a class="el" href="group__msg__trace__driven.html#ga257090d08823abd94a06a2fed9bf84ff" title="Registers a function to handle a kind of action.">MSG_action_register</a> in your main, and then use <a class="el" href="group__msg__trace__driven.html#gafa55312e5f8e947c3311471643c5cc42" title="A trace loader.">MSG_action_trace_run</a> to launch the simulation. You can either have one trace file containing all your events, or a file per simulated process.</p>
114
<p>In such situations, SimGrid allows to write your protocol in your C file, and the events to react to in a separate text file. Declare a function handling each of the events that you want to accept in your trace files, register them using <a class="el" href="group__XBT__replay.html#ga994ddcd8aa680aabc58762d8965f93ef" title="Registers a function to handle a kind of action.">xbt_replay_action_register</a> in your main, and then use <a class="el" href="group__msg__trace__driven.html#gaff3ae0c6d1fc712f2162cc199086731f" title="A trace loader.">MSG_action_trace_run</a> to launch the simulation. You can either have one trace file containing all your events, or a file per simulated process.</p>
104
115
<p>Check the examples in <b>examples/msg/actions/actions.c</b> for details. </p>
105
<hr/><h2>Function Documentation</h2>
106
<a class="anchor" id="ga257090d08823abd94a06a2fed9bf84ff"></a><!-- doxytag: member="msg_actions.c::MSG_action_register" ref="ga257090d08823abd94a06a2fed9bf84ff" args="(const char *action_name, msg_action_fun function)" -->
107
<div class="memitem">
108
<div class="memproto">
109
<table class="memname">
111
<td class="memname">void MSG_action_register </td>
113
<td class="paramtype">const char * </td>
114
<td class="paramname"><em>action_name</em>, </td>
117
<td class="paramkey"></td>
119
<td class="paramtype">msg_action_fun </td>
120
<td class="paramname"><em>function</em> </td>
131
<p>Registers a function to handle a kind of action. </p>
132
<p>Registers a function to handle a kind of action This table is then used by <a class="el" href="group__msg__trace__driven.html#gafa55312e5f8e947c3311471643c5cc42" title="A trace loader.">MSG_action_trace_run</a></p>
133
<p>The argument of the function is the line describing the action, splitted on spaces with <a class="el" href="group__XBT__str.html#gaa6839f81f1789acf3865eeade8c23c77" title="Splits a string into a dynar of strings, taking quotes into account.">xbt_str_split_quoted()</a></p>
134
<dl><dt><b>Parameters:</b></dt><dd>
135
<table class="params">
136
<tr><td class="paramname">action_name</td><td>the reference name of the action. </td></tr>
137
<tr><td class="paramname">function</td><td>prototype given by the type: void...(xbt_dynar_t action) </td></tr>
144
<a class="anchor" id="ga97cfd42121c68d8d34c9203d1babcf07"></a><!-- doxytag: member="msg_actions.c::MSG_action_unregister" ref="ga97cfd42121c68d8d34c9203d1babcf07" args="(const char *action_name)" -->
145
<div class="memitem">
146
<div class="memproto">
147
<table class="memname">
149
<td class="memname">void MSG_action_unregister </td>
151
<td class="paramtype">const char * </td>
152
<td class="paramname"><em>action_name</em></td><td>)</td>
159
<p>Unregisters a function, which handled a kind of action. </p>
160
<dl><dt><b>Parameters:</b></dt><dd>
161
<table class="params">
162
<tr><td class="paramname">action_name</td><td>the reference name of the action. </td></tr>
169
<a class="anchor" id="gafa55312e5f8e947c3311471643c5cc42"></a><!-- doxytag: member="msg_actions.c::MSG_action_trace_run" ref="gafa55312e5f8e947c3311471643c5cc42" args="(char *path)" -->
170
<div class="memitem">
171
<div class="memproto">
172
<table class="memname">
174
<td class="memname"><a class="el" href="group__msg__simulation.html#ga65ef31a33e9a49d675aae2bb6e1c9a04">MSG_error_t</a> MSG_action_trace_run </td>
116
<h2>Function Documentation</h2>
117
<a class="anchor" id="gaff3ae0c6d1fc712f2162cc199086731f"></a>
118
<div class="memitem">
119
<div class="memproto">
120
<table class="memname">
122
<td class="memname"><a class="el" href="group__msg__simulation.html#gaf79b56c0bd3b78b539b0cb4c12e56425">msg_error_t</a> MSG_action_trace_run </td>
176
124
<td class="paramtype">char * </td>
177
125
<td class="paramname"><em>path</em></td><td>)</td>
129
</div><div class="memdoc">
184
131
<p>A trace loader. </p>
185
132
<p>If path!=NULL, load a trace file containing actions, and execute them. Else, assume that each process gets the path in its deployment file </p>
136
</div><!-- contents -->
137
</div><!-- doc-content -->
138
<!-- start footer part -->
139
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
141
<li class="footer">Generated on Wed Jan 30 2013 17:21:58 for SimGrid by
142
<a href="http://www.doxygen.org/index.html">
143
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.1.2 </li>
196
<a href="index.html"><b>
197
Back to the main Simgrid Documentation page</b></a>
200
<small>The version of <a href="http://simgrid.gforge.inria.fr">SimGrid</a> documented here is v3.7.1.<br/>
201
Documentation of other versions can be found in their respective
202
archive files (directory doc/html).
205
<small>Generated by <a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border=0 width=110 height=53></a> </small>