用OMPT追踪基于任务的应用程序

发布于 2025-01-18 23:49:00 字数 924 浏览 1 评论 0原文

我正在尝试使用OMPT跟踪基于任务的应用程序。

这些是我用来编译LLVM OpenMP运行时的编译选项:

cmake ../openmp -G "Unix Makefiles" -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release  -DOPENMP_ENABLE_LIBOMPTARGET=OFF -DLIBOMP_OMPT_OPTIONAL=ON

我使用的是Clang 13和官方GitHub Repo的最新LLVM OpenMP运行时。

My application is composed of several nested tasks using #pragma omp task depend (inout:some_vector[0:some_limit])

I registered several OMPT callbacks including ompt_callback_task_create, ompt_callback_dependencesompt_callback_task_schedule正常运行并给我想要的反馈。

但是,某些回调没有运行:ompt_callback_task_dependence(任务之间存在依赖关系...)和ompt_callback_work即使他们使用ompt_set_set_set_callback 返回代码5,对应于ompt_set_always

我该怎么做才能使这些回调工作?我在这里错过了什么吗?我还尝试使用不同的运行时间/编译器,没有任何结果。

任何帮助将不胜感激。

I am trying to use OMPT to trace a task-based application.

These are the compile options I used to compile the LLVM OpenMP runtime:

cmake ../openmp -G "Unix Makefiles" -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release  -DOPENMP_ENABLE_LIBOMPTARGET=OFF -DLIBOMP_OMPT_OPTIONAL=ON

I am using Clang 13 and the latest LLVM OpenMP runtime from the official github repo.

My application is composed of several nested tasks using #pragma omp task depend (inout:some_vector[0:some_limit])

I registered several OMPT callbacks including ompt_callback_task_create, ompt_callback_dependences, ompt_callback_task_schedule that are running properly and giving me the wanted feedback.

However, some callbacks are not being run: ompt_callback_task_dependence(while there is dependencies between tasks...) and ompt_callback_work even if their registering with ompt_set_callback returns code 5 which corresponds to ompt_set_always.

What should I do to get those callback to work? Am I missing on something here? I also tried using different runtimes/compilers without any result.

Any help would be highly appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

弃爱 2025-01-25 23:49:00

如果前任在继任者的创建之前完成,则可能不会提出ompt_callback_task_dependence事件。
看看用> 1线的最小示例波纹管。

生产者线程创建“ A”并睡1 s。
同时,另一个线程会消耗“ A”并完成它。
然后,1 s。后来,生产者线程醒来并创建“ B”。
由于“ A”完成了,因此无需根据它来制作“ B”。

# pragma omp task depend(out: x) // A
{}

sleep(1);

# pragma omp task depend(in: x) // B
{}

It is possible that an ompt_callback_task_dependence event is not raised if the predecessor completed before the successor' creation.
Take a look at the minimal example bellow with >1 thread.

The producer thread creates 'A' and sleeps for 1 s.
In parallel, another thread consumes 'A' and completes it.
Then, 1 s. later, the producer thread wakes up and creates 'B'.
Since 'A' completed, there is no need to make 'B' depending on it.

# pragma omp task depend(out: x) // A
{}

sleep(1);

# pragma omp task depend(in: x) // B
{}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文