This is an archive of the discontinued LLVM Phabricator instance.

Add implementation to two OMPT API routines
ClosedPublic

Authored by hbae on May 7 2019, 2:34 PM.

Diff Detail

Repository
rOMP OpenMP

Event Timeline

hbae created this revision.May 7 2019, 2:34 PM

The code looks good to me, thanks for fixing the implementation.

Would you consider to also add the test?
https://github.com/OpenMPToolsInterface/LLVM-openmp/commit/9fc7407aeb2568ddcd33b69772c48f47ca595f41

The test actually builds on this change:
https://github.com/OpenMPToolsInterface/LLVM-openmp/commit/ba99a76793babdbfdad34e04776e9eb35a7b14cd

If possible we should also have a test for ompt_finalize_tool.

I think, a test for ompt_finalize_tool could be something along:

#include <callback.h>
int main() {
#pragma omp parallel num_threads(2)
  {
  }
  printf("Before ompt_finalize_tool\n")
  ompt_finalize_tool();
  printf("After ompt_finalize_tool\n")
  return 0;
}

And then test, that all completion events (implicit task-end, thread-end ) are written between Before and After

hbae updated this revision to Diff 198707.May 8 2019, 12:04 PM

Added tests for the routines.

protze.joachim accepted this revision.May 9 2019, 9:27 AM

Great, thanks!
I like the approach with USE_PRIVATE_TOOL.

This revision is now accepted and ready to land.May 9 2019, 9:27 AM
This revision was automatically updated to reflect the committed changes.
steakhal added inline comments.
runtime/test/ompt/tasks/task_memory.c
102

This test seems to be flaky. Could you have a look on that why?
Here is my build-bot failure: http://lab.llvm.org:8011/builders/openmp-clang-x86_64-linux-debian/builds/13978/steps/test-openmp/logs/stdio

protze.joachim added inline comments.Sep 15 2020, 1:50 AM
runtime/test/ompt/tasks/task_memory.c
99

There is a chance, that the first task gets executed before the second task is created.
This line should also have CHECK-DAG.