Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[doc] explain how to use TRACE_declare_mark and TRACE_mark
[simgrid.git] / doc / tracing.doc
index 407a0c4..d8b5692 100644 (file)
@@ -76,6 +76,20 @@ created with the function \c MSG_task_create. The second parameter
 \c category must contain a category that was previously defined by the function
 \c TRACE_category.
 
+\li <b>\c TRACE_declare_mark(const char *mark_type)</b>: This function
+declares a new Paje event type in the trace file that can be used by
+simulators to declare application-level marks. This function is
+independent of which API is used in SimGrid.
+
+\li <b>\c TRACE_mark(const char *mark_type, const char *mark_value)</b>:
+This function creates a mark in the trace file. The first parameter
+had to be previously declared using \c TRACE_declare_mark, the second
+is the identifier for this mark instance. We recommend that the \c
+mark_value (the second parameter) is a unique value for the whole
+trace file (the whole simulation). Nevertheless, this is not a strong
+requirement: the trace will be valid if there are multiple mark
+identifiers for the same trace.
+
 \li <b>\c TRACE_[host|link]_variable_declare (const char *variable)</b>:
 Declare a user variable that will be associated to host/link. A variable can
 be used to trace user variables such as the number of tasks in a server,
@@ -219,6 +233,40 @@ triva/uncategorized
 --cfg=triva/categorized:graph_uncategorized.plist
 \endverbatim
 
+\subsection tracing_tracing_example_parameters Case studies
+
+Some scenarios that might help you decide which tracing options
+you should use to analyze your simulator.
+
+\li I want to trace the resource utilization of all hosts
+and links of the platform, and my simulator <b>does not</b> use
+the tracing API. For that, you can run a uncategorized trace
+with the following parameters (it will work with <b>any</b> Simgrid
+simulator):
+\verbatim
+./your_simulator \
+          --cfg=tracing:1 \
+          --cfg=tracing/uncategorized:1 \
+          --cfg=tracing/filename:mytracefile.trace \
+          --cfg=triva/uncategorized:uncat.plist
+\endverbatim
+
+\li I want to trace only a subset of my MSG (or SimDAG) tasks.
+For that, you will need to create tracing categories using the
+<b>TRACE_category (...)</b> function (as explained above),
+and then classify your tasks to a previously declared category
+using the <b>TRACE_msg_set_task_category (...)</b>
+(or <b>TRACE_sd_set_task_category (...)</b> for SimDAG tasks). After
+recompiling, run your simulator with the following parameters:
+\verbatim
+./your_simulator \
+          --cfg=tracing:1 \
+          --cfg=tracing/categorized:1 \
+          --cfg=tracing/filename:mytracefile.trace \
+          --cfg=triva/categorized:cat.plist
+\endverbatim
+
+
 \subsection tracing_tracing_example Example of Instrumentation
 
 A simplified example using the tracing mandatory functions.