Index: openmp/tools/archer/README.md
===================================================================
--- openmp/tools/archer/README.md
+++ openmp/tools/archer/README.md
@@ -104,7 +104,11 @@
flush_shadow |
0 |
-Flush shadow memory at the end of an outer OpenMP parallel region. Our experiments show that this can reduce memory overhead by ~30% and runtime overhead by ~10%. This flag is useful for large OpenMP applications that typically require large amounts of memory, causing out-of-memory exceptions when checked by Archer. |
+Flush shadow memory at the end of an outer OpenMP
+parallel region. Our experiments show that this can reduce memory overhead
+by ~30% and runtime overhead by ~10%. This flag is useful for large OpenMP
+applications that typically require large amounts of memory, causing
+out-of-memory exceptions when checked by Archer. |
@@ -118,6 +122,17 @@
+ignore_serial |
+0 |
+Turn off tracking and analysis of memory accesses in
+the sequential part of an OpenMP program. (Only effective when OpenMP
+runtime is initialized. In doubt, insert omp_get_max_threads() as first
+statement in main!) |
+
+
+
+
+
verbose |
0 |
Print startup information. |
Index: openmp/tools/archer/ompt-tsan.cpp
===================================================================
--- openmp/tools/archer/ompt-tsan.cpp
+++ openmp/tools/archer/ompt-tsan.cpp
@@ -43,18 +43,14 @@
class ArcherFlags {
public:
#if (LLVM_VERSION) >= 40
- int flush_shadow;
+ int flush_shadow{0};
#endif
- int print_max_rss;
- int verbose;
- int enabled;
+ int print_max_rss{0};
+ int verbose{0};
+ int enabled{1};
+ int ignore_serial{0};
- ArcherFlags(const char *env)
- :
-#if (LLVM_VERSION) >= 40
- flush_shadow(0),
-#endif
- print_max_rss(0), verbose(0), enabled(1) {
+ ArcherFlags(const char *env) {
if (env) {
std::vector tokens;
std::string token;
@@ -75,6 +71,8 @@
continue;
if (sscanf(it->c_str(), "enable=%d", &enabled))
continue;
+ if (sscanf(it->c_str(), "ignore_serial=%d", &ignore_serial))
+ continue;
std::cerr << "Illegal values for ARCHER_OPTIONS variable: " << token
<< std::endl;
}
@@ -505,12 +503,16 @@
parallel_data->ptr = Data;
TsanHappensBefore(Data->GetParallelPtr());
+ if (archer_flags->ignore_serial && ToTaskData(parent_task_data)->isInitial())
+ TsanIgnoreWritesEnd();
}
static void ompt_tsan_parallel_end(ompt_data_t *parallel_data,
ompt_data_t *task_data,
int flag,
const void *codeptr_ra) {
+ if (archer_flags->ignore_serial && ToTaskData(task_data)->isInitial())
+ TsanIgnoreWritesBegin();
ParallelData *Data = ToParallelData(parallel_data);
TsanHappensAfter(Data->GetBarrierPtr(0));
TsanHappensAfter(Data->GetBarrierPtr(1));
@@ -909,10 +911,14 @@
stderr,
"Warning: please export TSAN_OPTIONS='ignore_noninstrumented_modules=1' "
"to avoid false positive reports from the OpenMP runtime!\n");
+ if (archer_flags->ignore_serial)
+ TsanIgnoreWritesBegin();
return 1; // success
}
static void ompt_tsan_finalize(ompt_data_t *tool_data) {
+ if (archer_flags->ignore_serial)
+ TsanIgnoreWritesEnd();
if (archer_flags->print_max_rss) {
struct rusage end;
getrusage(RUSAGE_SELF, &end);