Skip to content

Commit

Permalink
Fixed subplot indexing issue in perftest plotting script, updated bas…
Browse files Browse the repository at this point in the history
…elines, and fixed clang- and cmake-formatting issues

Signed-off-by: Vedant <[email protected]>
  • Loading branch information
vrnimje committed Aug 15, 2024
1 parent 91a6d3f commit f6e9b0b
Show file tree
Hide file tree
Showing 25 changed files with 1,517 additions and 1,512 deletions.
2 changes: 1 addition & 1 deletion .jenkins/lsu-perftests/comment_github.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ curl \
-X POST \
-H "Authorization: token ${GITHUB_TOKEN}" \
https://api.github.com/repos/STEllAR-GROUP/hpx/issues/${ghprbPullId}/comments \
-d "{\"body\": \"<details><summary>Performance test report<\/summary><table><tr><th>Test name<\/th><th>Executor<\/th><th>Mean Percentage Diff.<\/th><th>P value<\/th><\/tr>${report}<\/table><\/details>\"}"
-d "{\"body\": \"<details><summary>Performance test report<\/summary><table><tr><th>Test name<\/th><th>Executor<\/th><th>Mean Percentage Diff.<\/th><th>Coefficient of variation<\/th><\/tr>${report}<\/table><\/details>\"}"

# popd
13 changes: 10 additions & 3 deletions cmake/HPX_AddTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -291,16 +291,23 @@ endfunction(add_hpx_performance_test)
function(add_hpx_performance_report_test subcategory name)
string(REPLACE "_perftest" "" name ${name})
add_test_and_deps_test(
"performance" "${subcategory}" ${name}_perftest EXECUTABLE ${name} PSEUDO_DEPS_NAME
${name} ${ARGN} RUN_SERIAL
"performance"
"${subcategory}"
${name}_perftest
EXECUTABLE
${name}
PSEUDO_DEPS_NAME
${name}
${ARGN}
RUN_SERIAL
"--print_cdash_img_path"
)
find_package(Python REQUIRED)

if(NOT ARGN STREQUAL "")
string(REPLACE "THREADS_PER_LOCALITY" "--hpx:threads=" ARGN ${ARGN})
string(REPLACE "LOCALITIES" "--hpx:localities=" ARGN ${ARGN})
string(REPLACE "--" " --" ARGN ${ARGN})
string(REPLACE "--" " --" ARGN ${ARGN})
endif()

add_custom_target(
Expand Down
28 changes: 7 additions & 21 deletions libs/core/algorithms/tests/performance/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,33 +51,19 @@ set(foreach_report_perftest_PARAMETERS
--test_count=200
)

set(transform_reduce_scaling_perftest_PARAMETERS
THREADS_PER_LOCALITY 4
)
set(transform_reduce_scaling_perftest_PARAMETERS THREADS_PER_LOCALITY 4)

set(benchmark_is_heap_until_perftest_PARAMETERS
THREADS_PER_LOCALITY 4
)
set(benchmark_is_heap_until_perftest_PARAMETERS THREADS_PER_LOCALITY 4)

set(benchmark_merge_perftest_PARAMETERS
THREADS_PER_LOCALITY 4
)
set(benchmark_merge_perftest_PARAMETERS THREADS_PER_LOCALITY 4)

set(benchmark_inplace_merge_perftest_PARAMETERS
THREADS_PER_LOCALITY 4
)
set(benchmark_inplace_merge_perftest_PARAMETERS THREADS_PER_LOCALITY 4)

set(benchmark_is_heap_perftest_PARAMETERS
THREADS_PER_LOCALITY 4
)
set(benchmark_is_heap_perftest_PARAMETERS THREADS_PER_LOCALITY 4)

set(benchmark_remove_perftest_PARAMETERS
THREADS_PER_LOCALITY 4
)
set(benchmark_remove_perftest_PARAMETERS THREADS_PER_LOCALITY 4)

set(benchmark_remove_if_perftest_PARAMETERS
THREADS_PER_LOCALITY 4
)
set(benchmark_remove_if_perftest_PARAMETERS THREADS_PER_LOCALITY 4)

foreach(benchmark ${benchmarks})
set(sources ${benchmark}.cpp)
Expand Down
40 changes: 24 additions & 16 deletions libs/core/algorithms/tests/performance/benchmark_nth_element.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ std::mt19937 my_rand(0);
int hpx_main(hpx::program_options::variables_map& vm)
{
hpx::util::perftests_init(vm, "benchmark_nth_element");

typedef std::less<uint64_t> compare_t;
std::vector<uint64_t> A, B;
uint64_t NELEM = 1000;
Expand All @@ -41,12 +41,16 @@ int hpx_main(hpx::program_options::variables_map& vm)
A.emplace_back(i);
std::shuffle(A.begin(), A.end(), my_rand);

hpx::util::perftests_report("hpx::nth_element, size: " + std::to_string(NELEM) + ", step: " + std::to_string(1), "seq", 100, [&] {
for (uint64_t i = 0; i < NELEM; i++) {
B = A;
hpx::nth_element(B.begin(), B.begin() + i, B.end(), compare_t());
}
});
hpx::util::perftests_report("hpx::nth_element, size: " +
std::to_string(NELEM) + ", step: " + std::to_string(1),
"seq", 100, [&] {
for (uint64_t i = 0; i < NELEM; i++)
{
B = A;
hpx::nth_element(
B.begin(), B.begin() + i, B.end(), compare_t());
}
});

NELEM = 100000;

Expand All @@ -59,14 +63,18 @@ int hpx_main(hpx::program_options::variables_map& vm)
A.emplace_back(i);
std::shuffle(A.begin(), A.end(), my_rand);
const uint32_t STEP = NELEM / 20;

hpx::util::perftests_report("hpx::nth_element, size: " + std::to_string(NELEM) + ", step: " + std::to_string(STEP), "seq", 100, [&] {
for (uint64_t i = 0; i < NELEM; i += STEP) {
B = A;
hpx::nth_element(B.begin(), B.begin() + i, B.end(), compare_t());
}
});


hpx::util::perftests_report("hpx::nth_element, size: " +
std::to_string(NELEM) + ", step: " + std::to_string(STEP),
"seq", 100, [&] {
for (uint64_t i = 0; i < NELEM; i += STEP)
{
B = A;
hpx::nth_element(
B.begin(), B.begin() + i, B.end(), compare_t());
}
});

hpx::util::perftests_print_times();

return hpx::local::finalize();
Expand All @@ -79,7 +87,7 @@ int main(int argc, char* argv[])
"Usage: " HPX_APPLICATION_STRING " [options]");

hpx::util::perftests_cfg(desc_commandline);

std::vector<std::string> cfg;
cfg.push_back("hpx.os_threads=all");
hpx::local::init_params init_args;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,16 @@ int hpx_main(hpx::program_options::variables_map& vm)
A.emplace_back(i);
std::shuffle(A.begin(), A.end(), my_rand);

hpx::util::perftests_report("hpx::nth_element, size: " + std::to_string(NELEM) + ", step: " + std::to_string(1), "par", 100, [&] {
for (uint64_t i = 0; i < NELEM; ++i)
{
B = A;
hpx::nth_element(::hpx::execution::par, B.begin(), B.begin() + i,
B.end(), compare_t());
}
});
hpx::util::perftests_report("hpx::nth_element, size: " +
std::to_string(NELEM) + ", step: " + std::to_string(1),
"par", 100, [&] {
for (uint64_t i = 0; i < NELEM; ++i)
{
B = A;
hpx::nth_element(::hpx::execution::par, B.begin(),
B.begin() + i, B.end(), compare_t());
}
});

NELEM = 100000;

Expand All @@ -64,16 +66,18 @@ int hpx_main(hpx::program_options::variables_map& vm)

const uint32_t STEP = NELEM / 20;

hpx::util::perftests_report("hpx::nth_element, size: " + std::to_string(NELEM) + ", step: " + std::to_string(STEP), "par", 100, [&] {
for (uint64_t i = 0; i < NELEM; i += STEP)
{
B = A;
hpx::nth_element(::hpx::execution::par, B.begin(), B.begin() + i,
B.end(), compare_t());
}
});
hpx::util::perftests_report("hpx::nth_element, size: " +
std::to_string(NELEM) + ", step: " + std::to_string(STEP),
"par", 100, [&] {
for (uint64_t i = 0; i < NELEM; i += STEP)
{
B = A;
hpx::nth_element(::hpx::execution::par, B.begin(),
B.begin() + i, B.end(), compare_t());
}
});

hpx::util::perftests_print_times();
hpx::util::perftests_print_times();

return hpx::local::finalize();
}
Expand All @@ -85,7 +89,7 @@ int main(int argc, char* argv[])
"Usage: " HPX_APPLICATION_STRING " [options]");

hpx::util::perftests_cfg(desc_commandline);

std::vector<std::string> cfg;
cfg.push_back("hpx.os_threads=all");
hpx::local::init_params init_args;
Expand Down
28 changes: 16 additions & 12 deletions libs/core/algorithms/tests/performance/benchmark_partial_sort.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,17 @@ int hpx_main(hpx::program_options::variables_map& vm)
A.emplace_back(i);
}
std::shuffle(A.begin(), A.end(), gen);

hpx::util::perftests_report("hpx::partial_sort, size: " + std::to_string(NELEM) + ", step: " + std::to_string(1) , "seq", 100, [&] {
for (uint32_t i = 0; i < NELEM; i++)
{
B = A;
hpx::partial_sort(B.begin(), B.begin() + i, B.end(), compare_t());
}
});

hpx::util::perftests_report("hpx::partial_sort, size: " +
std::to_string(NELEM) + ", step: " + std::to_string(1),
"seq", 100, [&] {
for (uint32_t i = 0; i < NELEM; i++)
{
B = A;
hpx::partial_sort(
B.begin(), B.begin() + i, B.end(), compare_t());
}
});

NELEM = 100000;

Expand All @@ -166,10 +169,11 @@ int hpx_main(hpx::program_options::variables_map& vm)
}
std::shuffle(A.begin(), A.end(), gen);

hpx::util::perftests_report("hpx::partial_sort, size: " + std::to_string(NELEM), "seq", 100, [&] {
B = A;
hpx::partial_sort(B.begin(), B.end(), B.end(), compare_t());
});
hpx::util::perftests_report(
"hpx::partial_sort, size: " + std::to_string(NELEM), "seq", 100, [&] {
B = A;
hpx::partial_sort(B.begin(), B.end(), B.end(), compare_t());
});

hpx::util::perftests_print_times();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,16 @@ int hpx_main(hpx::program_options::variables_map& vm)
}

std::shuffle(A.begin(), A.end(), gen);
hpx::util::perftests_report("hpx::partial_sort, size: " + std::to_string(NELEM) + ", step: " + std::to_string(1), "par", 100, [&]{
for (uint32_t i = 0; i < NELEM; ++i)
{
B = A;
hpx::partial_sort(::hpx::execution::par, B.begin(), B.begin() + i, B.end(), compare_t());
}
});
hpx::util::perftests_report("hpx::partial_sort, size: " +
std::to_string(NELEM) + ", step: " + std::to_string(1),
"par", 100, [&] {
for (uint32_t i = 0; i < NELEM; ++i)
{
B = A;
hpx::partial_sort(::hpx::execution::par, B.begin(),
B.begin() + i, B.end(), compare_t());
}
});

// Test 2
NELEM = 100000;
Expand All @@ -66,21 +69,26 @@ int hpx_main(hpx::program_options::variables_map& vm)
}

std::shuffle(A.begin(), A.end(), gen);
hpx::util::perftests_report("hpx::partial_sort, size: " + std::to_string(NELEM), "par", 100, [&]{
B = A;
hpx::partial_sort(::hpx::execution::par, B.begin(), B.end(), B.end(), compare_t());
});
hpx::util::perftests_report(
"hpx::partial_sort, size: " + std::to_string(NELEM), "par", 100, [&] {
B = A;
hpx::partial_sort(::hpx::execution::par, B.begin(), B.end(),
B.end(), compare_t());
});

// Test 3
std::shuffle(A.begin(), A.end(), gen);
uint32_t STEP = NELEM / 100;
hpx::util::perftests_report("hpx::partial_sort, size: " + std::to_string(NELEM) + ", step: " + std::to_string(STEP), "par", 100, [&]{
for (uint32_t i = 0; i < NELEM; i += STEP)
{
B = A;
hpx::partial_sort(::hpx::execution::par, B.begin(), B.begin() + i, B.end(), compare_t());
}
});
hpx::util::perftests_report("hpx::partial_sort, size: " +
std::to_string(NELEM) + ", step: " + std::to_string(STEP),
"par", 100, [&] {
for (uint32_t i = 0; i < NELEM; i += STEP)
{
B = A;
hpx::partial_sort(::hpx::execution::par, B.begin(),
B.begin() + i, B.end(), compare_t());
}
});

hpx::util::perftests_print_times();

Expand Down
16 changes: 4 additions & 12 deletions tests/performance/local/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -134,21 +134,13 @@ set(partitioned_vector_foreach_FLAGS DEPENDENCIES iostreams_component
set(future_overhead_PARAMETERS THREADS_PER_LOCALITY 4)
set(future_overhead_report_PARAMETERS THREADS_PER_LOCALITY 4)
set(future_overhead_report_perftest_PARAMETERS
THREADS_PER_LOCALITY
4
--hpx:ini=hpx.thread_queue.init_threads_count=100
--test-all
--repetitions=40
--futures=207270
THREADS_PER_LOCALITY 4 --hpx:ini=hpx.thread_queue.init_threads_count=100
--test-all --repetitions=40 --futures=207270
)

set(stream_report_perftest_PARAMETERS
THREADS_PER_LOCALITY
4
--hpx:ini=hpx.thread_queue.init_threads_count=100
--vector_size=518176
--iterations=200
--warmup_iterations=20
THREADS_PER_LOCALITY 4 --hpx:ini=hpx.thread_queue.init_threads_count=100
--vector_size=518176 --iterations=200 --warmup_iterations=20
)

# These tests do not run on hpx threads, so we don't want to pass hpx params
Expand Down
Loading

0 comments on commit f6e9b0b

Please sign in to comment.