Skip to content

Commit

Permalink
Improve trace doc
Browse files Browse the repository at this point in the history
  • Loading branch information
philippemilink authored and oaumage committed Oct 24, 2024
1 parent cd585b2 commit 37686b0
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,8 @@ starpu_task_insert()
\li <b>Iteration</b>: refers to the iteration number of the computation, as set by starpu_iteration_push() at the beginning of submission loops and starpu_iteration_pop() at the end of submission loops
\li <b>JobId</b>: represents a unique identifier for the specific task, as returned by starpu_task_get_job_id()
\li <b>NumaNodes</b>: refers to the NUMA node where the data is stored, the environment variable \ref STARPU_FXT_EVENTS needs to contain \c TASK_VERBOSE_EXTRA, otherwise it will be -1
\li <b>Params</b>: represents parameters or input/output types and sizes, possibly indicating the dimensions of the matrices
\li <b>Size</b>: represents the size of the data being operated on in bytes
\li <b>Params</b>: represents parameters or input/output types and sizes, possibly indicating the dimensions of the matrices, depending on how the function starpu_data_interface_ops::describe of the datatype is implemented
\li <b>Size</b>: represents the size of the data being operated on in bytes, computed as the sum of the data sizes of each data handle manipulated by the task
\li <b>Subiteration</b>: represents a sub-iteration number if the computation was part of a larger iteration or loop, as set by starpu_iteration_push()
\li <b>SubmitOrder</b>: represents the order in which the task was submitted by
the application
Expand Down Expand Up @@ -400,6 +400,23 @@ It is possible to get a graphical output of the graph by using the
$ dot -Tpdf dag.dot -o output.pdf
\endverbatim


or visualize it directly with a program like <c>xdot</c>:

\verbatim
$ xdot dag.dot
\endverbatim

In the task graph, the color of each node is computed as follows:
<ol>
<li>If the codelet defined a color (see \ref starpu_codelet::color), this color is used;</li>
<li>If the option <c>-c</c> of <c>starpu_fxt_tool</c> was set, all tasks having the same name will have the same color;</li>
<li>Otherwise, the color will represent on which worker the task was executed (green for CPUs and yellow to red for accelerators.</li>
</ol>

Moreover, the option <c>-no-acquire</c> of <c>starpu_fxt_tool</c> hides StarPU internal tasks for data acquisition from the graph. On the contrary, the option <c>-internal</c> shows more internal tasks.


\subsection TraceTaskDetails Getting Task Details

Another generated trace file gives details on the executed tasks. The
Expand Down
63 changes: 33 additions & 30 deletions src/debug/traces/starpu_fxt.c
Original file line number Diff line number Diff line change
Expand Up @@ -3052,41 +3052,44 @@ static void handle_task_name(struct fxt_ev_64 *ev, struct starpu_fxt_options *op
struct task_info *task = get_task(job_id, options->file_rank);
int worker = find_worker_id(prefixTOnodeid(prefix), ev->param[1]);

const char *color;
char buffer[32];
int code;
if (task->color != 0)
{
snprintf(buffer, sizeof(buffer), "#%06x", task->color);
color = &buffer[0];
code = ((task->color & 0xff) +
((task->color >> 8) & 0xff) +
((task->color >> 16) & 0xff)) / 256;
}
else if (options->per_task_colour)
{
unsigned red = get_color_symbol_red(name)/4;
unsigned green = get_color_symbol_green(name)/4;
unsigned blue = get_color_symbol_blue(name)/4;
snprintf(buffer, sizeof(buffer), "#%s%x%s%x%s%x",
red < 16 ? "0" : "", red,
green < 16 ? "0" : "", green,
blue < 16 ? "0" : "", blue);
color = &buffer[0];
code = (red + green + blue) / 256;
}
else
{
color= (worker < 0)?"#aaaaaa":get_worker_color(worker);
code = 0;
}

if (!task->name)
task->name = strdup(name);

char *fontcolor = code <= 1 ? "white" : "black";
if (!task->exclude_from_dag && show_task(task, options))
{
const char *color;
char buffer[32];
int code;
if (task->color != 0)
{
snprintf(buffer, sizeof(buffer), "#%06x", task->color);
color = &buffer[0];
code = ((task->color & 0xff) +
((task->color >> 8) & 0xff) +
((task->color >> 16) & 0xff)) / 256;
}
else if (options->per_task_colour)
{
unsigned red = get_color_symbol_red(name)/4;
unsigned green = get_color_symbol_green(name)/4;
unsigned blue = get_color_symbol_blue(name)/4;
snprintf(buffer, sizeof(buffer), "#%s%x%s%x%s%x",
red < 16 ? "0" : "", red,
green < 16 ? "0" : "", green,
blue < 16 ? "0" : "", blue);
color = &buffer[0];
code = (red + green + blue) / 256;
}
else
{
color= (worker < 0)?"#aaaaaa":get_worker_color(worker);
code = 0;
}


char *fontcolor = code <= 1 ? "white" : "black";
_starpu_fxt_dag_set_task_name(options->file_prefix, job_id, task->name, color, fontcolor);
}
}

#ifdef STARPU_RECURSIVE_TASKS
Expand Down

0 comments on commit 37686b0

Please sign in to comment.