This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP][Tool] Add Archer option to disable data race analysis for sequential part
ClosedPublic

Authored by protze.joachim on Oct 30 2020, 8:58 AM.

Details

Summary

This introduces the new ARCHER_OPTIONS flag ignore_serial=0|1 to disable analysis and logging of memory accesses in the sequential part of the OpenMP application.

In the sequential part of an OpenMP program no data race is possible, unless there is non-OpenMP concurrency (such as pthreads, MPI, ...). For the latter reason, this is not active by default.

Besides reducing the runtime overhead for the sequential part of the program, this reduces the memory overhead for sequential initialization. In combination with flush_shadow=1 this can allow analysis of applications, which run close to the limit of available memory, but only access smaller parts of shared memory during each OpenMP parallel region.

The problem is that Archer only gets active, when the OpenMP runtime gets initialized, which might be after serial initialization of the application. In such case, it helps to call for example omp_get_max_threads() at the beginning of main.

Diff Detail

Event Timeline

protze.joachim created this revision.Oct 30 2020, 8:58 AM
protze.joachim requested review of this revision.Oct 30 2020, 8:58 AM

Can we somehow test this?

I added run lines to the tests with race, to verify that the races are still detected, if ignore_serial=1 .

jdoerfert accepted this revision.Nov 13 2020, 2:12 PM
This revision is now accepted and ready to land.Nov 13 2020, 2:12 PM