Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move APEX CI to rostam #6456

Merged
merged 2 commits into from
May 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .jenkins/cscs/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pipeline {
// number of node-hours consumed
axis {
name 'configuration_name'
values 'gcc-11', 'clang-10', 'clang-13', 'clang-apex'
values 'gcc-11', 'clang-10', 'clang-13'
}
axis {
name 'build_type'
Expand Down
42 changes: 0 additions & 42 deletions .jenkins/cscs/env-clang-apex.sh

This file was deleted.

2 changes: 1 addition & 1 deletion .jenkins/lsu/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pipeline {
axes {
axis {
name 'configuration_name'
values 'gcc-10', 'gcc-11', 'gcc-12', 'gcc-13', 'clang-12', 'clang-13', 'clang-14', 'clang-15', 'clang-16', 'clang-17','gcc-12-cuda-12', 'gcc-13-cuda-12-dgx', 'hipcc'
values 'gcc-10', 'gcc-11', 'gcc-12', 'gcc-13', 'clang-12-apex', 'clang-12', 'clang-13', 'clang-14', 'clang-15', 'clang-16', 'clang-17','gcc-12-cuda-12', 'gcc-13-cuda-12-dgx', 'hipcc'
}
axis {
name 'build_type'
Expand Down
33 changes: 33 additions & 0 deletions .jenkins/lsu/env-clang-12-apex.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright (c) 2020 ETH Zurich
# Copyright (c) 2023 STE||AR-GROUP
#
# SPDX-License-Identifier: BSL-1.0
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

module purge
module load cmake
module load llvm/12
module load boost/1.75.0-${build_type,,}
module load hwloc
module load openmpi
module load pwrapi/1.1.1
module load papi/7.0.1
module load otf2/3.0.3

export HPXRUN_RUNWRAPPER=srun
export CXX_STD="20"
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH

configure_extra_options+=" -DHPX_WITH_MAX_CPU_COUNT=128"
configure_extra_options+=" -DHPX_WITH_MALLOC=system"
configure_extra_options+=" -DHPX_WITH_FETCH_ASIO=ON"
configure_extra_options+=" -DHPX_WITH_CXX_STANDARD=${CXX_STD}"
configure_extra_options+=" -DHPX_WITH_COMPILER_WARNINGS=ON"
configure_extra_options+=" -DHPX_WITH_COMPILER_WARNINGS_AS_ERRORS=ON"
configure_extra_options+=" -DHPX_WITH_SPINLOCK_DEADLOCK_DETECTION=ON"
configure_extra_options+=" -DHPX_WITH_APEX=ON"
configure_extra_options+=" -DHPX_WITH_FETCH_APEX=ON"
configure_extra_options+=" -DHPX_WITH_PAPI=ON"
configure_extra_options+=" -DAPEX_WITH_PAPI=ON"
configure_extra_options+=" -DAPEX_WITH_OTF2=ON"
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Copyright (c) 2020 ETH Zurich
# Copyright (c) 2023 STE||AR-GROUP
#
# SPDX-License-Identifier: BSL-1.0
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

configuration_slurm_constraint="mc"
configuration_slurm_partition="jenkins-compute"
configuration_slurm_num_nodes="1"
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

#include <stdio.h>
#include <unistd.h>
#include <iostream>
#include <stdio.h>
#include <string>
#include <unistd.h>
#include <vector>

#include <hpx/hpx.hpp>
Expand All @@ -17,13 +17,13 @@
#include <hpx/util/from_string.hpp>

///////////////////////////////////////////////////////////////////////////////
const char *counter_name = "/papi{locality#0/worker-thread#0}/PAPI_SR_INS";
const char* counter_name = "/papi{locality#0/worker-thread#0}/PAPI_SR_INS";
const size_t nstores = 1000000;

///////////////////////////////////////////////////////////////////////////////
inline bool close_enough(double m, double ex, double perc)
{
return 100.0*fabs(m-ex)/ex <= perc;
return 100.0 * fabs(m - ex) / ex <= perc;
}

///////////////////////////////////////////////////////////////////////////////
Expand All @@ -33,25 +33,29 @@ int hpx_main(hpx::program_options::variables_map&)

// perform n stores, active counter
volatile size_t i;
for (i = 0; i < nstores; i++) ;
for (i = 0; i < nstores; i = i + 1)
;

hpx::evaluate_active_counters();
// stop the counter w/o resetting
hpx::stop_active_counters();

// perform n stores (should be uncounted)
for (i = 0; i < nstores; i++) ;
for (i = 0; i < nstores; i = i + 1)
;
// get value and reset, and start again
hpx::evaluate_active_counters(true);
hpx::start_active_counters();

// perform 2*n stores, counted from 0 (or close to it)
for (i = 0; i < 2*nstores; i++) ;
for (i = 0; i < 2 * nstores; i = i + 1)
;
hpx::evaluate_active_counters();

// perform another n stores, counted from 0 (or close to it)
hpx::reset_active_counters();
for (i = 0; i < nstores; i++) ;
for (i = 0; i < nstores; i = i + 1)
;
hpx::evaluate_active_counters();

return hpx::finalize();
Expand All @@ -75,14 +79,14 @@ int check_(int fd)

pos = out.find(counter_name);
if (pos != out.npos)
{ // counter name found
{ // counter name found
out.erase(0, pos);
pos = out.find('\n');
if (pos != out.npos)
{ // this is complete line; extract counter value
{ // this is complete line; extract counter value
size_t cpos = out.rfind(',', pos);
std::cerr << out.substr(0, pos+1);
std::string value = out.substr(cpos+1, pos-cpos-1);
std::cerr << out.substr(0, pos + 1);
std::string value = out.substr(cpos + 1, pos - cpos - 1);
if (value == "invalid")
{
cnt.push_back(-1.0);
Expand All @@ -91,29 +95,30 @@ int check_(int fd)
{
cnt.push_back(hpx::util::from_string<double>(value));
}
if (cnt.size() == 5) break;
out.erase(0, pos+1);
if (cnt.size() == 5)
break;
out.erase(0, pos + 1);
}
}
}
else
throw std::runtime_error("truncated input; didn't get all counter values");
throw std::runtime_error(
"truncated input; didn't get all counter values");
}
// bail out if perf counter isn't available ...
if (close_enough(cnt[0], -1.0, 5.0))
return 0;

// since printing affects the counts, the relative error bounds need to be
// increased compared to the "basic_functions" test
bool pass = close_enough(cnt[0], nstores, 5.0) &&
(cnt[1] >= cnt[0]) && close_enough(cnt[0], cnt[1], 5.0) &&
close_enough(cnt[2], 2.0*cnt[0], 5.0) &&
bool pass = close_enough(cnt[0], nstores, 5.0) && (cnt[1] >= cnt[0]) &&
close_enough(cnt[0], cnt[1], 5.0) &&
close_enough(cnt[2], 2.0 * cnt[0], 5.0) &&
close_enough(cnt[3], cnt[0], 5.0);

std::cerr << (pass ? "PASSED" : "FAILED") << ".\n";

std::cerr << (pass? "PASSED": "FAILED") << ".\n";

return pass? 0: 1;
return pass ? 0 : 1;
}

///////////////////////////////////////////////////////////////////////////////
Expand All @@ -125,15 +130,16 @@ int main(int argc, char* argv[])
throw std::runtime_error("could not create pipe to stdout");

// Add the required counter command line option.
char **opt = new char *[argc+2];
for (int i = 0; i < argc; i++) opt[i] = argv[i];
char** opt = new char*[argc + 2];
for (int i = 0; i < argc; i++)
opt[i] = argv[i];
char copt[256];
snprintf(copt, 256, "--hpx:print-counter=%s", counter_name);
opt[argc] = copt;
opt[argc+1] = nullptr;
opt[argc + 1] = nullptr;

// Run test in HPX domain.
hpx::start(argc+1, opt);
hpx::start(argc + 1, opt);

// Collect and process the output.
int rc = check_(pipefd[0]);
Expand Down
5 changes: 2 additions & 3 deletions libs/core/affinity/src/affinity_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace hpx::threads::policies::detail {
std::vector<mask_type> const& masks) noexcept
{
std::size_t count = 0;
for (mask_cref_type const m : masks)
for (mask_cref_type m : masks)
{
if (threads::any(m))
++count;
Expand Down Expand Up @@ -268,8 +268,7 @@ namespace hpx::threads::policies::detail {
for (std::size_t num_thread = 0; num_thread != num_threads_;
++num_thread)
{
mask_cref_type const affinity_mask =
get_pu_mask(topo, num_thread);
mask_cref_type affinity_mask = get_pu_mask(topo, num_thread);
if (threads::any(pu_mask & affinity_mask))
++count;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ namespace hpx::parallel::util {
topo_.get_thread_affinity_mask_from_lva(&val);

std::size_t thread_num = hpx::get_worker_thread_num();
hpx::threads::mask_cref_type const thread_mask =
hpx::threads::mask_cref_type thread_mask =
hpx::parallel::execution::get_pu_mask(
executors_[i], topo_, thread_num);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ namespace hpx::resource::detail {

os << "\"" << sched << "\" is running on PUs : \n";

for (threads::mask_cref_type const assigned_pu : assigned_pus_)
for (threads::mask_cref_type assigned_pu : assigned_pus_)
{
os << hpx::threads::to_string(assigned_pu) << '\n';
}
Expand Down
4 changes: 2 additions & 2 deletions libs/core/runtime_local/src/runtime_local.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1322,7 +1322,7 @@ namespace hpx {
for (std::size_t i = 0; i != num_threads; ++i)
{
// print the mask for the current PU
threads::mask_cref_type const pu_mask = rp.get_pu_mask(i);
threads::mask_cref_type pu_mask = rp.get_pu_mask(i);

if (!threads::any(pu_mask))
{
Expand Down Expand Up @@ -1945,7 +1945,7 @@ namespace hpx {
// FIXME: We don't set the affinity of the service threads on BG/Q,
// as this is causing a hang (needs to be investigated)
#if !defined(__bgq__)
threads::mask_cref_type const used_processing_units =
threads::mask_cref_type used_processing_units =
thread_manager_->get_used_processing_units();

// --hpx:bind=none should disable all affinity definitions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ namespace hpx::threads::detail {
{
std::size_t global_thread_num =
this->thread_offset_ + thread_num;
threads::mask_cref_type const mask =
threads::mask_cref_type mask =
affinity_data_.get_pu_mask(topo, global_thread_num);

// thread_num ordering: 1. threads of default pool
Expand Down Expand Up @@ -436,7 +436,7 @@ namespace hpx::threads::detail {
topology const& topo = create_topology();

// Set the affinity for the current thread.
threads::mask_cref_type const mask =
threads::mask_cref_type mask =
affinity_data_.get_pu_mask(topo, global_thread_num);

if (LHPX_ENABLED(debug))
Expand Down