-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#2302: Start elaborating cmake system to turn and off measurement opt…
…ions (wip)
- Loading branch information
1 parent
5c993b5
commit 30b1083
Showing
17 changed files
with
145 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ build | |
transport | ||
lib/*-build | ||
lib/checkpoint | ||
lib/papi | ||
lib/googletest | ||
lib/kokkos | ||
.emacs.desktop | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
find_package(PAPI REQUIRED) | ||
message(STATUS: "FOUND PAPI: PAPI LIBRARY: ${PAPI_LIBRARY}\n PAPI INCLUDE DIR: ${PAPI_INCLUDE_DIR}") | ||
set(vt_papi_found "1") | ||
set(vt_papi_found "0") | ||
|
||
if (vt_papi_enabled) | ||
if (vt_perf_enabled) | ||
set(vt_papi_found "0") | ||
set(vt_papi_enabled "0") | ||
message(FATAL_ERROR "Both PAPI and perf measurements are enabled; this will cause errors, please turn off one of these options. Exiting.") | ||
endif () | ||
find_package(PAPI REQUIRED) | ||
message(STATUS: "FOUND PAPI: PAPI LIBRARY: ${PAPI_LIBRARY}\n PAPI INCLUDE DIR: ${PAPI_INCLUDE_DIR}") | ||
set(vt_papi_found "1") | ||
endif () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
set(vt_perf_found "0") | ||
|
||
if (vt_perf_enabled) | ||
if (vt_papi_enabled) | ||
message(FATAL_ERROR "Both PAPI and perf measurements are enabled; this will cause errors, please turn off one of these options. Exiting.") | ||
endif () | ||
# check if linux | ||
if (CMAKE_SYSTEM_NAME STREQUAL "Linux") | ||
# check if there's the perf header we need | ||
INCLUDE(CheckIncludeFiles) | ||
CHECK_INCLUDE_FILES("linux/perf_event.h" HAVE_PERF_EVENT_H) | ||
if (HAVE_PERF_EVENT_H) | ||
# check if the kernel is recent enough | ||
string(REPLACE "." ";" VERSION_LIST ${CMAKE_SYSTEM_VERSION}) | ||
list(GET VERSION_LIST 0 KERNEL_MAJOR_VERSION) | ||
if (KERNEL_MAJOR_VERSION GREATER_EQUAL 4) | ||
# check if a simple perf stat runs without issues | ||
execute_process( | ||
COMMAND "perf stat which cmake" | ||
RESULT_VARIABLE PERF_STAT_RESULT | ||
OUTPUT_QUIET | ||
ERROR_QUIET | ||
) | ||
if (PERF_STAT_RESULT EQUAL 0) | ||
set(vt_perf_enabled "1") | ||
set(vt_perf_found "1") | ||
else () | ||
message(WARNING "Perf measurements enabled but couldn't run perf stat successfully. Disabling perf measurements.") | ||
set(vt_perf_enabled "0") | ||
set(vt_perf_found "0") | ||
endif () | ||
else () | ||
message(WARNING "Perf measurements enabled but Kernel major version is less than 4. Disabling perf measurements.") | ||
set(vt_perf_enabled "0") | ||
set(vt_perf_found "0") | ||
endif () | ||
else () | ||
message(WARNING "Perf measurements enabled but couldn't find perf_event.h. Disabling perf measurements.") | ||
set(vt_perf_enabled "0") | ||
set(vt_perf_found "0") | ||
endif () | ||
else () | ||
message(WARNING "Perf measurements enabled but system is not Linux. Disabling perf measurements.") | ||
set(vt_perf_enabled "0") | ||
set(vt_perf_found "0") | ||
endif () | ||
endif () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters