This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Implement printing TDGs to dot files
ClosedPublic

Authored by Munesanz on May 19 2023, 6:39 AM.

Details

Summary

This patch implements the "__kmp_print_tdg_dot" function, that prints a task dependency graph into a dot file containing the tasks and their dependencies.

It is activated through a new environment variable "KMP_TDG_DOT"

Diff Detail

Event Timeline

Munesanz created this revision.May 19 2023, 6:39 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 19 2023, 6:39 AM
Munesanz requested review of this revision.May 19 2023, 6:39 AM
josemonsalve2 added inline comments.May 19 2023, 6:49 AM
openmp/runtime/src/kmp_tasking.cpp
5482–5483

Just a suggestion.

I think OMP_ prefix is reserved for environment variables defined by the spec, no? Or is this being added to the spec?

I think OMP_ prefix is reserved for environment variables defined by the spec, no? Or is this being added to the spec?

This is a good point. This was introduced in a previous patch. We can consider renaming. What do you think @jdoerfert @tianshilei1992? OMPX_ or LIBOMP_?

Munesanz updated this revision to Diff 523808.May 19 2023, 9:02 AM
Munesanz edited the summary of this revision. (Show Details)

Rename "OMP_TDG_DOT" to "KMP_TDG_DOT" and refactor printing.

Yeah, KMP is good.

tianshilei1992 accepted this revision.EditedMay 25 2023, 7:10 AM

LG but you might want to get a test case.

This revision is now accepted and ready to land.May 25 2023, 7:10 AM

@Munesanz once you add that test case, I will land it.

Munesanz updated this revision to Diff 526428.May 29 2023, 5:10 AM
Munesanz marked an inline comment as done.
Munesanz edited the summary of this revision. (Show Details)

Added test

tianshilei1992 added inline comments.May 29 2023, 5:14 AM
openmp/runtime/test/tasking/omp_record_replay_print_dot.cpp
74

it might be better to use FileCheck here.