├── extern └── src │ └── llvm-instrumentation │ ├── test │ ├── 001.filt │ ├── 003.filt │ ├── callsite.cfg │ ├── 002.cpp │ ├── lit.cfg │ ├── 004.cfg │ ├── 001.cpp │ ├── 004.cpp │ ├── 003.cpp │ ├── callsite.cpp │ └── callsite_exception.cpp │ ├── README.md │ ├── cmake │ ├── Config.cmake.in │ └── ToolchainOptions.cmake │ ├── .clang-tidy │ ├── CMakeLists.txt │ ├── lib │ └── CMakeLists.txt │ ├── .gitignore │ └── .clang-format ├── test ├── integration │ ├── Kripke │ │ ├── functors │ │ │ ├── .gitignore │ │ │ ├── clean_kripke_ct.py │ │ │ ├── no_instr_kripke_ct.py │ │ │ ├── kripke_ct.py │ │ │ ├── runner_kripke_ct.py │ │ │ └── analyze_kripke_ct.py │ │ ├── .gitignore │ │ ├── cxx-wrapper.sh │ │ ├── parameters.json │ │ ├── kripke_config.json │ │ ├── expected_instrumentation.json │ │ └── run.sh │ ├── Kripke_Slurm │ │ ├── functors │ │ │ ├── .gitignore │ │ │ ├── clean_kripke_ct.py │ │ │ ├── no_instr_kripke_ct.py │ │ │ ├── kripke_ct.py │ │ │ ├── runner_kripke_ct.py │ │ │ └── analyze_kripke_ct.py │ │ ├── .gitignore │ │ ├── cxx-wrapper.sh │ │ ├── parameters.json │ │ ├── kripke_config.json │ │ ├── batchsystem.json │ │ ├── expected_instrumentation.json │ │ └── run.sh │ ├── LULESH │ │ ├── .gitignore │ │ ├── functors │ │ │ ├── clean_lulesh_ct.py │ │ │ ├── no_instr_lulesh_ct.py │ │ │ ├── runner_lulesh_ct.py │ │ │ ├── analyze_lulesh_ct.py │ │ │ └── lulesh_ct.py │ │ ├── parameters.json │ │ ├── lulesh_config.json │ │ └── run.sh │ ├── LULESH_Slurm │ │ ├── .gitignore │ │ ├── functors │ │ │ ├── clean_lulesh_ct.py │ │ │ ├── no_instr_lulesh_ct.py │ │ │ ├── runner_lulesh_ct.py │ │ │ ├── analyze_lulesh_ct.py │ │ │ └── lulesh_ct.py │ │ ├── parameters.json │ │ ├── lulesh_config.json │ │ ├── batchsystem.json │ │ ├── run.sh │ │ └── expected_instrumentation.json │ ├── LoadImbalance │ │ ├── .gitignore │ │ ├── imbalance │ │ │ ├── .gitignore │ │ │ ├── compile.sh │ │ │ ├── util.h │ │ │ ├── README.md │ │ │ ├── util.c │ │ │ ├── lib.h │ │ │ ├── Makefile │ │ │ ├── main.c │ │ │ └── lib.c │ │ ├── functors │ │ │ ├── clean_imbalance_ct.py │ │ │ ├── no_instr_imbalance_ct.py │ │ │ ├── imbalance_ct.py │ │ │ ├── analyze_imbalance_ct.py │ │ │ └── runner_imbalance_ct.py │ │ ├── parameters.json │ │ ├── imbalance_config.json │ │ ├── expected_instrumentation.json │ │ └── run.sh │ ├── LoadImbalance_Slurm │ │ ├── .gitignore │ │ ├── imbalance │ │ │ ├── .gitignore │ │ │ ├── compile.sh │ │ │ ├── util.h │ │ │ ├── README.md │ │ │ ├── util.c │ │ │ ├── lib.h │ │ │ ├── Makefile │ │ │ ├── main.c │ │ │ └── lib.c │ │ ├── functors │ │ │ ├── clean_imbalance_ct.py │ │ │ ├── no_instr_imbalance_ct.py │ │ │ ├── imbalance_ct.py │ │ │ ├── analyze_imbalance_ct.py │ │ │ └── runner_imbalance_ct.py │ │ ├── parameters.json │ │ ├── imbalance_config.json │ │ ├── expected_instrumentation.json │ │ ├── batchsystem.json │ │ └── run.sh │ ├── AMG2013 │ │ ├── parameters.json │ │ ├── functors │ │ │ ├── analyze_amg_ct_mpi.py │ │ │ ├── clean_amg_ct_mpi.py │ │ │ ├── no_instr_amg_ct_mpi.py │ │ │ ├── amg_ct_mpi.py │ │ │ └── runner_amg_ct_mpi.py │ │ ├── expected_instrumentation.json │ │ ├── amg_config.json │ │ └── run.sh │ ├── AMG2013_Slurm │ │ ├── parameters.json │ │ ├── functors │ │ │ ├── analyze_amg_ct_mpi.py │ │ │ ├── clean_amg_ct_mpi.py │ │ │ ├── no_instr_amg_ct_mpi.py │ │ │ ├── amg_ct_mpi.py │ │ │ └── runner_amg_ct_mpi.py │ │ ├── expected_instrumentation.json │ │ ├── amg_config.json │ │ ├── batchsystem.json │ │ └── run.sh │ ├── GameOfLife │ │ ├── parameters.json │ │ ├── functors │ │ │ ├── clean_gol_ct.py │ │ │ ├── no_instr_gol_ct.py │ │ │ ├── runner_gol_ct.py │ │ │ ├── gol_ct.py │ │ │ └── analyze_gol_ct.py │ │ ├── expected_instrumentation.json │ │ ├── gol_config.json │ │ └── run.sh │ ├── GameOfLife_Slurm │ │ ├── parameters.json │ │ ├── functors │ │ │ ├── clean_gol_ct.py │ │ │ ├── no_instr_gol_ct.py │ │ │ ├── runner_gol_ct.py │ │ │ ├── gol_ct.py │ │ │ └── analyze_gol_ct.py │ │ ├── expected_instrumentation.json │ │ ├── gol_config.json │ │ ├── batchsystem.json │ │ └── run.sh │ ├── GameOfLife_heuristic │ │ ├── parameters.json │ │ ├── functors │ │ │ ├── clean_gol_ct.py │ │ │ ├── no_instr_gol_ct.py │ │ │ ├── runner_gol_ct.py │ │ │ ├── gol_ct.py │ │ │ └── analyze_gol_ct.py │ │ ├── expected_instrumentation.json │ │ ├── gol_config.json │ │ └── run.sh │ ├── GameOfLife_heuristic_Slurm │ │ ├── parameters.json │ │ ├── functors │ │ │ ├── clean_gol_ct.py │ │ │ ├── no_instr_gol_ct.py │ │ │ ├── runner_gol_ct.py │ │ │ ├── gol_ct.py │ │ │ └── analyze_gol_ct.py │ │ ├── expected_instrumentation.json │ │ ├── gol_config.json │ │ ├── batchsystem.json │ │ └── run.sh │ ├── GameOfLife_hybrid_filter │ │ ├── parameters.json │ │ ├── functors │ │ │ ├── clean_gol_ct.py │ │ │ ├── no_instr_gol_ct.py │ │ │ ├── runner_gol_ct.py │ │ │ ├── gol_ct.py │ │ │ └── analyze_gol_ct.py │ │ ├── gol_config.json │ │ ├── expected_instrumentation.json │ │ └── run.sh │ ├── GameOfLife_hybrid_filter_Slurm │ │ ├── parameters.json │ │ ├── functors │ │ │ ├── clean_gol_ct.py │ │ │ ├── no_instr_gol_ct.py │ │ │ ├── runner_gol_ct.py │ │ │ ├── gol_ct.py │ │ │ └── analyze_gol_ct.py │ │ ├── gol_config.json │ │ ├── expected_instrumentation.json │ │ ├── batchsystem.json │ │ └── run.sh │ ├── GameOfLifePiraVersion1 │ │ ├── functors │ │ │ ├── clean_gol_ct.py │ │ │ ├── no_instr_gol_ct.py │ │ │ ├── runner_gol_ct.py │ │ │ ├── gol_ct.py │ │ │ └── analyze_gol_ct.py │ │ ├── gol_config.json │ │ ├── expected_instrumentation.json │ │ └── run.sh │ ├── GameOfLifePiraVersion1_Slurm │ │ ├── functors │ │ │ ├── clean_gol_ct.py │ │ │ ├── no_instr_gol_ct.py │ │ │ ├── runner_gol_ct.py │ │ │ ├── gol_ct.py │ │ │ └── analyze_gol_ct.py │ │ ├── gol_config.json │ │ ├── expected_instrumentation.json │ │ ├── batchsystem.json │ │ └── run.sh │ └── prepare_environment.sh ├── inputs │ ├── configs │ │ ├── batchsystem_config_004.json │ │ ├── batchsystem_config_005.json │ │ ├── batchsystem_config_003.json │ │ ├── batchsystem_config_002.json │ │ ├── basic_config_005.json │ │ ├── basic_config_003.json │ │ ├── basic_config_002.json │ │ ├── basic_config_004.json │ │ ├── basic_config_001.json │ │ ├── basic_config_006.json │ │ ├── batchsystem_config_007.json │ │ ├── batchsystem_config_006.json │ │ └── batchsystem_config_001.json │ └── functors │ │ ├── test_item_ct.py │ │ ├── clean_test_item_ct.py │ │ ├── runner_test_item_ct.py │ │ ├── no_instr_test_item_ct.py │ │ └── analyze_test_item_ct.py ├── unit │ ├── input │ │ ├── unit_input_003.json │ │ ├── unit_input_002.json │ │ ├── unit_input_001.json │ │ └── unit_input_004.json │ ├── TimeTrackTest.py │ ├── ProfileSinkTest.py │ ├── DatabaseTest.py │ ├── BatchSystemTimerTest.py │ ├── ExporterTest.py │ └── BuilderTest.py └── README.md ├── .style.yapf ├── run-json-format.sh ├── lib ├── Exception.py ├── TimeTracking.py ├── db.py ├── BatchSystemTimer.py ├── DefaultFlags.py ├── tables.py └── Exporter.py ├── CITATION.cff ├── AUTHORS ├── run-python-lint.sh ├── run_tests.sh ├── run-shell-lint.sh ├── docker └── Dockerfile ├── LICENSE.txt ├── resources ├── setup_paths.sh └── remove_builds.sh └── .gitignore /extern/src/llvm-instrumentation/test/001.filt: -------------------------------------------------------------------------------- 1 | _Z3foov 2 | -------------------------------------------------------------------------------- /extern/src/llvm-instrumentation/test/003.filt: -------------------------------------------------------------------------------- 1 | _Z3foov 2 | -------------------------------------------------------------------------------- /test/integration/Kripke/functors/.gitignore: -------------------------------------------------------------------------------- 1 | __pycache__/ -------------------------------------------------------------------------------- /test/integration/Kripke_Slurm/functors/.gitignore: -------------------------------------------------------------------------------- 1 | __pycache__/ -------------------------------------------------------------------------------- /test/integration/LULESH/.gitignore: -------------------------------------------------------------------------------- 1 | LULESH/ 2 | *.tp 3 | *__pycache__ -------------------------------------------------------------------------------- /test/integration/LULESH_Slurm/.gitignore: -------------------------------------------------------------------------------- 1 | LULESH/ 2 | *.tp 3 | *__pycache__ -------------------------------------------------------------------------------- /test/integration/LoadImbalance/.gitignore: -------------------------------------------------------------------------------- 1 | main.ipcg 2 | compile_commands.json 3 | -------------------------------------------------------------------------------- /test/integration/Kripke/.gitignore: -------------------------------------------------------------------------------- 1 | Kripke/ 2 | *.tp 3 | *__pycache__ 4 | _pira.sqlite -------------------------------------------------------------------------------- /test/integration/LoadImbalance/imbalance/.gitignore: -------------------------------------------------------------------------------- 1 | *.out 2 | *.o 3 | *.a 4 | *.ipcg 5 | -------------------------------------------------------------------------------- /test/integration/LoadImbalance_Slurm/.gitignore: -------------------------------------------------------------------------------- 1 | main.ipcg 2 | compile_commands.json 3 | -------------------------------------------------------------------------------- /.style.yapf: -------------------------------------------------------------------------------- 1 | [style] 2 | based_on_style = pep8 3 | column_limit = 100 4 | indent_width = 2 5 | -------------------------------------------------------------------------------- /test/integration/Kripke_Slurm/.gitignore: -------------------------------------------------------------------------------- 1 | Kripke/ 2 | *.tp 3 | *__pycache__ 4 | _pira.sqlite -------------------------------------------------------------------------------- /test/integration/LoadImbalance/imbalance/compile.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | make CC="OMPI_CC=clang mpicc" -------------------------------------------------------------------------------- /test/integration/LoadImbalance_Slurm/imbalance/.gitignore: -------------------------------------------------------------------------------- 1 | *.out 2 | *.o 3 | *.a 4 | *.ipcg 5 | -------------------------------------------------------------------------------- /run-json-format.sh: -------------------------------------------------------------------------------- 1 | find . -iname "*.json" -exec python -m json.tool --sort-keys --indent 2 {} {} \; 2 | -------------------------------------------------------------------------------- /test/integration/LoadImbalance_Slurm/imbalance/compile.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | make CC="OMPI_CC=clang mpicc" -------------------------------------------------------------------------------- /extern/src/llvm-instrumentation/README.md: -------------------------------------------------------------------------------- 1 | # llvm-instrumentation 2 | 3 | LLVM Plugin for function-level filtered instrumentation. -------------------------------------------------------------------------------- /test/inputs/configs/batchsystem_config_004.json: -------------------------------------------------------------------------------- 1 | { 2 | "batch-settings": 3 | { 4 | "time": "00:10:00", 5 | "ntasks": 1 6 | } 7 | } -------------------------------------------------------------------------------- /test/inputs/configs/batchsystem_config_005.json: -------------------------------------------------------------------------------- 1 | { 2 | "batch-settings": 3 | { 4 | "mem-per-cpu": 3800, 5 | "ntasks": 1 6 | } 7 | } -------------------------------------------------------------------------------- /extern/src/llvm-instrumentation/test/callsite.cfg: -------------------------------------------------------------------------------- 1 | SCOREP_REGION_NAMES_BEGIN 2 | INCLUDE c MANGLED _Z1cv -> a MANGLED _Z1av 3 | SCOREP_REGION_NAMES_END 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /test/inputs/configs/batchsystem_config_003.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": null, 3 | "batch-settings": 4 | { 5 | "time": "00:10:00", 6 | "mem-per-cpu": 3800 7 | } 8 | } -------------------------------------------------------------------------------- /test/integration/LoadImbalance/imbalance/util.h: -------------------------------------------------------------------------------- 1 | #ifndef UTIL_H 2 | #define UTIL_H 3 | 4 | typedef void (*Fn) (); 5 | 6 | void get_func_ptr(void (**func)(), int i); 7 | 8 | #endif -------------------------------------------------------------------------------- /test/integration/LoadImbalance_Slurm/imbalance/util.h: -------------------------------------------------------------------------------- 1 | #ifndef UTIL_H 2 | #define UTIL_H 3 | 4 | typedef void (*Fn) (); 5 | 6 | void get_func_ptr(void (**func)(), int i); 7 | 8 | #endif -------------------------------------------------------------------------------- /extern/src/llvm-instrumentation/cmake/Config.cmake.in: -------------------------------------------------------------------------------- 1 | 2 | @PACKAGE_INIT@ 3 | 4 | include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake") 5 | check_required_components("@PROJECT_NAME@") 6 | -------------------------------------------------------------------------------- /test/integration/AMG2013/parameters.json: -------------------------------------------------------------------------------- 1 | { 2 | "Modeling": { 3 | "extrapolationThreshold": 2.1, 4 | "modelAggregationStrategy": "Maximum", 5 | "statementThreshold": 200 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /test/integration/AMG2013_Slurm/parameters.json: -------------------------------------------------------------------------------- 1 | { 2 | "Modeling": { 3 | "extrapolationThreshold": 2.1, 4 | "modelAggregationStrategy": "Maximum", 5 | "statementThreshold": 200 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /test/integration/GameOfLife/parameters.json: -------------------------------------------------------------------------------- 1 | { 2 | "Modeling": { 3 | "extrapolationThreshold": 2.1, 4 | "modelAggregationStrategy": "FirstModel", 5 | "statementThreshold": 200 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /test/integration/GameOfLife_Slurm/parameters.json: -------------------------------------------------------------------------------- 1 | { 2 | "Modeling": { 3 | "extrapolationThreshold": 2.1, 4 | "modelAggregationStrategy": "FirstModel", 5 | "statementThreshold": 200 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /test/integration/GameOfLife_heuristic/parameters.json: -------------------------------------------------------------------------------- 1 | { 2 | "Modeling": { 3 | "extrapolationThreshold": 2.1, 4 | "modelAggregationStrategy": "FirstModel", 5 | "statementThreshold": 200 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /test/integration/Kripke/cxx-wrapper.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | if [[ -z "${CXX_WRAP}" ]]; then 3 | >&2 echo "Error: CXX_WRAP environment variable not set!" 4 | exit 255 5 | else 6 | exec ${CXX_WRAP} "${@}" 7 | fi 8 | -------------------------------------------------------------------------------- /test/integration/GameOfLife_heuristic_Slurm/parameters.json: -------------------------------------------------------------------------------- 1 | { 2 | "Modeling": { 3 | "extrapolationThreshold": 2.1, 4 | "modelAggregationStrategy": "FirstModel", 5 | "statementThreshold": 200 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /test/integration/GameOfLife_hybrid_filter/parameters.json: -------------------------------------------------------------------------------- 1 | { 2 | "Modeling": { 3 | "extrapolationThreshold": 2.1, 4 | "modelAggregationStrategy": "FirstModel", 5 | "statementThreshold": 200 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /test/integration/Kripke_Slurm/cxx-wrapper.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | if [[ -z "${CXX_WRAP}" ]]; then 3 | >&2 echo "Error: CXX_WRAP environment variable not set!" 4 | exit 255 5 | else 6 | exec ${CXX_WRAP} "${@}" 7 | fi 8 | -------------------------------------------------------------------------------- /test/integration/GameOfLife_hybrid_filter_Slurm/parameters.json: -------------------------------------------------------------------------------- 1 | { 2 | "Modeling": { 3 | "extrapolationThreshold": 2.1, 4 | "modelAggregationStrategy": "FirstModel", 5 | "statementThreshold": 200 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /test/integration/LoadImbalance/imbalance/README.md: -------------------------------------------------------------------------------- 1 | # Imbalance 2 | 3 | Small custom MPI programm to test PIRA/PGIS with a manageable example. 4 | 5 | To build: `make` 6 | To run: `mpirun --oversubscribe -np 16 imbalance` 7 | -------------------------------------------------------------------------------- /test/integration/LoadImbalance_Slurm/imbalance/README.md: -------------------------------------------------------------------------------- 1 | # Imbalance 2 | 3 | Small custom MPI programm to test PIRA/PGIS with a manageable example. 4 | 5 | To build: `make` 6 | To run: `mpirun --oversubscribe -np 16 imbalance` 7 | -------------------------------------------------------------------------------- /test/inputs/configs/batchsystem_config_002.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "force-sequential": true 4 | }, 5 | "batch-settings": 6 | { 7 | "time": "00:10:00", 8 | "mem-per-cpu": 3800, 9 | "ntasks": 1 10 | } 11 | } -------------------------------------------------------------------------------- /test/inputs/functors/test_item_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return 'Test_Item' 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/inputs/functors/clean_test_item_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return 'Clean' 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/inputs/functors/runner_test_item_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return 'Runner' 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/inputs/functors/no_instr_test_item_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return 'No_Instr' 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /extern/src/llvm-instrumentation/test/002.cpp: -------------------------------------------------------------------------------- 1 | // RUN: clang++ -Xclang -load -Xclang ../build/lib/instrumentationlib.so -S -emit-llvm -o - %s | FileCheck %s 2 | // XFAIL: * 3 | void foo() { 4 | } 5 | 6 | int main(int argc, char **argv) { 7 | return 0; 8 | } 9 | -------------------------------------------------------------------------------- /test/integration/AMG2013/functors/analyze_amg_ct_mpi.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return 'pgis_pira' 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/integration/GameOfLife/functors/clean_gol_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return 'make clean' 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/integration/AMG2013/functors/clean_amg_ct_mpi.py: -------------------------------------------------------------------------------- 1 | 2 | def get_method(): 3 | return {'passive': True, 'active': False} 4 | 5 | 6 | def passive(benchmark, **kwargs): 7 | return 'make clean' 8 | 9 | 10 | def active(benchmark, **kwargs): 11 | pass 12 | -------------------------------------------------------------------------------- /test/integration/AMG2013_Slurm/functors/analyze_amg_ct_mpi.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return 'pgis_pira' 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/integration/GameOfLife_Slurm/functors/clean_gol_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return 'make clean' 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/integration/Kripke/functors/clean_kripke_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return 'make clean' 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/integration/LULESH/functors/clean_lulesh_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return 'make clean' 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/integration/AMG2013_Slurm/functors/clean_amg_ct_mpi.py: -------------------------------------------------------------------------------- 1 | 2 | def get_method(): 3 | return {'passive': True, 'active': False} 4 | 5 | 6 | def passive(benchmark, **kwargs): 7 | return 'make clean' 8 | 9 | 10 | def active(benchmark, **kwargs): 11 | pass 12 | -------------------------------------------------------------------------------- /test/integration/GameOfLife/functors/no_instr_gol_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return 'CXX=clang++ make gol' 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/integration/GameOfLifePiraVersion1/functors/clean_gol_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return 'make clean' 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/integration/GameOfLife_heuristic/functors/clean_gol_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return 'make clean' 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/integration/Kripke_Slurm/functors/clean_kripke_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return 'make clean' 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/integration/LULESH_Slurm/functors/clean_lulesh_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return 'make clean' 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/integration/LoadImbalance/functors/clean_imbalance_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return 'make clean' 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/integration/GameOfLife/functors/runner_gol_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return './gol ' + kwargs['args'][1] 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/integration/GameOfLifePiraVersion1_Slurm/functors/clean_gol_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return 'make clean' 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/integration/GameOfLife_heuristic_Slurm/functors/clean_gol_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return 'make clean' 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/integration/GameOfLife_hybrid_filter/functors/clean_gol_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return 'make clean' 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/integration/LoadImbalance_Slurm/functors/clean_imbalance_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return 'make clean' 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/integration/GameOfLife_Slurm/functors/no_instr_gol_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return 'CXX=clang++ make gol' 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/integration/GameOfLife_Slurm/functors/runner_gol_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return './gol ' + kwargs['args'][1] 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/integration/GameOfLife_heuristic/functors/no_instr_gol_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return 'CXX=clang++ make gol' 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/integration/GameOfLife_hybrid_filter_Slurm/functors/clean_gol_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return 'make clean' 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/integration/Kripke/functors/no_instr_kripke_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return 'make CXX_WRAP="mpicxx" -j' 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/integration/AMG2013/functors/no_instr_amg_ct_mpi.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return 'make CC="OMPI_CC=clang mpicc" -j' 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/integration/GameOfLifePiraVersion1/functors/no_instr_gol_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return 'CXX=clang++ make gol' 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/integration/GameOfLife_heuristic/functors/runner_gol_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return './gol ' + kwargs['args'][1] 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/integration/GameOfLife_hybrid_filter/functors/no_instr_gol_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return 'CXX=clang++ make gol' 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/integration/AMG2013_Slurm/functors/no_instr_amg_ct_mpi.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return 'make CC="OMPI_CC=clang mpicc" -j' 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/integration/GameOfLifePiraVersion1/functors/runner_gol_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return './gol ' + kwargs['args'][1] 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/integration/GameOfLifePiraVersion1_Slurm/functors/no_instr_gol_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return 'CXX=clang++ make gol' 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/integration/GameOfLife_heuristic_Slurm/functors/no_instr_gol_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return 'CXX=clang++ make gol' 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/integration/GameOfLife_heuristic_Slurm/functors/runner_gol_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return './gol ' + kwargs['args'][1] 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/integration/GameOfLife_hybrid_filter/functors/runner_gol_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return './gol ' + kwargs['args'][1] 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/integration/GameOfLife_hybrid_filter_Slurm/functors/no_instr_gol_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return 'CXX=clang++ make gol' 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/integration/Kripke_Slurm/functors/no_instr_kripke_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return 'make CXX_WRAP="mpicxx" -j' 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/integration/LoadImbalance/functors/no_instr_imbalance_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return 'make CC="OMPI_CC=clang mpicc"' 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/integration/GameOfLifePiraVersion1_Slurm/functors/runner_gol_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return './gol ' + kwargs['args'][1] 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/integration/GameOfLife_hybrid_filter_Slurm/functors/runner_gol_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return './gol ' + kwargs['args'][1] 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/integration/LoadImbalance_Slurm/functors/no_instr_imbalance_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return 'make CC="OMPI_CC=clang mpicc"' 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/integration/LULESH/functors/no_instr_lulesh_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return 'make CXXFLAGS="$LULESH_CXXFLAGS" CXX="mpicxx" -j' 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/integration/LULESH/functors/runner_lulesh_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return kwargs['LD_PRELOAD'] + ' mpirun -c 8 ./lulesh2.0 -b 1' 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/integration/LULESH_Slurm/functors/no_instr_lulesh_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return 'make CXXFLAGS="$LULESH_CXXFLAGS" CXX="mpicxx" -j' 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/integration/LULESH_Slurm/functors/runner_lulesh_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return kwargs['LD_PRELOAD'] + ' mpirun -c 8 ./lulesh2.0 -b 1' 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/integration/GameOfLife/functors/gol_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return 'CXX="scorep --instrument-filter=' + kwargs['filter-file'] + ' clang++" make gol' 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /extern/src/llvm-instrumentation/.clang-tidy: -------------------------------------------------------------------------------- 1 | --- 2 | Checks: '-clang-analyzer-core*, 3 | -clang-analyzer-cplusplus*, 4 | -cppcoreguidelines-*, 5 | -cert-err61-cpp, 6 | -modernize-raw-string-literal, 7 | -modernize-make*, 8 | -performance* 9 | ' 10 | ... 11 | -------------------------------------------------------------------------------- /test/integration/GameOfLife_Slurm/functors/gol_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return 'CXX="scorep --instrument-filter=' + kwargs['filter-file'] + ' clang++" make gol' 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/integration/GameOfLife_heuristic/functors/gol_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return 'CXX="scorep --instrument-filter=' + kwargs['filter-file'] + ' clang++" make gol' 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/integration/AMG2013/functors/amg_ct_mpi.py: -------------------------------------------------------------------------------- 1 | 2 | def get_method(): 3 | return {'passive': True, 'active': False} 4 | 5 | 6 | def passive(benchmark, **kwargs): 7 | return 'make CC="OMPI_CC=clang scorep --instrument-filter=' + kwargs['filter-file'] + ' mpicc" -j' 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/integration/GameOfLifePiraVersion1/functors/gol_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return 'CXX="scorep --instrument-filter=' + kwargs['filter-file'] + ' clang++" make gol' 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/integration/GameOfLife_hybrid_filter/functors/gol_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return 'CXX="scorep --instrument-filter=' + kwargs['filter-file'] + ' clang++" make gol' 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/integration/AMG2013_Slurm/functors/amg_ct_mpi.py: -------------------------------------------------------------------------------- 1 | 2 | def get_method(): 3 | return {'passive': True, 'active': False} 4 | 5 | 6 | def passive(benchmark, **kwargs): 7 | return 'make CC="OMPI_CC=clang scorep --instrument-filter=' + kwargs['filter-file'] + ' mpicc" -j' 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/integration/GameOfLifePiraVersion1_Slurm/functors/gol_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return 'CXX="scorep --instrument-filter=' + kwargs['filter-file'] + ' clang++" make gol' 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/integration/GameOfLife_heuristic_Slurm/functors/gol_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return 'CXX="scorep --instrument-filter=' + kwargs['filter-file'] + ' clang++" make gol' 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/integration/GameOfLife_hybrid_filter_Slurm/functors/gol_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return 'CXX="scorep --instrument-filter=' + kwargs['filter-file'] + ' clang++" make gol' 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/integration/Kripke/functors/kripke_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return 'make OMPI_CXX=clang++ CXX_WRAP="scorep --instrument-filter=' + kwargs['filter-file'] + ' mpicxx" -j' 7 | 8 | def active(benchmark, **kwargs): 9 | pass 10 | -------------------------------------------------------------------------------- /test/integration/LoadImbalance/functors/imbalance_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return 'make CC="OMPI_CC=clang scorep --instrument-filter=' + kwargs['filter-file'] + ' mpicc"' 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/integration/LoadImbalance/imbalance/util.c: -------------------------------------------------------------------------------- 1 | #include "util.h" 2 | #include "lib.h" 3 | 4 | #include 5 | 6 | void get_func_ptr(void (**func)(), int i) { 7 | void (*r)() = NULL; 8 | 9 | switch (i) { 10 | case 0: r = func1; break; 11 | default: r = func2; 12 | } 13 | 14 | *func = r; 15 | } -------------------------------------------------------------------------------- /test/integration/Kripke_Slurm/functors/kripke_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return 'make OMPI_CXX=clang++ CXX_WRAP="scorep --instrument-filter=' + kwargs['filter-file'] + ' mpicxx" -j' 7 | 8 | def active(benchmark, **kwargs): 9 | pass 10 | -------------------------------------------------------------------------------- /test/integration/LoadImbalance_Slurm/functors/imbalance_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return 'make CC="OMPI_CC=clang scorep --instrument-filter=' + kwargs['filter-file'] + ' mpicc"' 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/integration/LoadImbalance_Slurm/imbalance/util.c: -------------------------------------------------------------------------------- 1 | #include "util.h" 2 | #include "lib.h" 3 | 4 | #include 5 | 6 | void get_func_ptr(void (**func)(), int i) { 7 | void (*r)() = NULL; 8 | 9 | switch (i) { 10 | case 0: r = func1; break; 11 | default: r = func2; 12 | } 13 | 14 | *func = r; 15 | } -------------------------------------------------------------------------------- /test/integration/Kripke/functors/runner_kripke_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return kwargs['LD_PRELOAD'] + ' mpirun -c 8 ./bin/kripke.exe --procs 2,2,2 --groups ' + kwargs['args'][1] 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/integration/GameOfLife/functors/analyze_gol_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def pre(**kwargs): 6 | pass 7 | 8 | 9 | def passive(benchmark, **kwargs): 10 | return 'pgis_pira' 11 | 12 | 13 | def post(**kwargs): 14 | pass 15 | 16 | 17 | def active(benchmark, **kwargs): 18 | pass 19 | -------------------------------------------------------------------------------- /test/integration/Kripke_Slurm/functors/runner_kripke_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return kwargs['LD_PRELOAD'] + ' mpirun -c 8 ./bin/kripke.exe --procs 2,2,2 --groups ' + kwargs['args'][1] 7 | 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/integration/GameOfLife_Slurm/functors/analyze_gol_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def pre(**kwargs): 6 | pass 7 | 8 | 9 | def passive(benchmark, **kwargs): 10 | return 'pgis_pira' 11 | 12 | 13 | def post(**kwargs): 14 | pass 15 | 16 | 17 | def active(benchmark, **kwargs): 18 | pass 19 | -------------------------------------------------------------------------------- /test/integration/Kripke/functors/analyze_kripke_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def pre(**kwargs): 6 | pass 7 | 8 | 9 | def passive(benchmark, **kwargs): 10 | return 'pgis_pira' 11 | 12 | 13 | def post(**kwargs): 14 | pass 15 | 16 | 17 | def active(benchmark, **kwargs): 18 | pass 19 | -------------------------------------------------------------------------------- /test/integration/LULESH/functors/analyze_lulesh_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def pre(**kwargs): 6 | pass 7 | 8 | 9 | def passive(benchmark, **kwargs): 10 | return 'pgis_pira' 11 | 12 | 13 | def post(**kwargs): 14 | pass 15 | 16 | 17 | def active(benchmark, **kwargs): 18 | pass 19 | -------------------------------------------------------------------------------- /test/integration/LULESH/functors/lulesh_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return 'make CXXFLAGS="$LULESH_CXXFLAGS" CXX="OMPI_CXX=clang++ scorep --instrument-filter=' + kwargs['filter-file'] + ' mpicxx" -j' 7 | 8 | def active(benchmark, **kwargs): 9 | pass 10 | -------------------------------------------------------------------------------- /test/integration/LoadImbalance/functors/analyze_imbalance_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def pre(**kwargs): 6 | pass 7 | 8 | 9 | def passive(benchmark, **kwargs): 10 | return 'pgis_pira' 11 | 12 | 13 | def post(**kwargs): 14 | pass 15 | 16 | 17 | def active(benchmark, **kwargs): 18 | pass 19 | -------------------------------------------------------------------------------- /test/integration/GameOfLifePiraVersion1/functors/analyze_gol_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def pre(**kwargs): 6 | pass 7 | 8 | 9 | def passive(benchmark, **kwargs): 10 | return 'pgis_pira' 11 | 12 | 13 | def post(**kwargs): 14 | pass 15 | 16 | 17 | def active(benchmark, **kwargs): 18 | pass 19 | -------------------------------------------------------------------------------- /test/integration/GameOfLife_hybrid_filter/functors/analyze_gol_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def pre(**kwargs): 6 | pass 7 | 8 | 9 | def passive(benchmark, **kwargs): 10 | return 'pgis_pira' 11 | 12 | 13 | def post(**kwargs): 14 | pass 15 | 16 | 17 | def active(benchmark, **kwargs): 18 | pass 19 | -------------------------------------------------------------------------------- /test/integration/Kripke_Slurm/functors/analyze_kripke_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def pre(**kwargs): 6 | pass 7 | 8 | 9 | def passive(benchmark, **kwargs): 10 | return 'pgis_pira' 11 | 12 | 13 | def post(**kwargs): 14 | pass 15 | 16 | 17 | def active(benchmark, **kwargs): 18 | pass 19 | -------------------------------------------------------------------------------- /test/integration/LULESH_Slurm/functors/analyze_lulesh_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def pre(**kwargs): 6 | pass 7 | 8 | 9 | def passive(benchmark, **kwargs): 10 | return 'pgis_pira' 11 | 12 | 13 | def post(**kwargs): 14 | pass 15 | 16 | 17 | def active(benchmark, **kwargs): 18 | pass 19 | -------------------------------------------------------------------------------- /test/integration/LULESH_Slurm/functors/lulesh_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return 'make CXXFLAGS="$LULESH_CXXFLAGS" CXX="OMPI_CXX=clang++ scorep --instrument-filter=' + kwargs['filter-file'] + ' mpicxx" -j' 7 | 8 | def active(benchmark, **kwargs): 9 | pass 10 | -------------------------------------------------------------------------------- /test/integration/LoadImbalance_Slurm/functors/analyze_imbalance_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def pre(**kwargs): 6 | pass 7 | 8 | 9 | def passive(benchmark, **kwargs): 10 | return 'pgis_pira' 11 | 12 | 13 | def post(**kwargs): 14 | pass 15 | 16 | 17 | def active(benchmark, **kwargs): 18 | pass 19 | -------------------------------------------------------------------------------- /test/integration/GameOfLifePiraVersion1_Slurm/functors/analyze_gol_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def pre(**kwargs): 6 | pass 7 | 8 | 9 | def passive(benchmark, **kwargs): 10 | return 'pgis_pira' 11 | 12 | 13 | def post(**kwargs): 14 | pass 15 | 16 | 17 | def active(benchmark, **kwargs): 18 | pass 19 | -------------------------------------------------------------------------------- /test/integration/GameOfLife_hybrid_filter_Slurm/functors/analyze_gol_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def pre(**kwargs): 6 | pass 7 | 8 | 9 | def passive(benchmark, **kwargs): 10 | return 'pgis_pira' 11 | 12 | 13 | def post(**kwargs): 14 | pass 15 | 16 | 17 | def active(benchmark, **kwargs): 18 | pass 19 | -------------------------------------------------------------------------------- /test/integration/LoadImbalance/functors/runner_imbalance_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return kwargs['LD_PRELOAD'] + ' mpirun -np 8 imbalance-static.out' 7 | # return kwargs['LD_PRELOAD'] + ' mpirun -np 8 imbalance-dynamic.out' 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /test/integration/LoadImbalance/imbalance/lib.h: -------------------------------------------------------------------------------- 1 | #ifndef LIB_H 2 | #define LIB_H 3 | 4 | // General 5 | void print_mpi_info(int myrank, int nprocs); 6 | 7 | 8 | // imbalance detection test 9 | void imbalanced(int myrank); 10 | 11 | void balanced(); 12 | 13 | void test(int myrank); 14 | 15 | 16 | // function pointer test 17 | void func1(); 18 | void func2(); 19 | 20 | #endif -------------------------------------------------------------------------------- /test/integration/LoadImbalance_Slurm/imbalance/lib.h: -------------------------------------------------------------------------------- 1 | #ifndef LIB_H 2 | #define LIB_H 3 | 4 | // General 5 | void print_mpi_info(int myrank, int nprocs); 6 | 7 | 8 | // imbalance detection test 9 | void imbalanced(int myrank); 10 | 11 | void balanced(); 12 | 13 | void test(int myrank); 14 | 15 | 16 | // function pointer test 17 | void func1(); 18 | void func2(); 19 | 20 | #endif -------------------------------------------------------------------------------- /test/integration/LoadImbalance_Slurm/functors/runner_imbalance_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def passive(benchmark, **kwargs): 6 | return kwargs['LD_PRELOAD'] + ' mpirun -np 8 imbalance-static.out' 7 | # return kwargs['LD_PRELOAD'] + ' mpirun -np 8 imbalance-dynamic.out' 8 | 9 | def active(benchmark, **kwargs): 10 | pass 11 | -------------------------------------------------------------------------------- /extern/src/llvm-instrumentation/test/lit.cfg: -------------------------------------------------------------------------------- 1 | 2 | import os 3 | import sys 4 | import re 5 | import platform 6 | import subprocess 7 | 8 | import lit.formats 9 | import lit.util 10 | 11 | 12 | config.name = 'LLVM filtered instrumentation' 13 | 14 | execute_external = (True) 15 | config.test_format = lit.formats.ShTest(execute_external) 16 | config.suffixes = ['.c', '.cpp'] 17 | 18 | 19 | -------------------------------------------------------------------------------- /test/integration/LoadImbalance/parameters.json: -------------------------------------------------------------------------------- 1 | { 2 | "LIDe": { 3 | "childConstantThreshold": 5, 4 | "childFraction": 3e-05, 5 | "childRelevanceStrategy": "RelativeToMain", 6 | "contextStepCount": -1, 7 | "contextStrategy": "MajorPathsToMain", 8 | "imbalanceThreshold": 0.05, 9 | "metricType": "ImbalancePercentage", 10 | "relevanceThreshold": 0.02 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /test/inputs/functors/analyze_test_item_ct.py: -------------------------------------------------------------------------------- 1 | 2 | temporary_it = 0 3 | 4 | def get_method(): 5 | return {'passive': True, 'active': False} 6 | 7 | 8 | def passive(benchmark, **kwargs): 9 | global temporary_it 10 | temporary_it = 1 11 | return 'echo ' 12 | 13 | 14 | def active(benchmark, **kwargs): 15 | pass 16 | 17 | def get_it(): 18 | global temporary_it 19 | return temporary_it 20 | -------------------------------------------------------------------------------- /test/integration/LoadImbalance_Slurm/parameters.json: -------------------------------------------------------------------------------- 1 | { 2 | "LIDe": { 3 | "childConstantThreshold": 5, 4 | "childFraction": 3e-05, 5 | "childRelevanceStrategy": "RelativeToMain", 6 | "contextStepCount": -1, 7 | "contextStrategy": "MajorPathsToMain", 8 | "imbalanceThreshold": 0.05, 9 | "metricType": "ImbalancePercentage", 10 | "relevanceThreshold": 0.02 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /test/integration/GameOfLife_heuristic_Slurm/functors/analyze_gol_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def pre(**kwargs): 6 | pass 7 | 8 | 9 | def passive(benchmark, **kwargs): 10 | return 'pgis_pira --heuristic-selection fp_and_mem_ops --cuttoff-selection unique_median' 11 | 12 | 13 | def post(**kwargs): 14 | pass 15 | 16 | 17 | def active(benchmark, **kwargs): 18 | pass 19 | -------------------------------------------------------------------------------- /test/integration/GameOfLife_heuristic/functors/analyze_gol_ct.py: -------------------------------------------------------------------------------- 1 | def get_method(): 2 | return {'passive': True, 'active': False} 3 | 4 | 5 | def pre(**kwargs): 6 | pass 7 | 8 | 9 | def passive(benchmark, **kwargs): 10 | return 'pgis_pira --metacg-format 2 --heuristic-selection fp_and_mem_ops --cuttoff-selection unique_median' 11 | 12 | 13 | def post(**kwargs): 14 | pass 15 | 16 | 17 | def active(benchmark, **kwargs): 18 | pass 19 | -------------------------------------------------------------------------------- /extern/src/llvm-instrumentation/test/004.cfg: -------------------------------------------------------------------------------- 1 | # This is a comment 2 | 3 | # And this is another comment 4 | 5 | SCOREP_REGION_NAMES_BEGIN # Comment 3 6 | INCLUDE bar MANGLED foo 7 | INCLUDE main 8 | INCLUDE _Z3foov 9 | INCLUDE a -> b 10 | INCLUDE c MANGLED cee -> d MANGLED dee 11 | SCOREP_REGION_NAMES_END 12 | 13 | SCOREP_REGION_NAMES_BEGIN 14 | SCOREP_REGION_NAMES_END # empty region INCLUDE # This include is also an comment 15 | 16 | 17 | -------------------------------------------------------------------------------- /lib/Exception.py: -------------------------------------------------------------------------------- 1 | """ 2 | File: Exception.py 3 | License: Part of the PIRA project. Licensed under BSD 3 clause license. See LICENSE.txt file at https://github.com/tudasc/pira 4 | Description: Module holding base exception for all PIRA Exceptions. 5 | """ 6 | 7 | 8 | class PiraException(Exception): 9 | 10 | def __init__(self, message): 11 | super().__init__() 12 | self._message = message 13 | 14 | def __str__(self): 15 | return self._message 16 | -------------------------------------------------------------------------------- /test/integration/AMG2013/functors/runner_amg_ct_mpi.py: -------------------------------------------------------------------------------- 1 | 2 | def get_method(): 3 | return {'passive': True, 'active': False} 4 | 5 | 6 | def passive(benchmark, **kwargs): 7 | return 'cd test && ' + kwargs['LD_PRELOAD'] + ' mpirun --allow-run-as-root -oversubscribe -np 8 ./amg2013 -pooldist 1 -r ' + str(kwargs['args'][1]) + ' ' + str(kwargs['args'][1]) + ' ' + str(kwargs['args'][1]) + ' -P 1 1 1 -printstats' 8 | 9 | 10 | def active(benchmark, **kwargs): 11 | pass 12 | -------------------------------------------------------------------------------- /test/integration/AMG2013_Slurm/functors/runner_amg_ct_mpi.py: -------------------------------------------------------------------------------- 1 | 2 | def get_method(): 3 | return {'passive': True, 'active': False} 4 | 5 | 6 | def passive(benchmark, **kwargs): 7 | return 'cd test && ' + kwargs['LD_PRELOAD'] + ' mpirun --allow-run-as-root -oversubscribe -np 8 ./amg2013 -pooldist 1 -r ' + str(kwargs['args'][1]) + ' ' + str(kwargs['args'][1]) + ' ' + str(kwargs['args'][1]) + ' -P 1 1 1 -printstats' 8 | 9 | 10 | def active(benchmark, **kwargs): 11 | pass 12 | -------------------------------------------------------------------------------- /test/integration/Kripke/parameters.json: -------------------------------------------------------------------------------- 1 | { 2 | "Modeling": { 3 | "extrapolationThreshold": 2.1, 4 | "statementThreshold": 200, 5 | "modelAggregationStrategy": "Sum" 6 | }, 7 | "LIDe": { 8 | "metricType": "ImbalancePercentage", 9 | "imbalanceThreshold": 0.10, 10 | "relevanceThreshold": 0.02, 11 | "contextStrategy": "None", 12 | "contextStepCount": -1, 13 | "childRelevanceStrategy": "RelativeToMain", 14 | "childConstantThreshold": 150, 15 | "childFraction": 0.00003 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /test/integration/LULESH/parameters.json: -------------------------------------------------------------------------------- 1 | { 2 | "Modeling": { 3 | "extrapolationThreshold": 2.1, 4 | "statementThreshold": 200, 5 | "modelAggregationStrategy": "Sum" 6 | }, 7 | "LIDe": { 8 | "metricType": "ImbalancePercentage", 9 | "imbalanceThreshold": 0.10, 10 | "relevanceThreshold": 0.02, 11 | "contextStrategy": "None", 12 | "contextStepCount": -1, 13 | "childRelevanceStrategy": "RelativeToMain", 14 | "childConstantThreshold": 150, 15 | "childFraction": 0.00003 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /extern/src/llvm-instrumentation/test/001.cpp: -------------------------------------------------------------------------------- 1 | // RUN: clang++ -Xclang -load -Xclang ../build/lib/instrumentationlib.so -mllvm --filter-list=001.filt -S -emit-llvm -o - %s | FileCheck %s 2 | // 3 | // CHECK-LABEL: define dso_local void @_Z3foov() 4 | // CHECK: call void @__cyg_profile_func_enter 5 | // CHECK: call void @__cyg_profile_func_exit 6 | void foo() { 7 | } 8 | 9 | // CHECK-LABEL: define dso_local i32 @main( 10 | // CHECK: store i32 0, i32* %3 11 | // CHECK: store i8** %1, i8*** %5 12 | int main(int argc, char **argv) { 13 | return 0; 14 | } 15 | -------------------------------------------------------------------------------- /extern/src/llvm-instrumentation/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5) 2 | 3 | project(llvminstrumentation) 4 | 5 | set(CMAKE_EXPORT_COMPILE_COMMANDS ON) 6 | set(CMAKE_VERBOSE_MAKEFILE ON) 7 | 8 | set(CMAKE_CXX_STANDARD 17) 9 | set(CMAKE_CXX_STANDARD_REQUIRED ON) 10 | set(CMAKE_CXX_EXTENSIONS OFF) 11 | 12 | list(APPEND CMAKE_MODULE_PATH 13 | ${CMAKE_CURRENT_SOURCE_DIR}/cmake 14 | ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules 15 | ) 16 | 17 | include(ToolchainOptions) 18 | include(CMakePackageConfigHelpers) 19 | 20 | add_subdirectory(lib) 21 | -------------------------------------------------------------------------------- /test/integration/Kripke_Slurm/parameters.json: -------------------------------------------------------------------------------- 1 | { 2 | "Modeling": { 3 | "extrapolationThreshold": 2.1, 4 | "statementThreshold": 200, 5 | "modelAggregationStrategy": "Sum" 6 | }, 7 | "LIDe": { 8 | "metricType": "ImbalancePercentage", 9 | "imbalanceThreshold": 0.10, 10 | "relevanceThreshold": 0.02, 11 | "contextStrategy": "None", 12 | "contextStepCount": -1, 13 | "childRelevanceStrategy": "RelativeToMain", 14 | "childConstantThreshold": 150, 15 | "childFraction": 0.00003 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /test/integration/LULESH_Slurm/parameters.json: -------------------------------------------------------------------------------- 1 | { 2 | "Modeling": { 3 | "extrapolationThreshold": 2.1, 4 | "statementThreshold": 200, 5 | "modelAggregationStrategy": "Sum" 6 | }, 7 | "LIDe": { 8 | "metricType": "ImbalancePercentage", 9 | "imbalanceThreshold": 0.10, 10 | "relevanceThreshold": 0.02, 11 | "contextStrategy": "None", 12 | "contextStepCount": -1, 13 | "childRelevanceStrategy": "RelativeToMain", 14 | "childConstantThreshold": 150, 15 | "childFraction": 0.00003 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /CITATION.cff: -------------------------------------------------------------------------------- 1 | cff-version: 1.2.0 2 | message: "If you use this software, please cite its initial paper." 3 | authors: 4 | - family-names: Lehr 5 | given-names: Jan-Patrick 6 | orcid: https://orcid.org/0000-0002-6330-4816 7 | - family-names: Hück 8 | given-names: Alexander 9 | orcid: https://orcid.org/0000-0003-1931-773X 10 | - family-names: Bischof 11 | given-names: Christian 12 | orcid: https://orcid.org/0000-0003-2711-3032 13 | title: "PIRA: Performance Instrumentation Refinement Automation" 14 | doi: 10.1145/3281070.3281071 15 | version: 0.4.0 -------------------------------------------------------------------------------- /test/inputs/configs/basic_config_005.json: -------------------------------------------------------------------------------- 1 | { 2 | "builds": { 3 | "%base": { 4 | "items": { 5 | "test_item": { 6 | "analyzer": "/tmp", 7 | "argmap": { 8 | "mapper": "Linear", 9 | "p1": [ 10 | "1" 11 | ] 12 | }, 13 | "cubes": "/tmp", 14 | "flavors": [ 15 | "ct" 16 | ], 17 | "functors": "../functors", 18 | "mode": "ct" 19 | } 20 | } 21 | } 22 | }, 23 | "directories": { 24 | "base": "/tmp" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /extern/src/llvm-instrumentation/test/004.cpp: -------------------------------------------------------------------------------- 1 | // RUN: clang++ -Xclang -load -Xclang ../build/lib/instrumentationlib.so -mllvm --score-p-filter=004.cfg -S -emit-llvm -o - %s | FileCheck %s 2 | // 3 | // CHECK-LABEL: define dso_local void @_Z3foov() 4 | // CHECK: call void @__cyg_profile_func_enter 5 | // CHECK: call void @__cyg_profile_func_exit 6 | void foo() { 7 | } 8 | 9 | // CHECK-LABEL: define dso_local i32 @main( 10 | // CHECK: store i32 0, i32* %4 11 | // CHECK: store i32 %0, i32* %5 12 | // CHECK: store i8** %1, i8*** %6 13 | int main(int argc, char **argv) { 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /test/inputs/configs/basic_config_003.json: -------------------------------------------------------------------------------- 1 | { 2 | "builds": { 3 | "%base": { 4 | "items": { 5 | "i01": { 6 | "analyzer": "/does/exist", 7 | "argmap": { 8 | "mapper": "Garbage", 9 | "p1": [ 10 | "1" 11 | ] 12 | }, 13 | "cubes": "/does/exist", 14 | "flavors": [ 15 | "one" 16 | ], 17 | "functors": "../wrong", 18 | "mode": "ct" 19 | } 20 | } 21 | } 22 | }, 23 | "directories": { 24 | "base": "/does/exist" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /test/inputs/configs/basic_config_002.json: -------------------------------------------------------------------------------- 1 | { 2 | "builds": { 3 | "%base": { 4 | "items": { 5 | "i01": { 6 | "analyzer": "/does/exist", 7 | "argmap": { 8 | "mapper": "Garbage", 9 | "p1": [ 10 | "1" 11 | ] 12 | }, 13 | "cubes": "/does/exist", 14 | "flavors": [ 15 | "one" 16 | ], 17 | "functors": "../functors", 18 | "mode": "ct" 19 | } 20 | } 21 | } 22 | }, 23 | "directories": { 24 | "base": "/does/not/exist" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /test/inputs/configs/basic_config_004.json: -------------------------------------------------------------------------------- 1 | { 2 | "builds": { 3 | "%base": { 4 | "items": { 5 | "i01": { 6 | "analyzer": "/does/exist", 7 | "argmap": { 8 | "mapper": "Linear", 9 | "p1": [ 10 | "1" 11 | ] 12 | }, 13 | "cubes": "/does/exist", 14 | "flavors": [ 15 | "invalid" 16 | ], 17 | "functors": "../functors", 18 | "mode": "ct" 19 | } 20 | } 21 | } 22 | }, 23 | "directories": { 24 | "base": "/does/exist" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /test/integration/LoadImbalance/imbalance/Makefile: -------------------------------------------------------------------------------- 1 | all: imbalance 2 | 3 | imbalance: lib util 4 | $(CC) -O0 main.c -ggdb -L. -l:libtest.so -l:libutil.so -o imbalance-dynamic.out 5 | $(CC) -O0 main.c -ggdb -rdynamic -L. -l:libtest.a -l:libutil.a -o imbalance-static.out 6 | 7 | lib: 8 | $(CC) -O0 -ggdb -c -Wall -fpic lib.c -o lib.o 9 | $(CC) -O0 -ggdb -shared -o libtest.so lib.o 10 | ar rcs libtest.a lib.o 11 | 12 | util: 13 | $(CC) -O0 -ggdb -c -Wall -fpic util.c -o util.o 14 | $(CC) -O0 -ggdb -shared -o libutil.so util.o 15 | ar rcs libutil.a util.o 16 | 17 | clean: 18 | rm -f *.out *.o *.so *.a 19 | -------------------------------------------------------------------------------- /test/inputs/configs/basic_config_001.json: -------------------------------------------------------------------------------- 1 | { 2 | "builds": { 3 | "%base": { 4 | "items": { 5 | "i01": { 6 | "analyzer": "/does/not/exist", 7 | "argmap": { 8 | "mapper": "Linear", 9 | "p1": [ 10 | "1" 11 | ] 12 | }, 13 | "cubes": "/does/not/exist", 14 | "flavors": [ 15 | "one" 16 | ], 17 | "functors": "../functors", 18 | "mode": "ct" 19 | } 20 | } 21 | } 22 | }, 23 | "directories": { 24 | "base": "/does/not/exist" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /test/integration/AMG2013/expected_instrumentation.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "iteration": 0, 4 | "expect": ["main", "GenerateLaplacian27pt", "GenerateVarDifConv", "BuildParLaplacian", "BuildParVarDifConv", "GenerateLaplacian", "BuildParLaplacian27pt", "DistributeData", "ReadData"], 5 | "may-expect": ["HYPRE_.*", "hypre_.*"], 6 | "never-expect": [] 7 | }, 8 | { 9 | "iteration": 1, 10 | "expect": ["main", "BuildParVarDifConv", "BuildParLaplacian", "BuildParLaplacian27pt"], 11 | "may-expect": ["HYPRE_.*", "hypre_.*"], 12 | "never-expect": [] 13 | } 14 | ] -------------------------------------------------------------------------------- /test/integration/LoadImbalance_Slurm/imbalance/Makefile: -------------------------------------------------------------------------------- 1 | all: imbalance 2 | 3 | imbalance: lib util 4 | $(CC) -O0 main.c -ggdb -L. -l:libtest.so -l:libutil.so -o imbalance-dynamic.out 5 | $(CC) -O0 main.c -ggdb -rdynamic -L. -l:libtest.a -l:libutil.a -o imbalance-static.out 6 | 7 | lib: 8 | $(CC) -O0 -ggdb -c -Wall -fpic lib.c -o lib.o 9 | $(CC) -O0 -ggdb -shared -o libtest.so lib.o 10 | ar rcs libtest.a lib.o 11 | 12 | util: 13 | $(CC) -O0 -ggdb -c -Wall -fpic util.c -o util.o 14 | $(CC) -O0 -ggdb -shared -o libutil.so util.o 15 | ar rcs libutil.a util.o 16 | 17 | clean: 18 | rm -f *.out *.o *.so *.a 19 | -------------------------------------------------------------------------------- /test/integration/AMG2013_Slurm/expected_instrumentation.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "iteration": 0, 4 | "expect": ["main", "GenerateLaplacian27pt", "GenerateVarDifConv", "BuildParLaplacian", "BuildParVarDifConv", "GenerateLaplacian", "BuildParLaplacian27pt", "DistributeData", "ReadData"], 5 | "may-expect": ["HYPRE_.*", "hypre_.*"], 6 | "never-expect": [] 7 | }, 8 | { 9 | "iteration": 1, 10 | "expect": ["main", "BuildParVarDifConv", "BuildParLaplacian", "BuildParLaplacian27pt"], 11 | "may-expect": ["HYPRE_.*", "hypre_.*"], 12 | "never-expect": [] 13 | } 14 | ] -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | # This is the official list of PIRA authors for copyright purposes. 2 | 3 | # Names should be added to this file as one of 4 | # Organization's name 5 | # Individual's name <*optional:* submission email address> 6 | 7 | # Please keep the list sorted according to affiliation and first contribution. 8 | 9 | TU Darmstadt, Darmstadt, Germany 10 | Jan-Patrick Lehr 11 | Saching Manawadi 12 | Constantin Völter 13 | Peter Arzt 14 | Rickert Jonas 15 | Jonathan Otto 16 | 17 | Jan-Patrick Lehr 18 | -------------------------------------------------------------------------------- /extern/src/llvm-instrumentation/test/003.cpp: -------------------------------------------------------------------------------- 1 | // RUN: clang++ -Xclang -load -Xclang ../build/lib/instrumentationlib.so -mllvm --filter-list=001.filt -S -emit-llvm -o - %s | FileCheck %s 2 | // 3 | // CHECK-LABEL: define dso_local void @_Z3foov() 4 | // CHECK: call void @__cyg_profile_func_enter 5 | // CHECK: call void @__cyg_profile_func_exit 6 | void foo() { 7 | } 8 | 9 | // CHECK-LABEL: define dso_local void @_Z3fooi( 10 | // CHECK: ret 11 | void foo(int a) { 12 | } 13 | 14 | // CHECK-LABEL: define dso_local i32 @main( 15 | // CHECK: store i32 0, i32* %3 16 | // CHECK: store i8** %1, i8*** %5 17 | int main(int argc, char **argv) { 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /test/inputs/configs/basic_config_006.json: -------------------------------------------------------------------------------- 1 | { 2 | "builds": { 3 | "%base": { 4 | "items": { 5 | "test_item": { 6 | "analyzer": "$PIRA_TEST_ENV_VAR_ANALYZER", 7 | "argmap": { 8 | "mapper": "Linear", 9 | "p1": [ 10 | "1" 11 | ] 12 | }, 13 | "cubes": "$PIRA_TEST_ENV_VAR_CUBES", 14 | "flavors": [ 15 | "ct" 16 | ], 17 | "functors": "$PIRA_TEST_ENV_VAR_FUNCTORS", 18 | "mode": "ct" 19 | } 20 | } 21 | } 22 | }, 23 | "directories": { 24 | "base": "$PIRA_TEST_ENV_VAR_BASE" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /test/integration/LULESH/lulesh_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "builds": { 3 | "%lulesh": { 4 | "items": { 5 | "lulesh": { 6 | "analyzer": "../../../extern/install/metacg/bin/", 7 | "argmap": { 8 | "X": [ 9 | 30 10 | ], 11 | "mapper": "Linear" 12 | }, 13 | "cubes": "${PIRA_DIR}/lulesh_cubes", 14 | "flavors": [ 15 | "ct" 16 | ], 17 | "functors": "./functors", 18 | "mode": "CT" 19 | } 20 | } 21 | } 22 | }, 23 | "directories": { 24 | "lulesh": "./LULESH" 25 | }, 26 | "glob-flavors": [], 27 | "glob-submitter": {} 28 | } 29 | -------------------------------------------------------------------------------- /test/integration/LULESH_Slurm/lulesh_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "builds": { 3 | "%lulesh": { 4 | "items": { 5 | "lulesh": { 6 | "analyzer": "../../../extern/install/metacg/bin/", 7 | "argmap": { 8 | "X": [ 9 | 30 10 | ], 11 | "mapper": "Linear" 12 | }, 13 | "cubes": "${PIRA_DIR}/lulesh_cubes", 14 | "flavors": [ 15 | "ct" 16 | ], 17 | "functors": "./functors", 18 | "mode": "CT" 19 | } 20 | } 21 | } 22 | }, 23 | "directories": { 24 | "lulesh": "./LULESH" 25 | }, 26 | "glob-flavors": [], 27 | "glob-submitter": {} 28 | } 29 | -------------------------------------------------------------------------------- /test/integration/Kripke/kripke_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "builds": { 3 | "%kripke": { 4 | "items": { 5 | "kripke": { 6 | "analyzer": "../../../extern/install/metacg/bin/", 7 | "argmap": { 8 | "groups": [ 9 | 128 10 | ], 11 | "mapper": "Linear" 12 | }, 13 | "cubes": "${PIRA_DIR}/kripke_cubes", 14 | "flavors": [ 15 | "ct" 16 | ], 17 | "functors": "./functors", 18 | "mode": "CT" 19 | } 20 | } 21 | } 22 | }, 23 | "directories": { 24 | "kripke": "./Kripke/build" 25 | }, 26 | "glob-flavors": [], 27 | "glob-submitter": {} 28 | } 29 | -------------------------------------------------------------------------------- /test/integration/Kripke_Slurm/kripke_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "builds": { 3 | "%kripke": { 4 | "items": { 5 | "kripke": { 6 | "analyzer": "../../../extern/install/metacg/bin/", 7 | "argmap": { 8 | "groups": [ 9 | 128 10 | ], 11 | "mapper": "Linear" 12 | }, 13 | "cubes": "${PIRA_DIR}/kripke_cubes", 14 | "flavors": [ 15 | "ct" 16 | ], 17 | "functors": "./functors", 18 | "mode": "CT" 19 | } 20 | } 21 | } 22 | }, 23 | "directories": { 24 | "kripke": "./Kripke/build" 25 | }, 26 | "glob-flavors": [], 27 | "glob-submitter": {} 28 | } 29 | -------------------------------------------------------------------------------- /test/integration/GameOfLifePiraVersion1/gol_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "builds": { 3 | "%gol": { 4 | "items": { 5 | "gol": { 6 | "analyzer": "../../../extern/install/metacg/bin/", 7 | "argmap": { 8 | "mapper": "Linear", 9 | "size": [ 10 | 150 11 | ] 12 | }, 13 | "cubes": "${PIRA_DIR}/gol_cubes", 14 | "flavors": [ 15 | "ct" 16 | ], 17 | "functors": "./functors", 18 | "mode": "CT" 19 | } 20 | } 21 | } 22 | }, 23 | "directories": { 24 | "gol": "./gol/serial_non_template" 25 | }, 26 | "glob-flavors": [], 27 | "glob-submitter": {} 28 | } 29 | -------------------------------------------------------------------------------- /test/integration/GameOfLifePiraVersion1_Slurm/gol_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "builds": { 3 | "%gol": { 4 | "items": { 5 | "gol": { 6 | "analyzer": "../../../extern/install/metacg/bin/", 7 | "argmap": { 8 | "mapper": "Linear", 9 | "size": [ 10 | 150 11 | ] 12 | }, 13 | "cubes": "${PIRA_DIR}/gol_cubes", 14 | "flavors": [ 15 | "ct" 16 | ], 17 | "functors": "./functors", 18 | "mode": "CT" 19 | } 20 | } 21 | } 22 | }, 23 | "directories": { 24 | "gol": "./gol/serial_non_template" 25 | }, 26 | "glob-flavors": [], 27 | "glob-submitter": {} 28 | } 29 | -------------------------------------------------------------------------------- /test/integration/LoadImbalance/imbalance_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "builds": { 3 | "%imbalance": { 4 | "items": { 5 | "imbalance": { 6 | "analyzer": "../../../extern/install/metacg/bin/", 7 | "argmap": { 8 | "mapper": "Linear", 9 | "size": [ 10 | 100 11 | ] 12 | }, 13 | "cubes": "${PIRA_DIR}/imbalance_cubes", 14 | "flavors": [ 15 | "ct" 16 | ], 17 | "functors": "./functors", 18 | "mode": "CT" 19 | } 20 | } 21 | } 22 | }, 23 | "directories": { 24 | "imbalance": "./imbalance" 25 | }, 26 | "glob-flavors": [], 27 | "glob-submitter": {} 28 | } 29 | -------------------------------------------------------------------------------- /test/integration/LoadImbalance_Slurm/imbalance_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "builds": { 3 | "%imbalance": { 4 | "items": { 5 | "imbalance": { 6 | "analyzer": "../../../extern/install/metacg/bin/", 7 | "argmap": { 8 | "mapper": "Linear", 9 | "size": [ 10 | 100 11 | ] 12 | }, 13 | "cubes": "${PIRA_DIR}/imbalance_cubes", 14 | "flavors": [ 15 | "ct" 16 | ], 17 | "functors": "./functors", 18 | "mode": "CT" 19 | } 20 | } 21 | } 22 | }, 23 | "directories": { 24 | "imbalance": "./imbalance" 25 | }, 26 | "glob-flavors": [], 27 | "glob-submitter": {} 28 | } 29 | -------------------------------------------------------------------------------- /test/integration/GameOfLife/expected_instrumentation.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "iteration": 0, 4 | "expect": ["main", "_ZNK10GameOfLife19getNumLiveNeighborsEii", "_ZN10GameOfLife4tickEv", "_ZN10GameOfLife4tickEv", "_ZN10GameOfLife10applyRulesEiiRSt6vectorIcSaIcEE", "_ZN10GameOfLife4initEv"], 5 | "may-expect": [".*basic_string.*", ".*stoa.*", ".*swap.*"], 6 | "never-expect": [] 7 | }, 8 | { 9 | "iteration": 1, 10 | "expect": [], 11 | "may-expect": [".*basic_string.*", ".*stoa.*", ".*swap.*"], 12 | "never-expect": [] 13 | }, 14 | { 15 | "iteration": 2, 16 | "expect": [], 17 | "may-expect": [], 18 | "never-expect": [] 19 | } 20 | ] -------------------------------------------------------------------------------- /test/integration/GameOfLife_Slurm/expected_instrumentation.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "iteration": 0, 4 | "expect": ["main", "_ZNK10GameOfLife19getNumLiveNeighborsEii", "_ZN10GameOfLife4tickEv", "_ZN10GameOfLife4tickEv", "_ZN10GameOfLife10applyRulesEiiRSt6vectorIcSaIcEE", "_ZN10GameOfLife4initEv"], 5 | "may-expect": [".*basic_string.*", ".*stoa.*", ".*swap.*"], 6 | "never-expect": [] 7 | }, 8 | { 9 | "iteration": 1, 10 | "expect": [], 11 | "may-expect": [".*basic_string.*", ".*stoa.*", ".*swap.*"], 12 | "never-expect": [] 13 | }, 14 | { 15 | "iteration": 2, 16 | "expect": [], 17 | "may-expect": [], 18 | "never-expect": [] 19 | } 20 | ] -------------------------------------------------------------------------------- /test/integration/GameOfLife_heuristic/expected_instrumentation.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "iteration": 0, 4 | "expect": ["main", "_ZNK10GameOfLife19getNumLiveNeighborsEii", "_ZN10GameOfLife4tickEv", "_ZN10GameOfLife4tickEv", "_ZN10GameOfLife10applyRulesEiiRSt6vectorIcSaIcEE", "_ZN10GameOfLife4initEv"], 5 | "may-expect": [".*basic_string.*", ".*stoa.*", ".*swap.*"], 6 | "never-expect": [] 7 | }, 8 | { 9 | "iteration": 1, 10 | "expect": [], 11 | "may-expect": [".*basic_string.*", ".*stoa.*", ".*swap.*"], 12 | "never-expect": [] 13 | }, 14 | { 15 | "iteration": 2, 16 | "expect": [], 17 | "may-expect": [], 18 | "never-expect": [] 19 | } 20 | ] -------------------------------------------------------------------------------- /test/integration/GameOfLife_heuristic_Slurm/expected_instrumentation.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "iteration": 0, 4 | "expect": ["main", "_ZNK10GameOfLife19getNumLiveNeighborsEii", "_ZN10GameOfLife4tickEv", "_ZN10GameOfLife4tickEv", "_ZN10GameOfLife10applyRulesEiiRSt6vectorIcSaIcEE", "_ZN10GameOfLife4initEv"], 5 | "may-expect": [".*basic_string.*", ".*stoa.*", ".*swap.*"], 6 | "never-expect": [] 7 | }, 8 | { 9 | "iteration": 1, 10 | "expect": [], 11 | "may-expect": [".*basic_string.*", ".*stoa.*", ".*swap.*"], 12 | "never-expect": [] 13 | }, 14 | { 15 | "iteration": 2, 16 | "expect": [], 17 | "may-expect": [], 18 | "never-expect": [] 19 | } 20 | ] -------------------------------------------------------------------------------- /test/integration/AMG2013/amg_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "builds": { 3 | "%amg2013": { 4 | "items": { 5 | "amg": { 6 | "analyzer": "../../../extern/install/metacg/bin/", 7 | "argmap": { 8 | "X": [ 9 | 10, 10 | 12, 11 | 24, 12 | 30, 13 | 40 14 | ], 15 | "mapper": "Linear" 16 | }, 17 | "cubes": "${PIRA_DIR}/amg_cubes", 18 | "flavors": [ 19 | "ct_mpi" 20 | ], 21 | "functors": "./functors", 22 | "mode": "CT" 23 | } 24 | } 25 | } 26 | }, 27 | "directories": { 28 | "amg2013": "./AMG2013" 29 | }, 30 | "glob-flavors": [], 31 | "glob-submitter": {} 32 | } 33 | -------------------------------------------------------------------------------- /test/integration/AMG2013_Slurm/amg_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "builds": { 3 | "%amg2013": { 4 | "items": { 5 | "amg": { 6 | "analyzer": "../../../extern/install/metacg/bin/", 7 | "argmap": { 8 | "X": [ 9 | 10, 10 | 12, 11 | 24, 12 | 30, 13 | 40 14 | ], 15 | "mapper": "Linear" 16 | }, 17 | "cubes": "${PIRA_DIR}/amg_cubes", 18 | "flavors": [ 19 | "ct_mpi" 20 | ], 21 | "functors": "./functors", 22 | "mode": "CT" 23 | } 24 | } 25 | } 26 | }, 27 | "directories": { 28 | "amg2013": "./AMG2013" 29 | }, 30 | "glob-flavors": [], 31 | "glob-submitter": {} 32 | } 33 | -------------------------------------------------------------------------------- /test/integration/prepare_environment.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # File: prepare_environment.sh 4 | # License: Part of the PIRA project. Licensed under BSD 3 clause license. See LICENSE.txt file at https://github.com/tudasc/pira 5 | # Description: Sets up the environment for PIRA's integration tests 6 | # 7 | 8 | testDir=$PWD 9 | export TEST_DIR=$testDir 10 | 11 | echo -e "\n----- Getting and building jq (v 1.6) -----" 12 | # Used for extracting info from the compile_commands.json file 13 | 14 | if [ ! -d jq ]; then 15 | echo "Fetching jq release 1.6" 16 | wget https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 17 | mkdir jq 18 | mv jq-linux64 jq/jq 19 | cd jq 20 | chmod +x jq 21 | else 22 | cd jq 23 | fi 24 | export PATH=$PWD:$PATH 25 | echo $PATH 26 | cd .. 27 | 28 | -------------------------------------------------------------------------------- /test/integration/GameOfLife/gol_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "builds": { 3 | "%gol": { 4 | "items": { 5 | "gol": { 6 | "analyzer": "../../../extern/install/metacg/bin/", 7 | "argmap": { 8 | "mapper": "Linear", 9 | "size": [ 10 | 50, 11 | 80, 12 | 110, 13 | 150, 14 | 300, 15 | 500 16 | ] 17 | }, 18 | "cubes": "${PIRA_DIR}/gol_cubes", 19 | "flavors": [ 20 | "ct" 21 | ], 22 | "functors": "./functors", 23 | "mode": "CT" 24 | } 25 | } 26 | } 27 | }, 28 | "directories": { 29 | "gol": "./gol/serial_non_template" 30 | }, 31 | "glob-flavors": [], 32 | "glob-submitter": {} 33 | } 34 | -------------------------------------------------------------------------------- /test/integration/GameOfLife_Slurm/gol_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "builds": { 3 | "%gol": { 4 | "items": { 5 | "gol": { 6 | "analyzer": "../../../extern/install/metacg/bin/", 7 | "argmap": { 8 | "mapper": "Linear", 9 | "size": [ 10 | 50, 11 | 80, 12 | 110, 13 | 150, 14 | 300, 15 | 500 16 | ] 17 | }, 18 | "cubes": "${PIRA_DIR}/gol_cubes", 19 | "flavors": [ 20 | "ct" 21 | ], 22 | "functors": "./functors", 23 | "mode": "CT" 24 | } 25 | } 26 | } 27 | }, 28 | "directories": { 29 | "gol": "./gol/serial_non_template" 30 | }, 31 | "glob-flavors": [], 32 | "glob-submitter": {} 33 | } 34 | -------------------------------------------------------------------------------- /test/integration/GameOfLife_heuristic/gol_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "builds": { 3 | "%gol": { 4 | "items": { 5 | "gol": { 6 | "analyzer": "../../../extern/install/metacg/bin/", 7 | "argmap": { 8 | "mapper": "Linear", 9 | "size": [ 10 | 50, 11 | 80, 12 | 110, 13 | 150, 14 | 300, 15 | 500 16 | ] 17 | }, 18 | "cubes": "${PIRA_DIR}/gol_cubes", 19 | "flavors": [ 20 | "ct" 21 | ], 22 | "functors": "./functors", 23 | "mode": "CT" 24 | } 25 | } 26 | } 27 | }, 28 | "directories": { 29 | "gol": "./gol/serial_non_template" 30 | }, 31 | "glob-flavors": [], 32 | "glob-submitter": {} 33 | } 34 | -------------------------------------------------------------------------------- /test/integration/GameOfLife_hybrid_filter/gol_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "builds": { 3 | "%gol": { 4 | "items": { 5 | "gol": { 6 | "analyzer": "../../../extern/install/metacg/bin/", 7 | "argmap": { 8 | "mapper": "Linear", 9 | "size": [ 10 | 50, 11 | 80, 12 | 110, 13 | 150, 14 | 300, 15 | 500 16 | ] 17 | }, 18 | "cubes": "${PIRA_DIR}/gol_cubes", 19 | "flavors": [ 20 | "ct" 21 | ], 22 | "functors": "./functors", 23 | "mode": "CT" 24 | } 25 | } 26 | } 27 | }, 28 | "directories": { 29 | "gol": "./gol/serial_non_template" 30 | }, 31 | "glob-flavors": [], 32 | "glob-submitter": {} 33 | } 34 | -------------------------------------------------------------------------------- /test/integration/GameOfLife_heuristic_Slurm/gol_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "builds": { 3 | "%gol": { 4 | "items": { 5 | "gol": { 6 | "analyzer": "../../../extern/install/metacg/bin/", 7 | "argmap": { 8 | "mapper": "Linear", 9 | "size": [ 10 | 50, 11 | 80, 12 | 110, 13 | 150, 14 | 300, 15 | 500 16 | ] 17 | }, 18 | "cubes": "${PIRA_DIR}/gol_cubes", 19 | "flavors": [ 20 | "ct" 21 | ], 22 | "functors": "./functors", 23 | "mode": "CT" 24 | } 25 | } 26 | } 27 | }, 28 | "directories": { 29 | "gol": "./gol/serial_non_template" 30 | }, 31 | "glob-flavors": [], 32 | "glob-submitter": {} 33 | } 34 | -------------------------------------------------------------------------------- /test/integration/GameOfLife_hybrid_filter_Slurm/gol_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "builds": { 3 | "%gol": { 4 | "items": { 5 | "gol": { 6 | "analyzer": "../../../extern/install/metacg/bin/", 7 | "argmap": { 8 | "mapper": "Linear", 9 | "size": [ 10 | 50, 11 | 80, 12 | 110, 13 | 150, 14 | 300, 15 | 500 16 | ] 17 | }, 18 | "cubes": "${PIRA_DIR}/gol_cubes", 19 | "flavors": [ 20 | "ct" 21 | ], 22 | "functors": "./functors", 23 | "mode": "CT" 24 | } 25 | } 26 | } 27 | }, 28 | "directories": { 29 | "gol": "./gol/serial_non_template" 30 | }, 31 | "glob-flavors": [], 32 | "glob-submitter": {} 33 | } 34 | -------------------------------------------------------------------------------- /test/unit/input/unit_input_003.json: -------------------------------------------------------------------------------- 1 | { 2 | "builds": { 3 | "%home": { 4 | "items": { 5 | "item01": { 6 | "analyzer": "/path/to/analysis/tool", 7 | "argmap": { 8 | "mapper": "Linear", 9 | "param1": [ 10 | "val1", 11 | "val2", 12 | "val3" 13 | ], 14 | "param2": [ 15 | "yval1", 16 | "yval2", 17 | "yval3" 18 | ] 19 | }, 20 | "cubes": "/where/to/put/cube/files/item01", 21 | "flavors": [ 22 | "test" 23 | ], 24 | "functors": "/directory/for/functors/item01", 25 | "mode": "CT" 26 | } 27 | } 28 | } 29 | }, 30 | "directories": { 31 | "home": "/this/is/my/home" 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /extern/src/llvm-instrumentation/lib/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(PROJECT_NAME instrumentationlib) 2 | set(TARGETS_EXPORT_NAME ${PROJECT_NAME}-target) 3 | 4 | 5 | set(LIB_SOURCES 6 | src/InstrumentationLib.cpp 7 | ) 8 | 9 | make_llvm_module(instrumentationlib 10 | "${LIB_SOURCES}" 11 | INCLUDE_DIRS 12 | ${CMAKE_CURRENT_SOURCE_DIR} 13 | ${PROJECT_SOURCE_DIR}/lib/include 14 | ) 15 | 16 | install( 17 | TARGETS instrumentationlib 18 | EXPORT ${TARGETS_EXPORT_NAME} 19 | LIBRARY DESTINATION lib 20 | ARCHIVE DESTINATION lib 21 | ) 22 | 23 | configure_package_config_file( 24 | ${PROJECT_SOURCE_DIR}/cmake/Config.cmake.in 25 | ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake 26 | INSTALL_DESTINATION lib/cmake 27 | ) 28 | 29 | install(FILES 30 | ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake 31 | DESTINATION lib/cmake 32 | ) 33 | -------------------------------------------------------------------------------- /test/integration/GameOfLife_hybrid_filter/expected_instrumentation.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "iteration": 0, 4 | "expect": ["main", "_ZNK10GameOfLife19getNumLiveNeighborsEii", "_ZN10GameOfLife4tickEv", "_ZN10GameOfLife4tickEv", "_ZN10GameOfLife10applyRulesEiiRSt6vectorIcSaIcEE", "_ZN10GameOfLife4initEv"], 5 | "may-expect": [".*basic_string.*", ".*stoa.*", ".*swap.*"], 6 | "never-expect": [] 7 | }, 8 | { 9 | "iteration": 1, 10 | "expect": [], 11 | "may-expect": [".*basic_string.*", ".*stoa.*", ".*swap.*"], 12 | "never-expect": [] 13 | }, 14 | { 15 | "iteration": 2, 16 | "expect": [], 17 | "may-expect": [], 18 | "never-expect": [] 19 | }, 20 | { 21 | "iteration": 3, 22 | "expect": [], 23 | "may-expect": [], 24 | "never-expect": [] 25 | } 26 | ] -------------------------------------------------------------------------------- /test/integration/GameOfLife_hybrid_filter_Slurm/expected_instrumentation.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "iteration": 0, 4 | "expect": ["main", "_ZNK10GameOfLife19getNumLiveNeighborsEii", "_ZN10GameOfLife4tickEv", "_ZN10GameOfLife4tickEv", "_ZN10GameOfLife10applyRulesEiiRSt6vectorIcSaIcEE", "_ZN10GameOfLife4initEv"], 5 | "may-expect": [".*basic_string.*", ".*stoa.*", ".*swap.*"], 6 | "never-expect": [] 7 | }, 8 | { 9 | "iteration": 1, 10 | "expect": [], 11 | "may-expect": [".*basic_string.*", ".*stoa.*", ".*swap.*"], 12 | "never-expect": [] 13 | }, 14 | { 15 | "iteration": 2, 16 | "expect": [], 17 | "may-expect": [], 18 | "never-expect": [] 19 | }, 20 | { 21 | "iteration": 3, 22 | "expect": [], 23 | "may-expect": [], 24 | "never-expect": [] 25 | } 26 | ] -------------------------------------------------------------------------------- /run-python-lint.sh: -------------------------------------------------------------------------------- 1 | echo "Running Python formatting and linting" 2 | 3 | didfail=0 4 | 5 | export PYTHONPATH=$PWD:$PYTHONPATH 6 | # This seems to be specific to my machine... 7 | export PATH=~/.local/bin:$PATH 8 | 9 | # files and directories to be checked by pylint 10 | locations=( 11 | ./pira.py 12 | ./lib 13 | ./test/integration/check.py 14 | ) 15 | 16 | # First check for formatting then lint 17 | for i in $(find ${locations[@]} -iname "*.py"); do 18 | testName=$(echo "$i" | awk -F . '{print substr($2,2)}') 19 | 20 | echo "Formatting check for $i -> $testName"; 21 | python -m yapf -q $i 22 | if [ $? -ne 0 ]; then 23 | echo "Formatting check failed for $i" 24 | exit 1 25 | fi 26 | 27 | echo "Running $i -> $testName"; 28 | python -m pylint -E $i 29 | if [ $? -ne 0 ]; then 30 | let didfail=$didfail+1; 31 | fi ; 32 | done 33 | 34 | echo "Failed tests: $didfail" 35 | 36 | exit $didfail 37 | -------------------------------------------------------------------------------- /test/integration/LoadImbalance/expected_instrumentation.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "iteration": 0, 4 | "expect": ["main"], 5 | "may-expect": [], 6 | "never-expect": [] 7 | }, 8 | { 9 | "iteration": 1, 10 | "expect": ["main"], 11 | "may-expect": ["test", "imbalanced", "balanced", "MPI_Init"], 12 | "never-expect": [] 13 | }, 14 | { 15 | "iteration": 2, 16 | "expect": ["main"], 17 | "may-expect": ["test", "imbalanced", "balanced", "MPI_Init"], 18 | "never-expect": [] 19 | }, 20 | { 21 | "iteration": 3, 22 | "expect": ["main"], 23 | "may-expect": ["test", "imbalanced", "balanced", "MPI_Init"], 24 | "never-expect": [] 25 | }, 26 | { 27 | "iteration": 4, 28 | "expect": ["main", "imbalanced"], 29 | "may-expect": ["test", "MPI_Init"], 30 | "never-expect": ["balanced"] 31 | } 32 | ] -------------------------------------------------------------------------------- /run_tests.sh: -------------------------------------------------------------------------------- 1 | echo "Running the PIRA tests" 2 | 3 | tester='' 4 | 5 | didfail=0 6 | 7 | export PYTHONPATH=$PWD:$PYTHONPATH 8 | # This seems to be specific to my machine... 9 | export PATH=~/.local/bin:$PATH 10 | 11 | command -v pytest 12 | if [ $? -eq 1 ]; then 13 | echo -e "[PIRA]: No pytest found.\n" 14 | else 15 | tester=pytest 16 | fi 17 | 18 | command -v pytest-3 19 | if [ $? -eq 1 ]; then 20 | echo -e "[PIRA]: No pytest-3 found.\n" 21 | else 22 | tester=pytest-3 23 | fi 24 | 25 | if [ -z $tester ]; then 26 | exit -1 27 | fi 28 | 29 | cd test/unit 30 | for i in `find . -iname "*.py"`; do 31 | testName=$(echo "$i" | awk -F . '{print substr($2,2)}') 32 | echo "Running $i -> $testName" 33 | $tester --junit-xml=report-${testName}.xml --cov=lib --cov-append $i 34 | if [ $? -ne 0 ]; then 35 | didfail=$((didfail+1)) 36 | fi 37 | done 38 | coverage combine 39 | cd ../.. 40 | 41 | echo "Failed tests: $didfail" 42 | 43 | exit $didfail 44 | -------------------------------------------------------------------------------- /test/integration/LoadImbalance_Slurm/expected_instrumentation.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "iteration": 0, 4 | "expect": ["main"], 5 | "may-expect": [], 6 | "never-expect": [] 7 | }, 8 | { 9 | "iteration": 1, 10 | "expect": ["main"], 11 | "may-expect": ["test", "imbalanced", "balanced", "MPI_Init"], 12 | "never-expect": [] 13 | }, 14 | { 15 | "iteration": 2, 16 | "expect": ["main"], 17 | "may-expect": ["test", "imbalanced", "balanced", "MPI_Init"], 18 | "never-expect": [] 19 | }, 20 | { 21 | "iteration": 3, 22 | "expect": ["main"], 23 | "may-expect": ["test", "imbalanced", "balanced", "MPI_Init"], 24 | "never-expect": [] 25 | }, 26 | { 27 | "iteration": 4, 28 | "expect": ["main", "imbalanced"], 29 | "may-expect": ["test", "MPI_Init"], 30 | "never-expect": ["balanced"] 31 | } 32 | ] -------------------------------------------------------------------------------- /test/integration/LoadImbalance/imbalance/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "lib.h" 4 | #include "util.h" 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | void function_pointer_test() { 11 | void (*r)() = NULL; 12 | 13 | get_func_ptr(&r, 0); 14 | 15 | r(); 16 | } 17 | 18 | 19 | /** 20 | * Main function 21 | */ 22 | int main(int argc, char** argv ) { 23 | MPI_Init( &argc, &argv ); 24 | 25 | int myrank, nprocs; 26 | MPI_Comm_rank( MPI_COMM_WORLD, &myrank ); 27 | MPI_Comm_size( MPI_COMM_WORLD, &nprocs ); 28 | 29 | // function pointer test 30 | function_pointer_test(); 31 | // Fn func = get_func_ptr(0); 32 | // func(); 33 | 34 | // print_mpi_info(myrank, nprocs); 35 | 36 | // imbalance detection test 37 | test(myrank); 38 | 39 | printf("%d is done.\n", myrank); 40 | 41 | MPI_Barrier(MPI_COMM_WORLD); 42 | 43 | MPI_Finalize(); 44 | 45 | return 0; 46 | } 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /test/integration/LoadImbalance_Slurm/imbalance/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "lib.h" 4 | #include "util.h" 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | void function_pointer_test() { 11 | void (*r)() = NULL; 12 | 13 | get_func_ptr(&r, 0); 14 | 15 | r(); 16 | } 17 | 18 | 19 | /** 20 | * Main function 21 | */ 22 | int main(int argc, char** argv ) { 23 | MPI_Init( &argc, &argv ); 24 | 25 | int myrank, nprocs; 26 | MPI_Comm_rank( MPI_COMM_WORLD, &myrank ); 27 | MPI_Comm_size( MPI_COMM_WORLD, &nprocs ); 28 | 29 | // function pointer test 30 | function_pointer_test(); 31 | // Fn func = get_func_ptr(0); 32 | // func(); 33 | 34 | // print_mpi_info(myrank, nprocs); 35 | 36 | // imbalance detection test 37 | test(myrank); 38 | 39 | printf("%d is done.\n", myrank); 40 | 41 | MPI_Barrier(MPI_COMM_WORLD); 42 | 43 | MPI_Finalize(); 44 | 45 | return 0; 46 | } 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /test/integration/GameOfLifePiraVersion1/expected_instrumentation.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "iteration": 0, 4 | "expect": ["main", "_ZNK10GameOfLife19getNumLiveNeighborsEii", "_ZN10GameOfLife4tickEv", "_ZN10GameOfLife4tickEv", "_ZN10GameOfLife10applyRulesEiiRSt6vectorIcSaIcEE", "_ZN10GameOfLife4initEv"], 5 | "may-expect": [".*basic_string.*", ".*stoa.*", ".*swap.*"], 6 | "never-expect": [] 7 | }, 8 | { 9 | "iteration": 1, 10 | "expect": ["main"], 11 | "may-expect": [".*basic_string.*", ".*stoa.*", ".*swap.*", ".*vector.*at.*", "_ZN10GameOfLife10applyRulesEiiRSt6vectorIcSaIcEE", "_ZNK10GameOfLife19getNumLiveNeighborsEii", "_ZN10GameOfLife4tickEv"], 12 | "never-expect": [] 13 | }, 14 | { 15 | "iteration": 2, 16 | "expect": ["main", "_ZN10GameOfLife10applyRulesEiiRSt6vectorIcSaIcEE", "_ZNK10GameOfLife19getNumLiveNeighborsEii", "_ZN10GameOfLife4tickEv"], 17 | "may-expect": [".*vector.*at.*"], 18 | "never-expect": [] 19 | } 20 | ] -------------------------------------------------------------------------------- /test/integration/GameOfLifePiraVersion1_Slurm/expected_instrumentation.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "iteration": 0, 4 | "expect": ["main", "_ZNK10GameOfLife19getNumLiveNeighborsEii", "_ZN10GameOfLife4tickEv", "_ZN10GameOfLife4tickEv", "_ZN10GameOfLife10applyRulesEiiRSt6vectorIcSaIcEE", "_ZN10GameOfLife4initEv"], 5 | "may-expect": [".*basic_string.*", ".*stoa.*", ".*swap.*"], 6 | "never-expect": [] 7 | }, 8 | { 9 | "iteration": 1, 10 | "expect": ["main"], 11 | "may-expect": [".*basic_string.*", ".*stoa.*", ".*swap.*", ".*vector.*at.*", "_ZN10GameOfLife10applyRulesEiiRSt6vectorIcSaIcEE", "_ZNK10GameOfLife19getNumLiveNeighborsEii", "_ZN10GameOfLife4tickEv"], 12 | "never-expect": [] 13 | }, 14 | { 15 | "iteration": 2, 16 | "expect": ["main", "_ZN10GameOfLife10applyRulesEiiRSt6vectorIcSaIcEE", "_ZNK10GameOfLife19getNumLiveNeighborsEii", "_ZN10GameOfLife4tickEv"], 17 | "may-expect": [".*vector.*at.*"], 18 | "never-expect": [] 19 | } 20 | ] -------------------------------------------------------------------------------- /extern/src/llvm-instrumentation/test/callsite.cpp: -------------------------------------------------------------------------------- 1 | // RUN: clang++ -Xclang -load -Xclang ../build/lib/instrumentationlib.so -mllvm --score-p-filter=callsite.cfg -S -emit-llvm -o - %s | FileCheck %s 2 | // 3 | 4 | // CHECK-LABEL: define dso_local i32 @_Z1av() 5 | // CHECK-NOT: call void @__cyg_profile_func_enter 6 | // CHECK-NOT: call void @__cyg_profile_func_exit 7 | int a() { 8 | int b = 3; 9 | return b; 10 | } 11 | 12 | // CHECK-LABEL: define dso_local i32 @_Z1cv() 13 | // CHECK: call void @__cyg_profile_func_enter 14 | // CHECK: call i32 @_Z1av() 15 | // CHECK: call void @__cyg_profile_func_exit 16 | int c() { 17 | int some_var = 2; 18 | a(); 19 | return 7; 20 | } 21 | 22 | // CHECK-LABEL: define dso_local void @_Z3foov() 23 | // CHECK-NOT: call void @__cyg_profile_func_enter 24 | // CHECK-NOT: call void @__cyg_profile_func_exit 25 | void foo() {} 26 | 27 | // CHECK-LABEL: define dso_local i32 @main( 28 | // CHECK: store i32 0, i32* %3 29 | // CHECK: store i8** %1, i8*** %5 30 | int main(int argc, char **argv) { return 0; } 31 | -------------------------------------------------------------------------------- /run-shell-lint.sh: -------------------------------------------------------------------------------- 1 | #! //usr/bin/env bash 2 | echo "Running Shell lint" 3 | 4 | didfail=0 5 | 6 | 7 | 8 | for i in $(find ./test/integration -iname "*.sh"); do 9 | testName=$(echo "$i" | awk -F . '{print substr($2,2)}') 10 | echo "Running $i -> $testName"; 11 | 12 | if [[ $(grep -e '/home/*' -c "$i") -ne 0 ]]; then 13 | echo "Detected paths refering to /home" 14 | didfail=$((didfail+1)) 15 | fi 16 | 17 | if [[ "$(shellcheck -S error "$i")" -ne 0 ]]; then 18 | didfail=$((didfail+1)) 19 | fi 20 | done 21 | 22 | for i in $(find ./resources -iname "*.sh"); do 23 | testName=$(echo "$i" | awk -F . '{print substr($2,2)}') 24 | echo "Running $i -> $testName"; 25 | 26 | if [[ $(grep -e '/home/*' -c "$i") -ne 0 ]]; then 27 | echo "Detected paths refering to /home" 28 | didfail=$((didfail+1)) 29 | fi 30 | 31 | shellcheck -S error "$i" 32 | if [[ "$(shellcheck -S error "$i")" -ne 0 ]]; then 33 | didfail=$((didfail+1)) 34 | fi 35 | done 36 | 37 | echo "Failed tests: $didfail" 38 | 39 | exit $didfail 40 | -------------------------------------------------------------------------------- /extern/src/llvm-instrumentation/test/callsite_exception.cpp: -------------------------------------------------------------------------------- 1 | // RUN: clang++ -Xclang -load -Xclang ../build/lib/instrumentationlib.so -mllvm --score-p-filter=callsite.cfg -S -emit-llvm -o - %s | FileCheck %s 2 | // 3 | 4 | // CHECK-LABEL: define dso_local i32 @_Z1av() 5 | // CHECK-NOT: call void @__cyg_profile_func_enter 6 | // CHECK-NOT: call void @__cyg_profile_func_exit 7 | int a() { 8 | int b = 3; 9 | return b; 10 | } 11 | 12 | // CHECK-LABEL: define dso_local i32 @_Z1cv() 13 | // CHECK: call void @__cyg_profile_func_enter 14 | // CHECK: invoke i32 @_Z1av() 15 | // CHECK: call void @__cyg_profile_func_exit 16 | int c() { 17 | try { 18 | a(); 19 | } catch (int ex) { 20 | } 21 | return 7; 22 | } 23 | 24 | // CHECK-LABEL: define dso_local void @_Z3foov() 25 | // CHECK-NOT: call void @__cyg_profile_func_enter 26 | // CHECK-NOT: call void @__cyg_profile_func_exit 27 | void foo() {} 28 | 29 | // CHECK-LABEL: define dso_local i32 @main( 30 | // CHECK: store i32 0, i32* %3 31 | // CHECK: store i8** %1, i8*** %5 32 | int main(int argc, char **argv) { return 0; } 33 | -------------------------------------------------------------------------------- /docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:20.04 2 | 3 | WORKDIR /usr/src 4 | 5 | ENV DEBIAN_FRONTEND=noninteractive 6 | 7 | RUN apt-get update -y && apt-get upgrade -y && \ 8 | apt-get install -y gcc g++ cmake python3 apt-utils wget gnupg qt5-default git autoconf automake \ 9 | libtool zlib1g-dev zlib1g vim unzip python3-pip python3-pytest python3-pytest-cov openmpi-bin \ 10 | openmpi-common bison flex 11 | 12 | RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key| apt-key add - && \ 13 | apt-get install -y libllvm10 llvm-10 llvm-10-dev llvm-10-doc llvm-10-examples \ 14 | llvm-10-runtime clang-10 clang-tools-10 libclang-common-10-dev libclang-10-dev libclang1-10 clang-format-10 clang-tidy-10 15 | 16 | RUN ln -s /usr/bin/clang-10 /usr/bin/clang && \ 17 | ln -s /usr/bin/clang++-10 /usr/bin/clang++ 18 | 19 | RUN python3 -m pip install -U pip 20 | 21 | RUN mkdir pira 22 | COPY resources pira/resources 23 | COPY extern pira/extern 24 | COPY .git pira/.git 25 | RUN cd pira && cd resources && ./build_submodules.sh -p $(nproc) -o "--with-mpi=openmpi" && cp setup_paths.sh setup_paths.sh.mod 26 | RUN cd pira && sed -i "1s/.*/#!\/usr\/bin\/env python3/" ./extern/install/mpiwrap/wrap.py 27 | COPY . pira 28 | RUN cd pira/resources && cp setup_paths.sh.mod setup_paths.sh 29 | -------------------------------------------------------------------------------- /test/README.md: -------------------------------------------------------------------------------- 1 | # Resources used in PIRA tests 2 | 3 | The directories contain the resources used for testing PIRA and are organized in the two categories *unit* and *integration*. 4 | This corresponds to, as the names suggest, the size of the tests that go into both directories. 5 | 6 | The third directory is meant to contain inputs to PIRA that are shared between unit and integration test cases, so we do not have to duplicate inputs. 7 | 8 | ## unit 9 | 10 | Is meant to hold the unit tests that are run. 11 | 12 | ## integration 13 | 14 | This folder has all resources required for our integration testing, i.e., invoking pira.py with some arguments. 15 | The sub directories here are meant to hold those files (configs, etc), that are specific to ```targets``` and are only used in integration testing. 16 | 17 | ### configs 18 | 19 | Contains various configs that are valid and invalid. 20 | Test targeting the configuration should make sure that errors are caught as early as possible. 21 | 22 | ### functors 23 | 24 | Contains various functors. 25 | Some of the functors can / should be used together with a config, but that is not mandatory. 26 | 27 | ### targets 28 | 29 | Contains target programs that we use to apply our toolchain to during integration testing. 30 | -------------------------------------------------------------------------------- /test/unit/input/unit_input_002.json: -------------------------------------------------------------------------------- 1 | { 2 | "builds": { 3 | "%home": { 4 | "items": { 5 | "item01": { 6 | "analyzer": "/path/to/analysis/tool", 7 | "argmap": { 8 | "mapper": "CartesianProduct", 9 | "param1": [ 10 | "val1", 11 | "val2" 12 | ], 13 | "param2": [ 14 | "val3", 15 | "val4" 16 | ] 17 | }, 18 | "cubes": "/where/to/put/cube/files", 19 | "flavors": [ 20 | "local-flav1", 21 | "vanilla" 22 | ], 23 | "functors": "/directory/for/functors/item01", 24 | "mode": "CT" 25 | }, 26 | "item02": { 27 | "analyzer": "/path/to/analysis/tool", 28 | "argmap": { 29 | "mapper": "Linear", 30 | "param1": [ 31 | "val1", 32 | "val2", 33 | "val3" 34 | ] 35 | }, 36 | "cubes": "/where/to/put/cube/files/item02", 37 | "flavors": [ 38 | "test-flav" 39 | ], 40 | "functors": "/directory/for/functors/item02", 41 | "mode": "CT" 42 | } 43 | } 44 | } 45 | }, 46 | "directories": { 47 | "home": "/this/is/my/home" 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /test/integration/LoadImbalance/imbalance/lib.c: -------------------------------------------------------------------------------- 1 | #include "lib.h" 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | /* 8 | * Prints information about MPI environment 9 | */ 10 | void print_mpi_info(int myrank, int nprocs) { 11 | 12 | if(myrank == 0) { // only once 13 | printf("Size: %d\n", nprocs); 14 | } 15 | 16 | MPI_Barrier(MPI_COMM_WORLD); 17 | 18 | printf("My Rank: %d\n", myrank); 19 | } 20 | 21 | /** 22 | * This function is load imbalanced on purpose. 23 | */ 24 | void imbalanced(int myrank) { 25 | // do some heavy work 26 | int i = 0; 27 | i++; 28 | i++; 29 | i--; 30 | i+=42; 31 | i*=2; 32 | i=0; 33 | 34 | if(myrank % 2 == 0) { 35 | sleep(1); 36 | } else { 37 | sleep(2); 38 | } 39 | } 40 | 41 | /** 42 | * Perfectly balanced - as all things should be. 43 | */ 44 | void balanced() { 45 | // do some heavy work 46 | int i = 0; 47 | i++; 48 | i++; 49 | i--; 50 | i+=42; 51 | i*=2; 52 | i=0; 53 | 54 | // wait for some time 55 | sleep(1); 56 | } 57 | 58 | void test(int myrank) { 59 | MPI_Barrier(MPI_COMM_WORLD); 60 | 61 | balanced(); 62 | imbalanced(myrank); 63 | 64 | MPI_Barrier(MPI_COMM_WORLD); 65 | } 66 | 67 | void func1() { 68 | sleep(1); 69 | printf("Running func1\n"); 70 | } 71 | 72 | void func2() { 73 | sleep(1); 74 | printf("Running func2\n"); 75 | } -------------------------------------------------------------------------------- /test/integration/LoadImbalance_Slurm/imbalance/lib.c: -------------------------------------------------------------------------------- 1 | #include "lib.h" 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | /* 8 | * Prints information about MPI environment 9 | */ 10 | void print_mpi_info(int myrank, int nprocs) { 11 | 12 | if(myrank == 0) { // only once 13 | printf("Size: %d\n", nprocs); 14 | } 15 | 16 | MPI_Barrier(MPI_COMM_WORLD); 17 | 18 | printf("My Rank: %d\n", myrank); 19 | } 20 | 21 | /** 22 | * This function is load imbalanced on purpose. 23 | */ 24 | void imbalanced(int myrank) { 25 | // do some heavy work 26 | int i = 0; 27 | i++; 28 | i++; 29 | i--; 30 | i+=42; 31 | i*=2; 32 | i=0; 33 | 34 | if(myrank % 2 == 0) { 35 | sleep(1); 36 | } else { 37 | sleep(2); 38 | } 39 | } 40 | 41 | /** 42 | * Perfectly balanced - as all things should be. 43 | */ 44 | void balanced() { 45 | // do some heavy work 46 | int i = 0; 47 | i++; 48 | i++; 49 | i--; 50 | i+=42; 51 | i*=2; 52 | i=0; 53 | 54 | // wait for some time 55 | sleep(1); 56 | } 57 | 58 | void test(int myrank) { 59 | MPI_Barrier(MPI_COMM_WORLD); 60 | 61 | balanced(); 62 | imbalanced(myrank); 63 | 64 | MPI_Barrier(MPI_COMM_WORLD); 65 | } 66 | 67 | void func1() { 68 | sleep(1); 69 | printf("Running func1\n"); 70 | } 71 | 72 | void func2() { 73 | sleep(1); 74 | printf("Running func2\n"); 75 | } -------------------------------------------------------------------------------- /test/inputs/configs/batchsystem_config_007.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "backend": "slurm", 4 | "interface": "pyslurm", 5 | "timings": "subprocess" 6 | }, 7 | "module-loads": [ 8 | { 9 | "name": "gcc", 10 | "version": "8.5", 11 | "depends-on": null 12 | }, 13 | { 14 | "name": "cmake", 15 | "version": "8.5", 16 | "depends-on": null 17 | }, 18 | { 19 | "name": "llvm", 20 | "version": "10.0.0", 21 | "depends-on": [ 22 | { 23 | "version": "8.5" 24 | } 25 | ] 26 | }, 27 | { 28 | "name": "openmpi", 29 | "version": "4.0.5", 30 | "depends-on": [ 31 | { 32 | "name": "gcc", 33 | "version": "8.5" 34 | } 35 | ] 36 | }, 37 | { 38 | "name": "python", 39 | "version": "3.9.5", 40 | "depends-on": [ 41 | { 42 | "name": "openmpi", 43 | "version": "4.0.5" 44 | } 45 | ] 46 | }, 47 | { 48 | "name": "qt", 49 | "version": "5.13.2", 50 | "depends-on": [ 51 | { 52 | "name": "python", 53 | "version": "3.9.5" 54 | } 55 | ] 56 | } 57 | ], 58 | "batch-settings": 59 | { 60 | "time": "00:10:00", 61 | "mem-per-cpu": 3800, 62 | "ntasks": 1, 63 | "partition": null, 64 | "reservation": null, 65 | "account": "project01823", 66 | "cpus-per_task": 96 67 | } 68 | } -------------------------------------------------------------------------------- /test/inputs/configs/batchsystem_config_006.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "backend": "slurm", 4 | "interface": "pyslurm", 5 | "timings": "subprocess" 6 | }, 7 | "module-loads": [ 8 | { 9 | "version": "8.5", 10 | "depends-on": null 11 | }, 12 | { 13 | "name": "cmake", 14 | "version": "8.5", 15 | "depends-on": null 16 | }, 17 | { 18 | "name": "llvm", 19 | "version": "10.0.0", 20 | "depends-on": [ 21 | { 22 | "name": "gcc", 23 | "version": "8.5" 24 | } 25 | ] 26 | }, 27 | { 28 | "name": "openmpi", 29 | "version": "4.0.5", 30 | "depends-on": [ 31 | { 32 | "name": "gcc", 33 | "version": "8.5" 34 | } 35 | ] 36 | }, 37 | { 38 | "name": "python", 39 | "version": "3.9.5", 40 | "depends-on": [ 41 | { 42 | "name": "openmpi", 43 | "version": "4.0.5" 44 | } 45 | ] 46 | }, 47 | { 48 | "name": "qt", 49 | "version": "5.13.2", 50 | "depends-on": [ 51 | { 52 | "name": "python", 53 | "version": "3.9.5" 54 | } 55 | ] 56 | } 57 | ], 58 | "batch-settings": 59 | { 60 | "time": "00:10:00", 61 | "mem-per-cpu": 3800, 62 | "ntasks": 1, 63 | "partition": null, 64 | "reservation": null, 65 | "account": "project01823", 66 | "cpus-per-task": 96 67 | } 68 | } -------------------------------------------------------------------------------- /test/inputs/configs/batchsystem_config_001.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "backend": "slurm", 4 | "interface": "pyslurm", 5 | "timings": "subprocess" 6 | }, 7 | "module-loads": [ 8 | { 9 | "name": "gcc", 10 | "version": "8.5", 11 | "depends-on": null 12 | }, 13 | { 14 | "name": "cmake", 15 | "version": "8.5", 16 | "depends-on": null 17 | }, 18 | { 19 | "name": "llvm", 20 | "version": "10.0.0", 21 | "depends-on": [ 22 | { 23 | "name": "gcc", 24 | "version": "8.5" 25 | } 26 | ] 27 | }, 28 | { 29 | "name": "openmpi", 30 | "version": "4.0.5", 31 | "depends-on": [ 32 | { 33 | "name": "gcc", 34 | "version": "8.5" 35 | } 36 | ] 37 | }, 38 | { 39 | "name": "python", 40 | "version": "3.9.5", 41 | "depends-on": [ 42 | { 43 | "name": "openmpi", 44 | "version": "4.0.5" 45 | } 46 | ] 47 | }, 48 | { 49 | "name": "qt", 50 | "version": "5.13.2", 51 | "depends-on": [ 52 | { 53 | "name": "python", 54 | "version": "3.9.5" 55 | } 56 | ] 57 | } 58 | ], 59 | "batch-settings": 60 | { 61 | "time": "00:10:00", 62 | "mem-per-cpu": 3800, 63 | "ntasks": 1, 64 | "partition": null, 65 | "reservation": null, 66 | "account": "project01823", 67 | "cpus-per-task": 96 68 | } 69 | } -------------------------------------------------------------------------------- /extern/src/llvm-instrumentation/.gitignore: -------------------------------------------------------------------------------- 1 | # Taken from github.com 2 | 3 | # C++ 4 | # Prerequisites 5 | *.d 6 | 7 | # Compiled Object files 8 | *.slo 9 | *.lo 10 | *.o 11 | *.obj 12 | 13 | # Precompiled Headers 14 | *.gch 15 | *.pch 16 | 17 | # Compiled Dynamic libraries 18 | *.so 19 | *.dylib 20 | *.dll 21 | 22 | # Fortran module files 23 | *.mod 24 | *.smod 25 | 26 | # Compiled Static libraries 27 | *.lai 28 | *.la 29 | *.a 30 | *.lib 31 | 32 | # Executables 33 | *.exe 34 | *.out 35 | *.app 36 | 37 | # C 38 | # Prerequisites 39 | *.d 40 | 41 | # Object files 42 | *.o 43 | *.ko 44 | *.obj 45 | *.elf 46 | 47 | # Linker output 48 | *.ilk 49 | *.map 50 | *.exp 51 | 52 | # Precompiled Headers 53 | *.gch 54 | *.pch 55 | 56 | # Libraries 57 | *.lib 58 | *.a 59 | *.la 60 | *.lo 61 | 62 | # Shared objects (inc. Windows DLLs) 63 | *.dll 64 | *.so 65 | *.so.* 66 | *.dylib 67 | 68 | # Executables 69 | *.exe 70 | *.out 71 | *.app 72 | *.i*86 73 | *.x86_64 74 | *.hex 75 | 76 | # Debug files 77 | *.dSYM/ 78 | *.su 79 | *.idb 80 | *.pdb 81 | 82 | # Kernel Module Compile Results 83 | *.mod* 84 | *.cmd 85 | .tmp_versions/ 86 | modules.order 87 | Module.symvers 88 | Mkfile.old 89 | dkms.conf 90 | 91 | # CMake 92 | CMakeLists.txt.user 93 | CMakeCache.txt 94 | CMakeFiles 95 | CMakeScripts 96 | Testing 97 | Makefile 98 | cmake_install.cmake 99 | install_manifest.txt 100 | compile_commands.json 101 | CTestTestfile.cmake 102 | _deps 103 | -------------------------------------------------------------------------------- /test/integration/GameOfLifePiraVersion1_Slurm/batchsystem.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "backend": "slurm", 4 | "interface": "sbatch-wait", 5 | "timings": "subprocess" 6 | }, 7 | "module-loads": [ 8 | { 9 | "name": "gcc", 10 | "version": "8.5", 11 | "depends_on": null 12 | }, 13 | { 14 | "name": "cmake", 15 | "version": "8.5", 16 | "depends_on": null 17 | }, 18 | { 19 | "name": "llvm", 20 | "version": "10.0.0", 21 | "depends_on": [ 22 | { 23 | "name": "gcc", 24 | "version": "8.5" 25 | } 26 | ] 27 | }, 28 | { 29 | "name": "openmpi", 30 | "version": "4.0.5", 31 | "depends_on": [ 32 | { 33 | "name": "gcc", 34 | "version": "8.5" 35 | } 36 | ] 37 | }, 38 | { 39 | "name": "python", 40 | "version": "3.9.5", 41 | "depends_on": [ 42 | { 43 | "name": "openmpi", 44 | "version": "4.0.5" 45 | } 46 | ] 47 | }, 48 | { 49 | "name": "qt", 50 | "version": "5.13.2", 51 | "depends_on": [ 52 | { 53 | "name": "python", 54 | "version": "3.9.5" 55 | } 56 | ] 57 | } 58 | ], 59 | "batch-settings": 60 | { 61 | "time": "00:10:00", 62 | "mem-per-cpu": 3800, 63 | "ntasks": 1, 64 | "partition": null, 65 | "reservation": null, 66 | "account": "project01823", 67 | "cpus-per-task": 96 68 | } 69 | } -------------------------------------------------------------------------------- /test/integration/Kripke/expected_instrumentation.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "iteration": 0, 4 | "expect": [ 5 | "main" 6 | ], 7 | "may-expect": [ 8 | ".*" 9 | ], 10 | "never-expect": [] 11 | }, 12 | { 13 | "iteration": 1, 14 | "expect": [ 15 | "main" 16 | ], 17 | "may-expect": [ 18 | ".*" 19 | ], 20 | "never-expect": [ 21 | "_ZN6Kripke6TimingD0Ev", 22 | "_ZN6Kripke9SweepComm13workRemainingEv", 23 | "_ZNSt6vectorImSaImEE6resizeEmRKm", 24 | "_ZN6Kripke9SweepComm13workRemainingEv", 25 | "_ZN6Kripke8Generate12generateDataERNS_4Core9DataStoreERK14InputVariables" 26 | ] 27 | }, 28 | { 29 | "iteration": 2, 30 | "expect": [ 31 | "main", 32 | "_ZN6Kripke17SteadyStateSolverERNS_4Core9DataStoreEmb", 33 | "_ZN6Kripke6Kernel10scatteringERNS_4Core9DataStoreE" 34 | ], 35 | "may-expect": [ 36 | ".+Kripke.dispatch.*" 37 | ], 38 | "never-expect": [] 39 | }, 40 | { 41 | "iteration": 3, 42 | "expect": [ 43 | "main", 44 | "_ZN6Kripke17SteadyStateSolverERNS_4Core9DataStoreEmb", 45 | "_ZN6Kripke6Kernel10scatteringERNS_4Core9DataStoreE" 46 | ], 47 | "may-expect": [ 48 | ".+Kripke.dispatch.*" 49 | ], 50 | "never-expect": [] 51 | } 52 | ] -------------------------------------------------------------------------------- /test/integration/Kripke_Slurm/batchsystem.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "backend": "slurm", 4 | "interface": "os", 5 | "timings": "os", 6 | "force-sequential": false 7 | }, 8 | "module-loads": [ 9 | { 10 | "name": "gcc", 11 | "version": "8.5", 12 | "depends_on": null 13 | }, 14 | { 15 | "name": "cmake", 16 | "version": "8.5", 17 | "depends_on": null 18 | }, 19 | { 20 | "name": "llvm", 21 | "version": "10.0.0", 22 | "depends_on": [ 23 | { 24 | "name": "gcc", 25 | "version": "8.5" 26 | } 27 | ] 28 | }, 29 | { 30 | "name": "openmpi", 31 | "version": "4.0.5", 32 | "depends_on": [ 33 | { 34 | "name": "gcc", 35 | "version": "8.5" 36 | } 37 | ] 38 | }, 39 | { 40 | "name": "python", 41 | "version": "3.9.5", 42 | "depends_on": [ 43 | { 44 | "name": "openmpi", 45 | "version": "4.0.5" 46 | } 47 | ] 48 | }, 49 | { 50 | "name": "qt", 51 | "version": "5.13.2", 52 | "depends_on": [ 53 | { 54 | "name": "python", 55 | "version": "3.9.5" 56 | } 57 | ] 58 | } 59 | ], 60 | "batch-settings": 61 | { 62 | "time": "00:10:00", 63 | "mem-per-cpu": 3800, 64 | "ntasks": 8, 65 | "partition": null, 66 | "reservation": null, 67 | "account": "project01823", 68 | "cpus-per-task": 96 69 | } 70 | } -------------------------------------------------------------------------------- /test/integration/Kripke_Slurm/expected_instrumentation.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "iteration": 0, 4 | "expect": [ 5 | "main" 6 | ], 7 | "may-expect": [ 8 | ".*" 9 | ], 10 | "never-expect": [] 11 | }, 12 | { 13 | "iteration": 1, 14 | "expect": [ 15 | "main" 16 | ], 17 | "may-expect": [ 18 | ".*" 19 | ], 20 | "never-expect": [ 21 | "_ZN6Kripke6TimingD0Ev", 22 | "_ZN6Kripke9SweepComm13workRemainingEv", 23 | "_ZNSt6vectorImSaImEE6resizeEmRKm", 24 | "_ZN6Kripke9SweepComm13workRemainingEv", 25 | "_ZN6Kripke8Generate12generateDataERNS_4Core9DataStoreERK14InputVariables" 26 | ] 27 | }, 28 | { 29 | "iteration": 2, 30 | "expect": [ 31 | "main", 32 | "_ZN6Kripke17SteadyStateSolverERNS_4Core9DataStoreEmb", 33 | "_ZN6Kripke6Kernel10scatteringERNS_4Core9DataStoreE" 34 | ], 35 | "may-expect": [ 36 | ".+Kripke.dispatch.*" 37 | ], 38 | "never-expect": [] 39 | }, 40 | { 41 | "iteration": 3, 42 | "expect": [ 43 | "main", 44 | "_ZN6Kripke17SteadyStateSolverERNS_4Core9DataStoreEmb", 45 | "_ZN6Kripke6Kernel10scatteringERNS_4Core9DataStoreE" 46 | ], 47 | "may-expect": [ 48 | ".+Kripke.dispatch.*" 49 | ], 50 | "never-expect": [] 51 | } 52 | ] -------------------------------------------------------------------------------- /test/integration/GameOfLife_Slurm/batchsystem.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "backend": "slurm", 4 | "interface": "os", 5 | "timings": "os", 6 | "force-sequential": false 7 | }, 8 | "module-loads": [ 9 | { 10 | "name": "gcc", 11 | "version": "8.5", 12 | "depends_on": null 13 | }, 14 | { 15 | "name": "cmake", 16 | "version": "8.5", 17 | "depends_on": null 18 | }, 19 | { 20 | "name": "llvm", 21 | "version": "10.0.0", 22 | "depends_on": [ 23 | { 24 | "name": "gcc", 25 | "version": "8.5" 26 | } 27 | ] 28 | }, 29 | { 30 | "name": "openmpi", 31 | "version": "4.0.5", 32 | "depends_on": [ 33 | { 34 | "name": "gcc", 35 | "version": "8.5" 36 | } 37 | ] 38 | }, 39 | { 40 | "name": "python", 41 | "version": "3.9.5", 42 | "depends_on": [ 43 | { 44 | "name": "openmpi", 45 | "version": "4.0.5" 46 | } 47 | ] 48 | }, 49 | { 50 | "name": "qt", 51 | "version": "5.13.2", 52 | "depends_on": [ 53 | { 54 | "name": "python", 55 | "version": "3.9.5" 56 | } 57 | ] 58 | } 59 | ], 60 | "batch-settings": 61 | { 62 | "time": "00:10:00", 63 | "mem-per-cpu": 3800, 64 | "ntasks": 1, 65 | "partition": null, 66 | "reservation": null, 67 | "account": "project01823", 68 | "cpus-per-task": 96 69 | } 70 | } -------------------------------------------------------------------------------- /test/integration/LULESH_Slurm/batchsystem.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "backend": "slurm", 4 | "interface": "os", 5 | "timings": "subprocess", 6 | "force-sequential": false 7 | }, 8 | "module-loads": [ 9 | { 10 | "name": "gcc", 11 | "version": "8.5", 12 | "depends_on": null 13 | }, 14 | { 15 | "name": "cmake", 16 | "version": "8.5", 17 | "depends_on": null 18 | }, 19 | { 20 | "name": "llvm", 21 | "version": "10.0.0", 22 | "depends_on": [ 23 | { 24 | "name": "gcc", 25 | "version": "8.5" 26 | } 27 | ] 28 | }, 29 | { 30 | "name": "openmpi", 31 | "version": "4.0.5", 32 | "depends_on": [ 33 | { 34 | "name": "gcc", 35 | "version": "8.5" 36 | } 37 | ] 38 | }, 39 | { 40 | "name": "python", 41 | "version": "3.9.5", 42 | "depends_on": [ 43 | { 44 | "name": "openmpi", 45 | "version": "4.0.5" 46 | } 47 | ] 48 | }, 49 | { 50 | "name": "qt", 51 | "version": "5.13.2", 52 | "depends_on": [ 53 | { 54 | "name": "python", 55 | "version": "3.9.5" 56 | } 57 | ] 58 | } 59 | ], 60 | "batch-settings": 61 | { 62 | "time": "00:10:00", 63 | "mem-per-cpu": 475, 64 | "ntasks": 8, 65 | "partition": null, 66 | "reservation": null, 67 | "account": "project01823", 68 | "cpus-per-task": 12 69 | } 70 | } -------------------------------------------------------------------------------- /test/unit/TimeTrackTest.py: -------------------------------------------------------------------------------- 1 | """ 2 | File: TimeTrackTest.py 3 | License: Part of the PIRA project. Licensed under BSD 3 clause license. See LICENSE.txt file at https://github.com/tudasc/pira 4 | Description: Tests for the argument mapping 5 | """ 6 | 7 | import unittest 8 | import lib.TimeTracking as T 9 | 10 | 11 | class Dummy: 12 | def __init__(self, arg): 13 | self.val = arg 14 | 15 | def func(self): 16 | self.val += 1 17 | return self.val 18 | 19 | 20 | def func(): 21 | return 0 22 | 23 | def func1(arg): 24 | return arg + 1 25 | 26 | class TestTimeTracking(unittest.TestCase): 27 | def test_create(self): 28 | tracker = T.TimeTracker() 29 | 30 | def test_f_track(self): 31 | tracker = T.TimeTracker() 32 | r, time = tracker.f_track('invocation', func) 33 | self.assertGreater(time[0], -1.0) 34 | self.assertGreater(time[1], -1.0) 35 | self.assertEqual(r, 0) 36 | 37 | def test_f_track_arg(self): 38 | tracker = T.TimeTracker() 39 | r, time = tracker.f_track('invocation 2', func1, 2) 40 | self.assertGreater(time[0], -1.0) 41 | self.assertGreater(time[1], -1.0) 42 | self.assertEqual(r, 3); 43 | 44 | def test_m_track(self): 45 | tracker = T.TimeTracker() 46 | obj = Dummy(1) 47 | r, time = tracker.m_track('obj invocation', obj, 'func') 48 | self.assertGreater(time[0], -1.0) 49 | self.assertGreater(time[1], -1.0) 50 | self.assertEqual(r, 2) 51 | self.assertEqual(obj.val, 2) 52 | 53 | 54 | if __name__ == '__main__': 55 | unittest.main() 56 | -------------------------------------------------------------------------------- /test/integration/GameOfLife_heuristic_Slurm/batchsystem.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "backend": "slurm", 4 | "interface": "os", 5 | "timings": "os", 6 | "force-sequential": false 7 | }, 8 | "module-loads": [ 9 | { 10 | "name": "gcc", 11 | "version": "8.5", 12 | "depends_on": null 13 | }, 14 | { 15 | "name": "cmake", 16 | "version": "8.5", 17 | "depends_on": null 18 | }, 19 | { 20 | "name": "llvm", 21 | "version": "10.0.0", 22 | "depends_on": [ 23 | { 24 | "name": "gcc", 25 | "version": "8.5" 26 | } 27 | ] 28 | }, 29 | { 30 | "name": "openmpi", 31 | "version": "4.0.5", 32 | "depends_on": [ 33 | { 34 | "name": "gcc", 35 | "version": "8.5" 36 | } 37 | ] 38 | }, 39 | { 40 | "name": "python", 41 | "version": "3.9.5", 42 | "depends_on": [ 43 | { 44 | "name": "openmpi", 45 | "version": "4.0.5" 46 | } 47 | ] 48 | }, 49 | { 50 | "name": "qt", 51 | "version": "5.13.2", 52 | "depends_on": [ 53 | { 54 | "name": "python", 55 | "version": "3.9.5" 56 | } 57 | ] 58 | } 59 | ], 60 | "batch-settings": 61 | { 62 | "time": "00:10:00", 63 | "mem-per-cpu": 3800, 64 | "ntasks": 1, 65 | "partition": null, 66 | "reservation": null, 67 | "account": "project01823", 68 | "cpus-per-task": 96 69 | } 70 | } -------------------------------------------------------------------------------- /test/integration/GameOfLife_hybrid_filter_Slurm/batchsystem.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "backend": "slurm", 4 | "interface": "os", 5 | "timings": "os", 6 | "force-sequential": false 7 | }, 8 | "module-loads": [ 9 | { 10 | "name": "gcc", 11 | "version": "8.5", 12 | "depends_on": null 13 | }, 14 | { 15 | "name": "cmake", 16 | "version": "8.5", 17 | "depends_on": null 18 | }, 19 | { 20 | "name": "llvm", 21 | "version": "10.0.0", 22 | "depends_on": [ 23 | { 24 | "name": "gcc", 25 | "version": "8.5" 26 | } 27 | ] 28 | }, 29 | { 30 | "name": "openmpi", 31 | "version": "4.0.5", 32 | "depends_on": [ 33 | { 34 | "name": "gcc", 35 | "version": "8.5" 36 | } 37 | ] 38 | }, 39 | { 40 | "name": "python", 41 | "version": "3.9.5", 42 | "depends_on": [ 43 | { 44 | "name": "openmpi", 45 | "version": "4.0.5" 46 | } 47 | ] 48 | }, 49 | { 50 | "name": "qt", 51 | "version": "5.13.2", 52 | "depends_on": [ 53 | { 54 | "name": "python", 55 | "version": "3.9.5" 56 | } 57 | ] 58 | } 59 | ], 60 | "batch-settings": 61 | { 62 | "time": "00:10:00", 63 | "mem-per-cpu": 3800, 64 | "ntasks": 1, 65 | "partition": null, 66 | "reservation": null, 67 | "account": "project01823", 68 | "cpus-per-task": 96 69 | } 70 | } -------------------------------------------------------------------------------- /test/integration/AMG2013_Slurm/batchsystem.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "backend": "slurm", 4 | "interface": "os", 5 | "timings": "subprocess", 6 | "force-sequential": true 7 | }, 8 | "module-loads": [ 9 | { 10 | "name": "gcc", 11 | "version": "8.5", 12 | "depends_on": null 13 | }, 14 | { 15 | "name": "cmake", 16 | "version": "8.5", 17 | "depends_on": null 18 | }, 19 | { 20 | "name": "llvm", 21 | "version": "10.0.0", 22 | "depends_on": [ 23 | { 24 | "name": "gcc", 25 | "version": "8.5" 26 | } 27 | ] 28 | }, 29 | { 30 | "name": "openmpi", 31 | "version": "4.0.5", 32 | "depends_on": [ 33 | { 34 | "name": "gcc", 35 | "version": "8.5" 36 | } 37 | ] 38 | }, 39 | { 40 | "name": "python", 41 | "version": "3.9.5", 42 | "depends_on": [ 43 | { 44 | "name": "openmpi", 45 | "version": "4.0.5" 46 | } 47 | ] 48 | }, 49 | { 50 | "name": "qt", 51 | "version": "5.13.2", 52 | "depends_on": [ 53 | { 54 | "name": "python", 55 | "version": "3.9.5" 56 | } 57 | ] 58 | } 59 | ], 60 | "batch-settings": 61 | { 62 | "time": "00:15:00", 63 | "mem-per-cpu": 3000, 64 | "ntasks": 8, 65 | "partition": null, 66 | "reservation": null, 67 | "account": "project01823", 68 | "cpus-per-task": 1, 69 | "exclusive": false 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /test/integration/LoadImbalance_Slurm/batchsystem.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "backend": "slurm", 4 | "interface": "sbatch-wait", 5 | "timings": "subprocess", 6 | "force-sequential": false 7 | }, 8 | "module-loads": [ 9 | { 10 | "name": "gcc", 11 | "version": "8.5", 12 | "depends_on": null 13 | }, 14 | { 15 | "name": "cmake", 16 | "version": "8.5", 17 | "depends_on": null 18 | }, 19 | { 20 | "name": "llvm", 21 | "version": "10.0.0", 22 | "depends_on": [ 23 | { 24 | "name": "gcc", 25 | "version": "8.5" 26 | } 27 | ] 28 | }, 29 | { 30 | "name": "openmpi", 31 | "version": "4.0.5", 32 | "depends_on": [ 33 | { 34 | "name": "gcc", 35 | "version": "8.5" 36 | } 37 | ] 38 | }, 39 | { 40 | "name": "python", 41 | "version": "3.9.5", 42 | "depends_on": [ 43 | { 44 | "name": "openmpi", 45 | "version": "4.0.5" 46 | } 47 | ] 48 | }, 49 | { 50 | "name": "qt", 51 | "version": "5.13.2", 52 | "depends_on": [ 53 | { 54 | "name": "python", 55 | "version": "3.9.5" 56 | } 57 | ] 58 | } 59 | ], 60 | "batch-settings": 61 | { 62 | "time": "00:10:00", 63 | "mem-per-cpu": 475, 64 | "ntasks": 8, 65 | "partition": null, 66 | "reservation": null, 67 | "account": "project01823", 68 | "cpus-per-task": 12, 69 | "exclusive": true 70 | } 71 | } -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2019-2022, Jan-Patrick Lehr 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /lib/TimeTracking.py: -------------------------------------------------------------------------------- 1 | """ 2 | File: TimeTracking.py 3 | License: Part of the PIRA project. Licensed under BSD 3 clause license. See LICENSE.txt file at https://github.com/tudasc/pira 4 | Description: This module allows to track timings of the various bits and pieces with convenience functions. 5 | """ 6 | 7 | import os 8 | import lib.Logging as L 9 | 10 | 11 | class TimeTracker(): 12 | """ 13 | Lightweight covenience class for time tracking of various components 14 | """ 15 | 16 | def __init__(self): 17 | self._s = os.times() 18 | self._e = self._s 19 | 20 | def f_track(self, sec_name, function, *args): 21 | self._start() 22 | res = function(*args) 23 | self.stop() 24 | time_tuple = self.get_time() 25 | L.get_logger().log(sec_name + ' took %.3f seconds' % time_tuple[0], level='perf') 26 | return (res, time_tuple) 27 | 28 | def m_track(self, sec_name, obj, method_name, *args): 29 | obj_method = self._get_callable(obj, method_name) 30 | self._start() 31 | res = obj_method(*args) 32 | self.stop() 33 | time_tuple = self.get_time() 34 | L.get_logger().log(sec_name + ' took %.3f seconds' % time_tuple[0], level='perf') 35 | return (res, time_tuple) 36 | 37 | def get_time(self): 38 | u_time = self._e[2] - self._s[2] 39 | s_time = self._e[3] - self._s[3] 40 | return (u_time, s_time) 41 | 42 | def _start(self): 43 | self._s = os.times() 44 | 45 | def stop(self): 46 | self._e = os.times() 47 | 48 | def _get_callable(self, obj, name): 49 | try: 50 | obj_method = getattr(obj, name) 51 | return obj_method 52 | except Exception as e: 53 | L.get_logger().log('No such attribute', level='error') 54 | raise e 55 | -------------------------------------------------------------------------------- /test/unit/ProfileSinkTest.py: -------------------------------------------------------------------------------- 1 | """ 2 | File: ProfileSinkTest.py 3 | License: Part of the PIRA project. Licensed under BSD 3 clause license. See LICENSE.txt file at https://github.com/tudasc/pira 4 | Description: Tests for the argument mapping 5 | """ 6 | 7 | import lib.ProfileSink as P 8 | import lib.Configuration as C 9 | from lib.DefaultFlags import BackendDefaults 10 | import unittest 11 | 12 | 13 | class TestProfileSink(unittest.TestCase): 14 | 15 | def setUp(self): 16 | self._target = 'asd' 17 | self._flavor = 'fl' 18 | self._dbi = 'a' 19 | self._nreps = 1 20 | 21 | self._ic_true = C.InstrumentConfig(True, self._nreps) 22 | self._ic_false = C.InstrumentConfig() 23 | self._params = ['par1'] 24 | self._prefix = 'pre' 25 | self._postfix = 'post' 26 | self._filename = 'profile.cubex' 27 | C.InvocationConfig.create_from_kwargs({'config' : '../inputs/configs/basic_config_005.json'}) 28 | 29 | def test_base_raises(self): 30 | sb = P.ProfileSinkBase() 31 | backend_provider = BackendDefaults() 32 | self._dir = backend_provider.instance.get_pira_dir() 33 | self._tc = C.TargetConfig(self._dir, self._dir, self._target, self._flavor, self._dbi) 34 | self.assertRaises(RuntimeError, sb.process, self._dir, self._tc, self._ic_true) 35 | 36 | def test_extrap_create(self): 37 | backend_provider = BackendDefaults() 38 | self._dir = backend_provider.instance.get_pira_dir() 39 | self._tc = C.TargetConfig(self._dir, self._dir, self._target, self._flavor, self._dbi) 40 | es = P.ExtrapProfileSink(self._dir, self._params, self._prefix, self._postfix, self._filename) 41 | self.assertEqual(es.get_target(), '') 42 | 43 | 44 | if __name__ == '__main__': 45 | unittest.main() -------------------------------------------------------------------------------- /test/unit/input/unit_input_001.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": { 3 | "builds": { 4 | "/home/something/top_dir": { 5 | "flavors": { 6 | "builders": { 7 | "item01": "/builder/item01/directory", 8 | "item02": "/another/builder/directory/for/item02" 9 | }, 10 | "instrument-analysis": { 11 | "item01": [ 12 | "/ins_anal/directory/for/functors", 13 | "/where/to/put/cube/files", 14 | "/path/to/analysis/tool" 15 | ], 16 | "item02": [ 17 | "/item02/path/to/functors", 18 | "/shared/work/cubes", 19 | "/directory/where_to/find/analyzer" 20 | ] 21 | }, 22 | "item01": [ 23 | "local-flav1", 24 | "vanilla" 25 | ], 26 | "item02": [ 27 | "local-flav1" 28 | ], 29 | "run": { 30 | "item01": { 31 | "args": [], 32 | "batch_script": "/some/madeup/script.sh", 33 | "runner": "/path/to/runner_functors/item01", 34 | "submitter": "/another/path/to/item01/submitter" 35 | }, 36 | "item02": { 37 | "args": [ 38 | "-i 200", 39 | "-g 100" 40 | ], 41 | "batch_script": "", 42 | "runner": "/item02/runner/functors.dir", 43 | "submitter": "" 44 | } 45 | } 46 | }, 47 | "items": [ 48 | "item01", 49 | "item02" 50 | ], 51 | "prefix": "" 52 | } 53 | }, 54 | "directories": [ 55 | "/home/something/top_dir" 56 | ], 57 | "glob-flavors": [], 58 | "glob-submitter": { 59 | "flav1": "/path/to/py/functor", 60 | "flav2": "path/to/py/functor" 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /resources/setup_paths.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env bash 2 | #""" 3 | # File: load_submodules.sh 4 | # License: Part of the PIRA project. Licensed under BSD 3 clause license. 5 | # See LICENSE.txt file at https://github.com/tudasc/pira 6 | # Description: Script provides environment information for PIRA 7 | #""" 8 | 9 | scriptdir="$1" 10 | 11 | if [[ -z "$scriptdir" ]]; then 12 | scriptdir="$( cd "$(dirname "$0")" ; pwd -P )" 13 | fi 14 | 15 | # The upper-case parts are sed'ed while installation 16 | cube_install_dir=CUBEINSTALLDIR 17 | scorep_install_dir=SCOREPINSTALLDIR 18 | extrap_install_dir=EXTRAPINSTALLDIR 19 | metacg_install_dir=METACGINSTALLDIR 20 | mpiwrap_install_dir=MPIWRAPINSTALLDIR 21 | bear_install_dir=BEARINSTALLDIR 22 | 23 | echo -e "Cube installation dir:\t$cube_install_dir" 24 | echo -e "Score-P installation dir:\t$scorep_install_dir" 25 | echo -e "Extra-P installation dir:\t$extrap_install_dir" 26 | echo -e "MetaCG installation dir:\t$metacg_install_dir" 27 | echo -e "mpiwrap installation dir:\t$mpiwrap_install_dir" 28 | echo -e "bear installation dir:\t$bear_install_dir" 29 | 30 | echo -e "Setting up paths\n" 31 | 32 | clangbaseraw="$( cd "$(dirname ""$(which clang)"")" ; pwd -P )" 33 | export CLANG_BASE_PATH="${clangbaseraw/\/bin/}" 34 | 35 | export PIRA_DIR="$scriptdir/.." 36 | 37 | 38 | export PATH=$cube_install_dir/bin:$scorep_install_dir/bin:$extrap_install_dir/bin:$metacg_install_dir/bin:$mpiwrap_install_dir:$bear_install_dir/bin:$PATH 39 | export LD_LIBRARY_PATH=$cube_install_dir/lib:$scorep_install_dir/lib:$extrap_install_dir/lib:$metacg_install_dir/lib:$mpiwrap_install_dir/lib:$bear_install_dir/lib:$LD_LIBRARY_PATH 40 | export LD_LIBRARY_PATH=$cube_install_dir/lib64:$scorep_install_dir/lib64:$extrap_install_dir/lib64:$metacg_install_dir/lib64:$mpiwrap_install_dir/lib64:$bear_install_dir/lib64:$LD_LIBRARY_PATH 41 | echo -e "-- PATH --\n" $PATH 42 | echo -e "\n-- LD_LIBRARY_PATH --\n" $LD_LIBRARY_PATH 43 | 44 | -------------------------------------------------------------------------------- /resources/remove_builds.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env bash 2 | #""" 3 | # File: remove_builds.sh 4 | # License: Part of the PIRA project. Licensed under BSD 3 clause license. See LICENSE.txt file at https://github.com/tudasc/pira 5 | # Description: Helper script to remove build folders in PIRA external dependencies 6 | #""" 7 | 8 | scriptdir="$( cd "$(dirname "$0")" ; pwd -P )" 9 | extsourcedir=$scriptdir/../extern/src 10 | 11 | function check_directory_or_file_exists { 12 | dir_to_check=$1 13 | 14 | # According to https://unix.stackexchange.com/questions/590694/posix-compliant-way-to-redirect-stdout-and-stderr-to-a-file 15 | # This is also POSIC compliant 16 | stat $dir_to_check >/dev/null 2>&1 17 | 18 | if [ $? -ne 0 ]; then 19 | return 1 20 | fi 21 | return 0 22 | } 23 | 24 | function remove_if_exists { 25 | dir_to_remove=$1 26 | 27 | check_directory_or_file_exists $dir_to_remove 28 | 29 | if [ $? -eq 0 ]; then 30 | echo "Removing $dir_to_remove" 31 | rm -rdf $dir_to_remove 32 | fi 33 | } 34 | 35 | if [ -z "$1" ] || [ "llvm-instrumentation" == "$1" ]; then 36 | echo "Testing llvm-instrumentation" 37 | remove_if_exists $extsourcedir/llvm-instrumentation/build 38 | fi 39 | 40 | if [ -z "$1" ] || [ "scorep" == "$1" ]; then 41 | echo "Testing scorep" 42 | remove_if_exists $extsourcedir/scorep-mod/scorep-build 43 | fi 44 | 45 | if [ -z "$1" ] || [ "metacg" == "$1" ]; then 46 | echo "Testing cgcollector" 47 | remove_if_exists $extsourcedir/metacg/build 48 | fi 49 | 50 | if [ -z "$1" ] || [ "extrap" == "$1" ]; then 51 | echo "Testing extrap" 52 | remove_if_exists $extsourcedir/extrap/extrap-3.0/build 53 | fi 54 | 55 | if [ -z "$1" ] || [ "bear" == "$1" ]; then 56 | echo "Testing bear" 57 | remove_if_exists $extsourcedir/bear 58 | fi 59 | 60 | if [ -z "$1" ] || [ "mpiwrap" == "$1" ]; then 61 | echo "Testing mpiwrap" 62 | remove_if_exists $extsourcedir/mpiwrap 63 | fi 64 | 65 | if [ -z "$1" ] || [ "git" == "$1" ]; then 66 | git restore ./setup_paths.sh 67 | fi 68 | -------------------------------------------------------------------------------- /test/unit/input/unit_input_004.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": { 3 | "builds": { 4 | "/this/is/top_dir": { 5 | "flavors": { 6 | "builders": { 7 | "item01": "/builder/directory/for/functor/item01", 8 | "item02": "/builder/directory/for/functor/item02" 9 | }, 10 | "instrument-analysis": { 11 | "item01": [ 12 | "/instrumentation_analysis/directory/for/functors/item01", 13 | "/tmp/where/cube/files/are/item01", 14 | "/path/to/analysis/tool/item01" 15 | ], 16 | "item02": [ 17 | "/instrumentation_analysis/directory/for/functors/item02", 18 | "/tmp/where/cube/files/are/item02", 19 | "/path/to/analysis/tool/item02" 20 | ] 21 | }, 22 | "item01": [ 23 | "item01-flavor01", 24 | "item01-flavor02" 25 | ], 26 | "item02": [ 27 | "item02-flavor01" 28 | ], 29 | "run": { 30 | "item01": { 31 | "args": [ 32 | "argument item01", 33 | "argument for item 02" 34 | ], 35 | "batch_script": "/batch_script/directory/for/item01", 36 | "runner": "/runner/directory/for/functor/item01", 37 | "submitter": "/submitter/directory/for/functor/item01" 38 | }, 39 | "item02": { 40 | "args": [], 41 | "batch_script": "/batch_script/directory/for/item02", 42 | "runner": "/runner/directory/for/functor/item02", 43 | "submitter": "/submitter/directory/for/functor/item02" 44 | } 45 | } 46 | }, 47 | "items": [ 48 | "item01", 49 | "item02" 50 | ], 51 | "prefix": "my_prefix" 52 | } 53 | }, 54 | "directories": [ 55 | "/this/is/top_dir" 56 | ], 57 | "glob-flavors": [], 58 | "glob-submitter": {} 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /test/integration/LoadImbalance/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # File: run.sh 5 | # License: Part of the PIRA project. Licensed under BSD 3 clause license. See LICENSE.txt file at https://github.com/tudasc/pira 6 | # Description: Runs the game of life integration test 7 | # 8 | 9 | testDir=$PWD 10 | export TEST_DIR=$testDir 11 | 12 | # Export all the Pira tools for the integration test 13 | cd $testDir/../../../resources 14 | . setup_paths.sh 15 | cd $testDir 16 | 17 | mkdir -p /tmp/pira-meta 18 | 19 | echo -e "\n------ PATH -----" 20 | echo $PATH 21 | echo -e "\n------ LD_LIBRARY_PATH -----" 22 | echo $LD_LIBRARY_PATH 23 | echo -e "\n------ Which tools -----" 24 | which pgis_pira 25 | which cgcollector 26 | which scorep 27 | which wrap.py 28 | 29 | 30 | echo -e "\n----- Build Imbalance / build call graph -----" 31 | cd imbalance 32 | echo -e "\n -> Running make clean" 33 | bear make clean 34 | echo -e "\n -> Running bear make" 35 | bear make CC="OMPI_CC=clang mpicc" imbalance 2>&1 > /dev/null 36 | echo -e "\n -> Running cgcollector" 37 | cgc --metacg-format-version=2 main.c 2>&1 > /dev/null || exit 1 38 | cgc --metacg-format-version=2 lib.c 2>&1 > /dev/null || exit 1 39 | cgc --metacg-format-version=2 util.h 2>&1 > /dev/null || exit 1 40 | echo "null" > imbalance.ipcg 41 | cgmerge imbalance.ipcg main.ipcg lib.ipcg util.ipcg || exit 1 42 | cp imbalance.ipcg $PWD/../../../../extern/install/metacg/bin/imbalance_ct.mcg 43 | 44 | echo -e "\n----- Running Pira -----\n" 45 | 46 | # use runtime folder for extrap files 47 | if [[ -z "${XDG_DATA_HOME}" ]]; then 48 | pira_dir=$HOME/.local/share/pira 49 | else 50 | pira_dir=$XDG_DATA_HOME/pira 51 | fi 52 | export PIRA_DIR=$pira_dir 53 | echo -e "Using ${pira_dir} for runtime files\n" 54 | 55 | python3 ../../../../pira.py --config-version 2 --iterations 5 --tape ../imbalance.tp --lide --analysis-parameters $testDir/parameters.json $testDir/imbalance_config.json || exit 1 56 | 57 | cd ${TEST_DIR} 58 | ../check.py ../../../extern/install/metacg/bin/out expected_instrumentation.json imbalance_ct || exit 1 59 | -------------------------------------------------------------------------------- /test/integration/GameOfLifePiraVersion1/run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # File: run.sh 4 | # License: Part of the PIRA project. Licensed under BSD 3 clause license. See LICENSE.txt file at https://github.com/tudasc/pira 5 | # Description: Runs the game of life integration test 6 | # 7 | 8 | testDir=$PWD 9 | export TEST_DIR=$testDir 10 | 11 | # Export all the Pira tools for the integration test 12 | cd $testDir/../../../resources 13 | . setup_paths.sh 14 | cd $testDir 15 | 16 | echo -e "\n------ PATH -----" 17 | echo $PATH 18 | echo -e "\n------ LD_LIBRARY_PATH -----" 19 | echo $LD_LIBRARY_PATH 20 | echo -e "\n------ Which tools -----" 21 | which pgis_pira 22 | which cgcollector 23 | which scorep 24 | which wrap.py 25 | 26 | # Download the target application 27 | stat PIRA-testing.tar.gz 28 | if [ $? -ne 0 ]; then 29 | wget https://github.com/jplehr/GameOfLife/archive/PIRA-testing.tar.gz 30 | fi 31 | tar xzf PIRA-testing.tar.gz 32 | mv GameOfLife-PIRA-testing gol 33 | 34 | echo -e "\n----- Build GameOfLife / build call graph -----" 35 | cd gol/serial_non_template 36 | bear make gol 2>&1 > /dev/null 37 | cgc --metacg-format-version=2 main.cpp 2>&1 > /dev/null 38 | cgc --metacg-format-version=2 SerialGoL.cpp 2>&1 > /dev/null 39 | echo "null" > gol.ipcg 40 | cgmerge gol.ipcg main.ipcg SerialGoL.ipcg 2>&1 > /dev/null 41 | cp gol.ipcg $PWD/../../../../../extern/install/metacg/bin/gol_ct.mcg 42 | cd ../.. 43 | 44 | cd gol 45 | 46 | echo -e "\n----- Running Pira -----\n" 47 | 48 | # use runtime folder for extrap files 49 | if [[ -z "${XDG_DATA_HOME}" ]]; then 50 | pira_dir=$HOME/.local/share/pira 51 | else 52 | pira_dir=$XDG_DATA_HOME/pira 53 | fi 54 | export PIRA_DIR=$pira_dir 55 | echo -e "Using ${pira_dir} for runtime files\n" 56 | 57 | python3 ../../../../pira.py --config-version 2 --tape ../gol.tp $testDir/gol_config.json 58 | 59 | pirafailed=$? 60 | 61 | rm -rf ${pira_dir}/piraII 62 | rm -rf ${pira_dir}/gol_cubes-* 63 | cd $testDir 64 | rm -rf gol 65 | 66 | ../check.py ../../../extern/install/metacg/bin/out expected_instrumentation.json gol_ct -v || exit 1 67 | 68 | exit $pirafailed 69 | -------------------------------------------------------------------------------- /test/integration/LoadImbalance_Slurm/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # File: run.sh 5 | # License: Part of the PIRA project. Licensed under BSD 3 clause license. See LICENSE.txt file at https://github.com/tudasc/pira 6 | # Description: Runs the game of life integration test 7 | # 8 | 9 | testDir=$PWD 10 | export TEST_DIR=$testDir 11 | 12 | # Export all the Pira tools for the integration test 13 | cd $testDir/../../../resources 14 | . setup_paths.sh 15 | cd $testDir 16 | 17 | mkdir -p /tmp/pira-meta 18 | 19 | echo -e "\n------ PATH -----" 20 | echo $PATH 21 | echo -e "\n------ LD_LIBRARY_PATH -----" 22 | echo $LD_LIBRARY_PATH 23 | echo -e "\n------ Which tools -----" 24 | which pgis_pira 25 | which cgcollector 26 | which scorep 27 | which wrap.py 28 | 29 | 30 | echo -e "\n----- Build Imbalance / build call graph -----" 31 | cd imbalance 32 | echo -e "\n -> Running make clean" 33 | bear make clean 34 | echo -e "\n -> Running bear make" 35 | bear make CC="OMPI_CC=clang mpicc" imbalance 2>&1 > /dev/null 36 | echo -e "\n -> Running cgcollector" 37 | cgc --metacg-format-version=2 main.c 2>&1 > /dev/null || exit 1 38 | cgc --metacg-format-version=2 lib.c 2>&1 > /dev/null || exit 1 39 | cgc --metacg-format-version=2 util.h 2>&1 > /dev/null || exit 1 40 | echo "null" > imbalance.ipcg 41 | cgmerge imbalance.ipcg main.ipcg lib.ipcg util.ipcg || exit 1 42 | cp imbalance.ipcg $PWD/../../../../extern/install/metacg/bin/imbalance_ct.mcg 43 | 44 | echo -e "\n----- Running Pira -----\n" 45 | 46 | # use runtime folder for extrap files 47 | if [[ -z "${XDG_DATA_HOME}" ]]; then 48 | pira_dir=$HOME/.local/share/pira 49 | else 50 | pira_dir=$XDG_DATA_HOME/pira 51 | fi 52 | export PIRA_DIR=$pira_dir 53 | echo -e "Using ${pira_dir} for runtime files\n" 54 | 55 | python3 ../../../../pira.py --config-version 2 --slurm-config ${testDir}/batchsystem.json --iterations 5 --tape ../imbalance.tp --lide --analysis-parameters $testDir/parameters.json $testDir/imbalance_config.json || exit 1 56 | 57 | cd ${TEST_DIR} 58 | ../check.py ../../../extern/install/metacg/bin/out expected_instrumentation.json imbalance_ct || exit 1 59 | -------------------------------------------------------------------------------- /test/integration/GameOfLifePiraVersion1_Slurm/run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # File: run.sh 4 | # License: Part of the PIRA project. Licensed under BSD 3 clause license. See LICENSE.txt file at https://github.com/tudasc/pira 5 | # Description: Runs the game of life integration test 6 | # 7 | 8 | testDir=$PWD 9 | export TEST_DIR=$testDir 10 | 11 | # Export all the Pira tools for the integration test 12 | cd $testDir/../../../resources 13 | . setup_paths.sh 14 | cd $testDir 15 | 16 | echo -e "\n------ PATH -----" 17 | echo $PATH 18 | echo -e "\n------ LD_LIBRARY_PATH -----" 19 | echo $LD_LIBRARY_PATH 20 | echo -e "\n------ Which tools -----" 21 | which pgis_pira 22 | which cgcollector 23 | which scorep 24 | which wrap.py 25 | 26 | # Download the target application 27 | stat PIRA-testing.tar.gz 28 | if [ $? -ne 0 ]; then 29 | wget https://github.com/jplehr/GameOfLife/archive/PIRA-testing.tar.gz 30 | fi 31 | tar xzf PIRA-testing.tar.gz 32 | mv GameOfLife-PIRA-testing gol 33 | 34 | echo -e "\n----- Build GameOfLife / build call graph -----" 35 | cd gol/serial_non_template 36 | bear make gol 2>&1 > /dev/null 37 | cgc --metacg-format-version=2 main.cpp 2>&1 > /dev/null 38 | cgc --metacg-format-version=2 SerialGoL.cpp 2>&1 > /dev/null 39 | echo "null" > gol.ipcg 40 | cgmerge gol.ipcg main.ipcg SerialGoL.ipcg 2>&1 > /dev/null 41 | cp gol.ipcg $PWD/../../../../../extern/install/metacg/bin/gol_ct.mcg 42 | cd ../.. 43 | 44 | cd gol 45 | 46 | echo -e "\n----- Running Pira -----\n" 47 | 48 | # use runtime folder for extrap files 49 | if [[ -z "${XDG_DATA_HOME}" ]]; then 50 | pira_dir=$HOME/.local/share/pira 51 | else 52 | pira_dir=$XDG_DATA_HOME/pira 53 | fi 54 | export PIRA_DIR=$pira_dir 55 | echo -e "Using ${pira_dir} for runtime files\n" 56 | 57 | python3 ../../../../pira.py --config-version 2 --tape ../gol.tp --slurm-config $testDir/batchsystem.json $testDir/gol_config.json 58 | 59 | pirafailed=$? 60 | 61 | rm -rf ${pira_dir}/piraII 62 | rm -rf ${pira_dir}/gol_cubes-* 63 | cd $testDir 64 | rm -rf gol 65 | 66 | ../check.py ../../../extern/install/metacg/bin/out expected_instrumentation.json gol_ct -v || exit 1 67 | 68 | exit $pirafailed 69 | -------------------------------------------------------------------------------- /test/integration/GameOfLife_heuristic/run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # File: run.sh 4 | # License: Part of the PIRA project. Licensed under BSD 3 clause license. See LICENSE.txt file at https://github.com/tudasc/pira 5 | # Description: Runs the game of life integration test using a manually specified heuristic. Requires MetaCG version 2 6 | # 7 | 8 | testDir=$PWD 9 | export TEST_DIR=$testDir 10 | 11 | # Export all the Pira tools for the integration test 12 | cd $testDir/../../../resources 13 | . setup_paths.sh 14 | cd $testDir 15 | 16 | echo -e "\n------ PATH -----" 17 | echo $PATH 18 | echo -e "\n------ LD_LIBRARY_PATH -----" 19 | echo $LD_LIBRARY_PATH 20 | echo -e "\n------ Which tools -----" 21 | which pgis_pira 22 | which cgcollector 23 | which scorep 24 | which wrap.py 25 | 26 | # Download the target application 27 | stat PIRA-testing.tar.gz 28 | if [ $? -ne 0 ]; then 29 | wget https://github.com/jplehr/GameOfLife/archive/PIRA-testing.tar.gz 30 | fi 31 | tar xzf PIRA-testing.tar.gz 32 | mv GameOfLife-PIRA-testing gol 33 | 34 | echo -e "\n----- Build GameOfLife / build call graph -----" 35 | cd gol/serial_non_template 36 | bear make gol -j 2>&1 > /dev/null 37 | cgc "--metacg-format-version=2 main.cpp" 2>&1 > /dev/null 38 | cgc "--metacg-format-version=2 SerialGoL.cpp" 2>&1 > /dev/null 39 | echo "null" > gol.ipcg 40 | cgmerge gol.ipcg main.ipcg SerialGoL.ipcg 2>&1 > /dev/null 41 | cp gol.ipcg $PWD/../../../../../extern/install/metacg/bin/gol_ct.mcg 42 | cd ../.. 43 | 44 | cd gol 45 | 46 | echo -e "\n----- Running Pira -----\n" 47 | 48 | # use runtime folder for extrap files 49 | if [[ -z "${XDG_DATA_HOME}" ]]; then 50 | pira_dir=$HOME/.local/share/pira 51 | else 52 | pira_dir=$XDG_DATA_HOME/pira 53 | fi 54 | export PIRA_DIR=$pira_dir 55 | echo -e "Using ${pira_dir} for runtime files\n" 56 | 57 | python3 ../../../../pira.py --config-version 2 --extrap-dir ${pira_dir}/piraII --extrap-prefix t --tape ../gol.tp --analysis-parameters $testDir/parameters.json $testDir/gol_config.json 58 | pirafailed=$? 59 | 60 | rm -rf ${pira_dir}/piraII 61 | rm -rf ${pira_dir}/gol_cubes-* 62 | cd $testDir 63 | rm -rf gol 64 | 65 | exit $pirafailed 66 | -------------------------------------------------------------------------------- /extern/src/llvm-instrumentation/cmake/ToolchainOptions.cmake: -------------------------------------------------------------------------------- 1 | # LLVM related package 2 | find_package(LLVM REQUIRED CONFIG) 3 | message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}") 4 | list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}") 5 | 6 | include(AddLLVM) 7 | 8 | # Clang related package 9 | find_package(Clang REQUIRED CONFIG) 10 | 11 | # Compile flags 12 | function(default_compile_options target) 13 | cmake_parse_arguments(ARG "" "" "PRIVATE_FLAGS;PUBLIC_FLAGS" ${ARGN}) 14 | 15 | target_compile_options( 16 | ${target} 17 | PRIVATE -Wall 18 | -Wextra 19 | -pedantic 20 | -Wunreachable-code 21 | -Wwrite-strings 22 | -Wpointer-arith 23 | -Wcast-align 24 | -Wcast-qual 25 | -Werror) 26 | 27 | if(ARG_PRIVATE_FLAGS) 28 | target_compile_options(${target} PRIVATE "${ARG_PRIVATE_FLAGS}") 29 | endif() 30 | 31 | if(ARG_PUBLIC_FLAGS) 32 | target_compile_options(${target} PUBLIC "${ARG_PUBLIC_FLAGS}") 33 | endif() 34 | endfunction() 35 | 36 | # Clang tidy 37 | find_program( 38 | CLANG_TIDY 39 | NAMES clang-tidy 40 | clang-tidy-15 41 | clang-tidy-14 42 | clang-tidy-13 43 | clang-tidy-12 44 | clang-tidy-11 45 | clang-tidy-10 46 | clang-tidy-9 47 | clang-tidy-8 48 | clang-tidy-7 49 | clang-tidy-6.0) 50 | 51 | function(register_to_clang_tidy target) 52 | set_target_properties(${target} PROPERTIES CXX_CLANG_TIDY ${CLANG_TIDY}) 53 | endfunction() 54 | 55 | function(make_llvm_module name sources) 56 | cmake_parse_arguments(ARG "" "" "INCLUDE_DIRS;DEPENDS;LINK_LIBS" ${ARGN}) 57 | 58 | add_llvm_library(${name} MODULE ${LIB_SOURCES}) 59 | 60 | # Maybe this needs to be "LLVM_MAIN_INCLUDE_DIRS" 61 | target_include_directories(${name} SYSTEM PUBLIC ${LLVM_INCLUDE_DIRS}) 62 | 63 | if(ARG_INCLUDE_DIRS) 64 | target_include_directories(${name} PRIVATE ${ARG_INCLUDE_DIRS}) 65 | endif() 66 | 67 | target_compile_definitions(${name} PRIVATE ${LLVM_DEFINITIONS}) 68 | 69 | register_to_clang_tidy(${name} ${INSTRUMENTATIONLIB_SOURCES}) 70 | 71 | endfunction() 72 | -------------------------------------------------------------------------------- /test/unit/DatabaseTest.py: -------------------------------------------------------------------------------- 1 | """ 2 | File: DatabaseTest.py 3 | License: Part of the PIRA project. Licensed under BSD 3 clause license. See LICENSE.txt file at https://github.com/tudasc/pira 4 | Description: Tests for the argument mapping 5 | """ 6 | 7 | import lib.Database as D 8 | import lib.tables as T 9 | 10 | import unittest 11 | import os 12 | 13 | 14 | class TestDatabaseBasic(unittest.TestCase): 15 | 16 | """Tests the data base. Maybe""" 17 | 18 | def setUp(self): 19 | D.DBManager.instance = None 20 | 21 | def test_create_db(self): 22 | self.assertIsNone(D.DBManager.instance) 23 | dbm = D.DBManager('test.sqlite') 24 | self.assertIsNotNone(dbm) 25 | self.assertIsNotNone(dbm.instance.conn) 26 | 27 | def test_create_cursor(self): 28 | dbm = D.DBManager('test.sqlite') 29 | dbm.create_cursor() 30 | self.assertIsNotNone(dbm.instance.cursor) 31 | 32 | def test_create_db_fail(self): 33 | self.assertRaises(D.DBException, D.DBManager, None) #XXX Why does not raise? 34 | 35 | def test_fail_create_table_wo_cursor(self): 36 | dbm = D.DBManager('test.sqlite') 37 | self.assertRaises(D.DBException, D.DBManager.instance.create_table, T.create_items_table) 38 | 39 | class TestDatabaseManip(unittest.TestCase): 40 | 41 | """ Tests the manipulating functions of the DB implementation """ 42 | 43 | @classmethod 44 | def tearDownClass(cls): 45 | os.remove('test.sqlite') 46 | 47 | def setUp(self): 48 | D.DBManager.instance = None 49 | self.dbm = D.DBManager('test.sqlite') 50 | self.dbm.create_cursor() 51 | 52 | def test_create_app_table(self): 53 | self.dbm.create_table(T.create_application_table) 54 | # XXX Add actual asserts 55 | 56 | def test_create_build_table(self): 57 | self.dbm.create_table(T.create_builds_table) 58 | # XXX Add actual asserts 59 | 60 | def test_create_items_table(self): 61 | self.dbm.create_table(T.create_items_table) 62 | # XXX Add actual asserts 63 | 64 | def test_create_experiment_table(self): 65 | self.dbm.create_table(T.create_experiment_table) 66 | # XXX Add actual asserts 67 | 68 | 69 | if __name__ == '__main__': 70 | unittest.main() 71 | -------------------------------------------------------------------------------- /test/integration/GameOfLife/run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # File: run.sh 4 | # License: Part of the PIRA project. Licensed under BSD 3 clause license. See LICENSE.txt file at https://github.com/tudasc/pira 5 | # Description: Runs the game of life integration test 6 | # 7 | 8 | testDir=$PWD 9 | export TEST_DIR=$testDir 10 | 11 | # Export all the Pira tools for the integration test 12 | cd $testDir/../../../resources 13 | . setup_paths.sh 14 | cd $testDir 15 | 16 | echo -e "\n------ PATH -----" 17 | echo $PATH 18 | echo -e "\n------ LD_LIBRARY_PATH -----" 19 | echo $LD_LIBRARY_PATH 20 | echo -e "\n------ Which tools -----" 21 | which pgis_pira 22 | which cgcollector 23 | which scorep 24 | which wrap.py 25 | 26 | # Download the target application 27 | stat PIRA-testing.tar.gz 28 | if [ $? -ne 0 ]; then 29 | wget https://github.com/jplehr/GameOfLife/archive/PIRA-testing.tar.gz 30 | fi 31 | tar xzf PIRA-testing.tar.gz 32 | mv GameOfLife-PIRA-testing gol 33 | 34 | echo -e "\n----- Build GameOfLife / build call graph -----" 35 | cd gol/serial_non_template 36 | bear make gol -j 2>&1 > /dev/null 37 | cgc --metacg-format-version=2 main.cpp 2>&1 > /dev/null 38 | cgc --metacg-format-version=2 SerialGoL.cpp 2>&1 > /dev/null 39 | echo "null" > gol.ipcg 40 | cgmerge gol.ipcg main.ipcg SerialGoL.ipcg 2>&1 > /dev/null 41 | cp gol.ipcg $PWD/../../../../../extern/install/metacg/bin/gol_ct.mcg 42 | cd ../.. 43 | 44 | cd gol 45 | 46 | echo -e "\n----- Running Pira -----\n" 47 | 48 | # use runtime folder for extrap files 49 | if [[ -z "${XDG_DATA_HOME}" ]]; then 50 | pira_dir=$HOME/.local/share/pira 51 | else 52 | pira_dir=$XDG_DATA_HOME/pira 53 | fi 54 | export PIRA_DIR=$pira_dir 55 | echo -e "Using ${pira_dir} for runtime files\n" 56 | 57 | python3 ../../../../pira.py --config-version 2 --extrap-dir ${pira_dir}/piraII --extrap-prefix t --tape ../gol.tp --analysis-parameters $testDir/parameters.json $testDir/gol_config.json 58 | pirafailed=$? 59 | cd $testDir 60 | rm -rf ${pira_dir}/piraII 61 | rm -rf ${pira_dir}/gol_cubes-* 62 | cd $testDir 63 | rm -rf gol 64 | 65 | ../check.py ../../../extern/install/metacg/bin/out expected_instrumentation.json gol_ct || exit 1 66 | 67 | exit $pirafailed 68 | -------------------------------------------------------------------------------- /test/integration/GameOfLife_heuristic_Slurm/run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # File: run.sh 4 | # License: Part of the PIRA project. Licensed under BSD 3 clause license. See LICENSE.txt file at https://github.com/tudasc/pira 5 | # Description: Runs the game of life integration test using a manually specified heuristic. Requires MetaCG version 2 6 | # 7 | 8 | testDir=$PWD 9 | export TEST_DIR=$testDir 10 | 11 | # Export all the Pira tools for the integration test 12 | cd $testDir/../../../resources 13 | . setup_paths.sh 14 | cd $testDir 15 | 16 | echo -e "\n------ PATH -----" 17 | echo $PATH 18 | echo -e "\n------ LD_LIBRARY_PATH -----" 19 | echo $LD_LIBRARY_PATH 20 | echo -e "\n------ Which tools -----" 21 | which pgis_pira 22 | which cgcollector 23 | which scorep 24 | which wrap.py 25 | 26 | # Download the target application 27 | stat PIRA-testing.tar.gz 28 | if [ $? -ne 0 ]; then 29 | wget https://github.com/jplehr/GameOfLife/archive/PIRA-testing.tar.gz 30 | fi 31 | tar xzf PIRA-testing.tar.gz 32 | mv GameOfLife-PIRA-testing gol 33 | 34 | echo -e "\n----- Build GameOfLife / build call graph -----" 35 | cd gol/serial_non_template 36 | bear make gol -j 2>&1 > /dev/null 37 | cgc --metacg-format-version=2 main.cpp 2>&1 > /dev/null 38 | cgc --metacg-format-version=2 SerialGoL.cpp 2>&1 > /dev/null 39 | echo "null" > gol.ipcg 40 | cgmerge gol.ipcg main.ipcg SerialGoL.ipcg 2>&1 > /dev/null 41 | cp gol.ipcg $PWD/../../../../../extern/install/metacg/bin/gol_ct.mcg 42 | cd ../.. 43 | 44 | cd gol 45 | 46 | echo -e "\n----- Running Pira -----\n" 47 | 48 | # use runtime folder for extrap files 49 | if [[ -z "${XDG_DATA_HOME}" ]]; then 50 | pira_dir=$HOME/.local/share/pira 51 | else 52 | pira_dir=$XDG_DATA_HOME/pira 53 | fi 54 | export PIRA_DIR=$pira_dir 55 | echo -e "Using ${pira_dir} for runtime files\n" 56 | 57 | python3 ../../../../pira.py --config-version 2 --slurm-config ${testDir}/batchsystem.json --extrap-dir ${pira_dir}/piraII --extrap-prefix t --tape ../gol.tp --analysis-parameters $testDir/parameters.json $testDir/gol_config.json 58 | pirafailed=$? 59 | 60 | rm -rf ${pira_dir}/piraII 61 | rm -rf ${pira_dir}/gol_cubes-* 62 | cd $testDir 63 | rm -rf gol 64 | 65 | exit $pirafailed 66 | -------------------------------------------------------------------------------- /test/unit/BatchSystemTimerTest.py: -------------------------------------------------------------------------------- 1 | """ 2 | File: BatchSystemTimerTest.py 3 | License: Part of the PIRA project. Licensed under BSD 3 clause license. See LICENSE.txt file at https://github.com/tudasc/pira 4 | Description: Tests for the batch system timer module. 5 | """ 6 | import json 7 | import os 8 | import subprocess 9 | import unittest 10 | import lib.Utility as U 11 | 12 | 13 | class BatchSystemTimerTest(unittest.TestCase): 14 | def __init__(self, *args, **kwargs): 15 | super().__init__(*args, **kwargs) 16 | self.key = "ABCDEFG" 17 | self.job_id = "123456" 18 | self.job_array_id = "0" 19 | self.export_path = "." 20 | self.command = "sleep 2" 21 | # comparison options 22 | self.elapsed = 2 23 | self.output = "" 24 | 25 | def setUp(self) -> None: 26 | self.cmd = ["python3", f"{U.get_pira_code_dir()}/lib/BatchSystemTimer.py", self.key, self.job_id, 27 | self.job_array_id, self.export_path, self.command] 28 | 29 | def tearDown(self) -> None: 30 | os.remove(f"{self.export_path}/pira-slurm-{self.job_id}-{self.key}-{self.job_array_id}.json") 31 | 32 | def test_result_file(self): 33 | subprocess.run(self.cmd) 34 | try: 35 | with open(f"{self.export_path}/pira-slurm-{self.job_id}-{self.key}-{self.job_array_id}.json", "r") as f: 36 | content = json.load(f) 37 | print(content["output"]) 38 | self.assertTrue(self.elapsed - 1 < content["elapsed"] < self.elapsed + 1) 39 | newline = "\n" 40 | self.assertEqual(content['output'], f"{self.output}{newline if self.output != '' else ''}") 41 | except FileNotFoundError: 42 | assert False 43 | 44 | 45 | class BatchSystemTimerTest2(BatchSystemTimerTest): 46 | def __init__(self, *args, **kwargs): 47 | super().__init__(*args, **kwargs) 48 | self.command = "sleep 10" 49 | # comparison options 50 | self.elapsed = 10 51 | self.output = "" 52 | 53 | 54 | class BatchSystemTimerTest3(BatchSystemTimerTest): 55 | def __init__(self, *args, **kwargs): 56 | super().__init__(*args, **kwargs) 57 | self.command = "sleep 2; echo 'Hello World!'" 58 | # comparison options 59 | self.elapsed = 2 60 | self.output = "Hello World!" 61 | 62 | 63 | -------------------------------------------------------------------------------- /test/integration/GameOfLife_Slurm/run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # File: run.sh 4 | # License: Part of the PIRA project. Licensed under BSD 3 clause license. See LICENSE.txt file at https://github.com/tudasc/pira 5 | # Description: Runs the game of life integration test 6 | # 7 | 8 | testDir=$PWD 9 | export TEST_DIR=$testDir 10 | 11 | # Export all the Pira tools for the integration test 12 | cd $testDir/../../../resources 13 | . setup_paths.sh 14 | cd $testDir 15 | 16 | echo -e "\n------ PATH -----" 17 | echo $PATH 18 | echo -e "\n------ LD_LIBRARY_PATH -----" 19 | echo $LD_LIBRARY_PATH 20 | echo -e "\n------ Which tools -----" 21 | which pgis_pira 22 | which cgcollector 23 | which scorep 24 | which wrap.py 25 | 26 | # Download the target application 27 | stat PIRA-testing.tar.gz 28 | if [ $? -ne 0 ]; then 29 | wget https://github.com/jplehr/GameOfLife/archive/PIRA-testing.tar.gz 30 | fi 31 | tar xzf PIRA-testing.tar.gz 32 | mv GameOfLife-PIRA-testing gol 33 | 34 | echo -e "\n----- Build GameOfLife / build call graph -----" 35 | cd gol/serial_non_template 36 | bear make gol -j 2>&1 > /dev/null 37 | cgc --metacg-format-version=2 main.cpp 2>&1 > /dev/null 38 | cgc --metacg-format-version=2 SerialGoL.cpp 2>&1 > /dev/null 39 | echo "null" > gol.ipcg 40 | cgmerge gol.ipcg main.ipcg SerialGoL.ipcg 2>&1 > /dev/null 41 | cp gol.ipcg $PWD/../../../../../extern/install/metacg/bin/gol_ct.mcg 42 | cd ../.. 43 | 44 | cd gol 45 | 46 | echo -e "\n----- Running Pira -----\n" 47 | 48 | # use runtime folder for extrap files 49 | if [[ -z "${XDG_DATA_HOME}" ]]; then 50 | pira_dir=$HOME/.local/share/pira 51 | else 52 | pira_dir=$XDG_DATA_HOME/pira 53 | fi 54 | export PIRA_DIR=$pira_dir 55 | echo -e "Using ${pira_dir} for runtime files\n" 56 | 57 | python3 ../../../../pira.py --config-version 2 --extrap-dir ${pira_dir}/piraII --extrap-prefix t --tape ../gol.tp --slurm-config $testDir/batchsystem.json --analysis-parameters $testDir/parameters.json $testDir/gol_config.json 58 | pirafailed=$? 59 | cd $testDir 60 | rm -rf ${pira_dir}/piraII 61 | rm -rf ${pira_dir}/gol_cubes-* 62 | cd $testDir 63 | rm -rf gol 64 | 65 | ../check.py ../../../extern/install/metacg/bin/out expected_instrumentation.json gol_ct || exit 1 66 | 67 | exit $pirafailed 68 | -------------------------------------------------------------------------------- /test/integration/GameOfLife_hybrid_filter/run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # File: run.sh 4 | # License: Part of the PIRA project. Licensed under BSD 3 clause license. See LICENSE.txt file at https://github.com/tudasc/pira 5 | # Description: Runs the game of life integration test 6 | # 7 | 8 | testDir=$PWD 9 | export TEST_DIR=$testDir 10 | 11 | # Export all the Pira tools for the integration test 12 | cd $testDir/../../../resources 13 | . setup_paths.sh 14 | cd $testDir 15 | 16 | echo -e "\n------ PATH -----" 17 | echo $PATH 18 | echo -e "\n------ LD_LIBRARY_PATH -----" 19 | echo $LD_LIBRARY_PATH 20 | echo -e "\n------ Which tools -----" 21 | which pgis_pira 22 | which cgcollector 23 | which scorep 24 | which wrap.py 25 | 26 | # Download the target application 27 | stat PIRA-testing.tar.gz 28 | if [ $? -ne 0 ]; then 29 | wget https://github.com/jplehr/GameOfLife/archive/PIRA-testing.tar.gz 30 | fi 31 | tar xzf PIRA-testing.tar.gz 32 | mv GameOfLife-PIRA-testing gol 33 | 34 | echo -e "\n----- Build GameOfLife / build call graph -----" 35 | cd gol/serial_non_template 36 | bear make gol 2>&1 > /dev/null 37 | cgc --metacg-format-version=2 main.cpp 2>&1 > /dev/null 38 | cgc --metacg-format-version=2 SerialGoL.cpp 2>&1 > /dev/null 39 | echo "null" > gol.ipcg 40 | cgmerge gol.ipcg main.ipcg SerialGoL.ipcg 2>&1 > /dev/null 41 | cp gol.ipcg $PWD/../../../../../extern/install/metacg/bin/gol_ct.mcg 42 | cd ../.. 43 | 44 | cd gol 45 | 46 | echo -e "\n----- Running Pira -----\n" 47 | 48 | # use runtime folder for extrap files 49 | if [[ -z "${XDG_DATA_HOME}" ]]; then 50 | pira_dir=$HOME/.local/share/pira 51 | else 52 | pira_dir=$XDG_DATA_HOME/pira 53 | fi 54 | export PIRA_DIR=$pira_dir 55 | echo -e "Using ${pira_dir} for runtime files\n" 56 | 57 | python3 ../../../../pira.py --config-version 2 --hybrid-filter-iters 2 --iterations 4 --extrap-dir ${pira_dir}/piraII --extrap-prefix t --tape ../gol.tp --analysis-parameters $testDir/parameters.json $testDir/gol_config.json 58 | 59 | pirafailed=$? 60 | 61 | rm -rf ${pira_dir}/piraII 62 | rm -rf ${pira_dir}/gol_cubes-* 63 | cd $testDir 64 | rm -rf gol 65 | 66 | ../check.py ../../../extern/install/metacg/bin/out expected_instrumentation.json gol_ct || exit 1 67 | 68 | exit $pirafailed 69 | -------------------------------------------------------------------------------- /extern/src/llvm-instrumentation/.clang-format: -------------------------------------------------------------------------------- 1 | Language: Cpp 2 | # BasedOnStyle: Google 3 | AccessModifierOffset: -1 4 | AlignAfterOpenBracket: true 5 | AlignEscapedNewlinesLeft: true 6 | AlignOperands: true 7 | AlignTrailingComments: true 8 | AllowAllParametersOfDeclarationOnNextLine: true 9 | AllowShortBlocksOnASingleLine: false 10 | AllowShortCaseLabelsOnASingleLine: false 11 | AllowShortIfStatementsOnASingleLine: false 12 | AllowShortLoopsOnASingleLine: false 13 | AllowShortFunctionsOnASingleLine: All 14 | AlwaysBreakAfterDefinitionReturnType: false 15 | AlwaysBreakTemplateDeclarations: true 16 | AlwaysBreakBeforeMultilineStrings: true 17 | BreakBeforeBinaryOperators: None 18 | BreakBeforeTernaryOperators: true 19 | BreakConstructorInitializersBeforeComma: false 20 | BinPackParameters: true 21 | BinPackArguments: true 22 | ColumnLimit: 120 23 | ConstructorInitializerAllOnOneLineOrOnePerLine: true 24 | ConstructorInitializerIndentWidth: 4 25 | DerivePointerAlignment: false 26 | ExperimentalAutoDetectBinPacking: false 27 | IndentCaseLabels: true 28 | IndentWrappedFunctionNames: false 29 | IndentFunctionDeclarationAfterType: false 30 | MaxEmptyLinesToKeep: 1 31 | KeepEmptyLinesAtTheStartOfBlocks: false 32 | NamespaceIndentation: None 33 | ObjCBlockIndentWidth: 2 34 | ObjCSpaceAfterProperty: false 35 | ObjCSpaceBeforeProtocolList: false 36 | PenaltyBreakBeforeFirstCallParameter: 1 37 | PenaltyBreakComment: 300 38 | PenaltyBreakString: 1000 39 | PenaltyBreakFirstLessLess: 120 40 | PenaltyExcessCharacter: 1000000 41 | PenaltyReturnTypeOnItsOwnLine: 200 42 | PointerAlignment: Right 43 | SpacesBeforeTrailingComments: 2 44 | Cpp11BracedListStyle: true 45 | Standard: Cpp11 46 | IndentWidth: 2 47 | TabWidth: 2 48 | UseTab: Never 49 | BreakBeforeBraces: Attach 50 | SpacesInParentheses: false 51 | SpacesInSquareBrackets: false 52 | SpacesInAngles: false 53 | SpaceInEmptyParentheses: false 54 | SpacesInCStyleCastParentheses: false 55 | SpaceAfterCStyleCast: false 56 | SpacesInContainerLiterals: true 57 | SpaceBeforeAssignmentOperators: true 58 | ContinuationIndentWidth: 4 59 | CommentPragmas: '^ IWYU pragma:' 60 | ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ] 61 | SpaceBeforeParens: ControlStatements 62 | DisableFormat: false 63 | -------------------------------------------------------------------------------- /test/integration/GameOfLife_hybrid_filter_Slurm/run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # File: run.sh 4 | # License: Part of the PIRA project. Licensed under BSD 3 clause license. See LICENSE.txt file at https://github.com/tudasc/pira 5 | # Description: Runs the game of life integration test 6 | # 7 | 8 | testDir=$PWD 9 | export TEST_DIR=$testDir 10 | 11 | # Export all the Pira tools for the integration test 12 | cd $testDir/../../../resources 13 | . setup_paths.sh 14 | cd $testDir 15 | 16 | echo -e "\n------ PATH -----" 17 | echo $PATH 18 | echo -e "\n------ LD_LIBRARY_PATH -----" 19 | echo $LD_LIBRARY_PATH 20 | echo -e "\n------ Which tools -----" 21 | which pgis_pira 22 | which cgcollector 23 | which scorep 24 | which wrap.py 25 | 26 | # Download the target application 27 | stat PIRA-testing.tar.gz 28 | if [ $? -ne 0 ]; then 29 | wget https://github.com/jplehr/GameOfLife/archive/PIRA-testing.tar.gz 30 | fi 31 | tar xzf PIRA-testing.tar.gz 32 | mv GameOfLife-PIRA-testing gol 33 | 34 | echo -e "\n----- Build GameOfLife / build call graph -----" 35 | cd gol/serial_non_template 36 | bear make gol 2>&1 > /dev/null 37 | cgc --metacg-format-version=2 main.cpp 2>&1 > /dev/null 38 | cgc --metacg-format-version=2 SerialGoL.cpp 2>&1 > /dev/null 39 | echo "null" > gol.ipcg 40 | cgmerge gol.ipcg main.ipcg SerialGoL.ipcg 2>&1 > /dev/null 41 | cp gol.ipcg $PWD/../../../../../extern/install/metacg/bin/gol_ct.mcg 42 | cd ../.. 43 | 44 | cd gol 45 | 46 | echo -e "\n----- Running Pira -----\n" 47 | 48 | # use runtime folder for extrap files 49 | if [[ -z "${XDG_DATA_HOME}" ]]; then 50 | pira_dir=$HOME/.local/share/pira 51 | else 52 | pira_dir=$XDG_DATA_HOME/pira 53 | fi 54 | export PIRA_DIR=$pira_dir 55 | echo -e "Using ${pira_dir} for runtime files\n" 56 | 57 | python3 ../../../../pira.py --config-version 2 --slurm-config ${testDir}/batchsystem.json --hybrid-filter-iters 2 --iterations 4 --extrap-dir ${pira_dir}/piraII --extrap-prefix t --tape ../gol.tp --analysis-parameters $testDir/parameters.json $testDir/gol_config.json 58 | 59 | pirafailed=$? 60 | 61 | rm -rf ${pira_dir}/piraII 62 | rm -rf ${pira_dir}/gol_cubes-* 63 | cd $testDir 64 | rm -rf gol 65 | 66 | ../check.py ../../../extern/install/metacg/bin/out expected_instrumentation.json gol_ct || exit 1 67 | 68 | exit $pirafailed 69 | -------------------------------------------------------------------------------- /lib/db.py: -------------------------------------------------------------------------------- 1 | """ 2 | File: db.py 3 | License: Part of the PIRA project. Licensed under BSD 3 clause license. See LICENSE.txt file at https://github.com/tudasc/pira 4 | Description: -- 5 | """ 6 | import sqlite3 as db 7 | import lib.Logging as log 8 | 9 | 10 | class database: 11 | 12 | def __init__(self, conf_db_name): 13 | try: 14 | self.conn = db.connect(conf_db_name) 15 | except Exception as e: 16 | log.get_logger().log(str(e), level='warn') 17 | return None 18 | 19 | def create_cursor(self, conn): 20 | try: 21 | cursor = conn.cursor() 22 | return cursor 23 | except Exception as e: 24 | log.get_logger().log(str(e), level='warn') 25 | 26 | def create_table(self, cursor, table_name): 27 | try: 28 | cursor.execute(table_name) 29 | except Exception as e: 30 | log.get_logger().log(str(e), level='warn') 31 | 32 | def insert_data_application(self, cursor, values): 33 | #cursor.execute("INSERT INTO "+table_name+" VALUES (?,?,?)") 34 | sql = ''' INSERT INTO Application(AppID,App_Name,Global_Flavor,Global_Submitter) 35 | VALUES(?,?,?,?) ''' 36 | 37 | cursor.execute(sql, values) 38 | self.conn.commit() 39 | 40 | def insert_data_builds(self, cursor, values): 41 | #cursor.execute("INSERT INTO "+table_name+" VALUES (?,?,?)") 42 | sql = ''' INSERT INTO Builds(BuildID,Build_Name,Prefix,Flavors,AppName) 43 | VALUES(?,?,?,?,?) ''' 44 | 45 | cursor.execute(sql, values) 46 | self.conn.commit() 47 | 48 | def insert_data_items(self, cursor, values): 49 | #cursor.execute("INSERT INTO "+table_name+" VALUES (?,?,?)") 50 | sql = ''' INSERT INTO Items(ItemID,Item_Name,Inst_Analysis_Functor_Path,Builders_Funtor_Path,Run_Args,Runner_Functor_Path,Submitter_Functor_Path,Exp_Data_Dir_Base_Path,BuildName) 51 | VALUES(?,?,?,?,?,?,?,?,?) ''' 52 | 53 | cursor.execute(sql, values) 54 | self.conn.commit() 55 | 56 | def insert_data_experiment(self, cursor, values): 57 | #cursor.execute("INSERT INTO "+table_name+" VALUES (?,?,?)") 58 | sql = ''' INSERT INTO Experiment(Experiment_ID,BenchmarkName,Iteration_No,IsWithInstrumentation,CubeFilePath,Runtime,Item_ID) 59 | VALUES(?,?,?,?,?,?,?) ''' 60 | cursor.execute(sql, values) 61 | self.conn.commit() 62 | -------------------------------------------------------------------------------- /lib/BatchSystemTimer.py: -------------------------------------------------------------------------------- 1 | """ 2 | File: BatchSystemTimer.py 3 | License: Part of the PIRA project. Licensed under BSD 3 clause license. See LICENSE.txt file at https://github.com/tudasc/pira 4 | Description: Wrapper for timings in PIRA Slurm jobs, utilizes subprocess and os.times(). This way it is the 5 | same as in PIRA, with in the U.shell call. 6 | """ 7 | 8 | import json 9 | import os 10 | import subprocess 11 | import sys 12 | 13 | 14 | class BatchSystemTimer: 15 | """ 16 | A timer class for batch systems. 17 | This is not meant to be used in pira itself. 18 | It is a class that is used in the job script, 19 | as a python wrapper to obtain the timing results 20 | like it is done in PIRA local, with os.times(). 21 | The times will be written to a json file, which will 22 | be read by PIRA later. 23 | For this to work, you have to give four arguments to this script: 24 | - key: The timings key from within PIRA. 25 | - job_id: The job id of the slurm job. 26 | - job_array_id: The index of the Slurm array job. 27 | - export_path: The path where the json results should go. 28 | - command: The command to run/to time. 29 | """ 30 | 31 | def __init__(self, key: str, job_id: str, job_array_id: int, export_path: str, command: str): 32 | """ 33 | Constructor. 34 | """ 35 | self.key = key 36 | self.job_id = job_id 37 | self.job_array_id = job_array_id 38 | self.export_path = export_path 39 | self.command = command 40 | self.results = {} 41 | 42 | def run(self): 43 | """ 44 | Run and time the command. 45 | Start the exporting. 46 | """ 47 | t1 = os.times() # start time 48 | out = subprocess.check_output(command, shell=True) 49 | t2 = os.times() # end time 50 | cutime = t2[2] - t1[2] 51 | cstime = t2[3] - t1[3] 52 | elapsed = t2[4] - t1[4] 53 | runtime = elapsed 54 | out = str(out.decode('utf-8')) 55 | res = {"cutime": cutime, "cstime": cstime, "elapsed": runtime, "output": str(out)} 56 | self.export_results(res) 57 | 58 | def export_results(self, res): 59 | """ 60 | Export results to the json file. 61 | """ 62 | filename = f"{self.export_path}/pira-slurm-{self.job_id}-{self.key}-{self.job_array_id}.json" 63 | with open(filename, "w") as f: 64 | json.dump(res, f, indent=4) 65 | 66 | 67 | if __name__ == "__main__": 68 | args = sys.argv[1:] 69 | key = args[0] 70 | job_id = args[1] 71 | job_array_id = int(args[2]) 72 | export_path = args[3] 73 | command = args[4] 74 | BatchSystemTimer(key, job_id, job_array_id, export_path, command).run() 75 | -------------------------------------------------------------------------------- /lib/DefaultFlags.py: -------------------------------------------------------------------------------- 1 | """ 2 | File: DefaultFlags.py 3 | License: Part of the PIRA project. Licensed under BSD 3 clause license. See LICENSE.txt file at https://github.com/tudasc/pira 4 | Description: Module holds a selection of default flags. 5 | """ 6 | import typing 7 | import os 8 | 9 | from lib.Configuration import InvocationConfig 10 | 11 | 12 | class BackendDefaults: 13 | """ 14 | Meant to hold different defaults for, e.g., flags. 15 | """ 16 | 17 | class _BackendDefaultsImpl: 18 | 19 | def __init__(self): 20 | self._c_compiler = 'clang' 21 | self._cpp_compiler = 'clang++' 22 | self._compiler_instr_flag = '-finstrument-functions' 23 | self._compiler_instr_wl_flag = '-finstrument-functions-whitelist-inputfile' 24 | self._num_compile_procs = 8 25 | self._pira_exe_name = 'pira.built.exe' 26 | self.pira_dir = InvocationConfig.get_instance().get_pira_dir() 27 | 28 | def get_default_c_compiler_name(self) -> str: 29 | return self._c_compiler 30 | 31 | def get_default_cpp_compiler_name(self) -> str: 32 | return self._cpp_compiler 33 | 34 | def get_default_instrumentation_flag(self) -> str: 35 | return self._compiler_instr_flag 36 | 37 | def get_default_instrumentation_selection_flag(self) -> str: 38 | return self._compiler_instr_wl_flag 39 | 40 | def get_default_number_of_processes(self) -> int: 41 | return self._num_compile_procs 42 | 43 | def get_default_exe_name(self) -> str: 44 | return self._pira_exe_name 45 | 46 | def get_default_kwargs(self) -> dict: 47 | kwargs = { 48 | 'CC': '\"' + self.get_default_c_compiler_name() + '\"', 49 | 'CXX': '\"' + self.get_default_cpp_compiler_name() + '\"', 50 | 'PIRANAME': self.get_default_exe_name(), 51 | 'NUMPROCS': self._num_compile_procs 52 | } 53 | return kwargs 54 | 55 | def get_pira_dir(self) -> str: 56 | return self.pira_dir 57 | 58 | def get_wrap_w_file(self) -> str: 59 | return os.path.join(self.pira_dir, 'pira-mpi-filter.w') 60 | 61 | def get_wrap_c_file(self) -> str: 62 | return os.path.join(self.pira_dir, 'pira-mpi-filter.c') 63 | 64 | def get_wrap_so_file(self) -> str: 65 | return os.path.join(self.pira_dir, 'PIRA_MPI_Filter.so') 66 | 67 | def get_MPI_wrap_LD_PRELOAD(self) -> str: 68 | return 'LD_PRELOAD=' + self.get_wrap_so_file() 69 | 70 | instance = None 71 | 72 | def __init__(self): 73 | if not BackendDefaults.instance: 74 | BackendDefaults.instance = BackendDefaults._BackendDefaultsImpl() 75 | 76 | def __getattr__(self, name): 77 | return getattr(self.instance, name) 78 | -------------------------------------------------------------------------------- /lib/tables.py: -------------------------------------------------------------------------------- 1 | """ 2 | File: tables.py 3 | License: Part of the PIRA project. Licensed under BSD 3 clause license. See LICENSE.txt file at https://github.com/tudasc/pira 4 | """ 5 | import sqlite3 as db 6 | 7 | create_application_table = """ CREATE TABLE IF NOT EXISTS Application ( 8 | AppID text PRIMARY KEY, 9 | App_Name text, 10 | Global_Flavor text, 11 | Global_Submitter text 12 | ); """ 13 | 14 | create_builds_table = """ CREATE TABLE IF NOT EXISTS Builds ( 15 | BuildID text PRIMARY KEY, 16 | Build_Name text NOT NULL, 17 | Prefix text NOT NULL, 18 | Flavors text NOT NULL, 19 | AppName text NOT NULL, 20 | FOREIGN KEY(AppName) REFERENCES Application(App_Name) 21 | ); """ 22 | 23 | create_items_table = """ CREATE TABLE IF NOT EXISTS Items ( 24 | ItemID text PRIMARY KEY, 25 | Item_Name text NOT NULL, 26 | Inst_Analysis_Functor_Path text NOT NULL, 27 | Builders_Funtor_Path text NOT NULL, 28 | Run_Args text NOT NULL, 29 | Runner_Functor_Path text NOT NULL, 30 | Submitter_Functor_Path text NOT NULL, 31 | Exp_Data_Dir_Base_Path text NOT NULL, 32 | BuildName text NOT NULL, 33 | FOREIGN KEY(BuildName) REFERENCES Builds(Build_Name) 34 | ); """ 35 | 36 | create_experiment_table = """ CREATE TABLE IF NOT EXISTS Experiment ( 37 | Experiment_ID text PRIMARY KEY, 38 | BenchmarkName text, 39 | Iteration_No INTEGER, 40 | IsWithInstrumentation INTEGER, 41 | CubeFilePath text NOT NULL, 42 | Runtime text NOT NULL, 43 | Item_ID text NOT NULL, 44 | FOREIGN KEY(Item_ID) REFERENCES Items(ItemID) 45 | ); """ 46 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ### 2 | # Python 3 | ### 4 | 5 | # Byte-compiled / optimized / DLL files 6 | __pycache__/ 7 | *.py[cod] 8 | *$py.class 9 | 10 | # C extensions 11 | *.so 12 | 13 | # Distribution / packaging 14 | .Python 15 | build/ 16 | develop-eggs/ 17 | dist/ 18 | downloads/ 19 | eggs/ 20 | .eggs/ 21 | #lib/ 22 | lib64/ 23 | parts/ 24 | sdist/ 25 | var/ 26 | wheels/ 27 | share/python-wheels/ 28 | *.egg-info/ 29 | .installed.cfg 30 | *.egg 31 | MANIFEST 32 | 33 | # PyInstaller 34 | # Usually these files are written by a python script from a template 35 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 36 | *.manifest 37 | *.spec 38 | 39 | # Installer logs 40 | pip-log.txt 41 | pip-delete-this-directory.txt 42 | 43 | # Unit test / coverage reports 44 | htmlcov/ 45 | .tox/ 46 | .nox/ 47 | .coverage 48 | .coverage.* 49 | .cache 50 | nosetests.xml 51 | coverage.xml 52 | *.cover 53 | .hypothesis/ 54 | .pytest_cache/ 55 | report-*.xml 56 | 57 | # Translations 58 | *.mo 59 | *.pot 60 | 61 | # Django stuff: 62 | *.log 63 | local_settings.py 64 | db.sqlite3 65 | 66 | # Flask stuff: 67 | instance/ 68 | .webassets-cache 69 | 70 | # Scrapy stuff: 71 | .scrapy 72 | 73 | # Sphinx documentation 74 | docs/_build/ 75 | 76 | # PyBuilder 77 | target/ 78 | 79 | # Jupyter Notebook 80 | .ipynb_checkpoints 81 | 82 | # IPython 83 | profile_default/ 84 | ipython_config.py 85 | 86 | # pyenv 87 | .python-version 88 | 89 | # celery beat schedule file 90 | celerybeat-schedule 91 | 92 | # SageMath parsed files 93 | *.sage.py 94 | 95 | # Environments 96 | .env 97 | .venv 98 | env/ 99 | venv/ 100 | ENV/ 101 | env.bak/ 102 | venv.bak/ 103 | 104 | # Spyder project settings 105 | .spyderproject 106 | .spyproject 107 | 108 | # Rope project settings 109 | .ropeproject 110 | 111 | # mkdocs documentation 112 | /site 113 | 114 | # mypy 115 | .mypy_cache/ 116 | .dmypy.json 117 | dmypy.json 118 | 119 | # Pyre type checker 120 | .pyre/ 121 | 122 | 123 | ### 124 | # IDEs 125 | ### 126 | .idea 127 | .vscode 128 | 129 | ### 130 | # vim 131 | ### 132 | # Swap 133 | [._]*.s[a-v][a-z] 134 | [._]*.sw[a-p] 135 | [._]s[a-rt-v][a-z] 136 | [._]ss[a-gi-z] 137 | [._]sw[a-p] 138 | 139 | # Session 140 | Session.vim 141 | 142 | # Temporary 143 | .netrwhist 144 | *~ 145 | # Auto-generated tag files 146 | tags 147 | # Persistent undo 148 | [._]*.un~ 149 | 150 | 151 | ## Project specific 152 | # Tape files 153 | *.tp 154 | tapes/*.tp 155 | # experiment database 156 | *.sqlite 157 | # externally installed dependencies 158 | extern/install/* 159 | extern/src/cxxopts 160 | extern/src/extrap 161 | extern/src/json 162 | extern/src/scorep-mod/ 163 | extern/src/bear/ 164 | extern/src/metacg/ 165 | extern/src/mpiwrap/ 166 | -------------------------------------------------------------------------------- /test/integration/LULESH/run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # File: run.sh 4 | # License: Part of the PIRA project. Licensed under BSD 3 clause license. See LICENSE.txt file at https://github.com/tudasc/pira 5 | # Description: Runs the game of life integration test 6 | # 7 | 8 | # The test directory where the top-level files reside 9 | testDir=$PWD 10 | export TEST_DIR=$testDir 11 | 12 | echo -e "[ -- ## testDir == $testDir ## -- ]" 13 | 14 | export PATH=$PWD/../jq:$PATH 15 | # Export all the Pira tools for the integration test 16 | cd $testDir/../../../resources 17 | . setup_paths.sh 18 | cd $testDir 19 | 20 | echo -e "\n------ PATH -----" 21 | echo $PATH 22 | echo -e "\n------ LD_LIBRARY_PATH -----" 23 | echo $LD_LIBRARY_PATH 24 | echo -e "\n------ Which tools -----" 25 | which pgis_pira 26 | which cgcollector 27 | which scorep 28 | which wrap.py 29 | 30 | # XXX Currently required by PGIS 31 | mkdir $PWD/../../../extern/install/metacg/bin/out 32 | 33 | # Download the target application 34 | stat LULESH 35 | if [ $? -ne 0 ]; then 36 | git clone https://github.com/LLNL/LULESH.git 37 | fi 38 | cd LULESH 39 | git checkout 3e01c40 40 | git clean -dxf 41 | 42 | echo -e "\n----- Build LULESG / build call graph -----" 43 | export LULESH_CXXFLAGS="-DUSE_MPI=1 -O3 -g -I. -Wno-unknown-pragmas -Wall" 44 | # Builds the compile_commands.json file 45 | bear make CXX="mpicxx" CXXFLAGS="$LULESH_CXXFLAGS" -j 46 | # Now cgcollector can read the compile_commands.json file, to retrieve the commands required 47 | for f in $(cat compile_commands.json | jq -r 'map(.directory + "/" + .file) | .[]' | grep '\.cc'); do 48 | echo "Processing $f" 49 | cgc --metacg-format-version=2 $f >/dev/null 2>&1 50 | done 51 | # Build the full whole-program call-graph 52 | echo "null" > lulesh.mcg # create empty json file 53 | find . -name "*.ipcg" -exec cgmerge lulesh.mcg lulesh.mcg {} + 2>&1 > ../cgcollector.log # merge all ipcg files into lulesh.mcg 54 | # Move the CG to where PIRA expects it 55 | echo $PWD 56 | cp lulesh.mcg $PWD/../../../../extern/install/metacg/bin/lulesh_ct.mcg 57 | cd .. 58 | 59 | 60 | echo -e "\n----- Running Pira -----\n" 61 | 62 | # use runtime folder for extrap files 63 | if [[ -z "${XDG_DATA_HOME}" ]]; then 64 | pira_dir=$HOME/.local/share/pira 65 | else 66 | pira_dir=$XDG_DATA_HOME/pira 67 | fi 68 | export PIRA_DIR=$pira_dir 69 | echo -e "Using ${pira_dir} for runtime files\n" 70 | 71 | python3 ../../../pira.py --config-version 2 --iterations 10 --repetitions 1 --lide --tape lulesh.tp --analysis-parameters $testDir/parameters.json $testDir/lulesh_config.json 72 | 73 | pirafailed=$? 74 | 75 | #rm -rf ${pira_dir}/piraII 76 | #rm -rf ${pira_dir}/lulesh_cubes-* 77 | cd $testDir 78 | #rm -rf LULESH 79 | ../check.py ../../../extern/install/metacg/bin/out expected_instrumentation.json lulesh_ct || exit 1 80 | 81 | exit $pirafailed 82 | -------------------------------------------------------------------------------- /test/integration/LULESH_Slurm/run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # File: run.sh 4 | # License: Part of the PIRA project. Licensed under BSD 3 clause license. See LICENSE.txt file at https://github.com/tudasc/pira 5 | # Description: Runs the game of life integration test 6 | # 7 | 8 | # The test directory where the top-level files reside 9 | testDir=$PWD 10 | export TEST_DIR=$testDir 11 | 12 | echo -e "[ -- ## testDir == $testDir ## -- ]" 13 | 14 | export PATH=$PWD/../jq:$PATH 15 | # Export all the Pira tools for the integration test 16 | cd $testDir/../../../resources 17 | . setup_paths.sh 18 | cd $testDir 19 | 20 | echo -e "\n------ PATH -----" 21 | echo $PATH 22 | echo -e "\n------ LD_LIBRARY_PATH -----" 23 | echo $LD_LIBRARY_PATH 24 | echo -e "\n------ Which tools -----" 25 | which pgis_pira 26 | which cgcollector 27 | which scorep 28 | which wrap.py 29 | 30 | # XXX Currently required by PGIS 31 | mkdir $PWD/../../../extern/install/metacg/bin/out 32 | 33 | # Download the target application 34 | stat LULESH 35 | if [ $? -ne 0 ]; then 36 | git clone https://github.com/LLNL/LULESH.git 37 | fi 38 | cd LULESH 39 | git checkout 3e01c40 40 | git clean -dxf 41 | 42 | echo -e "\n----- Build LULESG / build call graph -----" 43 | export LULESH_CXXFLAGS="-DUSE_MPI=1 -O3 -g -I. -Wno-unknown-pragmas -Wall" 44 | # Builds the compile_commands.json file 45 | bear make CXX="mpicxx" CXXFLAGS="$LULESH_CXXFLAGS" -j 46 | # Now cgcollector can read the compile_commands.json file, to retrieve the commands required 47 | for f in $(cat compile_commands.json | jq -r 'map(.directory + "/" + .file) | .[]' | grep '\.cc'); do 48 | echo "Processing $f" 49 | cgc --metacg-format-version=2 $f >/dev/null 2>&1 50 | done 51 | # Build the full whole-program call-graph 52 | echo "null" > lulesh.mcg # create empty json file 53 | find . -name "*.ipcg" -exec cgmerge lulesh.mcg lulesh.mcg {} + 2>&1 > ../cgcollector.log # merge all ipcg files into lulesh.mcg 54 | # Move the CG to where PIRA expects it 55 | echo $PWD 56 | cp lulesh.mcg $PWD/../../../../extern/install/metacg/bin/lulesh_ct.mcg 57 | cd .. 58 | 59 | 60 | echo -e "\n----- Running Pira -----\n" 61 | 62 | # use runtime folder for extrap files 63 | if [[ -z "${XDG_DATA_HOME}" ]]; then 64 | pira_dir=$HOME/.local/share/pira 65 | else 66 | pira_dir=$XDG_DATA_HOME/pira 67 | fi 68 | export PIRA_DIR=$pira_dir 69 | echo -e "Using ${pira_dir} for runtime files\n" 70 | 71 | python3 ../../../pira.py --config-version 2 --slurm-config ${testDir}/batchsystem.json --iterations 10 --repetitions 1 --lide --tape lulesh.tp --analysis-parameters $testDir/parameters.json $testDir/lulesh_config.json 72 | 73 | pirafailed=$? 74 | 75 | #rm -rf ${pira_dir}/piraII 76 | #rm -rf ${pira_dir}/lulesh_cubes-* 77 | cd $testDir 78 | #rm -rf LULESH 79 | ../check.py ../../../extern/install/metacg/bin/out expected_instrumentation.json lulesh_ct || exit 1 80 | 81 | exit $pirafailed 82 | -------------------------------------------------------------------------------- /test/integration/AMG2013/run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # File: run.sh 4 | # License: Part of the PIRA project. Licensed under BSD 3 clause license. See LICENSE.txt file at https://github.com/tudasc/pira 5 | # Description: Runs the game of life integration test 6 | # 7 | 8 | # The test directory where the top-level files reside 9 | testDir=$PWD 10 | export TEST_DIR=$testDir 11 | 12 | echo -e "[ -- ## testDir == $testDir ## -- ]" 13 | 14 | export PATH=$PWD/../jq:$PATH 15 | # Export all the Pira tools for the integration test 16 | cd $testDir/../../../resources 17 | . setup_paths.sh 18 | cd $testDir 19 | 20 | echo -e "\n------ PATH -----" 21 | echo $PATH 22 | echo -e "\n------ LD_LIBRARY_PATH -----" 23 | echo $LD_LIBRARY_PATH 24 | echo -e "\n------ Which tools -----" 25 | which pgis_pira 26 | which cgcollector 27 | which scorep 28 | which wrap.py 29 | 30 | # XXX Currently required from PGIS 31 | mkdir $PWD/../../../extern/install/metacg/bin/out 32 | 33 | # Download the target application 34 | stat amg2013_0.tgz 35 | if [ $? -ne 0 ]; then 36 | wget https://asc.llnl.gov/sites/asc/files/2021-01/amg2013_0.tgz 37 | fi 38 | tar xzf amg2013_0.tgz 39 | cd AMG2013 40 | 41 | # XXX The clang version we use is built w/o OMP support, therefore, remove OMP flags 42 | sed -i "s/-fopenmp//" Makefile.include 43 | sed -i "s/-DHYPRE_USING_OPENMP//" Makefile.include 44 | 45 | 46 | echo -e "\n----- Build AMG2013 / build call graph -----" 47 | # Builds the compile_commands.json file 48 | bear make CC="OMPI_CC=clang mpicc" -j 49 | # Now cgcollector can read the compile_commands.json file, to retrieve the commands required 50 | for f in $(cat compile_commands.json | jq -r 'map(.directory + "/" + .file) | .[]' | grep '\.c'); do 51 | echo "Processing $f" 52 | cgc --metacg-format-version=2 $f >/dev/null 2>&1 53 | done 54 | # Build the full whole-program call-graph 55 | echo "null" > amg.ipcg # create empty json file 56 | find . -name "*.ipcg" -exec cgmerge amg.ipcg amg.ipcg {} + 2>&1 > ../cgcollector.log # merge all ipcg files into amg.ipcg 57 | # Move the CG to where PIRA expects it 58 | echo $PWD 59 | cp amg.ipcg $PWD/../../../../extern/install/metacg/bin/amg_ct_mpi.mcg 60 | cd .. 61 | 62 | 63 | echo -e "\n----- Running Pira -----\n" 64 | 65 | # use runtime folder for extrap files 66 | if [[ -z "${XDG_DATA_HOME}" ]]; then 67 | pira_dir=$HOME/.local/share/pira 68 | else 69 | pira_dir=$XDG_DATA_HOME/pira 70 | fi 71 | export PIRA_DIR=$pira_dir 72 | echo -e "Using ${pira_dir} for runtime files\n" 73 | 74 | python3 ../../../pira.py --config-version 2 --iterations 2 --repetitions 2 --extrap-dir ${pira_dir}/piraII --extrap-prefix t --tape ../amg.tp --analysis-parameters $testDir/parameters.json $testDir/amg_config.json 75 | 76 | pirafailed=$? 77 | 78 | #rm -rf ${pira_dir}/piraII 79 | #rm -rf ${pira_dir}/amg_cubes-* 80 | cd $testDir 81 | #rm -rf AMG2013 82 | ../check.py ../../../extern/install/metacg/bin/out expected_instrumentation.json amg_ct_mpi || exit 1 83 | 84 | exit $pirafailed 85 | -------------------------------------------------------------------------------- /test/integration/AMG2013_Slurm/run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # File: run.sh 4 | # License: Part of the PIRA project. Licensed under BSD 3 clause license. See LICENSE.txt file at https://github.com/tudasc/pira 5 | # Description: Runs the game of life integration test 6 | # 7 | 8 | # The test directory where the top-level files reside 9 | testDir=$PWD 10 | export TEST_DIR=$testDir 11 | 12 | echo -e "[ -- ## testDir == $testDir ## -- ]" 13 | 14 | export PATH=$PWD/../jq:$PATH 15 | # Export all the Pira tools for the integration test 16 | cd $testDir/../../../resources 17 | . setup_paths.sh 18 | cd $testDir 19 | 20 | echo -e "\n------ PATH -----" 21 | echo $PATH 22 | echo -e "\n------ LD_LIBRARY_PATH -----" 23 | echo $LD_LIBRARY_PATH 24 | echo -e "\n------ Which tools -----" 25 | which pgis_pira 26 | which cgcollector 27 | which scorep 28 | which wrap.py 29 | 30 | # XXX Currently required from PGIS 31 | mkdir $PWD/../../../extern/install/metacg/bin/out 32 | 33 | # Download the target application 34 | stat amg2013_0.tgz 35 | if [ $? -ne 0 ]; then 36 | wget https://asc.llnl.gov/sites/asc/files/2021-01/amg2013_0.tgz 37 | fi 38 | tar xzf amg2013_0.tgz 39 | cd AMG2013 40 | 41 | # XXX The clang version we use is built w/o OMP support, therefore, remove OMP flags 42 | sed -i "s/-fopenmp//" Makefile.include 43 | sed -i "s/-DHYPRE_USING_OPENMP//" Makefile.include 44 | 45 | 46 | echo -e "\n----- Build AMG2013 / build call graph -----" 47 | # Builds the compile_commands.json file 48 | bear make CC="OMPI_CC=clang mpicc" -j 49 | # Now cgcollector can read the compile_commands.json file, to retrieve the commands required 50 | for f in $(cat compile_commands.json | jq -r 'map(.directory + "/" + .file) | .[]' | grep '\.c'); do 51 | echo "Processing $f" 52 | cgc --metacg-format-version=2 $f >/dev/null 2>&1 53 | done 54 | # Build the full whole-program call-graph 55 | echo "null" > amg.ipcg # create empty json file 56 | find . -name "*.ipcg" -exec cgmerge amg.ipcg amg.ipcg {} + 2>&1 > ../cgcollector.log # merge all ipcg files into amg.ipcg 57 | # Move the CG to where PIRA expects it 58 | echo $PWD 59 | cp amg.ipcg $PWD/../../../../extern/install/metacg/bin/amg_ct_mpi.mcg 60 | cd .. 61 | 62 | 63 | echo -e "\n----- Running Pira -----\n" 64 | 65 | # use runtime folder for extrap files 66 | if [[ -z "${XDG_DATA_HOME}" ]]; then 67 | pira_dir=$HOME/.local/share/pira 68 | else 69 | pira_dir=$XDG_DATA_HOME/pira 70 | fi 71 | export PIRA_DIR=$pira_dir 72 | echo -e "Using ${pira_dir} for runtime files\n" 73 | 74 | python3 ../../../pira.py --config-version 2 --iterations 2 --repetitions 2 --slurm-config ${testDir}/batchsystem.json --extrap-dir ${pira_dir}/piraII --extrap-prefix t --tape ../amg.tp --analysis-parameters $testDir/parameters.json $testDir/amg_config.json 75 | 76 | pirafailed=$? 77 | 78 | #rm -rf ${pira_dir}/piraII 79 | #rm -rf ${pira_dir}/amg_cubes-* 80 | cd $testDir 81 | #rm -rf AMG2013 82 | ../check.py ../../../extern/install/metacg/bin/out expected_instrumentation.json amg_ct_mpi || exit 1 83 | 84 | exit $pirafailed 85 | -------------------------------------------------------------------------------- /test/integration/Kripke/run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # File: run.sh 4 | # License: Part of the PIRA project. Licensed under BSD 3 clause license. See LICENSE.txt file at https://github.com/tudasc/pira 5 | # Description: Runs the game of life integration test 6 | # 7 | 8 | # The test directory where the top-level files reside 9 | testDir=$PWD 10 | export TEST_DIR=$testDir 11 | 12 | echo -e "[ -- ## testDir == $testDir ## -- ]" 13 | 14 | export PATH=$PWD/../jq:$PATH 15 | # Export all the Pira tools for the integration test 16 | cd $testDir/../../../resources 17 | . setup_paths.sh 18 | cd $testDir 19 | 20 | echo -e "\n------ PATH -----" 21 | echo $PATH 22 | echo -e "\n------ LD_LIBRARY_PATH -----" 23 | echo $LD_LIBRARY_PATH 24 | echo -e "\n------ Which tools -----" 25 | which pgis_pira 26 | which cgcollector 27 | which scorep 28 | which wrap.py 29 | 30 | export CXX_COMPILER_WRAPPER=${TEST_DIR}/cxx-wrapper.sh 31 | 32 | # XXX Currently required by PGIS 33 | mkdir $PWD/../../../extern/install/metacg/bin/out 34 | 35 | # Download the target application 36 | stat Kripke 37 | if [ $? -ne 0 ]; then 38 | git clone git@github.com:LLNL/Kripke.git 39 | fi 40 | cd Kripke 41 | git checkout v1.2.4 42 | git submodule update --init 43 | git clean -dxf 44 | 45 | echo -e "\n----- Build Kripke / build call graph -----" 46 | export LULESH_CXXFLAGS="-DUSE_MPI=1 -O3 -g -I. -Wno-unknown-pragmas -Wall" 47 | 48 | # Configure 49 | mkdir build 50 | cd build 51 | export CXX_WRAP="clang++" 52 | cmake -DENABLE_MPI=ON -Wno-dev -DCMAKE_CXX_COMPILER=${CXX_COMPILER_WRAPPER} .. || exit 1 53 | 54 | # Initial build 55 | # Builds the compile_commands.json file 56 | bear make -j || exit 1 57 | 58 | cd .. 59 | 60 | # CGCollection 61 | # Now cgcollector can read the compile_commands.json file, to retrieve the commands required 62 | cp build/compile_commands.json . 63 | # for f in $(cat build/compile_commands.json | jq -r 'map(.directory + "/" + .file) | .[]' | grep '\.cpp'); do 64 | for f in $(find ./src -type f -iname "*.cpp" ); do 65 | echo "Processing $f" 66 | cgc --metacg-format-version=2 $f >/dev/null 2>&1 67 | done 68 | 69 | # Build the full whole-program call-graph 70 | echo "null" > kripke.mcg # create empty json file 71 | find . -name "*.ipcg" -exec cgmerge kripke.mcg kripke.mcg {} + 2>&1 > ../cgmerge.log # merge all ipcg files into kripke.mcg 72 | 73 | # Move the CG to where PIRA expects it 74 | cp kripke.mcg $PWD/../../../../extern/install/metacg/bin/kripke_ct.mcg 75 | cd .. 76 | 77 | echo -e "\n----- Running Pira -----\n" 78 | 79 | # use runtime folder for extrap files 80 | if [[ -z "${XDG_DATA_HOME}" ]]; then 81 | pira_dir=$HOME/.local/share/pira 82 | else 83 | pira_dir=$XDG_DATA_HOME/pira 84 | fi 85 | export PIRA_DIR=$pira_dir 86 | echo -e "Using ${pira_dir} for runtime files\n" 87 | 88 | python3 ../../../pira.py --config-version 2 --iterations 4 --repetitions 1 --tape kripke.tp $testDir/kripke_config.json 89 | pirafailed=$? 90 | 91 | #rm -rf ${pira_dir}/piraII 92 | #rm -rf ${pira_dir}/lulesh_cubes-* 93 | cd $testDir 94 | ../check.py ../../../extern/install/metacg/bin/out expected_instrumentation.json kripke_ct || exit 1 95 | 96 | exit $pirafailed 97 | -------------------------------------------------------------------------------- /test/integration/Kripke_Slurm/run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # File: run.sh 4 | # License: Part of the PIRA project. Licensed under BSD 3 clause license. See LICENSE.txt file at https://github.com/tudasc/pira 5 | # Description: Runs the game of life integration test 6 | # 7 | 8 | # The test directory where the top-level files reside 9 | testDir=$PWD 10 | export TEST_DIR=$testDir 11 | 12 | echo -e "[ -- ## testDir == $testDir ## -- ]" 13 | 14 | export PATH=$PWD/../jq:$PATH 15 | # Export all the Pira tools for the integration test 16 | cd $testDir/../../../resources 17 | . setup_paths.sh 18 | cd $testDir 19 | 20 | echo -e "\n------ PATH -----" 21 | echo $PATH 22 | echo -e "\n------ LD_LIBRARY_PATH -----" 23 | echo $LD_LIBRARY_PATH 24 | echo -e "\n------ Which tools -----" 25 | which pgis_pira 26 | which cgcollector 27 | which scorep 28 | which wrap.py 29 | 30 | export CXX_COMPILER_WRAPPER=${TEST_DIR}/cxx-wrapper.sh 31 | 32 | # XXX Currently required by PGIS 33 | mkdir $PWD/../../../extern/install/metacg/bin/out 34 | 35 | # Download the target application 36 | stat Kripke 37 | if [ $? -ne 0 ]; then 38 | git clone git@github.com:LLNL/Kripke.git 39 | fi 40 | cd Kripke 41 | git checkout v1.2.4 42 | git submodule update --init 43 | git clean -dxf 44 | 45 | echo -e "\n----- Build Kripke / build call graph -----" 46 | export LULESH_CXXFLAGS="-DUSE_MPI=1 -O3 -g -I. -Wno-unknown-pragmas -Wall" 47 | 48 | # Configure 49 | mkdir build 50 | cd build 51 | export CXX_WRAP="clang++" 52 | cmake -DENABLE_MPI=ON -Wno-dev -DCMAKE_CXX_COMPILER=${CXX_COMPILER_WRAPPER} .. || exit 1 53 | 54 | # Initial build 55 | # Builds the compile_commands.json file 56 | bear make -j || exit 1 57 | 58 | cd .. 59 | 60 | # CGCollection 61 | # Now cgcollector can read the compile_commands.json file, to retrieve the commands required 62 | cp build/compile_commands.json . 63 | # for f in $(cat build/compile_commands.json | jq -r 'map(.directory + "/" + .file) | .[]' | grep '\.cpp'); do 64 | for f in $(find ./src -type f -iname "*.cpp" ); do 65 | echo "Processing $f" 66 | cgc --metacg-format-version=2 $f >/dev/null 2>&1 67 | done 68 | 69 | # Build the full whole-program call-graph 70 | echo "null" > kripke.mcg # create empty json file 71 | find . -name "*.ipcg" -exec cgmerge kripke.mcg kripke.mcg {} + 2>&1 > ../cgmerge.log # merge all ipcg files into kripke.mcg 72 | 73 | # Move the CG to where PIRA expects it 74 | cp kripke.mcg $PWD/../../../../extern/install/metacg/bin/kripke_ct.mcg 75 | cd .. 76 | 77 | echo -e "\n----- Running Pira -----\n" 78 | 79 | # use runtime folder for extrap files 80 | if [[ -z "${XDG_DATA_HOME}" ]]; then 81 | pira_dir=$HOME/.local/share/pira 82 | else 83 | pira_dir=$XDG_DATA_HOME/pira 84 | fi 85 | export PIRA_DIR=$pira_dir 86 | echo -e "Using ${pira_dir} for runtime files\n" 87 | 88 | python3 ../../../pira.py --config-version 2 --slurm-config ${testDir}/batchsystem.json --iterations 4 --repetitions 1 --tape kripke.tp $testDir/kripke_config.json 89 | pirafailed=$? 90 | 91 | #rm -rf ${pira_dir}/piraII 92 | #rm -rf ${pira_dir}/lulesh_cubes-* 93 | cd $testDir 94 | ../check.py ../../../extern/install/metacg/bin/out expected_instrumentation.json kripke_ct || exit 1 95 | 96 | exit $pirafailed 97 | -------------------------------------------------------------------------------- /test/unit/ExporterTest.py: -------------------------------------------------------------------------------- 1 | """ 2 | File: ExporterTest.py 3 | License: Part of the PIRA project. Licensed under BSD 3 clause license. See LICENSE.txt file at https://github.com/tudasc/pira 4 | Description: Unit test for Exporter module. 5 | """ 6 | 7 | import unittest 8 | 9 | import lib.Exporter as E 10 | import lib.Measurement as M 11 | import os 12 | 13 | class TestCSVExporter(unittest.TestCase): 14 | 15 | def test_init_None(self): 16 | with self.assertRaises(RuntimeError) as ex_cm: 17 | exporter = E.CSVExporter(None) 18 | 19 | exception = ex_cm.exception 20 | self.assertEqual(str(exception), 'name argument for CSVExport-ctor must not be None') 21 | 22 | def test_init(self): 23 | exporter = E.CSVExporter('test exporter') 24 | self.assertIsNotNone(exporter) 25 | self.assertEqual(exporter.get_name(), 'test exporter') 26 | 27 | def test_add_new_export_None_arguments(self): 28 | exporter = E.CSVExporter('TE') 29 | with self.assertRaises(RuntimeError) as e_cm: 30 | exporter.add_new_export(None, [1,2]) 31 | 32 | exception = e_cm.exception 33 | self.assertEqual(str(exception), 'name argument needs to be not None') 34 | 35 | with self.assertRaises(RuntimeError) as e_cm: 36 | exporter.add_new_export('key', None) 37 | 38 | exception = e_cm.exception 39 | self.assertEqual(str(exception), 'values argument needs to be not None') 40 | 41 | def test_add_new_export(self): 42 | exporter = E.CSVExporter('TE') 43 | exporter.add_new_export('a', [1]) 44 | self.assertTrue('a' in exporter._exports) 45 | self.assertEqual(exporter._exports['a'], [1]) 46 | 47 | def test_add_new_export_key_exists(self): 48 | exporter = E.CSVExporter('TE') 49 | exporter.add_new_export('a', [1]) 50 | with self.assertRaises(KeyError) as e_cm: 51 | exporter.add_new_export('a', [2]) 52 | 53 | ex = e_cm.exception 54 | # This seems to be an incosistency in Python (?), as the other exceptions do not show this sort of behavior 55 | self.assertEqual(str(ex), "'Key already exists'") 56 | 57 | def test_add_export_key_error(self): 58 | exporter = E.CSVExporter('TE') 59 | with self.assertRaises(KeyError) as e_cm: 60 | exporter.add_export('a', [2]) 61 | 62 | ex = e_cm.exception 63 | self.assertEqual(str(ex), "'a'") 64 | 65 | def test_add_export(self): 66 | exporter = E.CSVExporter('TE') 67 | exporter.add_new_export('a', [1]) 68 | exporter.add_export('a', [2]) 69 | self.assertEqual(exporter._exports['a'], [1, 2]) 70 | 71 | class TestRunResultExporter(unittest.TestCase): 72 | def test_init(self): 73 | rre = E.RunResultExporter() 74 | self.assertIsNotNone(rre) 75 | 76 | def test_add_row(self): 77 | rre = E.RunResultExporter() 78 | rr = M.RunResult(1,1) 79 | rr.add_values(2,2) 80 | rre.add_row("test", rr) 81 | self.assertEqual(len(rre.rows), 1) 82 | self.assertEqual(len(rre.rows[0]), 5) 83 | self.assertEqual(rre.rows[0][0], "test") 84 | self.assertEqual(rre.rows[0][1], 1) 85 | self.assertEqual(rre.rows[0][2], 1) 86 | self.assertEqual(rre.rows[0][3], 2) 87 | self.assertEqual(rre.rows[0][4], 2) 88 | self.assertEqual(rre.width, 5) 89 | 90 | def test_export(self): 91 | rre = E.RunResultExporter() 92 | rr = M.RunResult(1, 1) 93 | rr.add_values(2, 2) 94 | rre.add_row("test", rr) 95 | rre.export("test_file") 96 | with open("test_file", "r") as tf: 97 | data = tf.read() 98 | expected_data = '"Type of Run","Accumulated Runtime","Number of Runs","Accumulated Runtime","Number of Runs"\n"test","1","1","2","2"\n' 99 | self.assertEqual(data, expected_data) 100 | os.remove("test_file") -------------------------------------------------------------------------------- /test/unit/BuilderTest.py: -------------------------------------------------------------------------------- 1 | """ 2 | File: BuilderTest.py 3 | License: Part of the PIRA project. Licensed under BSD 3 clause license. See LICENSE.txt file at https://github.com/tudasc/pira 4 | Description: Unit test for the Builder class. 5 | """ 6 | 7 | import unittest 8 | import lib.Builder as B 9 | import lib.Configuration as C 10 | import lib.ConfigurationLoader as CO 11 | 12 | 13 | class BuilderTest(unittest.TestCase): 14 | 15 | def setUp(self): 16 | C.InvocationConfig.create_from_kwargs({'config' : '../inputs/configs/basic_config_005.json'}) 17 | ld = CO.SimplifiedConfigurationLoader() 18 | self.cfg = ld.load_conf() 19 | pass 20 | 21 | def test_init(self): 22 | tc = C.TargetConfig(self.cfg.get_place('/tmp'), '/tmp', 'test_item', 'ct', 'asdf') 23 | builder = B.Builder(tc, True) 24 | self.assertIsNotNone(builder) 25 | self.assertIsNone(builder.error) 26 | self.assertIsNone(builder.instrumentation_file) 27 | self.assertTrue(builder.build_instr) 28 | self.assertEqual(builder.directory, '/tmp') 29 | 30 | def test_init_tc_none(self): 31 | with self.assertRaises(B.BuilderException) as cm_b: 32 | builder = B.Builder(None, True) 33 | b_exc = cm_b.exception 34 | self.assertEqual(str(b_exc), 'Builder::ctor: Target Configuration was None') 35 | 36 | @unittest.skip('Builder::set_up mainly changes directories. How to test?') 37 | def test_set_up(self): 38 | self.assertFalse(True) 39 | 40 | def test_construct_pira_kwargs_fail_instr(self): 41 | tc = C.TargetConfig(self.cfg.get_place('/tmp'), '/tmp', 'test_item', 'ct', 'asdf') 42 | builder = B.Builder(tc, True, '/tmp/instr_file') 43 | self.assertIsNotNone(builder) 44 | self.assertIsNotNone(builder.instrumentation_file) 45 | 46 | with self.assertRaises(B.BuilderException) as cm_b: 47 | p_kwargs = builder.construct_pira_kwargs() 48 | 49 | exc = cm_b.exception 50 | self.assertEqual(str(exc), 'Should not construct non-instrument kwargs in instrumentation mode.') 51 | 52 | def test_construct_pira_kwargs(self): 53 | tc = C.TargetConfig(self.cfg.get_place('/tmp'), '/tmp', 'test_item', 'ct', 'asdf') 54 | builder = B.Builder(tc, False, '/tmp/instr_file') 55 | self.assertIsNotNone(builder) 56 | self.assertIsNotNone(builder.instrumentation_file) 57 | 58 | p_kwargs = builder.construct_pira_kwargs() 59 | self.assertEqual(p_kwargs['CC'], '\"clang\"') 60 | self.assertEqual(p_kwargs['CXX'], '\"clang++\"') 61 | self.assertEqual(p_kwargs['PIRANAME'], 'pira.built.exe') 62 | self.assertEqual(p_kwargs['NUMPROCS'], 8) 63 | 64 | @unittest.skip('Implement this test, when fully switched to internal Score-P') 65 | def test_construct_pira_instr_kwargs(self): 66 | tc = C.TargetConfig(self.cfg.get_place('/tmp'), '/tmp', 'test_item', 'ct', 'asdf') 67 | builder = B.Builder(tc, True, '/tmp/instr_file') 68 | self.assertIsNotNone(builder) 69 | self.assertIsNotNone(builder.instrumentation_file) 70 | 71 | p_kwargs = builder.construct_pira_instr_kwargs() 72 | self.assertEqual(p_kwargs['CC'],'\"clang -finstrument-functions -finstrument-functions-whitelist-inputfile=/tmp/instr_file\"') 73 | self.assertEqual(p_kwargs['CXX'],'\"clang++ -finstrument-functions -finstrument-functions-whitelist-inputfile=/tmp/instr_file\"') 74 | # self.assertEqual(p_kwargs['CLFLAGS'], '\" scorep.init.o ') 75 | # self.assertEqual(p_kwargs['CXXLFLAGS'], ) 76 | self.assertEqual(p_kwargs['PIRANAME'], 'pira.built.exe') 77 | self.assertEqual(p_kwargs['NUMPROCS'], 8) 78 | self.assertEqual(p_kwargs['filter-file'], '/tmp/instr_file') 79 | 80 | def test_construct_pira_instr_kwargs(self): 81 | tc = C.TargetConfig(self.cfg.get_place('/tmp'), '/tmp', 'test_item', 'ct', 'asdf') 82 | builder = B.Builder(tc, False) 83 | self.assertIsNotNone(builder) 84 | 85 | with self.assertRaises(B.BuilderException) as cm_b: 86 | p_kwargs = builder.construct_pira_instr_kwargs() 87 | 88 | exc = cm_b.exception 89 | self.assertEqual(str(exc), 'Should not construct instrument kwargs in non-instrumentation mode.') 90 | 91 | @unittest.skip('This actually calls the functor.') 92 | def test_build_flavors(self): 93 | pass 94 | -------------------------------------------------------------------------------- /test/integration/LULESH_Slurm/expected_instrumentation.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "iteration": 0, 4 | "expect": ["main"], 5 | "may-expect": [], 6 | "never-expect": [] 7 | }, 8 | { 9 | "iteration": 1, 10 | "expect": ["main"], 11 | "may-expect": [ 12 | "_ZN6DomainCEiiiiiiiii", 13 | "_Z8CommSendR6DomainiiPMS_FRdiEiiibb", 14 | "_Z7CommSBNR6DomainiPMS_FRdiE", 15 | "_ZN6DomainC2Eiiiiiiiii", 16 | "_ZL16LagrangeLeapFrogR6Domain", 17 | "_ZN6DomainC1Eiiiiiiiii", 18 | "_ZN6DomainC5Eiiiiiiiii" 19 | ], 20 | "never-expect": [] 21 | }, 22 | { 23 | "iteration": 2, 24 | "expect": ["main"], 25 | "may-expect": [ 26 | "_Z8CommSendR6DomainiiPMS_FRdiEiiibb", 27 | "_Z7CommSBNR6DomainiPMS_FRdiE", 28 | "_ZL16LagrangeLeapFrogR6Domain", 29 | "_ZL16LagrangeElementsR6Domaini", 30 | "_ZL13LagrangeNodalR6Domain" 31 | ], 32 | "never-expect": [] 33 | }, 34 | { 35 | "iteration": 3, 36 | "expect": ["main"], 37 | "may-expect": [ 38 | "_Z14CommSyncPosVelR6Domain", 39 | "_ZL20CalcLagrangeElementsR6Domain", 40 | "_ZL17CalcForceForNodesR6Domain", 41 | "_ZL16LagrangeElementsR6Domaini", 42 | "_ZL31ApplyMaterialPropertiesForElemsR6Domain", 43 | "_ZL16LagrangeLeapFrogR6Domain", 44 | "_ZL13CalcQForElemsR6Domain" 45 | ], 46 | "never-expect": [] 47 | }, 48 | { 49 | "iteration": 4, 50 | "expect": [ 51 | "main", 52 | "_ZL16LagrangeElementsR6Domaini", 53 | "_ZL16LagrangeLeapFrogR6Domain", 54 | "_ZL31ApplyMaterialPropertiesForElemsR6Domain" 55 | ], 56 | "may-expect": [ 57 | "_Z22CalcKinematicsForElemsR6Domaindi", 58 | "_ZL20CalcLagrangeElementsR6Domain", 59 | "_ZL22CalcMonotonicQForElemsR6Domain", 60 | "_ZL17CalcForceForNodesR6Domain", 61 | "_ZL15EvalEOSForElemsR6DomainPdiPii", 62 | "_ZL23CalcVolumeForceForElemsR6Domain" 63 | ], 64 | "never-expect": [] 65 | }, 66 | { 67 | "iteration": 5, 68 | "expect": [ 69 | "main", 70 | "_ZL16LagrangeElementsR6Domaini", 71 | "_ZL16LagrangeLeapFrogR6Domain", 72 | "_ZL31ApplyMaterialPropertiesForElemsR6Domain" 73 | ], 74 | "may-expect": [ 75 | "_ZL15EvalEOSForElemsR6DomainPdiPii", 76 | "_ZL22CalcMonotonicQForElemsR6Domain", 77 | "_ZL23IntegrateStressForElemsR6DomainPdS1_S1_S1_ii", 78 | "_ZL28CalcHourglassControlForElemsR6DomainPdd", 79 | "_ZL28CalcMonotonicQRegionForElemsR6Domainid" 80 | ], 81 | "never-expect": [] 82 | }, 83 | { 84 | "iteration": 6, 85 | "expect": [ 86 | "main", 87 | "_ZL16LagrangeElementsR6Domaini", 88 | "_ZL16LagrangeLeapFrogR6Domain", 89 | "_ZL31ApplyMaterialPropertiesForElemsR6Domain" 90 | ], 91 | "may-expect": [ 92 | "_ZL15EvalEOSForElemsR6DomainPdiPii", 93 | "_ZL23IntegrateStressForElemsR6DomainPdS1_S1_S1_ii", 94 | "_ZL28CalcFBHourglassForceForElemsR6DomainPdS1_S1_S1_S1_S1_S1_dii", 95 | "_ZL28CalcHourglassControlForElemsR6DomainPdd" 96 | ], 97 | "never-expect": [] 98 | }, 99 | { 100 | "iteration": 7, 101 | "expect": [ 102 | "main", 103 | "_ZL16LagrangeElementsR6Domaini", 104 | "_ZL16LagrangeLeapFrogR6Domain", 105 | "_ZL31ApplyMaterialPropertiesForElemsR6Domain" 106 | ], 107 | "may-expect": [ 108 | "_ZL15EvalEOSForElemsR6DomainPdiPii" 109 | ], 110 | "never-expect": [] 111 | }, 112 | { 113 | "iteration": 8, 114 | "expect": [ 115 | "main", 116 | "_ZL16LagrangeElementsR6Domaini", 117 | "_ZL16LagrangeLeapFrogR6Domain", 118 | "_ZL31ApplyMaterialPropertiesForElemsR6Domain" 119 | ], 120 | "may-expect": [ 121 | "_ZL15EvalEOSForElemsR6DomainPdiPii" 122 | ], 123 | "never-expect": [] 124 | }, 125 | { 126 | "iteration": 9, 127 | "expect": [ 128 | "main", 129 | "_ZL16LagrangeElementsR6Domaini", 130 | "_ZL16LagrangeLeapFrogR6Domain", 131 | "_ZL31ApplyMaterialPropertiesForElemsR6Domain" 132 | ], 133 | "may-expect": [ 134 | "_ZL15EvalEOSForElemsR6DomainPdiPii" 135 | ], 136 | "never-expect": [] 137 | } 138 | ] -------------------------------------------------------------------------------- /lib/Exporter.py: -------------------------------------------------------------------------------- 1 | """ 2 | File: Exporter.py 3 | License: Part of the PIRA project. Licensed under BSD 3 clause license. See LICENSE.txt file at https://github.com/tudasc/pira 4 | Description: Module that implements various exporters, e.g., CSV-export. 5 | """ 6 | 7 | import csv 8 | 9 | import lib.Logging as L 10 | import typing 11 | 12 | from lib.Exception import PiraException 13 | from lib.Measurement import RunResult 14 | 15 | 16 | class CSVExporter: 17 | 18 | def __init__(self, name): 19 | if name is None: 20 | raise RuntimeError('name argument for CSVExport-ctor must not be None') 21 | self._name = name 22 | self._exports = {} 23 | 24 | def get_name(self): 25 | return self._name 26 | 27 | def add_new_export(self, name, values): 28 | if name is None: 29 | raise RuntimeError('name argument needs to be not None') 30 | if values is None: 31 | raise RuntimeError('values argument needs to be not None') 32 | if name in self._exports: 33 | raise KeyError('Key already exists') 34 | 35 | self._exports[name] = values 36 | 37 | def add_export(self, name, values): 38 | self._exports[name] += values 39 | 40 | def export(self, file_name, keys=None): 41 | if keys is None: 42 | keys = [str(x) for x in self._exports.keys()] 43 | 44 | L.get_logger().log('[CSVExporter::export] Keys to export: ' + str(keys)) 45 | 46 | 47 | class RunResultExporter: 48 | 49 | def __init__(self): 50 | self.rows = [] 51 | self.width = 0 52 | 53 | def add_row(self, run_type: str, rr: RunResult): 54 | # first element is type of run 55 | row = [run_type] 56 | if (len(rr.get_accumulated_runtime()) != len(rr.get_nr_of_iterations())): 57 | raise PiraException( 58 | "Could not add row to RunResultExporter; lengths of accumulated runtimes and number of iterations do not match" 59 | ) 60 | else: 61 | # assemble row content 62 | for i in range(len(rr.get_accumulated_runtime())): 63 | row.append(rr.get_accumulated_runtime()[i]) 64 | row.append(rr.get_nr_of_iterations()[i]) 65 | 66 | # add row to table 67 | self.rows.append(row) 68 | 69 | # check if width attribute needs to be updated 70 | if (len(row) > self.width): 71 | self.width = len(row) 72 | 73 | def export(self, file_name: str, dialect='unix'): 74 | with open(file_name, 'w', newline='') as csvfile: 75 | 76 | writer = csv.writer(csvfile, dialect) 77 | 78 | # construct table header 79 | fieldnames = ['Type of Run'] 80 | for i in range((self.width - 1) // 2): 81 | fieldnames.append('Accumulated Runtime') 82 | fieldnames.append('Number of Runs') 83 | 84 | # write table header as first row 85 | writer.writerow(fieldnames) 86 | 87 | # write rows 88 | writer.writerows(self.rows) 89 | 90 | 91 | class PiraRuntimeExporter: 92 | 93 | class MetaInformationProvider: 94 | 95 | def __init__(self, str_for_average: str, str_for_median: str, str_for_stdev: str): 96 | self._average = str_for_average 97 | self._median = str_for_median 98 | self._stdev = str_for_stdev 99 | 100 | def get_average(self, unused_void, unused_void_2): 101 | return self._average 102 | 103 | def get_median(self, unused_void, unused_void_2): 104 | return self._median 105 | 106 | def get_stdev(self, unused_void, unused_void_2): 107 | return self._stdev 108 | 109 | def get_num_data_sets(self): 110 | return 1 111 | 112 | def __init__(self): 113 | self._iteration_data = [ 114 | ('Data', PiraRuntimeExporter.MetaInformationProvider('Average', 'Median', 'Stdev')) 115 | ] 116 | 117 | def add_iteration_data(self, name: str, rt_info) -> None: 118 | self._iteration_data.append((name, rt_info)) 119 | 120 | def export(self, file_name: str, dialect='unix'): 121 | with open(file_name, 'w', newline='') as csvfile: 122 | 123 | writer = csv.writer(csvfile, dialect) 124 | 125 | writer_data = [] 126 | for el in self._iteration_data: 127 | for nd in range(0, el[1].get_num_data_sets()): 128 | writer_data.append(el[0]) 129 | writer.writerow(writer_data) 130 | 131 | writer_data = [] 132 | for el in self._iteration_data: 133 | for nd in range(0, el[1].get_num_data_sets()): 134 | writer_data.append(el[1].get_average(0, nd)) 135 | writer.writerow(writer_data) 136 | 137 | writer_data = [] 138 | for el in self._iteration_data: 139 | for nd in range(0, el[1].get_num_data_sets()): 140 | writer_data.append(el[1].get_median(0, nd)) 141 | writer.writerow(writer_data) 142 | 143 | writer_data = [] 144 | for el in self._iteration_data: 145 | for nd in range(0, el[1].get_num_data_sets()): 146 | writer_data.append(el[1].get_stdev(0, nd)) 147 | writer.writerow(writer_data) 148 | --------------------------------------------------------------------------------