diff --git a/.jenkins/cscs/Jenkinsfile b/.jenkins/cscs/Jenkinsfile index 32c63feb7a8c..3952d18f286c 100644 --- a/.jenkins/cscs/Jenkinsfile +++ b/.jenkins/cscs/Jenkinsfile @@ -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' diff --git a/.jenkins/cscs/env-clang-apex.sh b/.jenkins/cscs/env-clang-apex.sh deleted file mode 100644 index 207d401622c2..000000000000 --- a/.jenkins/cscs/env-clang-apex.sh +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright (c) 2020 ETH Zurich -# -# 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) - -export CRAYPE_LINK_TYPE=dynamic -export APPS_ROOT="/apps/daint/SSL/HPX/packages" -export CLANG_VER="10.0.1" -export CXX_STD="17" -export BOOST_VER="1.74.0" -export HWLOC_VER="2.2.0" -export CLANG_ROOT="${APPS_ROOT}/llvm-${CLANG_VER}" -export BOOST_ROOT="${APPS_ROOT}/boost-${BOOST_VER}-clang-${CLANG_VER}-c++${CXX_STD}-debug" -export HWLOC_ROOT="${APPS_ROOT}/hwloc-${HWLOC_VER}-gcc-10.2.0" -export OTF2_ROOT="${APPS_ROOT}/otf2-2.2-clang-10.0.1" -export PAPI_ROOT="/opt/cray/pe/papi/6.0.0.2" -export CXXFLAGS="-Wno-unused-command-line-argument -stdlib=libc++ -nostdinc++ -I${CLANG_ROOT}/include/c++/v1 -L${CLANG_ROOT}/lib -Wl,-rpath,${CLANG_ROOT}/lib,-lsupc++" -export LDCXXFLAGS="-stdlib=libc++ -L${CLANG_ROOT}/lib -Wl,-rpath,${CLANG_ROOT}/lib,-lsupc++" -export CXX="${CLANG_ROOT}/bin/clang++" -export CC="${CLANG_ROOT}/bin/clang" -export CPP="${CLANG_ROOT}/bin/clang -E" - -module load daint-mc -spack load cmake@3.18.6 -spack load ninja@1.10.0 - -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_LIBCDS=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" -configure_extra_options+=" -DPAPI_ROOT=${PAPI_ROOT}" -configure_extra_options+=" -DOTF2_ROOT=${OTF2_ROOT}" diff --git a/.jenkins/lsu/Jenkinsfile b/.jenkins/lsu/Jenkinsfile index 5fed445647ff..b638b11e8393 100644 --- a/.jenkins/lsu/Jenkinsfile +++ b/.jenkins/lsu/Jenkinsfile @@ -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' diff --git a/.jenkins/lsu/env-clang-12-apex.sh b/.jenkins/lsu/env-clang-12-apex.sh new file mode 100644 index 000000000000..0ade7b3262cf --- /dev/null +++ b/.jenkins/lsu/env-clang-12-apex.sh @@ -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" diff --git a/.jenkins/cscs/slurm-constraint-clang-apex.sh b/.jenkins/lsu/slurm-configuration-clang-12-apex.sh similarity index 65% rename from .jenkins/cscs/slurm-constraint-clang-apex.sh rename to .jenkins/lsu/slurm-configuration-clang-12-apex.sh index 1f9f300cc8fd..b646318b22ad 100644 --- a/.jenkins/cscs/slurm-constraint-clang-apex.sh +++ b/.jenkins/lsu/slurm-configuration-clang-12-apex.sh @@ -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" diff --git a/components/performance_counters/papi/tests/regressions/papi_counters_active_interface.cpp b/components/performance_counters/papi/tests/regressions/papi_counters_active_interface.cpp index a2aa092ffa8e..63539d25e614 100644 --- a/components/performance_counters/papi/tests/regressions/papi_counters_active_interface.cpp +++ b/components/performance_counters/papi/tests/regressions/papi_counters_active_interface.cpp @@ -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 -#include #include +#include #include +#include #include #include @@ -17,13 +17,13 @@ #include /////////////////////////////////////////////////////////////////////////////// -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; } /////////////////////////////////////////////////////////////////////////////// @@ -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(); @@ -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); @@ -91,13 +95,15 @@ int check_(int fd) { cnt.push_back(hpx::util::from_string(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)) @@ -105,15 +111,14 @@ int check_(int fd) // 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; } /////////////////////////////////////////////////////////////////////////////// @@ -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]); diff --git a/libs/core/affinity/src/affinity_data.cpp b/libs/core/affinity/src/affinity_data.cpp index 2c41ccc0c85c..883cf881686b 100644 --- a/libs/core/affinity/src/affinity_data.cpp +++ b/libs/core/affinity/src/affinity_data.cpp @@ -24,7 +24,7 @@ namespace hpx::threads::policies::detail { std::vector 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; @@ -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; } diff --git a/libs/core/compute_local/include/hpx/compute_local/host/numa_allocator.hpp b/libs/core/compute_local/include/hpx/compute_local/host/numa_allocator.hpp index e88030e7370f..982bb8fe7eea 100644 --- a/libs/core/compute_local/include/hpx/compute_local/host/numa_allocator.hpp +++ b/libs/core/compute_local/include/hpx/compute_local/host/numa_allocator.hpp @@ -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); diff --git a/libs/core/resource_partitioner/src/detail_partitioner.cpp b/libs/core/resource_partitioner/src/detail_partitioner.cpp index dc6c87007b64..6beba34b07e0 100644 --- a/libs/core/resource_partitioner/src/detail_partitioner.cpp +++ b/libs/core/resource_partitioner/src/detail_partitioner.cpp @@ -172,7 +172,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'; } diff --git a/libs/core/runtime_local/src/runtime_local.cpp b/libs/core/runtime_local/src/runtime_local.cpp index 691a3d406221..526d9dd2cac8 100644 --- a/libs/core/runtime_local/src/runtime_local.cpp +++ b/libs/core/runtime_local/src/runtime_local.cpp @@ -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)) { @@ -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 diff --git a/libs/core/thread_pools/include/hpx/thread_pools/scheduled_thread_pool_impl.hpp b/libs/core/thread_pools/include/hpx/thread_pools/scheduled_thread_pool_impl.hpp index 314862ee9b8e..3a76d0c28611 100644 --- a/libs/core/thread_pools/include/hpx/thread_pools/scheduled_thread_pool_impl.hpp +++ b/libs/core/thread_pools/include/hpx/thread_pools/scheduled_thread_pool_impl.hpp @@ -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 @@ -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))