Skip to content

Commit e44ee7f

Browse files
committed
#2302: Fix commented code and pin papi version
1 parent eb04548 commit e44ee7f

File tree

5 files changed

+21
-22
lines changed

5 files changed

+21
-22
lines changed

ci/build_cpp.sh

+4-3
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ fi
116116

117117
if test "$VT_PAPI_ENABLED" -eq 1 && "$VT_PERF_ENABLED" -eq 1
118118
then
119-
echo "Both PAPI and perf measurements are enabled; this isn't possible, please turn off one of these options. Exiting."
119+
echo "Both PAPI and perf measurements are enabled; this is not supported. Please turn off one of these options. Exiting."
120120
exit
121121
fi
122122

@@ -127,12 +127,13 @@ then
127127
{ echo "papi already in lib... not downloading, building, and installing"; } 2>/dev/null
128128
else
129129
cd "${source_dir}/lib"
130-
git clone --depth 1 https://github.com/icl-utk-edu/papi.git
130+
papi_rev="papi-7-2-0b1-t"
131+
git clone -b "${papi_rev}" --depth 1 https://github.com/icl-utk-edu/papi.git
131132
cd papi/src
132133
export PAPI_BUILD=${build_dir}/papi
133134
mkdir -p "$PAPI_BUILD"
134135
CC="${CC:-cc}" F77="${F77:-gfortran}" ./configure --prefix="$PAPI_BUILD/install"
135-
make -j "${dashj}" && make install
136+
make ${dashj} && make install
136137
fi
137138
fi
138139

cmake/load_perf.cmake

+13-13
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,22 @@ if (vt_perf_enabled)
1414
string(REPLACE "." ";" VERSION_LIST ${CMAKE_SYSTEM_VERSION})
1515
list(GET VERSION_LIST 0 KERNEL_MAJOR_VERSION)
1616
if (KERNEL_MAJOR_VERSION GREATER_EQUAL 4)
17-
# # check if a simple perf stat runs without issues
18-
# execute_process(
19-
# COMMAND "perf stat pwd"
20-
# RESULT_VARIABLE PERF_STAT_RESULT
21-
# OUTPUT_QUIET
22-
# ERROR_QUIET
23-
# )
24-
# if (PERF_STAT_RESULT EQUAL 0)
17+
# check if a simple perf stat runs without issues
18+
execute_process(
19+
COMMAND perf stat pwd
20+
RESULT_VARIABLE PERF_STAT_RESULT
21+
OUTPUT_QUIET
22+
ERROR_QUIET
23+
)
24+
if (PERF_STAT_RESULT EQUAL 0)
2525
message(STATUS "Perf measurements enabled.")
2626
set(vt_perf_enabled "1")
2727
set(vt_perf_found "1")
28-
# else ()
29-
# message(WARNING "Perf measurements enabled but couldn't run perf stat successfully. Disabling perf measurements.")
30-
# set(vt_perf_enabled "0")
31-
# set(vt_perf_found "0")
32-
# endif ()
28+
else ()
29+
message(WARNING "Perf measurements enabled but couldn't run perf stat successfully. Disabling perf measurements.")
30+
set(vt_perf_enabled "0")
31+
set(vt_perf_found "0")
32+
endif ()
3333
else ()
3434
message(WARNING "Perf measurements enabled but Kernel major version is less than 4. Disabling perf measurements.")
3535
set(vt_perf_enabled "0")

src/vt/context/runnable_context/lb_data.cc

+4-4
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ std::unordered_map<std::string, uint64_t> LBData::getPAPIMetrics() {
8484
for (size_t i = 0; i < papiData_->native_events.size(); i++) {
8585
papi_metrics[papiData_->native_events[i]] = papiData_->values[i];
8686
}
87-
papi_metrics[std::string("real_time")] = papiData_->end_real_usec - papiData_->start_real_usec;
88-
papi_metrics[std::string("real_cycles")] = papiData_->end_real_cycles - papiData_->start_real_cycles;
89-
papi_metrics[std::string("virt_time")] = papiData_->end_virt_usec - papiData_->start_virt_usec;
90-
papi_metrics[std::string("virt_cycles")] = papiData_->end_virt_cycles - papiData_->start_virt_cycles;
87+
papi_metrics["real_time"] = papiData_->end_real_usec - papiData_->start_real_usec;
88+
papi_metrics["real_cycles"] = papiData_->end_real_cycles - papiData_->start_real_cycles;
89+
papi_metrics["virt_time"] = papiData_->end_virt_usec - papiData_->start_virt_usec;
90+
papi_metrics["virt_cycles"] = papiData_->end_virt_cycles - papiData_->start_virt_cycles;
9191
return papi_metrics;
9292
}
9393
#endif

src/vt/context/runnable_context/papi_data.h

-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ struct PAPIData {
6868

6969
// check if the environment variable is set
7070
if (env_p == nullptr) {
71-
fmt::print("Warning: Environment variabale VT_EVENTS not set, defaulting to instructions for the PAPI event set.\n");
7271
native_events.push_back("PAPI_TOT_INS");
7372
}
7473
else {

src/vt/metrics/perf_data.cc

-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ PerfData::PerfData()
5252

5353
// Check if the environment variable is set
5454
if (env_p == nullptr) {
55-
// vtWarn("Warning: Environment variable VT_EVENTS not set, defaulting to 'instructions' for the perf event set.\n");
5655
event_names_.push_back("instructions");
5756
}
5857
else {

0 commit comments

Comments
 (0)