~ubuntu-branches/ubuntu/raring/simgrid/raring

« back to all changes in this revision

Viewing changes to doc/html/group__MSG__examples.html

  • Committer: Package Import Robot
  • Author(s): Martin Quinson
  • Date: 2013-01-31 00:24:51 UTC
  • mfrom: (10.1.6 sid)
  • Revision ID: package-import@ubuntu.com-20130131002451-krejhf7w7h24lpsc
Tags: 3.9~rc1-1
* New upstream release: the "Grasgory" release. Major changes:
  - Gras was completely removed from this version.
  - Documentation reorganization to ease browsing it.
  - New default value for the TCP_gamma parameter: 4MiB

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
<html xmlns="http://www.w3.org/1999/xhtml">
3
3
<head>
4
4
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
5
 
<title>SimGrid: MSG Examples</title>
 
5
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
 
6
<title>SimGrid: MSG examples</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);
 
15
</script>
 
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); });
 
20
</script>
 
21
<link href="stylesheet.css" rel="stylesheet" type="text/css" />
9
22
</head>
10
23
<body>
11
 
<!-- Generated by Doxygen 1.7.4 -->
12
 
<div id="top">
 
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">
15
27
 <tbody>
16
28
 <tr style="height: 56px;">
17
29
  <td style="padding-left: 0.5em;">
18
 
   <div id="projectname">SimGrid&#160;<span id="projectnumber">3.7.1</span></div>
19
 
   <div id="projectbrief">Scalable simulation of distributed systems</div>
 
30
   <div id="projectname">SimGrid
 
31
   &#160;<span id="projectnumber">3.9</span>
 
32
   </div>
 
33
   <div id="projectbrief">Versatile Simulation of Distributed Systems</div>
20
34
  </td>
21
35
 </tr>
22
36
 </tbody>
23
37
</table>
24
38
</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&#160;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&nbsp;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">
 
45
        <span class="left">
 
46
          <img id="MSearchSelect" src="search/mag_sel.png"
 
47
               onmouseover="return searchBox.OnSearchSelectShow()"
 
48
               onmouseout="return searchBox.OnSearchSelectHide()"
 
49
               alt=""/>
 
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>
 
56
          </span>
 
57
        </div>
 
58
</li>
33
59
    </ul>
34
 
      <div class="tabs_group_use">
35
 
        <ul class="tablist">
36
 
                <li><a href="install.html"><span>Installing SimGrid</span></a></li>
37
 
                <li class="current"><a href="modules.html"><span>Modules&#160;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>
43
 
        </ul></div>
44
 
      </div>
45
 
  </div>
46
 
 
47
 
<!-- POST-PROCESSED TABS -->
48
 
<div class="tabs2">
49
 
<ul class="tablist">
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>
60
 
  </ul></div>
61
 
<div class="tabs2">
62
 
<ul class="tablist">
63
 
  <li class="current"> <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> <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>
73
 
  </ul></div>
74
 
<div class="tabs2">
75
 
  <ul class="tablist">
76
 
  <li> <a href="group__MSG__ex__asynchronous__communications.html"><span>Asynchronous communications</span></a></li>
77
 
  <li> <a href="group__MSG__ex__master__slave.html"><span>Basic Master/Slaves</span></a></li>
78
 
  </ul></div>
79
 
 
80
 
<!-- END OF POST-PROCESSED TABS -->
81
 
</div>
 
60
  </div> 
 
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');
 
65
</script>
 
66
</div><!-- top -->
 
67
<div id="side-nav" class="ui-resizable side-nav-resizable">
 
68
  <div id="nav-tree">
 
69
    <div id="nav-tree-contents">
 
70
      <div id="nav-sync" class="sync"></div>
 
71
    </div>
 
72
  </div>
 
73
  <div id="splitbar" style="-moz-user-select:none;" 
 
74
       class="ui-resizable-handle">
 
75
  </div>
 
76
</div>
 
77
<script type="text/javascript">
 
78
$(document).ready(function(){initNavTree('group__MSG__examples.html','');});
 
79
</script>
 
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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Pages</a></div>
 
87
 
 
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">
 
92
</iframe>
 
93
</div>
 
94
 
82
95
<div class="header">
83
 
  <div class="summary">
84
 
<a href="#groups">Modules</a>  </div>
85
96
  <div class="headertitle">
86
 
<div class="title">MSG Examples</div>  </div>
87
 
<div class="ingroups"><a class="el" href="group__MSG__API.html">MSG</a></div></div>
 
97
<div class="title">MSG examples</div>  </div>
 
98
<div class="ingroups"><a class="el" href="group__MSG__API.html">MSG</a></div></div><!--header-->
88
99
<div class="contents">
89
 
<table class="memberdecls">
90
 
<tr><td colspan="2"><h2><a name="groups"></a>
91
 
Modules</h2></td></tr>
92
 
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__MSG__ex__asynchronous__communications.html">Asynchronous communications</a></td></tr>
93
 
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__MSG__ex__master__slave.html">Basic Master/Slaves</a></td></tr>
94
 
</table>
95
 
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
96
 
 <!-- DOXYGEN_NAVBAR_LABEL="Examples" --> <p>MSG comes with an extensive set of examples. It is sometimes difficult to find the one you need. This list aims at helping you finding the example from which you can learn what you want to.</p>
97
 
<h2><a class="anchor" id="MSG_ex_basics"></a>
98
 
Basic examples and features</h2>
 
100
 
 
101
<p>MSG examples from examples directory examples/msg.  
 
102
<a href="#details">More...</a></p>
 
103
<p>MSG examples from examples directory examples/msg. </p>
 
104
<p>MSG comes with an extensive set of examples. It is sometimes difficult to find the one you need. This list aims at helping you finding the example from which you can learn what you want to.</p>
 
105
<h1><a class="anchor" id="msg_bsc_ex"></a>
 
106
Basic examples</h1>
99
107
<ul>
100
108
<li><b>sendrecv/sendrecv.c: Ping-pong example</b>. It's hard to think of a simpler example. The tesh files laying in the directory are instructive concerning the way to pass options to the simulators (as described in <a class="el" href="options.html">Simgrid options and configurations</a>).</li>
101
109
</ul>
102
110
<ul>
103
 
<li><b>masterslave/masterslave_forwarder.c: Master/slaves example</b>. This good old example is also very simple. Its basic version is fully commented on this page: <a class="el" href="group__MSG__ex__master__slave.html">Basic Master/Slaves</a>, but several variants can be found in the same directory.</li>
104
 
</ul>
105
 
<ul>
106
 
<li><b>masterslave/masterslave_console.c</b>: demonstrate how to use lua files instead of XML for the platform and deployment declaration using <a class="el" href="group__MSG__LUA.html#ga2923710a7784b2d2b019ebfd6ace7eb9">MSG_load_platform_script</a>. The most interesting part is probably not the C code, but rather the <b>masterslave/masterslave_script.lua</b>, which demonstrates how to express the platform and deployment in lua.</li>
107
 
</ul>
108
 
<ul>
109
 
<li><b>migration/migration.c</b> Demonstrates how to use the <a class="el" href="group__m__process__management.html#ga8bc50f72b481a5d9739e44dbad6d322b">MSG_process_migrate</a> function to let processes change the host they run on after their start.</li>
110
 
</ul>
111
 
<ul>
112
 
<li><b>suspend/suspend.c</b>: Demonstrates how to suspend and resume processes using <a class="el" href="group__m__process__management.html#gaad0e871e30546e4d862a0ce902856bd3">MSG_process_suspend</a> and <a class="el" href="group__m__process__management.html#gadf31a5d347675b8424eecf7e56234e65">MSG_process_resume</a>.</li>
113
 
</ul>
114
 
<ul>
115
 
<li><b>properties/msg_prop.c</b> Attaching arbitrary informations to host, processes and such, and retrieving them with <a class="el" href="group__m__host__management.html#gabf5edf2c968764c6f9216e4661116e43">MSG_host_get_properties</a>, <a class="el" href="group__m__host__management.html#gad3f3c634129231acd67b7bcebcca621a">MSG_host_get_property_value</a>, <a class="el" href="group__m__process__management.html#gab3beb979ef69e1c5fcb8d792d71be064">MSG_process_get_properties</a> and <a class="el" href="group__m__process__management.html#ga80ec919eccc1f948bfdc274b9d45b014">MSG_process_get_property_value</a>. Also make sure to read the platform and deployment XML files to see how to declare these data.</li>
116
 
</ul>
117
 
<ul>
118
 
<li><b>parallel_task/parallel_task.c</b>: Demonstrates the use of <a class="el" href="group__m__task__management.html#ga32c5df8c19d3441642e36efeba880d75">MSG_parallel_task_create</a>, to create special tasks that run on several hosts at the same time. The resulting simulations are very close to what can be achieved in <a class="el" href="group__SD__API.html">SimDag</a>, but still allows to use the other features of MSG (it'd be cool to be able to mix interfaces, but it's not possible ATM).</li>
119
 
</ul>
120
 
<ul>
121
 
<li><b>priority/priority.c</b>: Demonstrates the use of <a class="el" href="group__m__task__management.html#ga20367e0e24a2bbdc709b6ff18321c052">MSG_task_set_priority</a> to change the computation priority of a given task.</li>
122
 
</ul>
123
 
<h2><a class="anchor" id="MSG_ex_icomms"></a>
124
 
Asynchronous communications</h2>
125
 
<p>There is several examples of asynchronous communications coming in the archive. In addition to the fully documented example <a class="el" href="group__MSG__ex__asynchronous__communications.html">Asynchronous communications</a>, there is several other examples in the archive:</p>
126
 
<ul>
127
 
<li><b>msg/icomms/peer.c</b>: basic example of async functions (<a class="el" href="group__msg__task__usage.html#ga93753007666dafb73395de52d18d9f35">MSG_task_isend</a>, <a class="el" href="group__msg__task__usage.html#gabfc220a24b53509f7e41227fd4db14e0">MSG_task_irecv</a>, <a class="el" href="group__msg__task__usage.html#ga2e55adaddb5aada23084a9aa18434f7f">MSG_comm_wait</a>)</li>
 
111
<li><b>masterslave/masterslave_forwarder.c: Master/slaves example</b>. This good old example is also very simple. Its basic version is fully commented on this page: <a class="el" href="use.html#MSG_ex_master_slave">Basic Master/Slaves</a>, but several variants can be found in the same directory.</li>
 
112
</ul>
 
113
<ul>
 
114
<li><b>migration/migration.c</b> Demonstrates how to use the <a class="el" href="group__m__process__management.html#ga6651c72dff79c7f1aa6eff05db5b3063">MSG_process_migrate</a> function to let processes change the host they run on after their start.</li>
 
115
</ul>
 
116
<ul>
 
117
<li><b>suspend/suspend.c</b>: Demonstrates how to suspend and resume processes using <a class="el" href="group__m__process__management.html#gac00bbc4ebc824d14a3f6719de8190618">MSG_process_suspend</a> and <a class="el" href="group__m__process__management.html#ga9f25a30269f39c7683d18f9d4e1fd331">MSG_process_resume</a>.</li>
 
118
</ul>
 
119
<ul>
 
120
<li><b>properties/msg_prop.c</b> Attaching arbitrary informations to host, processes and such, and retrieving them with <a class="el" href="group__m__host__management.html#gac5d6359399bb8c8daba83cf62f47785f">MSG_host_get_properties</a>, <a class="el" href="group__m__host__management.html#gadcefcdecf27f1dfb19a5c2ac5a775402">MSG_host_get_property_value</a>, <a class="el" href="group__m__process__management.html#gad7570aff7510cbed3fc1dc3b97d0231b">MSG_process_get_properties</a> and <a class="el" href="group__m__process__management.html#ga7894a7c080a4821b49b17d0b6abd46ae">MSG_process_get_property_value</a>. Also make sure to read the platform and deployment XML files to see how to declare these data.</li>
 
121
</ul>
 
122
<ul>
 
123
<li><b>parallel_task/parallel_task.c</b>: Demonstrates the use of <a class="el" href="group__m__task__management.html#ga54412e440ff859933bbbcb0204aa5a75">MSG_parallel_task_create</a>, to create special tasks that run on several hosts at the same time. The resulting simulations are very close to what can be achieved in <a class="el" href="group__SD__API.html">SimDag</a>, but still allows to use the other features of MSG (it'd be cool to be able to mix interfaces, but it's not possible ATM).</li>
 
124
</ul>
 
125
<ul>
 
126
<li><b>priority/priority.c</b>: Demonstrates the use of <a class="el" href="group__m__task__management.html#ga22cf2562fbb9cad8c5860914c0d8d6dc">MSG_task_set_priority</a> to change the computation priority of a given task.</li>
 
127
</ul>
 
128
<h1><a class="anchor" id="MSG_ex_icomms"></a>
 
129
Asynchronous communications</h1>
 
130
<p>There is several examples of asynchronous communications coming in the archive. In addition to the fully documented example <a class="el" href="use.html#MSG_ex_asynchronous_communications">Asynchronous communications</a>, there is several other examples in the archive:</p>
 
131
<ul>
 
132
<li><b>msg/icomms/peer.c</b>: basic example of async functions (<a class="el" href="group__msg__task__usage.html#gaa280111a523d70bb36061e6e52ca1b42">MSG_task_isend</a>, <a class="el" href="group__msg__task__usage.html#gadb4623d587d75ad3b078928f0f1b27a5">MSG_task_irecv</a>, <a class="el" href="group__msg__task__usage.html#ga2ae956f1e7a1014652d85b5f8db42aa3">MSG_comm_wait</a>)</li>
128
133
</ul>
129
134
<ul>
130
135
<li><b>msg/icomms/peer2.c</b>: demonstrates the <a class="el" href="group__msg__task__usage.html#ga01ce9097c976b96664e6785f6ab5d4b6">MSG_comm_waitall</a> function</li>
132
137
<ul>
133
138
<li><b>msg/icomms/peer3.c</b>: demonstrates the <a class="el" href="group__msg__task__usage.html#ga62772e7b378bc485c114231af4b8f596">MSG_comm_waitany</a> function</li>
134
139
</ul>
135
 
<h2><a class="anchor" id="MSG_ex_tracing"></a>
136
 
Tracing and vizualization features</h2>
137
 
<ul>
138
 
<li><b>tracing/simple.c</b> very simple program where each process creates, executes and destroy a task. You might want to run this program with the following parameters: --cfg=tracing/uncategorized:1 (See <a class="el" href="tracing.html#tracing_tracing_options">Tracing configuration Options</a> for details)</li>
139
 
</ul>
140
 
<ul>
141
 
<li><b>tracing/ms.c</b> This is a master/slave program where the master creates tasks, send them to the slaves. For each task received, the slave executes it and then destroys it. This program uses several tracing functions that enable the tracing of categorized resource utilization, the use of trace marks, and user variables associated to the hosts of the platform file. You might want to run this program with the following parameters: --cfg=tracing/categorized:1 --cfg=tracing/uncategorized:1 --cfg=triva/categorized:triva_cat.plist --cfg=triva/uncategorized:triva_uncat.plist (See <a class="el" href="tracing.html#tracing_tracing_options">Tracing configuration Options</a> for details)</li>
142
 
</ul>
143
 
<ul>
144
 
<li><b>tracing/categories.c</b> This is a master/slave program where the master creates tasks, send them to the slaves. For each task received, the slave executes it and then destroys it. This program declares several tracing categories that are used to classify tasks. When the program is executed, the tracing mechanism registers the resource utilization of hosts and links according to these categories. You might want to run this program with the following parameters: --cfg=tracing:1 --cfg=tracing/categorized:1 --cfg=tracing/uncategorized:1 --cfg=triva/categorized:triva_cat.plist --cfg=triva/uncategorized:triva_uncat.plist (See <a class="el" href="tracing.html#tracing_tracing_options">Tracing configuration Options</a> for details)</li>
145
 
</ul>
146
 
<ul>
147
 
<li><b>tracing/procmig.c</b> This program shows a process migration. Tracing this program with the options below enables a gantt-chart visualization of where the process has been during its execution. Migrations are represented by arrows from the origin to the destination host. You might want to run this program with the following parameters: --cfg=tracing:1 --cfg=tracing/msg/process:1 (See <a class="el" href="tracing.html#tracing_tracing_options">Tracing configuration Options</a> for details)</li>
148
 
</ul>
149
 
<ul>
150
 
<li><b>tracing/trace_platform.c</b>: This program demonstrates how a platform file is traced to a Paje trace file format using the tracing mechanism of Simgrid. You might want to run this program with the following parameters: --cfg=tracing:1 --cfg=tracing/categorized:1 (See <a class="el" href="tracing.html#tracing_tracing_options">Tracing configuration Options</a> for details)</li>
151
 
</ul>
152
 
<ul>
153
 
<li><b>tracing/user_variables.c</b>: This program demonstrates how to trace user variables associated to the hosts of the platform file. You might want to run this program with the following parameters: --cfg=tracing:1 --cfg=tracing/platform:1 (See <a class="el" href="tracing.html#tracing_tracing_options">Tracing configuration Options</a> for details)</li>
154
 
</ul>
155
 
<ul>
156
 
<li><b>tracing/link_user_variables.c</b>: This program demonstrates how to trace user variables associated to the links of the platform file. You need to provide the name of the link to update the value of the variable associated to that link. You might want to run this program with the following parameters: --cfg=tracing:1 --cfg=tracing/platform:1 (See <a class="el" href="tracing.html#tracing_tracing_options">Tracing configuration Options</a> for details)</li>
157
 
</ul>
158
 
<ul>
159
 
<li><b>tracing/link_srcdst_user_variables.c</b>: This program demonstrates how to trace user variables associated to the links of the platform file. Instead of providing the name of the link to update one of its variable, this example shows how to provide two hosts as parameter (source and destination, use their names as defined in the platform file). The tracing mechanism will get the route between these two hosts, if there is one defined in the platform file, and update the variable of all the links of that route to the value provided. You might want to run this program with the following parameters: --cfg=tracing:1 --cfg=tracing/platform:1 (See <a class="el" href="tracing.html#tracing_tracing_options">Tracing configuration Options</a> for details)</li>
160
 
</ul>
161
 
<h2><a class="anchor" id="MSG_ex_models"></a>
162
 
Models-related examples</h2>
163
 
<h3><a class="anchor" id="MSG_ex_PLS"></a>
164
 
Packet level simulators</h3>
 
140
<h1><a class="anchor" id="MSG_ex_tracing"></a>
 
141
Tracing and vizualization features</h1>
 
142
<ul>
 
143
<li><b>tracing/simple.c</b> very simple program where each process creates, executes and destroy a task. You might want to run this program with the following parameters: &ndash;cfg=tracing/uncategorized:1 (See <a class="el" href="tracing.html#tracing_tracing_options">Tracing configuration Options</a> for details)</li>
 
144
</ul>
 
145
<ul>
 
146
<li><b>tracing/ms.c</b> This is a master/slave program where the master creates tasks, send them to the slaves. For each task received, the slave executes it and then destroys it. This program uses several tracing functions that enable the tracing of categorized resource utilization, the use of trace marks, and user variables associated to the hosts of the platform file. You might want to run this program with the following parameters: &ndash;cfg=tracing/categorized:1 &ndash;cfg=tracing/uncategorized:1 &ndash;cfg=viva/categorized:viva_cat.plist &ndash;cfg=viva/uncategorized:viva_uncat.plist (See <a class="el" href="tracing.html#tracing_tracing_options">Tracing configuration Options</a> for details)</li>
 
147
</ul>
 
148
<ul>
 
149
<li><b>tracing/categories.c</b> This is a master/slave program where the master creates tasks, send them to the slaves. For each task received, the slave executes it and then destroys it. This program declares several tracing categories that are used to classify tasks. When the program is executed, the tracing mechanism registers the resource utilization of hosts and links according to these categories. You might want to run this program with the following parameters: &ndash;cfg=tracing:1 &ndash;cfg=tracing/categorized:1 &ndash;cfg=tracing/uncategorized:1 &ndash;cfg=viva/categorized:viva_cat.plist &ndash;cfg=viva/uncategorized:viva_uncat.plist (See <a class="el" href="tracing.html#tracing_tracing_options">Tracing configuration Options</a> for details)</li>
 
150
</ul>
 
151
<ul>
 
152
<li><b>tracing/procmig.c</b> This program shows a process migration. Tracing this program with the options below enables a gantt-chart visualization of where the process has been during its execution. Migrations are represented by arrows from the origin to the destination host. You might want to run this program with the following parameters: &ndash;cfg=tracing:1 &ndash;cfg=tracing/msg/process:1 (See <a class="el" href="tracing.html#tracing_tracing_options">Tracing configuration Options</a> for details)</li>
 
153
</ul>
 
154
<ul>
 
155
<li><b>tracing/trace_platform.c</b>: This program demonstrates how a platform file is traced to a Paje trace file format using the tracing mechanism of Simgrid. You might want to run this program with the following parameters: &ndash;cfg=tracing:1 &ndash;cfg=tracing/categorized:1 (See <a class="el" href="tracing.html#tracing_tracing_options">Tracing configuration Options</a> for details)</li>
 
156
</ul>
 
157
<ul>
 
158
<li><b>tracing/user_variables.c</b>: This program demonstrates how to trace user variables associated to the hosts of the platform file. You might want to run this program with the following parameters: &ndash;cfg=tracing:1 &ndash;cfg=tracing/platform:1 (See <a class="el" href="tracing.html#tracing_tracing_options">Tracing configuration Options</a> for details)</li>
 
159
</ul>
 
160
<ul>
 
161
<li><b>tracing/link_user_variables.c</b>: This program demonstrates how to trace user variables associated to the links of the platform file. You need to provide the name of the link to update the value of the variable associated to that link. You might want to run this program with the following parameters: &ndash;cfg=tracing:1 &ndash;cfg=tracing/platform:1 (See <a class="el" href="tracing.html#tracing_tracing_options">Tracing configuration Options</a> for details)</li>
 
162
</ul>
 
163
<ul>
 
164
<li><b>tracing/link_srcdst_user_variables.c</b>: This program demonstrates how to trace user variables associated to the links of the platform file. Instead of providing the name of the link to update one of its variable, this example shows how to provide two hosts as parameter (source and destination, use their names as defined in the platform file). The tracing mechanism will get the route between these two hosts, if there is one defined in the platform file, and update the variable of all the links of that route to the value provided. You might want to run this program with the following parameters: &ndash;cfg=tracing:1 &ndash;cfg=tracing/platform:1 (See <a class="el" href="tracing.html#tracing_tracing_options">Tracing configuration Options</a> for details)</li>
 
165
</ul>
 
166
<h1><a class="anchor" id="MSG_ex_models"></a>
 
167
Models-related examples</h1>
 
168
<h2><a class="anchor" id="MSG_ex_PLS"></a>
 
169
Packet level simulators</h2>
165
170
<p>These examples demonstrate how to use the bindings to classical Packet-Level Simulators (PLS), as explained in <a class="el" href="pls.html">Packet level simulation</a>. The most interesting is probably not the C files since they are unchanged from the other simulations, but the associated files, such as the platform files to see how to declare a platform to be used with the PLS bindings of SimGrid and the tesh files to see how to actually start a simulation in these settings.</p>
166
171
<ul>
167
172
<li><b>ns3</b>: Simple ping-pong using ns3 instead of the SimGrid network models.</li>
169
174
<ul>
170
175
<li><b>gtnets</b> Simple ping-pong using GTNeTs instead of the SimGrid network models.</li>
171
176
</ul>
172
 
<h3><a class="anchor" id="MSG_ex_resources"></a>
173
 
Other resource kinds</h3>
 
177
<h2><a class="anchor" id="MSG_ex_resources"></a>
 
178
Other resource kinds</h2>
174
179
<p>This section contains some sparse examples of how to use the other kind of resources, such as disk or GPU. These resources are quite experimental for now, but here we go anyway.</p>
175
180
<ul>
176
181
<li><b>io/file.c</b> Example with the disk resource</li>
178
183
<ul>
179
184
<li><b>gpu/test_MSG_gpu_task_create.c</b> Example of use of the very experimental (for now) GPU resource.</li>
180
185
</ul>
181
 
<h2><a class="anchor" id="MSG_ex_actions"></a>
182
 
Trace driven simulations</h2>
 
186
<h1><a class="anchor" id="MSG_ex_actions"></a>
 
187
Trace driven simulations</h1>
183
188
<p>The <b>actions/actions.c</b> example demonstrates how to run trace-driven simulations. It 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>
184
 
<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">MSG_action_register</a> in your main, and then use <a class="el" href="group__msg__trace__driven.html#gafa55312e5f8e947c3311471643c5cc42">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. Check the tesh files in the example directory for details on how to do it.</p>
 
189
<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">xbt_replay_action_register</a> in your main, and then use <a class="el" href="group__msg__trace__driven.html#gaff3ae0c6d1fc712f2162cc199086731f">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. Check the tesh files in the example directory for details on how to do it.</p>
185
190
<p>This example uses this approach to replay MPI-like traces. It comes with a set of event handlers reproducing MPI events. This is somehow similar to SMPI, yet differently implemented. This code should probably be changed to use SMPI internals instead, but wasn't, so far.</p>
186
 
<h2><a class="anchor" id="MSG_ex_apps"></a>
187
 
Examples of full applications</h2>
 
191
<h1><a class="anchor" id="MSG_ex_apps"></a>
 
192
Examples of full applications</h1>
188
193
<ul>
189
194
<li><b>token_ring/ring_call.c</b>: Classical token ring communication, where a token is exchanged along a ring to reach every participant.</li>
190
195
</ul>
 
196
<h1><a class="anchor" id="MSG_ex_apps"></a>
 
197
Examples of full applications</h1>
 
198
<ul>
 
199
<li><b>token_ring/token_bypass.c</b>: Classical token ring with a bypass deployment. A token is exchanged along a ring to reach every participant.</li>
 
200
</ul>
191
201
<ul>
192
202
<li><b>pmm/msg_pmm.c</b>: Parallel Matrix Multiplication is a little application. This is something that most MPI developper have written during their class, here implemented using MSG instead of MPI.</li>
193
203
</ul>
194
204
<ul>
195
205
<li><b>chord/chord.c: Classical Chord P2P protocol</b> This example implements the well known Chord P2P protocol. Its main advantage is that it constitute a fully working non-trivial example. In addition, its implementation is rather efficient, as demonstrated in <a href="http://hal.inria.fr/inria-00602216/">http://hal.inria.fr/inria-00602216/</a> </li>
196
206
</ul>
 
207
</div><!-- contents -->
 
208
</div><!-- doc-content -->
 
209
<!-- start footer part -->
 
210
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
 
211
  <ul>
 
212
    <li class="footer">Generated on Wed Jan 30 2013 17:21:58 for SimGrid by
 
213
    <a href="http://www.doxygen.org/index.html">
 
214
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.1.2 </li>
 
215
  </ul>
197
216
</div>
198
 
<p>
199
 
<hr>
200
 
 
201
 
<table width=100%>
202
 
<tr>
203
 
<td align=left>
204
 
<a href="index.html"><b>
205
 
Back to the main Simgrid Documentation page</b></a>
206
 
</td>
207
 
<td align=middle>
208
 
<small>The version of <a href="http://simgrid.gforge.inria.fr">SimGrid</a> documented here is v3.7.1.<br/>
209
 
Documentation of other versions can be found in their respective
210
 
archive files (directory doc/html).
211
 
</td>
212
 
<td align=right>
213
 
<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>
214
 
</td>
215
 
</tr>
216
 
</table>
 
217
</body>
 
218
</html>