Skip to content

Commit

Permalink
Added option for printing CDash image path, and modified lsu-perftest…
Browse files Browse the repository at this point in the history
… for uploading results JSONs

Signed-off-by: Vedant <vedantnimjed@gmail.com>
  • Loading branch information
vrnimje committed Jul 29, 2024
1 parent d3b59d0 commit b3e4382
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .jenkins/lsu-perftests/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pipeline {
always {
archiveArtifacts artifacts: 'jenkins-hpx-*', fingerprint: true
archiveArtifacts artifacts: '*-Testing/**', fingerprint: true
// archiveArtifacts artifacts: '*-reports/**', fingerprint: true
archiveArtifacts artifacts: '*-reports/**', fingerprint: true
}
}
}
12 changes: 5 additions & 7 deletions .jenkins/lsu-perftests/batch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ status_computation_and_artifacts_storage() {

# Copy the testing directory for saving as an artifact
cp -r ${build_dir}/Testing ${src_dir}/${configuration_name}-Testing
# cp -r ${build_dir}/reports ${src_dir}/${configuration_name}-reports
cp -r ${build_dir}/*.json ${src_dir}/${configuration_name}-reports

echo "${ctest_status}" > "jenkins-hpx-${configuration_name}-ctest-status.txt"
# exit $ctest_status
exit $ctest_status
}

# trap "status_computation_and_artifacts_storage" EXIT
trap "status_computation_and_artifacts_storage" EXIT

src_dir="$(pwd)"
build_dir="${src_dir}/build/${configuration_name}"
Expand All @@ -33,7 +33,7 @@ cp -r ${src_dir}/tools/perftests_ci ${build_dir}/tools
# Variables
perftests_dir=${build_dir}/tools/perftests_ci
envfile=${src_dir}/.jenkins/lsu-perftests/env-${configuration_name}.sh
mkdir -p ${build_dir}/reports
mkdir -p ${src_dir}/${configuration_name}-reports
logfile=${build_dir}/reports/jenkins-hpx-${configuration_name}.log

# Load python packages
Expand All @@ -51,7 +51,6 @@ wait
source ${src_dir}/.jenkins/lsu-perftests/env-${configuration_name}.sh

# CTest to upload the images to CDash
set +e
ctest \
-VV \
--output-on-failure \
Expand All @@ -60,8 +59,7 @@ ctest \
-DCTEST_CONFIGURE_EXTRA_OPTIONS="${configure_extra_options}" \
-DCTEST_SOURCE_DIRECTORY="${src_dir}" \
-DCTEST_BINARY_DIRECTORY="${build_dir}"
set -e


status_computation_and_artifacts_storage

if [ -s $build_dir/index.html ]; then
Expand Down
2 changes: 1 addition & 1 deletion .jenkins/lsu/ctest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ set(ctest_submission_result ${ctest_submission_result} "Build: "
${__build_result} "\n"
)

ctest_test(PARALLEL_LEVEL "${CTEST_TEST_PARALLELISM}")
ctest_test(PARALLEL_LEVEL "${CTEST_TEST_PARALLELISM}" EXCLUDE "_perftest$")
ctest_submit(
PARTS Test
BUILD_ID __ctest_build_id
Expand Down
2 changes: 2 additions & 0 deletions cmake/HPX_AddTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,10 @@ function(add_hpx_performance_test subcategory name)
endfunction(add_hpx_performance_test)

function(add_hpx_performance_report_test subcategory name)
# set(ARGN "${ARGN} ")
add_test_and_deps_test(
"performance" "${subcategory}" ${name} ${ARGN} RUN_SERIAL
"--print_cdash_img_path"
)
find_package(Python REQUIRED)
string(REPLACE "_perftest" "" name ${name})
Expand Down
1 change: 1 addition & 0 deletions libs/core/testing/include/hpx/testing/performance.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

namespace hpx::util {
HPX_CORE_EXPORT inline bool detailed_;
HPX_CORE_EXPORT inline bool print_cdash_img;
HPX_CORE_EXPORT inline std::string test_name_;
HPX_CORE_EXPORT void perftests_cfg(
hpx::program_options::options_description& cmdline);
Expand Down
17 changes: 12 additions & 5 deletions libs/core/testing/src/performance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ namespace hpx::util {
{
cmdline.add_options()("detailed_bench",
"Use if detailed benchmarks are required, showing the execution "
"time taken for each epoch");
"time taken for each epoch")
("print_cdash_img_path",
"Print the path to the images to be uploaded, in CDash XML format");
}

void perftests_init(const hpx::program_options::variables_map& vm,
Expand All @@ -36,6 +38,10 @@ namespace hpx::util {
{
detailed_ = true;
}
if (vm.count("print_cdash_img_path"))
{
print_cdash_img = true;
}
test_name_ = test_name;
}

Expand Down Expand Up @@ -175,9 +181,10 @@ average: {{average(elapsed)}}{{^-last}}
strm << std::scientific << "average: " << average / series
<< "\n\n";
}
strm << "<CTestMeasurementFile type=\"image/png\" "
"name=\"perftests\" >"
<< "./" << test_name_ << ".png</CTestMeasurementFile>\n";
if (print_cdash_img)
strm << "<CTestMeasurementFile type=\"image/png\" "
"name=\"perftests\" >"
<< "./" << test_name_ << ".png</CTestMeasurementFile>\n";
}
return strm;
}
Expand Down Expand Up @@ -214,7 +221,7 @@ average: {{average(elapsed)}}{{^-last}}
void perftests_print_times(char const* templ, std::ostream& strm)
{
detail::bench().render(templ, strm);
if (!detailed_)
if (!detailed_ && print_cdash_img)
strm << "<CTestMeasurementFile type=\"image/png\" "
"name=\"perftests\">"
<< "./" << test_name_ << ".png</CTestMeasurementFile>\n";
Expand Down

0 comments on commit b3e4382

Please sign in to comment.