@@ -48,7 +48,7 @@ MPI_Send((void*) array, length, MPI_DOUBLE, ...)
4848
4949MUST and TypeART also handle MPI [derived datatypes](https://www.mpi-forum.org/docs/mpi-3.1/mpi31-report/node77.htm)
5050with complex underlying data structures, see our [MPI Demo](#13-example-mpi-demo). For more details, see
51- our [publications](#references), or download the current release (1.8 or higher) of MUST on
51+ our [publications](#references), or download the current release of MUST (1.8 or higher has TypeART integrated) on
5252its [project page](https://itc.rwth-aachen.de/must/).
5353
5454## Table of Contents
@@ -85,6 +85,9 @@ around Clang and MPI to apply TypeART in the `bin` folder of the TypeART install
8585instrument heap, stack and global allocations. The MPI-wrappers also filter allocations that are not passed to an MPI
8686call, see [Section 1.1.4](#114-filtering-allocations).
8787
88+ *Note*: Currently, the compilation process has to be serialied, e.g., `make -j 1`, due to extraction and consistency of
89+ type information per translation unit.
90+
8891#### 1.1.1 Building with TypeART
8992
9093A typical compile invocation may first compile code to object files and then link with any libraries:
@@ -131,6 +134,20 @@ $> TYPEART_WRAPPER=OFF cmake -B build -DCMAKE_C_COMPILER=*TypeART bin*/typeart-c
131134$> cmake --build build --target install
132135```
133136
137+ ##### MPI wrapper generation
138+
139+ For MPI, we rely on detecting the vendor to generate wrappers with appropriate environment variables to force the use of
140+ the Clang/LLVM compiler.
141+ We support detection for OpenMPI, Intel MPI and MPICH based on ` mpi.h ` symbols, and use the following flags for setting
142+ the Clang
143+ compiler:
144+
145+ | Vendor | Symbol | C compiler env. var | C++ compiler env. var |
146+ | -----------| ---------------| ----------------------| ------------------------|
147+ | Open MPI | OPEN_MPI | OMPI_CC | OMPI_CXX |
148+ | Intel MPI | I_MPI_VERSION | I_MPI_CC | I_MPI_CXX |
149+ | MPICH | MPICH_NAME | MPICH_CC | MPICH_CXX |
150+
134151##### Internal wrapper invocation
135152
136153For reference, the wrapper script executes the following (pseudo):
@@ -146,17 +163,18 @@ $> clang++ $(LINK_FLAGS) -L$(TYPEART_LIBPATH) -ltypeartRuntime code.o -o binary
146163
147164For modification of the pass behavior, we provide several options.
148165<!-- - @formatter:off --->
149- | Flag | Default | Description |
150- | -----------------------------| :------------:| --------------------------------------------------------------------------------------------|
151- | ` typeart ` | - | Invoke TypeART pass through LLVM ` opt ` |
152- | ` typeart-types ` | ` types.yaml ` | Serialized type layout information of user-defined types |
153- | ` typeart-heap ` | ` true ` | Instrument heap allocations |
154- | ` typeart-stack ` | ` false ` | Instrument stack and global allocations. Enables instrumentation of global allocations. |
155- | ` typeart-global ` | ` false ` | Instrument global allocations (see --typeart-stack). |
156- | ` typeart-stats ` | ` false ` | Show instrumentation statistic counters |
157- | ` typeart-call-filter ` | ` false ` | Filter stack and global allocations. See also [ Section 1.1.4] ( #114-filtering-allocations ) |
158- | ` typeart-call-filter-str ` | ` *MPI_* ` | Filter string target (glob string) |
159- | ` typeart-filter-pointer-alloca ` | ` true ` | Filter stack alloca of pointers (typically generated by LLVM for references of stack vars) |
166+ | Flag | Default | Description |
167+ | -----------------------------| :------------:| ----------------------------------------------------------------------------------------------------------------------------------------------------|
168+ | ` typeart ` | - | Invoke TypeART pass through LLVM ` opt ` |
169+ | ` typeart-types ` | ` types.yaml ` | Serialized type layout information of user-defined types. File location and name can also be controlled with the env variable ` TYPEART_TYPE_FILE ` . |
170+ | ` typeart-heap ` | ` true ` | Instrument heap allocations |
171+ | ` typeart-stack ` | ` false ` | Instrument stack and global allocations. Enables instrumentation of global allocations. |
172+ | ` typeart-global ` | ` false ` | Instrument global allocations (see --typeart-stack). |
173+ | ` typeart-stats ` | ` false ` | Show instrumentation statistic counters |
174+ | ` typeart-call-filter ` | ` false ` | Filter stack and global allocations. See also [ Section 1.1.4] ( #114-filtering-allocations ) |
175+ | ` typeart-call-filter-str ` | ` *MPI_* ` | Filter string target (glob string) |
176+ | ` typeart-filter-pointer-alloca ` | ` true ` | Filter stack alloca of pointers (typically generated by LLVM for references of stack vars) |
177+
160178<!-- - @formatter:on --->
161179
162180##### Example invocations
@@ -333,12 +351,12 @@ $> cmake --build build --target install --parallel
333351
334352< ! --- @formatter:off --->
335353
336- | Option | Default | Description |
337- | ------------------------| :-------:| --------------------------------------------------------------------------------------------------------------------------------------- |
338- | ` TYPEART_PHMAP ` | ` ON` | Enable usage of a [ btree-backed map](https://github.com/greg7mdp/parallel-hashmap) instead of ` std::map ` for storing allocation data. |
339- | ` TYPEART_ABSEIL ` | ` OFF` | Enable usage of btree-backed map of the [Abseil project ](https://abseil.io/ ) (alternative to TYPEART_PHMAP). |
340- | ` TYPEART_SOFTCOUNTERS` | ` OFF` | Enable runtime tracking of # tracked addrs. / #distinct checks / etc. |
341- | ` TYPEART_LOG_LEVEL_RT` | ` 0` | Granularity of runtime logger. 3 is most verbose, 0 is least. |
354+ | Option | Default | Description |
355+ | ------------------------| :-------:| -------------------------------------------------------------------------------------------------------------------------|
356+ | ` TYPEART_ABSEIL ` | ` ON` | Enable usage of btree-backed map of the [Abseil project ](https://abseil.io/) (LTS release) for storing allocation data. |
357+ | ` TYPEART_PHMAP ` | ` OFF` | Enable usage of a [ btree-backed map](https://github.com/greg7mdp/parallel-hashmap ) (alternative to Abseil). |
358+ | ` TYPEART_SOFTCOUNTERS` | ` OFF` | Enable runtime tracking of # tracked addrs. / #distinct checks / etc. |
359+ | ` TYPEART_LOG_LEVEL_RT` | ` 0` | Granularity of runtime logger. 3 is most verbose, 0 is least. |
342360
343361< ! --- @formatter:on --->
344362
@@ -372,11 +390,11 @@ Default mode is to protect the global data structure with a (shared) mutex. Two
372390
373391< ! --- @formatter:off --->
374392
375- | Option | Default | Description |
376- | --- | :---: | --- |
377- | ` TYPEART_TEST_CONFIG` | ` OFF` | Set (force) logging levels to appropriate levels for test runner to succeed |
378- | ` TYPEART_CODE_COVERAGE` | ` OFF` | Enable code coverage statistics using LCOV 1.14 and genhtml (gcovr optional) |
379- | ` TYPEART_LLVM_CODE_COVERAGE` | ` OFF` | Enable llvm-cov code coverage statistics (llvm-cov and llvm-profdata required) |
393+ | Option | Default | Description |
394+ | --- | :---: | -------------------------------------------------------------------------------------------------------------- |
395+ | ` TYPEART_TEST_CONFIG` | ` OFF` | Enable testing, and set (force) logging levels to appropriate levels for test runner to succeed |
396+ | ` TYPEART_CODE_COVERAGE` | ` OFF` | Enable code coverage statistics using LCOV 1.14 and genhtml (gcovr optional) |
397+ | ` TYPEART_LLVM_CODE_COVERAGE` | ` OFF` | Enable llvm-cov code coverage statistics (llvm-cov and llvm-profdata required) |
380398| ` TYPEART_ASAN, TSAN, UBSAN` | ` OFF` | Enable Clang sanitizers (tsan is mutually exclusive w.r.t. ubsan and asan as they don' t play well together) |
381399
382400<!--- @formatter:on --->
0 commit comments