From 70bd070a4dea52fd9236d101d85be65a5dbb12f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cezary=20Skrzy=C5=84ski?= Date: Thu, 9 May 2024 22:01:44 +0200 Subject: [PATCH 01/21] #2264: cmake: enable more warnings Enable more warnings and sort the flags alphabetically. --- cmake/turn_on_warnings.cmake | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cmake/turn_on_warnings.cmake b/cmake/turn_on_warnings.cmake index c562b5f72b..61072dd1b7 100644 --- a/cmake/turn_on_warnings.cmake +++ b/cmake/turn_on_warnings.cmake @@ -16,10 +16,13 @@ endmacro() if(NOT DEFINED VT_WARNING_FLAGS) add_cxx_compiler_flag_if_supported("-Wall") - add_cxx_compiler_flag_if_supported("-pedantic") - add_cxx_compiler_flag_if_supported("-Wshadow") + # add_cxx_compiler_flag_if_supported("-Wextra") add_cxx_compiler_flag_if_supported("-Wno-unknown-pragmas") + add_cxx_compiler_flag_if_supported("-Wnon-virtual-dtor") + add_cxx_compiler_flag_if_supported("-Wshadow") add_cxx_compiler_flag_if_supported("-Wsign-compare") + add_cxx_compiler_flag_if_supported("-Wsuggest-override") + add_cxx_compiler_flag_if_supported("-pedantic") # Not really a warning, is still diagnostic related.. if (NOT CMAKE_CXX_COMPILER_ID STREQUAL Intel OR CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 2021) From 2e47128f172d455a9f498fe0a6b5709d04c33dde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cezary=20Skrzy=C5=84ski?= Date: Thu, 9 May 2024 22:43:28 +0200 Subject: [PATCH 02/21] #2264: fix non-virtual-dtor and suggest-override warnings --- src/vt/group/base/group_info_base.h | 2 ++ src/vt/group/collective/group_info_collective.h | 2 ++ src/vt/group/rooted/group_info_rooted.h | 1 + src/vt/messaging/message/smart_ptr.h | 2 +- src/vt/objgroup/holder/holder_base.h | 2 +- src/vt/runtime/component/component_name.h | 1 + src/vt/runtime/component/diagnostic.h | 2 ++ src/vt/runtime/component/progressable.h | 2 ++ src/vt/termination/term_action.h | 1 + src/vt/termination/term_terminated.h | 2 ++ src/vt/vrt/collection/holders/base_holder.h | 1 + src/vt/vrt/collection/types/has_migrate.h | 3 +++ tests/unit/active/test_active_bcast_put.cc | 4 ++-- tests/unit/active/test_active_broadcast.cc | 4 ++-- tests/unit/active/test_active_send.cc | 2 +- tests/unit/active/test_active_send_put.cc | 2 +- tests/unit/collection/test_lb_data_retention.cc | 3 +-- tests/unit/index/test_index.nompi.cc | 4 ++-- tests/unit/memory/test_memory_lifetime.cc | 2 +- tests/unit/pool/test_pool.cc | 2 +- tests/unit/pool/test_pool_message_sizes.cc | 2 +- tests/unit/test_parallel_harness.h | 4 ++-- 22 files changed, 33 insertions(+), 17 deletions(-) diff --git a/src/vt/group/base/group_info_base.h b/src/vt/group/base/group_info_base.h index 05f1cc39c6..50115e5a22 100644 --- a/src/vt/group/base/group_info_base.h +++ b/src/vt/group/base/group_info_base.h @@ -59,6 +59,8 @@ struct InfoBase { using TreeType = collective::tree::Tree; using TreePtrType = std::unique_ptr; + virtual ~InfoBase() = default; + protected: virtual GroupType getGroupID() const = 0; virtual ActionType getAction() const = 0; diff --git a/src/vt/group/collective/group_info_collective.h b/src/vt/group/collective/group_info_collective.h index df251f40a1..327ac77b4c 100644 --- a/src/vt/group/collective/group_info_collective.h +++ b/src/vt/group/collective/group_info_collective.h @@ -75,6 +75,8 @@ struct InfoColl : virtual InfoBase { { } + virtual ~InfoColl() = default; + private: /* * Inner struct used as functor reduce target after the collective group is diff --git a/src/vt/group/rooted/group_info_rooted.h b/src/vt/group/rooted/group_info_rooted.h index f091f392a3..9e4821f646 100644 --- a/src/vt/group/rooted/group_info_rooted.h +++ b/src/vt/group/rooted/group_info_rooted.h @@ -68,6 +68,7 @@ struct InfoRooted : virtual InfoBase { bool const& in_is_remote, RegionPtrType in_region, RegionType::SizeType const& in_total_size ); + virtual ~InfoRooted() = default; protected: void setupRooted(); diff --git a/src/vt/messaging/message/smart_ptr.h b/src/vt/messaging/message/smart_ptr.h index 4cd31ab46d..efcc215c56 100644 --- a/src/vt/messaging/message/smart_ptr.h +++ b/src/vt/messaging/message/smart_ptr.h @@ -88,7 +88,7 @@ struct MsgPtrImplBase { template struct MsgPtrImplTyped : MsgPtrImplBase { - virtual void messageDeref(std::byte* msg_ptr) { + virtual void messageDeref(std::byte* msg_ptr) override { // N.B. messageDeref invokes delete-expr T. vt::messageDeref(reinterpret_cast(msg_ptr)); } diff --git a/src/vt/objgroup/holder/holder_base.h b/src/vt/objgroup/holder/holder_base.h index 0cd9f6439b..9ff67bcfec 100644 --- a/src/vt/objgroup/holder/holder_base.h +++ b/src/vt/objgroup/holder/holder_base.h @@ -78,7 +78,7 @@ template struct HolderObjBase : HolderBase { virtual ~HolderObjBase() = default; virtual ObjT* get() = 0; - virtual std::byte* getPtr() = 0; + virtual std::byte* getPtr() override = 0; }; }}} /* end namespace vt::objgroup::holder */ diff --git a/src/vt/runtime/component/component_name.h b/src/vt/runtime/component/component_name.h index 0a2af860e8..fd16f3ebb1 100644 --- a/src/vt/runtime/component/component_name.h +++ b/src/vt/runtime/component/component_name.h @@ -55,6 +55,7 @@ namespace vt { namespace runtime { namespace component { * unique name for the given component. */ struct ComponentName { + virtual ~ComponentName() = default; /** * \internal \brief Get the name of the component */ diff --git a/src/vt/runtime/component/diagnostic.h b/src/vt/runtime/component/diagnostic.h index 0513f4d1d5..6febcd0e23 100644 --- a/src/vt/runtime/component/diagnostic.h +++ b/src/vt/runtime/component/diagnostic.h @@ -69,6 +69,8 @@ struct Diagnostic : ComponentName, ComponentReducer { using UpdateType = DiagnosticUpdate; using UnitType = DiagnosticUnit; + virtual ~Diagnostic() = default; + virtual void dumpState() = 0; /** diff --git a/src/vt/runtime/component/progressable.h b/src/vt/runtime/component/progressable.h index 0c345cf2c0..fee3c4091c 100644 --- a/src/vt/runtime/component/progressable.h +++ b/src/vt/runtime/component/progressable.h @@ -54,6 +54,8 @@ namespace vt { namespace runtime { namespace component { */ struct Progressable { + virtual ~Progressable() = default; + /** * \brief Progress function for incremental polling * diff --git a/src/vt/termination/term_action.h b/src/vt/termination/term_action.h index 6836b6137a..555bbc29a9 100644 --- a/src/vt/termination/term_action.h +++ b/src/vt/termination/term_action.h @@ -104,6 +104,7 @@ struct TermAction : TermTerminated { using EpochStateType = std::unordered_map; TermAction() = default; + virtual ~TermAction() = default; public: void addDefaultAction(ActionType action); diff --git a/src/vt/termination/term_terminated.h b/src/vt/termination/term_terminated.h index 5f6f7ba87e..07df5791fb 100644 --- a/src/vt/termination/term_terminated.h +++ b/src/vt/termination/term_terminated.h @@ -59,6 +59,8 @@ enum struct TermStatusEnum : int8_t { }; struct TermTerminated { + virtual ~TermTerminated() = default; + virtual TermStatusEnum testEpochTerminated(EpochType epoch) = 0; }; diff --git a/src/vt/vrt/collection/holders/base_holder.h b/src/vt/vrt/collection/holders/base_holder.h index 1d2edf4ab2..b4c8df5f12 100644 --- a/src/vt/vrt/collection/holders/base_holder.h +++ b/src/vt/vrt/collection/holders/base_holder.h @@ -51,6 +51,7 @@ namespace vt { namespace vrt { namespace collection { struct BaseHolder { BaseHolder() = default; + virtual ~BaseHolder() = default; virtual void destroy() = 0; }; diff --git a/src/vt/vrt/collection/types/has_migrate.h b/src/vt/vrt/collection/types/has_migrate.h index 32e73a7bf6..10ab6bfac2 100644 --- a/src/vt/vrt/collection/types/has_migrate.h +++ b/src/vt/vrt/collection/types/has_migrate.h @@ -41,6 +41,7 @@ //@HEADER */ +#include "vt/vrt/context/context_vrtmanager.impl.h" #if !defined INCLUDED_VT_VRT_COLLECTION_TYPES_HAS_MIGRATE_H #define INCLUDED_VT_VRT_COLLECTION_TYPES_HAS_MIGRATE_H @@ -49,6 +50,8 @@ namespace vt { namespace vrt { namespace collection { struct HasMigrate { + virtual ~HasMigrate() = default; + virtual void migrate(NodeType const& to_node) = 0; }; diff --git a/tests/unit/active/test_active_bcast_put.cc b/tests/unit/active/test_active_bcast_put.cc index c14a2661e0..da47608775 100644 --- a/tests/unit/active/test_active_bcast_put.cc +++ b/tests/unit/active/test_active_bcast_put.cc @@ -64,7 +64,7 @@ struct TestActiveBroadcastPut : TestParameterHarnessNode { static int num_msg_sent; static size_t put_size; - virtual void SetUp() { + virtual void SetUp() override { TestParameterHarnessNode::SetUp(); handler_count = 0; num_msg_sent = 1; @@ -72,7 +72,7 @@ struct TestActiveBroadcastPut : TestParameterHarnessNode { SET_MIN_NUM_NODES_CONSTRAINT(2); } - virtual void TearDown() { + virtual void TearDown() override { TestParameterHarnessNode::TearDown(); } diff --git a/tests/unit/active/test_active_broadcast.cc b/tests/unit/active/test_active_broadcast.cc index 274ba5846a..549d13f56a 100644 --- a/tests/unit/active/test_active_broadcast.cc +++ b/tests/unit/active/test_active_broadcast.cc @@ -59,7 +59,7 @@ struct TestActiveBroadcast : TestParameterHarnessNode { static int handler_count; static int num_msg_sent; - virtual void SetUp() { + virtual void SetUp() override { TestParameterHarnessNode::SetUp(); handler_count = 0; @@ -68,7 +68,7 @@ struct TestActiveBroadcast : TestParameterHarnessNode { SET_MIN_NUM_NODES_CONSTRAINT(2); } - virtual void TearDown() { + virtual void TearDown() override { TestParameterHarnessNode::TearDown(); } diff --git a/tests/unit/active/test_active_send.cc b/tests/unit/active/test_active_send.cc index 7bc04977f4..f42c276f3d 100644 --- a/tests/unit/active/test_active_send.cc +++ b/tests/unit/active/test_active_send.cc @@ -83,7 +83,7 @@ struct TestActiveSend : TestParallelHarness { static int handler_count; static int num_msg_sent; - virtual void SetUp() { + virtual void SetUp() override { TestParallelHarness::SetUp(); handler_count = 0; diff --git a/tests/unit/active/test_active_send_put.cc b/tests/unit/active/test_active_send_put.cc index 1345d69cde..a2c765fed7 100644 --- a/tests/unit/active/test_active_send_put.cc +++ b/tests/unit/active/test_active_send_put.cc @@ -64,7 +64,7 @@ struct TestActiveSendPut : TestParameterHarnessNode { static NodeType from_node; static NodeType to_node; - virtual void SetUp() { + virtual void SetUp() override { TestParameterHarnessNode::SetUp(); from_node = 0; to_node = 1; diff --git a/tests/unit/collection/test_lb_data_retention.cc b/tests/unit/collection/test_lb_data_retention.cc index 432e36fd9f..f25678775f 100644 --- a/tests/unit/collection/test_lb_data_retention.cc +++ b/tests/unit/collection/test_lb_data_retention.cc @@ -107,7 +107,7 @@ struct TestCol : vt::Collection { static constexpr int32_t const num_elms = 16; struct TestLBDataRetention : TestParallelHarness { - virtual void SetUp() { + virtual void SetUp() override { TestParallelHarness::SetUp(); // We must have more or equal number of elements than nodes for this test to @@ -116,7 +116,6 @@ struct TestLBDataRetention : TestParallelHarness { } }; -using vt::vrt::collection::balance::LoadModel; using vt::vrt::collection::balance::PersistenceMedianLastN; TEST_F(TestLBDataRetention, test_lbdata_retention_last1) { diff --git a/tests/unit/index/test_index.nompi.cc b/tests/unit/index/test_index.nompi.cc index 1f5b245199..bd68b5b58f 100644 --- a/tests/unit/index/test_index.nompi.cc +++ b/tests/unit/index/test_index.nompi.cc @@ -51,11 +51,11 @@ namespace vt { namespace tests { namespace unit { class TestIndex : public TestHarness { - virtual void SetUp() { + virtual void SetUp() override { TestHarness::SetUp(); } - virtual void TearDown() { + virtual void TearDown() override { TestHarness::TearDown(); } }; diff --git a/tests/unit/memory/test_memory_lifetime.cc b/tests/unit/memory/test_memory_lifetime.cc index 8ab52b14c4..b883d05fc4 100644 --- a/tests/unit/memory/test_memory_lifetime.cc +++ b/tests/unit/memory/test_memory_lifetime.cc @@ -91,7 +91,7 @@ using NormalTestMsg = TrackMsg; using SerialTestMsg = SerialTrackMsg; struct TestMemoryLifetime : TestParallelHarness { - virtual void SetUp() { + virtual void SetUp() override { TestParallelHarness::SetUp(); SerialTestMsg::alloc_count = 0; local_count = 0; diff --git a/tests/unit/pool/test_pool.cc b/tests/unit/pool/test_pool.cc index 09c379fb38..6d9fd39316 100644 --- a/tests/unit/pool/test_pool.cc +++ b/tests/unit/pool/test_pool.cc @@ -63,7 +63,7 @@ struct TestPool : TestParallelHarness { template static void testPoolFun(TestMsg* prev_msg); - virtual void SetUp() { + virtual void SetUp() override { TestParallelHarness::SetUp(); } }; diff --git a/tests/unit/pool/test_pool_message_sizes.cc b/tests/unit/pool/test_pool_message_sizes.cc index 2af7a6eeb0..9ea981e079 100644 --- a/tests/unit/pool/test_pool_message_sizes.cc +++ b/tests/unit/pool/test_pool_message_sizes.cc @@ -65,7 +65,7 @@ static constexpr NodeType const to_node = 1; struct TestPoolMessageSizes : TestParallelHarness { static int count; - virtual void SetUp() { + virtual void SetUp() override { TestParallelHarness::SetUp(); count = 0; } diff --git a/tests/unit/test_parallel_harness.h b/tests/unit/test_parallel_harness.h index 5e3971bc09..13b3c806aa 100644 --- a/tests/unit/test_parallel_harness.h +++ b/tests/unit/test_parallel_harness.h @@ -60,7 +60,7 @@ extern char** test_argv; template struct TestParallelHarnessAny : TestHarnessAny { - virtual void SetUp() { + virtual void SetUp() override { using namespace vt; TestHarnessAny::SetUp(); @@ -102,7 +102,7 @@ struct TestParallelHarnessAny : TestHarnessAny { #endif } - virtual void TearDown() { + virtual void TearDown() override { using namespace vt; try { From efff6179ee48cd98f27c4a63b7173da99bfab114 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cezary=20Skrzy=C5=84ski?= Date: Thu, 9 May 2024 22:46:48 +0200 Subject: [PATCH 03/21] #2264: cmake: remove flags for unsupported compilers --- cmake/turn_on_warnings.cmake | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/cmake/turn_on_warnings.cmake b/cmake/turn_on_warnings.cmake index 61072dd1b7..e10cb88154 100644 --- a/cmake/turn_on_warnings.cmake +++ b/cmake/turn_on_warnings.cmake @@ -30,17 +30,7 @@ if(NOT DEFINED VT_WARNING_FLAGS) endif() if (vt_werror_enabled) # Treat warning as errors - add_cxx_compiler_flag_if_supported("-Werror") - endif() - - # Silence some spurious warnings on older compilers - if (${CMAKE_CXX_COMPILER_ID} MATCHES "GNU" AND - CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6) - list(APPEND VT_WARNING_FLAGS -Wno-unused-variable) - endif() - if (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang" AND - CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6) - list(APPEND VT_WARNING_FLAGS -Wno-missing-braces) + add_cxx_compiler_flag_if_supported("-Werror") endif() endif() From adfa0a7c4e41ee81b83363734fdfff9a397a552e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cezary=20Skrzy=C5=84ski?= Date: Thu, 9 May 2024 23:26:49 +0200 Subject: [PATCH 04/21] #2264: remove unused variable --- src/vt/runtime/runtime_banner.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/src/vt/runtime/runtime_banner.cc b/src/vt/runtime/runtime_banner.cc index 260417fd86..0573b6c0ca 100644 --- a/src/vt/runtime/runtime_banner.cc +++ b/src/vt/runtime/runtime_banner.cc @@ -960,7 +960,6 @@ void Runtime::printShutdownBanner( auto f2 = fmt::format("{}Total work units processed:{} ", green, reset); auto f3 = fmt::format("{}Total collective epochs processed:{} ", green, reset); auto vt_pre = bd_green + std::string("vt") + reset + ": "; - std::string fin = ""; std::string units = std::to_string(num_units); fmt::print("{}{}{}{}{}\n", vt_pre, f3, magenta, coll_epochs, reset); fmt::print("{}{}{}{}{}\n", vt_pre, f2, magenta, units, reset); From 9f1276fd4dc20a8c4ad146aa25e7e7af44d80832 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cezary=20Skrzy=C5=84ski?= Date: Thu, 9 May 2024 23:29:58 +0200 Subject: [PATCH 05/21] #2264: add FIXME for warning --- src/vt/rdma/channel/rdma_channel.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/vt/rdma/channel/rdma_channel.cc b/src/vt/rdma/channel/rdma_channel.cc index 63b41bfdcc..528e3a3a5b 100644 --- a/src/vt/rdma/channel/rdma_channel.cc +++ b/src/vt/rdma/channel/rdma_channel.cc @@ -188,6 +188,7 @@ Channel::lockChannelForOp() { (not is_target_) ? (op_type_ == RDMA_TypeType::Put ? MPI_LOCK_EXCLUSIVE : MPI_LOCK_SHARED) : (op_type_ == RDMA_TypeType::Put ? MPI_LOCK_SHARED : MPI_LOCK_SHARED); + // FIXME: same expression in both branches of ternary operator vt_debug_print( normal, rdma_channel, From 744975880439eb245fc6f9dce7dc50823aa7d47f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cezary=20Skrzy=C5=84ski?= Date: Thu, 9 May 2024 23:38:25 +0200 Subject: [PATCH 06/21] #2264: remove unused variable --- src/vt/configs/error/stack_out.cc | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/vt/configs/error/stack_out.cc b/src/vt/configs/error/stack_out.cc index 4b046f7383..3dd30029bd 100644 --- a/src/vt/configs/error/stack_out.cc +++ b/src/vt/configs/error/stack_out.cc @@ -122,7 +122,6 @@ DumpStackType dumpStack(int skip) { for (auto i = skip; i < num_frames; i++) { //printf("%s\n", symbols[i]); - std::string str = ""; Dl_info info; if (dladdr(callstack[i], &info) && info.dli_sname) { char *demangled = nullptr; @@ -140,12 +139,6 @@ DumpStackType dumpStack(int skip) { ) ); - auto const& t = stack.back(); - str = fmt::format( - "{:<4} {:<4} {:<15} {} + {}\n", - i, std::get<0>(t), std::get<1>(t), std::get<2>(t), std::get<3>(t) - ); - std::free(demangled); } else { stack.emplace_back( @@ -153,11 +146,6 @@ DumpStackType dumpStack(int skip) { static_cast(2 + sizeof(void*) * 2), reinterpret_cast(callstack[i]), symbols[i], 0 ) ); - - auto const& t = stack.back(); - str = fmt::format( - "{:10} {} {} {}\n", i, std::get<0>(t), std::get<1>(t), std::get<2>(t) - ); } } From da8c0340dd6a6e5360b93feb0c1a6e71dda942ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cezary=20Skrzy=C5=84ski?= Date: Thu, 9 May 2024 23:42:11 +0200 Subject: [PATCH 07/21] #2264: use const reference when possible --- src/vt/collective/basic.cc | 2 +- src/vt/collective/basic.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vt/collective/basic.cc b/src/vt/collective/basic.cc index 5baff8edb5..270157c75f 100644 --- a/src/vt/collective/basic.cc +++ b/src/vt/collective/basic.cc @@ -56,7 +56,7 @@ void abort(std::string const str, int32_t const code) { } void output( - std::string const str, int32_t const code, bool error, bool formatted, + std::string const& str, int32_t const code, bool error, bool formatted, bool decorate, bool abort_out ) { #if !vt_check_enabled(trace_only) diff --git a/src/vt/collective/basic.h b/src/vt/collective/basic.h index 09e653a1a9..c7edab2385 100644 --- a/src/vt/collective/basic.h +++ b/src/vt/collective/basic.h @@ -50,7 +50,7 @@ namespace vt { void abort(std::string const str = "", int32_t const code = 1); void output( - std::string const str, int32_t const code = 1, bool error = false, + std::string const& str, int32_t const code = 1, bool error = false, bool decorate = true, bool formatted = false, bool abort_out = false ); int rerror(char const* str); From 7292fd5487d4438ca6b39aa4175184d1d148a4c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cezary=20Skrzy=C5=84ski?= Date: Thu, 9 May 2024 23:45:26 +0200 Subject: [PATCH 08/21] #2264: scripts: remove unused variables --- ci/ctest_build_all.sh | 7 ------- 1 file changed, 7 deletions(-) diff --git a/ci/ctest_build_all.sh b/ci/ctest_build_all.sh index 59fcc5fffd..82611f26a7 100755 --- a/ci/ctest_build_all.sh +++ b/ci/ctest_build_all.sh @@ -8,13 +8,6 @@ build_dir=${2} # Dependency versions, when fetched via git. checkpoint_rev=develop -if test "${VT_DOXYGEN_ENABLED:-0}" -eq 1 -then - token=${3} -else - target=${3:-install} -fi - export parallel_level=4 if [ -z ${4} ]; then export dashj="" From 3adcbb8e4d7b6955b444f3ad63848ac557666c60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cezary=20Skrzy=C5=84ski?= Date: Thu, 9 May 2024 23:50:13 +0200 Subject: [PATCH 09/21] #2264: use range-based loop --- src/vt/runtime/runtime_banner.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vt/runtime/runtime_banner.cc b/src/vt/runtime/runtime_banner.cc index 0573b6c0ca..c507e286de 100644 --- a/src/vt/runtime/runtime_banner.cc +++ b/src/vt/runtime/runtime_banner.cc @@ -169,13 +169,13 @@ void Runtime::printStartupBanner() { fmt::format("{}Compile-time Features Enabled:{}\n", green, reset) }; - for (auto &&line: info_lines) + for (auto &&line : info_lines) { fmt::print("{}{}{}", vt_pre, line, reset); } - for (size_t i = 0; i < features.size(); i++) { - fmt::print("{}\t{}\n", vt_pre, emph(features.at(i))); + for (const auto& feature : features) { + fmt::print("{}\t{}\n", vt_pre, emph(feature)); } auto warn_cr = [=](std::string opt, std::string compile) -> std::string { From f145881be81a377a7a9caf757dc25039a0f4b05c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cezary=20Skrzy=C5=84ski?= Date: Thu, 9 May 2024 23:51:40 +0200 Subject: [PATCH 10/21] #2264: simplify `if` logic --- src/vt/termination/termination.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vt/termination/termination.cc b/src/vt/termination/termination.cc index 817b0d0153..cd9517510c 100644 --- a/src/vt/termination/termination.cc +++ b/src/vt/termination/termination.cc @@ -281,7 +281,7 @@ std::shared_ptr TerminationDetector::makeGraph( for (auto const& elm : epoch_state_) { auto const ep = elm.first; bool const rooted = epoch::EpochManip::isRooted(ep); - if (not rooted or (rooted and epoch::EpochManip::node(ep) == this_node_)) { + if (not rooted or (epoch::EpochManip::node(ep) == this_node_)) { if (not isEpochTerminated(elm.first)) { auto label = elm.second.getLabel(); live_epochs[ep] = std::make_shared(ep, label); From de030b98ac5cf57a86749617817b78364a181a22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cezary=20Skrzy=C5=84ski?= Date: Fri, 10 May 2024 18:16:48 +0200 Subject: [PATCH 11/21] #2264: cmake: enable -Wextra --- cmake/turn_on_warnings.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/turn_on_warnings.cmake b/cmake/turn_on_warnings.cmake index e10cb88154..3aadbdd5fa 100644 --- a/cmake/turn_on_warnings.cmake +++ b/cmake/turn_on_warnings.cmake @@ -16,7 +16,7 @@ endmacro() if(NOT DEFINED VT_WARNING_FLAGS) add_cxx_compiler_flag_if_supported("-Wall") - # add_cxx_compiler_flag_if_supported("-Wextra") + add_cxx_compiler_flag_if_supported("-Wextra") add_cxx_compiler_flag_if_supported("-Wno-unknown-pragmas") add_cxx_compiler_flag_if_supported("-Wnon-virtual-dtor") add_cxx_compiler_flag_if_supported("-Wshadow") From 39c0e478e52adfa93d2b7df4f5c0c5ff4e4cdec8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cezary=20Skrzy=C5=84ski?= Date: Tue, 14 May 2024 16:13:22 +0200 Subject: [PATCH 12/21] #2264: fix unused variable warnings --- examples/callback/callback.cc | 2 +- examples/collection/jacobi1d_vt.cc | 2 +- examples/collection/jacobi2d_vt.cc | 2 +- examples/collection/lb_iter.cc | 4 ++- examples/collection/transpose.cc | 6 ++-- examples/group/group_collective.cc | 2 +- examples/hello_world/hello_world_functor.cc | 2 +- examples/rdma/rdma_simple_get.cc | 2 +- src/vt/collective/barrier/barrier.cc | 4 ++- .../collective/reduce/operators/callback_op.h | 2 +- .../reduce/operators/functors/none_op.h | 2 +- .../operators/functors/tuple_op_helper.h | 4 ++- src/vt/configs/arguments/args.cc | 9 ++++-- src/vt/configs/error/assert_out.impl.h | 2 +- src/vt/configs/error/assert_out_info.impl.h | 3 +- src/vt/configs/error/error.impl.h | 6 ++-- src/vt/configs/error/soft_error.h | 2 +- src/vt/context/context.cc | 2 +- src/vt/event/event.cc | 2 +- .../group/collective/group_info_collective.cc | 4 +-- src/vt/group/group_manager.cc | 11 ++++--- src/vt/messaging/active.cc | 6 ++-- src/vt/messaging/active.impl.h | 4 +-- .../messaging/message/message_priority.impl.h | 31 ++++++++++++++----- src/vt/messaging/param_msg.h | 6 ++-- src/vt/objgroup/holder/holder_basic.h | 2 +- src/vt/objgroup/proxy/proxy_objgroup.impl.h | 4 ++- .../pipe/callback/anon/callback_anon.impl.h | 6 ++-- .../anon/callback_anon_listener.impl.h | 4 ++- src/vt/pipe/callback/anon/callback_anon_tl.h | 2 +- .../callback/anon/callback_anon_tl.impl.h | 2 +- src/vt/pipe/callback/callback_base.h | 4 ++- src/vt/pipe/callback/callback_base_tl.h | 2 +- .../handler_bcast/callback_bcast.impl.h | 10 ++++-- .../handler_send/callback_send.impl.h | 10 ++++-- .../objgroup_bcast/callback_objgroup_bcast.h | 2 +- .../callback_objgroup_bcast.impl.h | 4 ++- .../objgroup_send/callback_objgroup_send.h | 2 +- .../callback_objgroup_send.impl.h | 4 ++- .../proxy_bcast/callback_proxy_bcast_tl.h | 8 +++-- .../callback_proxy_bcast_tl.impl.h | 2 +- .../proxy_send/callback_proxy_send_tl.h | 8 +++-- .../proxy_send/callback_proxy_send_tl.impl.h | 2 +- src/vt/pipe/pipe_manager.impl.h | 4 ++- src/vt/pipe/pipe_manager_construct.h | 2 +- src/vt/rdma/rdma.cc | 17 ++++++---- src/vt/rdma/rdma.h | 12 ++++--- src/vt/rdma/state/rdma_state.cc | 4 +-- src/vt/rdmahandle/handle.index.impl.h | 4 +-- src/vt/rdmahandle/handle.node.impl.h | 2 +- src/vt/rdmahandle/holder.impl.h | 4 +-- src/vt/rdmahandle/manager.impl.h | 2 +- src/vt/runnable/runnable.cc | 4 +-- src/vt/runnable/runnable.h | 6 ++-- src/vt/runtime/component/base.h | 2 +- src/vt/runtime/component/component.h | 6 ++-- src/vt/runtime/component/component_dep.h | 3 +- .../runtime/component/component_pack.impl.h | 4 ++- src/vt/runtime/runtime.cc | 8 ++--- src/vt/runtime/runtime_diagnostics.cc | 3 +- src/vt/scheduler/scheduler.impl.h | 2 +- src/vt/scheduler/suspended_units.cc | 6 ++-- .../messaging/serialized_messenger.impl.h | 4 ++- src/vt/termination/dijkstra-scholten/ds.cc | 3 +- src/vt/termination/termination.cc | 4 ++- src/vt/topos/location/location.impl.h | 4 +-- src/vt/topos/mapping/dense/dense.impl.h | 4 ++- src/vt/trace/trace.cc | 2 +- src/vt/trace/trace_lite.cc | 10 ++++-- src/vt/trace/trace_log.h | 2 +- src/vt/utils/memory/memory_reporter.h | 2 +- .../vrt/collection/balance/baselb/baselb.cc | 2 +- .../balance/hierarchicallb/hierlb.cc | 6 ++-- src/vt/vrt/collection/balance/lb_common.h | 2 +- .../vrt/collection/balance/model/load_model.h | 14 ++++++--- .../collection/balance/offlinelb/offlinelb.h | 2 +- .../collection/balance/rotatelb/rotatelb.cc | 2 +- .../balance/temperedlb/temperedlb.cc | 3 +- .../vrt/collection/balance/workload_replay.cc | 2 +- src/vt/vrt/collection/manager.impl.h | 19 ++++++++---- src/vt/vrt/context/context_vrt.h | 4 +-- tests/unit/active/test_active_send.cc | 2 +- tests/unit/active/test_async_op_mpi.cc | 2 +- tests/unit/active/test_async_op_threads.cc | 4 +-- tests/unit/active/test_pending_send.cc | 2 +- .../collection/test_checkpoint.extended.cc | 5 ++- .../unit/collection/test_collection_common.h | 4 +-- .../test_collection_construct_common.h | 6 ++-- .../test_collection_group.extended.cc | 9 ++++-- .../collection/test_index_types.extended.cc | 2 +- tests/unit/collection/test_insert.extended.cc | 2 +- tests/unit/collection/test_list_insert.cc | 8 +++-- tests/unit/collection/test_query_context.cc | 2 +- .../collection/test_reduce_collection_race.cc | 2 +- tests/unit/collection/test_storage.cc | 2 +- .../collectives/test_collectives_reduce.cc | 5 ++- tests/unit/group/test_group.cc | 2 +- tests/unit/group/test_group.extended.cc | 2 +- tests/unit/lb/test_lb_data_comm.cc | 16 +++++----- tests/unit/location/test_hops.extended.cc | 4 +-- tests/unit/location/test_location.cc | 9 ++++-- tests/unit/memory/test_memory_active.cc | 2 +- tests/unit/memory/test_memory_lifetime.cc | 16 ++++++---- tests/unit/pipe/test_signal_cleanup.cc | 4 +-- tests/unit/pool/test_pool.cc | 6 ++-- tests/unit/pool/test_pool_message_sizes.cc | 8 +++-- tests/unit/rdma/test_rdma_common.h | 2 +- .../runtime/test_component_construction.cc | 4 ++- tests/unit/runtime/test_mpi_access_guards.cc | 2 +- ...st_serialize_messenger_virtual.extended.cc | 2 +- tests/unit/termination/test_epoch_guard.cc | 2 +- tests/unit/termination/test_term_chaining.cc | 12 +++---- tests/unit/termination/test_term_cleanup.cc | 2 +- .../termination/test_term_dep_send_chain.cc | 8 +++-- .../termination/test_termination_reset.cc | 2 +- tutorial/tutorial_1e.h | 2 +- tutorial/tutorial_1f.h | 2 +- tutorial/tutorial_2a.h | 2 +- 118 files changed, 345 insertions(+), 209 deletions(-) diff --git a/examples/callback/callback.cc b/examples/callback/callback.cc index 58d823015f..e2039ea9d0 100644 --- a/examples/callback/callback.cc +++ b/examples/callback/callback.cc @@ -110,7 +110,7 @@ struct MyObj { struct MyCol : vt::Collection { }; // Collection handler callback endpoint -void colHan(MyCol* col, TestMsg* msg) { +void colHan([[maybe_unused]] MyCol* col, [[maybe_unused]] TestMsg* msg) { printOutput(msg, "MyCol colHan (non-intrusive)"); } diff --git a/examples/collection/jacobi1d_vt.cc b/examples/collection/jacobi1d_vt.cc index 3a10699029..9f5b748dfc 100644 --- a/examples/collection/jacobi1d_vt.cc +++ b/examples/collection/jacobi1d_vt.cc @@ -227,7 +227,7 @@ struct LinearPb1DJacobi : vt::Collection { } - void doIter(BlankMsg *msg) { + void doIter([[maybe_unused]] BlankMsg *msg) { // // Treat the particular case of 1 object diff --git a/examples/collection/jacobi2d_vt.cc b/examples/collection/jacobi2d_vt.cc index eba9608c43..ecbd266e10 100644 --- a/examples/collection/jacobi2d_vt.cc +++ b/examples/collection/jacobi2d_vt.cc @@ -274,7 +274,7 @@ struct LinearPb2DJacobi : vt::Collection { } - void doIter(BlankMsg *msg) { + void doIter([[maybe_unused]] BlankMsg *msg) { // // Treat the particular case of 1 object diff --git a/examples/collection/lb_iter.cc b/examples/collection/lb_iter.cc index 6d467b0347..43cf1af159 100644 --- a/examples/collection/lb_iter.cc +++ b/examples/collection/lb_iter.cc @@ -61,7 +61,9 @@ struct IterCol : vt::Collection { static double weight = 1.0f; -void IterCol::iterWork(int64_t work_amt, int64_t iter, int subphase) { +void IterCol::iterWork( + int64_t work_amt, [[maybe_unused]] int64_t iter, int subphase +) { this->lb_data_.setSubPhase(subphase); double val = 0.1f; double val2 = 0.4f * work_amt; diff --git a/examples/collection/transpose.cc b/examples/collection/transpose.cc index 0c016c876d..89e5d35848 100644 --- a/examples/collection/transpose.cc +++ b/examples/collection/transpose.cc @@ -176,7 +176,7 @@ struct Block : vt::Collection { } } - void solve(SolveMsg* msg) { + void solve([[maybe_unused]] SolveMsg* msg) { // Invoke initialize here so that the index is ready initialize(); // Wait for all initializations to complete @@ -190,7 +190,9 @@ struct Block : vt::Collection { //using ActiveMapTypedFnType = NodeType(IndexT*, IndexT*, NodeType); template -vt::NodeType my_map(IndexT* idx, IndexT* max_idx, vt::NodeType num_nodes) { +vt::NodeType my_map( + IndexT* idx, [[maybe_unused]] IndexT* max_idx, vt::NodeType num_nodes +) { // simple round-robin for 1-d only. return idx->x() % num_nodes; } diff --git a/examples/group/group_collective.cc b/examples/group/group_collective.cc index e43a4b0e5e..0452e7e701 100644 --- a/examples/group/group_collective.cc +++ b/examples/group/group_collective.cc @@ -46,7 +46,7 @@ /// [Collective group creation] struct HelloGroupMsg : vt::Message { }; -static void hello_group_handler(HelloGroupMsg* msg) { +static void hello_group_handler([[maybe_unused]] HelloGroupMsg* msg) { fmt::print("{}: Hello from group handler\n", vt::theContext()->getNode()); } diff --git a/examples/hello_world/hello_world_functor.cc b/examples/hello_world/hello_world_functor.cc index fffd344172..306fdb2be9 100644 --- a/examples/hello_world/hello_world_functor.cc +++ b/examples/hello_world/hello_world_functor.cc @@ -64,7 +64,7 @@ struct MultipleFunctions { fmt::print("{}: MultipleFunctions -> Hello from node {}\n", vt::theContext()->getNode(), msg->from); } - void operator()(AnotherMsg* msg) const { + void operator()([[maybe_unused]] AnotherMsg* msg) const { fmt::print("{}: MultipleFunctions with AnotherMsg\n", vt::theContext()->getNode()); } }; diff --git a/examples/rdma/rdma_simple_get.cc b/examples/rdma/rdma_simple_get.cc index 77d60accf9..1ea468bcc9 100644 --- a/examples/rdma/rdma_simple_get.cc +++ b/examples/rdma/rdma_simple_get.cc @@ -77,7 +77,7 @@ static void tell_handle(HandleMsg* msg) { static std::unique_ptr my_data = nullptr; static vt::RDMA_GetType test_get_fn( - vt::BaseMessage*, vt::ByteType num_bytes, vt::ByteType offset, vt::TagType tag, + vt::BaseMessage*, vt::ByteType num_bytes, [[maybe_unused]] vt::ByteType offset, vt::TagType tag, bool ) { vt::NodeType this_node = vt::theContext()->getNode(); diff --git a/src/vt/collective/barrier/barrier.cc b/src/vt/collective/barrier/barrier.cc index 80986b70f4..ad8e2a5f64 100644 --- a/src/vt/collective/barrier/barrier.cc +++ b/src/vt/collective/barrier/barrier.cc @@ -91,7 +91,9 @@ Barrier::BarrierStateType& Barrier::insertFindBarrier( } void Barrier::removeBarrier( - bool const& is_named, bool const& is_wait, BarrierType const& barrier + bool const& is_named, + [[maybe_unused]] bool const& is_wait, + BarrierType const& barrier ) { auto& state = is_named ? named_barrier_state_ : unnamed_barrier_state_; diff --git a/src/vt/collective/reduce/operators/callback_op.h b/src/vt/collective/reduce/operators/callback_op.h index ab143d0b8d..d9f8147a9d 100644 --- a/src/vt/collective/reduce/operators/callback_op.h +++ b/src/vt/collective/reduce/operators/callback_op.h @@ -50,7 +50,7 @@ namespace vt { namespace collective { namespace reduce { namespace operators { template struct ReduceCallback { - void operator()(T* t) const { /* do nothing */ } + void operator()([[maybe_unused]] T* t) const { /* do nothing */ } }; }}}} /* end namespace vt::collective::reduce::operators */ diff --git a/src/vt/collective/reduce/operators/functors/none_op.h b/src/vt/collective/reduce/operators/functors/none_op.h index eb87e9f0b7..958d1406c8 100644 --- a/src/vt/collective/reduce/operators/functors/none_op.h +++ b/src/vt/collective/reduce/operators/functors/none_op.h @@ -57,7 +57,7 @@ struct None { "Must be empty data" ); - void operator()(T& v1, T const& v2) {} + void operator()([[maybe_unused]] T& v1, [[maybe_unused]] T const& v2) {} }; }}}} /* end namespace vt::collective::reduce::operators */ diff --git a/src/vt/collective/reduce/operators/functors/tuple_op_helper.h b/src/vt/collective/reduce/operators/functors/tuple_op_helper.h index 595b809351..096f2cd8ad 100644 --- a/src/vt/collective/reduce/operators/functors/tuple_op_helper.h +++ b/src/vt/collective/reduce/operators/functors/tuple_op_helper.h @@ -65,7 +65,9 @@ struct ApplyOp> { template struct ApplyOp> { template - static void apply(Tuple1& t1, Tuple2 const& t2) { } + static void apply( + [[maybe_unused]] Tuple1& t1, [[maybe_unused]] Tuple2 const& t2 + ) { } }; // diff --git a/src/vt/configs/arguments/args.cc b/src/vt/configs/arguments/args.cc index d14c2f7a0f..ae2f7f84ef 100644 --- a/src/vt/configs/arguments/args.cc +++ b/src/vt/configs/arguments/args.cc @@ -675,7 +675,10 @@ void addRuntimeArgs(CLI::App& app, AppConfig& appConfig) { a3->group(configRuntime); } -void addThreadingArgs(CLI::App& app, AppConfig& appConfig) { +void addThreadingArgs( + [[maybe_unused]] CLI::App& app, + [[maybe_unused]] AppConfig& appConfig +) { #if (vt_feature_fcontext != 0) auto ult_disable = "Disable running handlers in user-level threads"; auto stack_size = "The default stack size for user-level threads"; @@ -702,7 +705,9 @@ ArgConfig::construct(std::unique_ptr arg) { class VtFormatter : public CLI::Formatter { public: - std::string make_usage(const CLI::App *, std::string name) const override { + std::string make_usage( + const CLI::App *, [[maybe_unused]] std::string name + ) const override { std::stringstream u; u << "\n" "Usage:" diff --git a/src/vt/configs/error/assert_out.impl.h b/src/vt/configs/error/assert_out.impl.h index 49bc8e5d85..86d8d9c771 100644 --- a/src/vt/configs/error/assert_out.impl.h +++ b/src/vt/configs/error/assert_out.impl.h @@ -80,7 +80,7 @@ std::enable_if_t>::value == 0> assertOut( bool fail, std::string const cond, std::string const& str, std::string const& file, int const line, std::string const& func, - ErrorCodeType error, std::tuple&& tup + ErrorCodeType error, [[maybe_unused]] std::tuple&& tup ) { auto msg = "Assertion failed:"; auto assert_fail_str = stringizeMessage(msg,str,cond,file,line,func,error); diff --git a/src/vt/configs/error/assert_out_info.impl.h b/src/vt/configs/error/assert_out_info.impl.h index 5ab4713321..1e6c569b47 100644 --- a/src/vt/configs/error/assert_out_info.impl.h +++ b/src/vt/configs/error/assert_out_info.impl.h @@ -67,7 +67,8 @@ std::enable_if_t>::value == 0> assertOutInfo( bool fail, std::string const cond, std::string const& str, std::string const& file, int const line, std::string const& func, - ErrorCodeType error, std::tuple&& tup, std::tuple&& t2 + ErrorCodeType error, [[maybe_unused]] std::tuple&& tup, + std::tuple&& t2 ) { return assertOut( fail,cond,str,file,line,func,error,std::forward>(t2) diff --git a/src/vt/configs/error/error.impl.h b/src/vt/configs/error/error.impl.h index ea4f177442..55e4e3fcc2 100644 --- a/src/vt/configs/error/error.impl.h +++ b/src/vt/configs/error/error.impl.h @@ -62,7 +62,9 @@ namespace vt { namespace error { template inline std::enable_if_t>::value == 0> -display(std::string const& str, ErrorCodeType error, Args&&... args) { +display( + std::string const& str, ErrorCodeType error, [[maybe_unused]] Args&&... args +) { std::string const inf = ::fmt::format("FATAL ERROR: {}\n",str); return ::vt::abort(inf,error); } @@ -81,7 +83,7 @@ std::enable_if_t>::value == 0> displayLoc( std::string const& str, ErrorCodeType error, std::string const& file, int const line, std::string const& func, - std::tuple&& tup + [[maybe_unused]] std::tuple&& tup ) { auto msg = "vtAbort() Invoked"; auto const inf = debug::stringizeMessage(msg,str,"",file,line,func,error); diff --git a/src/vt/configs/error/soft_error.h b/src/vt/configs/error/soft_error.h index 9876f797a0..0180248585 100644 --- a/src/vt/configs/error/soft_error.h +++ b/src/vt/configs/error/soft_error.h @@ -86,7 +86,7 @@ inline std::enable_if_t>::value == 0> warningImpl( std::string const& str, ErrorCodeType error, bool quit, std::string const& file, int const line, std::string const& func, - Args&&... args + [[maybe_unused]] Args&&... args ) { auto msg = "vtWarn() Invoked"; auto inf = debug::stringizeMessage(msg,str,"",file,line,func,error); diff --git a/src/vt/context/context.cc b/src/vt/context/context.cc index 86f2998dd6..db02f6a11a 100644 --- a/src/vt/context/context.cc +++ b/src/vt/context/context.cc @@ -71,7 +71,7 @@ struct RunnableNew {}; namespace vt { namespace ctx { -Context::Context(bool const is_interop, MPI_Comm comm) { +Context::Context([[maybe_unused]] bool const is_interop, MPI_Comm comm) { #if DEBUG_VT_CONTEXT fmt::print( "Context::Context is_interop={}, comm={}\n", print_bool(is_interop), comm diff --git a/src/vt/event/event.cc b/src/vt/event/event.cc index d3de8b195c..c367a6cfcb 100644 --- a/src/vt/event/event.cc +++ b/src/vt/event/event.cc @@ -198,7 +198,7 @@ void AsyncEvent::finalize() { event_container_.clear(); } -int AsyncEvent::progress(TimeType current_time) { +int AsyncEvent::progress([[maybe_unused]] TimeType current_time) { theEvent()->testEventsTrigger(); return 0; } diff --git a/src/vt/group/collective/group_info_collective.cc b/src/vt/group/collective/group_info_collective.cc index 2ded4cc4ef..9cb25f6fc4 100644 --- a/src/vt/group/collective/group_info_collective.cc +++ b/src/vt/group/collective/group_info_collective.cc @@ -186,7 +186,7 @@ void InfoColl::setupCollective() { ); GroupOnlyTMsg::registerContinuationT( new_tree_cont_, - [group_](MsgSharedPtr msg){ + [group_]([[maybe_unused]] MsgSharedPtr msg){ auto iter = theGroup()->local_collective_group_info_.find(group_); vtAssertExpr(iter != theGroup()->local_collective_group_info_.end()); auto const& from = theContext()->getFromNodeCurrentTask(); @@ -766,7 +766,7 @@ void InfoColl::finalizeTree(GroupOnlyMsg* msg) { finalize(); } -void InfoColl::downTreeFinished(GroupOnlyMsg* msg) { +void InfoColl::downTreeFinished([[maybe_unused]] GroupOnlyMsg* msg) { send_down_finished_++; finalize(); } diff --git a/src/vt/group/group_manager.cc b/src/vt/group/group_manager.cc index 6e7f8a1d4c..835dbb7031 100644 --- a/src/vt/group/group_manager.cc +++ b/src/vt/group/group_manager.cc @@ -192,8 +192,8 @@ void GroupManager::triggerContinuation(RemoteOperationIDType const op) { } void GroupManager::initializeRemoteGroup( - GroupType const group, RegionPtrType in_region, bool const is_static, - RegionType::SizeType const group_size + GroupType const group, RegionPtrType in_region, + [[maybe_unused]] bool const is_static, RegionType::SizeType const group_size ) { auto group_info = std::make_unique( info_rooted_remote_cons, default_comm_, @@ -227,8 +227,8 @@ MPI_Comm GroupManager::getGroupComm(GroupType const group_id) { } void GroupManager::initializeLocalGroupCollective( - GroupType const group, bool const is_static, ActionType action, - bool const in_group, bool make_mpi_group + GroupType const group, [[maybe_unused]] bool const is_static, + ActionType action, bool const in_group, bool make_mpi_group ) { auto group_info = std::make_unique( info_collective_cons, default_comm_, @@ -244,7 +244,8 @@ void GroupManager::initializeLocalGroupCollective( } void GroupManager::initializeLocalGroup( - GroupType const group, RegionPtrType in_region, bool const is_static, ActionType action + GroupType const group, RegionPtrType in_region, + [[maybe_unused]] bool const is_static, ActionType action ) { auto const group_size = in_region->getSize(); diff --git a/src/vt/messaging/active.cc b/src/vt/messaging/active.cc index 32e6f32f8c..fbd69715a3 100644 --- a/src/vt/messaging/active.cc +++ b/src/vt/messaging/active.cc @@ -1152,7 +1152,7 @@ bool ActiveMessenger::testPendingAsyncOps() { ); } -int ActiveMessenger::progress(TimeType current_time) { +int ActiveMessenger::progress([[maybe_unused]] TimeType current_time) { bool const started_irecv_active_msg = tryProcessIncomingActiveMsg(); bool const started_irecv_data_msg = tryProcessDataMsgRecv(); bool const received_active_msg = testPendingActiveMsgAsyncRecv(); @@ -1167,7 +1167,9 @@ void ActiveMessenger::registerAsyncOp(std::unique_ptr in) { in_progress_ops.emplace(AsyncOpWrapper{std::move(in)}); } -void ActiveMessenger::blockOnAsyncOp(std::unique_ptr op) { +void ActiveMessenger::blockOnAsyncOp( + [[maybe_unused]] std::unique_ptr op +) { #if vt_check_enabled(fcontext) using TA = sched::ThreadAction; auto tid = TA::getActiveThreadID(); diff --git a/src/vt/messaging/active.impl.h b/src/vt/messaging/active.impl.h index 2cb263f9ea..13c94651e3 100644 --- a/src/vt/messaging/active.impl.h +++ b/src/vt/messaging/active.impl.h @@ -220,7 +220,7 @@ ActiveMessenger::PendingSendType ActiveMessenger::sendMsgAuto( template * f> ActiveMessenger::PendingSendType ActiveMessenger::broadcastMsgSz( MsgPtrThief msg, - ByteType msg_size, + [[maybe_unused]] ByteType msg_size, bool deliver_to_sender, TagType tag ) { @@ -265,7 +265,7 @@ template * f> ActiveMessenger::PendingSendType ActiveMessenger::sendMsgSz( NodeType dest, MsgPtrThief msg, - ByteType msg_size, + [[maybe_unused]] ByteType msg_size, TagType tag ) { auto const han = auto_registry::makeAutoHandler(); diff --git a/src/vt/messaging/message/message_priority.impl.h b/src/vt/messaging/message/message_priority.impl.h index 9db6ee43fb..9df9c81526 100644 --- a/src/vt/messaging/message/message_priority.impl.h +++ b/src/vt/messaging/message/message_priority.impl.h @@ -49,21 +49,27 @@ namespace vt { namespace messaging { template -void msgSetPriorityLevel(MsgT ptr, PriorityLevelType level) { +void msgSetPriorityLevel( + [[maybe_unused]] MsgT ptr, [[maybe_unused]] PriorityLevelType level +) { # if vt_check_enabled(priorities) envelopeSetPriorityLevel(ptr->env, level); # endif } template -void msgSetPriorityAllLevels(MsgT ptr, PriorityType priority) { +void msgSetPriorityAllLevels( + [[maybe_unused]] MsgT ptr, [[maybe_unused]] PriorityType priority +) { # if vt_check_enabled(priorities) envelopeSetPriority(ptr->env, priority); # endif } template -bool msgIncPriorityLevel(MsgT old_msg, MsgU new_msg) { +bool msgIncPriorityLevel( + [[maybe_unused]] MsgT old_msg, [[maybe_unused]] MsgU new_msg +) { # if vt_check_enabled(priorities) auto const level = envelopeGetPriorityLevel(old_msg->env); if (level + 1 < sched::priority_num_levels) { @@ -78,7 +84,11 @@ bool msgIncPriorityLevel(MsgT old_msg, MsgU new_msg) { } template -void msgSetPriority(MsgU new_msg, PriorityType priority, bool increment_level) { +void msgSetPriority( + [[maybe_unused]] MsgU new_msg, + [[maybe_unused]] PriorityType priority, + [[maybe_unused]] bool increment_level +) { # if vt_check_enabled(priorities) PriorityLevelType const level = increment_level ? 1 : 0; PriorityType old_priority = vt::min_priority; @@ -88,8 +98,10 @@ void msgSetPriority(MsgU new_msg, PriorityType priority, bool increment_level) { template void msgSetPriorityImpl( - MsgU new_msg, PriorityType new_priority, PriorityType old_priority, - PriorityLevelType level + [[maybe_unused]] MsgU new_msg, + [[maybe_unused]] PriorityType new_priority, + [[maybe_unused]] PriorityType old_priority, + [[maybe_unused]] PriorityLevelType level ) { # if vt_check_enabled(priorities) @@ -115,7 +127,8 @@ void msgSetPriorityImpl( template void msgSetPriorityFrom( - MsgT old_msg, MsgU new_msg, PriorityType priority, bool increment_level + [[maybe_unused]] MsgT old_msg, [[maybe_unused]] MsgU new_msg, + [[maybe_unused]] PriorityType priority, [[maybe_unused]] bool increment_level ) { # if vt_check_enabled(priorities) vtAssert(old_msg != nullptr, "Must have a valid message"); @@ -130,7 +143,9 @@ void msgSetPriorityFrom( } template -void msgSystemSetPriority(MsgT ptr, PriorityType priority) { +void msgSystemSetPriority( + [[maybe_unused]] MsgT ptr, [[maybe_unused]] PriorityType priority +) { # if vt_check_enabled(priorities) PriorityType prior = no_priority; envelopeSetPriorityLevel(ptr->env, 0); diff --git a/src/vt/messaging/param_msg.h b/src/vt/messaging/param_msg.h index 1ad19f0f5c..095b1e63c4 100644 --- a/src/vt/messaging/param_msg.h +++ b/src/vt/messaging/param_msg.h @@ -77,14 +77,16 @@ struct MsgProps { return std::move(*this); } - MsgProps&& withPriority(PriorityType in_priority) { + MsgProps&& withPriority([[maybe_unused]] PriorityType in_priority) { #if vt_check_enabled(priorities) priority_ = in_priority; #endif return std::move(*this); } - MsgProps&& withPriorityLevel(PriorityLevelType in_priority_level) { + MsgProps&& withPriorityLevel( + [[maybe_unused]] PriorityLevelType in_priority_level + ) { #if vt_check_enabled(priorities) priority_level_ = in_priority_level; #endif diff --git a/src/vt/objgroup/holder/holder_basic.h b/src/vt/objgroup/holder/holder_basic.h index d752843e5b..0f8d643893 100644 --- a/src/vt/objgroup/holder/holder_basic.h +++ b/src/vt/objgroup/holder/holder_basic.h @@ -64,7 +64,7 @@ struct HolderBasic final : HolderObjBase { std::byte* getPtr() override { return reinterpret_cast(obj_); } template - void reset(Args&&... args) { + void reset([[maybe_unused]] Args&&... args) { vtAssert(false, "HolderBasic is not resetable"); } diff --git a/src/vt/objgroup/proxy/proxy_objgroup.impl.h b/src/vt/objgroup/proxy/proxy_objgroup.impl.h index f594ae6abe..a0779cf7fd 100644 --- a/src/vt/objgroup/proxy/proxy_objgroup.impl.h +++ b/src/vt/objgroup/proxy/proxy_objgroup.impl.h @@ -150,7 +150,9 @@ typename Proxy::PendingSendType Proxy::multicast( auto groupID = theGroup()->GetTempGroupForRange(range); if (!groupID.has_value()) { - groupID = theGroup()->newGroup(std::move(nodes), [](GroupType type) {}); + groupID = theGroup()->newGroup( + std::move(nodes), []([[maybe_unused]] GroupType type) {} + ); theGroup()->AddNewTempGroup(range, groupID.value()); } diff --git a/src/vt/pipe/callback/anon/callback_anon.impl.h b/src/vt/pipe/callback/anon/callback_anon.impl.h index 04378a0a29..e4b039d8d3 100644 --- a/src/vt/pipe/callback/anon/callback_anon.impl.h +++ b/src/vt/pipe/callback/anon/callback_anon.impl.h @@ -67,7 +67,9 @@ void CallbackAnon::serialize(SerializerT& s) { template template typename CallbackAnon::template IsVoidType -CallbackAnon::triggerDispatch(SignalDataType* data, PipeType const& pid) { +CallbackAnon::triggerDispatch( + [[maybe_unused]] SignalDataType* data, PipeType const& pid +) { // Overload when the signal is void auto const& this_node = theContext()->getNode(); auto const& pipe_node = PipeIDBuilder::getNode(pid); @@ -115,7 +117,7 @@ void CallbackAnon::trigger_(SignalDataType* data, PipeType const& pid) { } template -void CallbackAnon::trigger_(SignalDataType* data) { +void CallbackAnon::trigger_([[maybe_unused]] SignalDataType* data) { vtAssert(0, "Should not be reachable in this derived class"); } diff --git a/src/vt/pipe/callback/anon/callback_anon_listener.impl.h b/src/vt/pipe/callback/anon/callback_anon_listener.impl.h index 05f9bfa413..d75e302e85 100644 --- a/src/vt/pipe/callback/anon/callback_anon_listener.impl.h +++ b/src/vt/pipe/callback/anon/callback_anon_listener.impl.h @@ -75,7 +75,9 @@ void AnonListener::trigger_(SignalDataType* data) { } template -void AnonListener::trigger_(SignalDataType* data, PipeType const& pipe_id) { +void AnonListener::trigger_( + SignalDataType* data, [[maybe_unused]] PipeType const& pipe_id +) { return trigger_(data); } diff --git a/src/vt/pipe/callback/anon/callback_anon_tl.h b/src/vt/pipe/callback/anon/callback_anon_tl.h index b68e31fda5..f991d37da0 100644 --- a/src/vt/pipe/callback/anon/callback_anon_tl.h +++ b/src/vt/pipe/callback/anon/callback_anon_tl.h @@ -61,7 +61,7 @@ struct CallbackAnonTypeless : CallbackBaseTL { template void serialize(SerializerT& s); - bool operator==(CallbackAnonTypeless const& other) const { + bool operator==([[maybe_unused]] CallbackAnonTypeless const& other) const { return true; } diff --git a/src/vt/pipe/callback/anon/callback_anon_tl.impl.h b/src/vt/pipe/callback/anon/callback_anon_tl.impl.h index 99605e6411..2d727c9adc 100644 --- a/src/vt/pipe/callback/anon/callback_anon_tl.impl.h +++ b/src/vt/pipe/callback/anon/callback_anon_tl.impl.h @@ -57,7 +57,7 @@ namespace vt { namespace pipe { namespace callback { template -void CallbackAnonTypeless::serialize(SerializerT& s) {} +void CallbackAnonTypeless::serialize([[maybe_unused]] SerializerT& s) {} template void CallbackAnonTypeless::trigger(MsgT* msg, PipeType const& pipe) { diff --git a/src/vt/pipe/callback/callback_base.h b/src/vt/pipe/callback/callback_base.h index 00aa10301c..f6b1f55407 100644 --- a/src/vt/pipe/callback/callback_base.h +++ b/src/vt/pipe/callback/callback_base.h @@ -95,7 +95,9 @@ struct CallbackBase { protected: virtual void trigger_(SignalDataType* data) = 0; - virtual void trigger_(SignalDataType* data, PipeType const& pipe_id) { + virtual void trigger_( + SignalDataType* data, [[maybe_unused]] PipeType const& pipe_id + ) { return trigger_(data); } diff --git a/src/vt/pipe/callback/callback_base_tl.h b/src/vt/pipe/callback/callback_base_tl.h index 29bbf0c06c..adae2dabaa 100644 --- a/src/vt/pipe/callback/callback_base_tl.h +++ b/src/vt/pipe/callback/callback_base_tl.h @@ -54,7 +54,7 @@ struct CallbackBaseTL { CallbackBaseTL() = default; template - void serialize(SerializerT& s) { } + void serialize([[maybe_unused]] SerializerT& s) { } template void trigger(MsgT* msg, PipeType const& pipe) { diff --git a/src/vt/pipe/callback/handler_bcast/callback_bcast.impl.h b/src/vt/pipe/callback/handler_bcast/callback_bcast.impl.h index ac2e8e52b5..869b6f54cd 100644 --- a/src/vt/pipe/callback/handler_bcast/callback_bcast.impl.h +++ b/src/vt/pipe/callback/handler_bcast/callback_bcast.impl.h @@ -75,14 +75,16 @@ void CallbackBcast::trigger_(SignalDataType* data, PipeType const& pid) { } template -void CallbackBcast::trigger_(SignalDataType* data) { +void CallbackBcast::trigger_([[maybe_unused]] SignalDataType* data) { vtAssert(0, "Should not be reachable in this derived class"); } template template typename CallbackBcast::template IsVoidType -CallbackBcast::triggerDispatch(SignalDataType* data, PipeType const& pid) { +CallbackBcast::triggerDispatch( + [[maybe_unused]] SignalDataType* data, PipeType const& pid +) { auto const& this_node = theContext()->getNode(); vt_debug_print( terse, pipe, @@ -96,7 +98,9 @@ CallbackBcast::triggerDispatch(SignalDataType* data, PipeType const& pid) template template typename CallbackBcast::template IsNotVoidType -CallbackBcast::triggerDispatch(SignalDataType* data, PipeType const& pid) { +CallbackBcast::triggerDispatch( + SignalDataType* data, [[maybe_unused]] PipeType const& pid +) { auto const& this_node = theContext()->getNode(); vt_debug_print( terse, pipe, diff --git a/src/vt/pipe/callback/handler_send/callback_send.impl.h b/src/vt/pipe/callback/handler_send/callback_send.impl.h index fd172c0eab..8914102668 100644 --- a/src/vt/pipe/callback/handler_send/callback_send.impl.h +++ b/src/vt/pipe/callback/handler_send/callback_send.impl.h @@ -73,14 +73,16 @@ void CallbackSend::trigger_(SignalDataType* data, PipeType const& pid) { } template -void CallbackSend::trigger_(SignalDataType* data) { +void CallbackSend::trigger_([[maybe_unused]] SignalDataType* data) { vtAssert(0, "Should not be reachable in this derived class"); } template template typename CallbackSend::template IsVoidType -CallbackSend::triggerDispatch(SignalDataType* data, PipeType const& pid) { +CallbackSend::triggerDispatch( + [[maybe_unused]] SignalDataType* data, PipeType const& pid +) { auto const& this_node = theContext()->getNode(); vt_debug_print( terse, pipe, @@ -100,7 +102,9 @@ CallbackSend::triggerDispatch(SignalDataType* data, PipeType const& pid) { template template typename CallbackSend::template IsNotVoidType -CallbackSend::triggerDispatch(SignalDataType* data, PipeType const& pid) { +CallbackSend::triggerDispatch( + SignalDataType* data, [[maybe_unused]] PipeType const& pid +) { auto const& this_node = theContext()->getNode(); vt_debug_print( terse, pipe, diff --git a/src/vt/pipe/callback/objgroup_bcast/callback_objgroup_bcast.h b/src/vt/pipe/callback/objgroup_bcast/callback_objgroup_bcast.h index bfd553affb..4c2c9d78e0 100644 --- a/src/vt/pipe/callback/objgroup_bcast/callback_objgroup_bcast.h +++ b/src/vt/pipe/callback/objgroup_bcast/callback_objgroup_bcast.h @@ -69,7 +69,7 @@ struct CallbackObjGroupBcast : CallbackBaseTL { template void trigger(MsgT* msg, PipeType const& pipe); - void triggerVoid(PipeType const& pipe) { + void triggerVoid([[maybe_unused]] PipeType const& pipe) { vtAssert(0, "Must not be void"); } diff --git a/src/vt/pipe/callback/objgroup_bcast/callback_objgroup_bcast.impl.h b/src/vt/pipe/callback/objgroup_bcast/callback_objgroup_bcast.impl.h index 8be44cf633..dc04a81159 100644 --- a/src/vt/pipe/callback/objgroup_bcast/callback_objgroup_bcast.impl.h +++ b/src/vt/pipe/callback/objgroup_bcast/callback_objgroup_bcast.impl.h @@ -58,7 +58,9 @@ void CallbackObjGroupBcast::serialize(SerializerT& s) { } template -void CallbackObjGroupBcast::trigger(MsgT* in_msg, PipeType const& pipe) { +void CallbackObjGroupBcast::trigger( + MsgT* in_msg, [[maybe_unused]] PipeType const& pipe +) { auto msg = promoteMsg(in_msg); envelopeSetGroup(msg->env, default_group); objgroup::broadcast(msg,handler_); diff --git a/src/vt/pipe/callback/objgroup_send/callback_objgroup_send.h b/src/vt/pipe/callback/objgroup_send/callback_objgroup_send.h index 3a53e664c0..18a16ead5e 100644 --- a/src/vt/pipe/callback/objgroup_send/callback_objgroup_send.h +++ b/src/vt/pipe/callback/objgroup_send/callback_objgroup_send.h @@ -70,7 +70,7 @@ struct CallbackObjGroupSend : CallbackBaseTL { template void trigger(MsgT* msg, PipeType const& pipe); - void triggerVoid(PipeType const& pipe) { + void triggerVoid([[maybe_unused]] PipeType const& pipe) { vtAssert(0, "Must not be void"); } diff --git a/src/vt/pipe/callback/objgroup_send/callback_objgroup_send.impl.h b/src/vt/pipe/callback/objgroup_send/callback_objgroup_send.impl.h index df945b9972..28cf2cdf28 100644 --- a/src/vt/pipe/callback/objgroup_send/callback_objgroup_send.impl.h +++ b/src/vt/pipe/callback/objgroup_send/callback_objgroup_send.impl.h @@ -57,7 +57,9 @@ void CallbackObjGroupSend::serialize(SerializerT& s) { } template -void CallbackObjGroupSend::trigger(MsgT* in_msg, PipeType const& pipe) { +void CallbackObjGroupSend::trigger( + MsgT* in_msg, [[maybe_unused]] PipeType const& pipe +) { auto msg = promoteMsg(in_msg); objgroup::send(msg,handler_,node_); } diff --git a/src/vt/pipe/callback/proxy_bcast/callback_proxy_bcast_tl.h b/src/vt/pipe/callback/proxy_bcast/callback_proxy_bcast_tl.h index 42cd97e21f..bf21aac8a9 100644 --- a/src/vt/pipe/callback/proxy_bcast/callback_proxy_bcast_tl.h +++ b/src/vt/pipe/callback/proxy_bcast/callback_proxy_bcast_tl.h @@ -57,7 +57,9 @@ struct CallbackProxyBcastTypeless : CallbackBaseTL { template void serialize(SerializerT& s); - bool operator==(CallbackProxyBcastTypeless const& other) const { + bool operator==( + [[maybe_unused]] CallbackProxyBcastTypeless const& other + ) const { return true; } @@ -65,7 +67,7 @@ struct CallbackProxyBcastTypeless : CallbackBaseTL { template void trigger(MsgT* msg, PipeType const& pipe); - void triggerVoid(PipeType const& pipe) { + void triggerVoid([[maybe_unused]] PipeType const& pipe) { vtAssert(0, "Must not be void"); } }; @@ -94,7 +96,7 @@ struct CallbackProxyBcastDirect : CallbackBaseTL { template void trigger(MsgT* msg, PipeType const& pipe); - void triggerVoid(PipeType const& pipe) { + void triggerVoid([[maybe_unused]] PipeType const& pipe) { vtAssert(0, "Must not be void"); } diff --git a/src/vt/pipe/callback/proxy_bcast/callback_proxy_bcast_tl.impl.h b/src/vt/pipe/callback/proxy_bcast/callback_proxy_bcast_tl.impl.h index 4d30b5eb35..d51e587061 100644 --- a/src/vt/pipe/callback/proxy_bcast/callback_proxy_bcast_tl.impl.h +++ b/src/vt/pipe/callback/proxy_bcast/callback_proxy_bcast_tl.impl.h @@ -61,7 +61,7 @@ namespace vt { namespace pipe { namespace callback { template -void CallbackProxyBcastTypeless::serialize(SerializerT& s) {} +void CallbackProxyBcastTypeless::serialize([[maybe_unused]] SerializerT& s) {} template void CallbackProxyBcastTypeless::trigger(MsgT* msg, PipeType const& pipe) { diff --git a/src/vt/pipe/callback/proxy_send/callback_proxy_send_tl.h b/src/vt/pipe/callback/proxy_send/callback_proxy_send_tl.h index c307248316..f8856f5c3b 100644 --- a/src/vt/pipe/callback/proxy_send/callback_proxy_send_tl.h +++ b/src/vt/pipe/callback/proxy_send/callback_proxy_send_tl.h @@ -57,7 +57,9 @@ struct CallbackProxySendTypeless : CallbackBaseTL { template void serialize(SerializerT& s); - bool operator==(CallbackProxySendTypeless const& other) const { + bool operator==( + [[maybe_unused]] CallbackProxySendTypeless const& other + ) const { return true; } @@ -65,7 +67,7 @@ struct CallbackProxySendTypeless : CallbackBaseTL { template void trigger(MsgT* msg, PipeType const& pipe); - void triggerVoid(PipeType const& pipe) { + void triggerVoid([[maybe_unused]] PipeType const& pipe) { vtAssert(0, "Must not be void"); } }; @@ -91,7 +93,7 @@ struct CallbackProxySendDirect : CallbackBaseTL { template void trigger(MsgT* msg, PipeType const& pipe); - void triggerVoid(PipeType const& pipe) { + void triggerVoid([[maybe_unused]] PipeType const& pipe) { vtAssert(0, "Must not be void"); } diff --git a/src/vt/pipe/callback/proxy_send/callback_proxy_send_tl.impl.h b/src/vt/pipe/callback/proxy_send/callback_proxy_send_tl.impl.h index c63c437051..52abbf3426 100644 --- a/src/vt/pipe/callback/proxy_send/callback_proxy_send_tl.impl.h +++ b/src/vt/pipe/callback/proxy_send/callback_proxy_send_tl.impl.h @@ -58,7 +58,7 @@ namespace vt { namespace pipe { namespace callback { template -void CallbackProxySendTypeless::serialize(SerializerT& s) { } +void CallbackProxySendTypeless::serialize([[maybe_unused]] SerializerT& s) { } template void CallbackProxySendTypeless::trigger(MsgT* msg, PipeType const& pipe) { diff --git a/src/vt/pipe/pipe_manager.impl.h b/src/vt/pipe/pipe_manager.impl.h index 78d6776e77..c365726df1 100644 --- a/src/vt/pipe/pipe_manager.impl.h +++ b/src/vt/pipe/pipe_manager.impl.h @@ -67,7 +67,9 @@ namespace vt { namespace pipe { template -void PipeManager::triggerSendBack(PipeType const& pipe, MsgT* data) { +void PipeManager::triggerSendBack( + PipeType const& pipe, [[maybe_unused]] MsgT* data +) { auto const& this_node = theContext()->getNode(); auto const& node_back = PipeIDBuilder::getNode(pipe); if (node_back != this_node) { diff --git a/src/vt/pipe/pipe_manager_construct.h b/src/vt/pipe/pipe_manager_construct.h index 390f6b6247..b9b7878e6f 100644 --- a/src/vt/pipe/pipe_manager_construct.h +++ b/src/vt/pipe/pipe_manager_construct.h @@ -139,7 +139,7 @@ struct ConstructCallbacksImpl { template /*static*/ typename ConstructCallbacksImpl::ResultType -ConstructCallbacksImpl::make(ConsT const& ct) { +ConstructCallbacksImpl::make([[maybe_unused]] ConsT const& ct) { return {}; } diff --git a/src/vt/rdma/rdma.cc b/src/vt/rdma/rdma.cc index 3caaaa4396..d5a44314bf 100644 --- a/src/vt/rdma/rdma.cc +++ b/src/vt/rdma/rdma.cc @@ -242,7 +242,10 @@ RDMAManager::RDMAManager() // do a direct recv into the user buffer theMsg()->recvDataMsgBuffer( msg->nchunks, put_ptr_offset, recv_tag, recv_node, true, []{}, - [=](RDMA_GetType ptr, ActionType deleter){ + [=]( + [[maybe_unused]] RDMA_GetType ptr, + [[maybe_unused]] ActionType deleter + ){ vt_debug_print( normal, rdma, "putData: recv_data_msg_buffer DIRECT: offset={}\n", @@ -304,7 +307,8 @@ RDMAManager::RDMAManager() RDMA_HandleType RDMAManager::registerNewCollective( bool const& use_default, RDMA_PtrType const& ptr, ByteType const& num_bytes, - ByteType const& num_total_bytes, ByteType const& elm_size, RDMA_MapType const& map + [[maybe_unused]] ByteType const& num_total_bytes, ByteType const& elm_size, + RDMA_MapType const& map ) { auto const& han = registerNewRdmaHandler(use_default, ptr, num_bytes, true); @@ -423,8 +427,8 @@ void RDMAManager::requestGetData( } void RDMAManager::triggerGetRecvData( - RDMA_OpType const& op, TagType const& tag, RDMA_PtrType ptr, - ByteType const& num_bytes, ActionType const& action + RDMA_OpType const& op, [[maybe_unused]] TagType const& tag, + RDMA_PtrType ptr, ByteType const& num_bytes, ActionType const& action ) { auto iter = pending_ops_.find(op); @@ -518,7 +522,7 @@ void RDMAManager::triggerPutRecvData( RDMA_PtrType RDMAManager::tryPutPtr( - RDMA_HandleType const& han, TagType const& tag + RDMA_HandleType const& han, [[maybe_unused]] TagType const& tag ) { auto const& this_node = theContext()->getNode(); auto const& is_collective = RDMA_HandleManagerType::isCollective(han); @@ -1195,7 +1199,8 @@ RDMAManager::RDMA_ChannelLookupType RDMAManager::makeChannelLookup( RDMAManager::RDMA_ChannelType* RDMAManager::findChannel( RDMA_HandleType const& han, RDMA_TypeType const& rdma_op_type, NodeType const& target, - NodeType const& non_target, bool const& should_insert, bool const& must_exist + NodeType const& non_target, [[maybe_unused]] bool const& should_insert, + [[maybe_unused]] bool const& must_exist ) { auto chan_iter = channels_.find( makeChannelLookup(han,rdma_op_type,target,non_target) diff --git a/src/vt/rdma/rdma.h b/src/vt/rdma/rdma.h index eef08c840c..8bd8e1f302 100644 --- a/src/vt/rdma/rdma.h +++ b/src/vt/rdma/rdma.h @@ -574,8 +574,10 @@ struct RDMAManager : runtime::component::Component { * \param[in] action action when complete */ void newGetChannel( - RDMA_HandleType const& han, NodeType const& target, - NodeType const& non_target, ActionType const& action = nullptr + [[maybe_unused]] RDMA_HandleType const& han, + [[maybe_unused]] NodeType const& target, + [[maybe_unused]] NodeType const& non_target, + [[maybe_unused]] ActionType const& action = nullptr ) { #if vt_check_enabled(mpi_rdma) return newChannel( @@ -595,8 +597,10 @@ struct RDMAManager : runtime::component::Component { * \param[in] action action when complete */ void newPutChannel( - RDMA_HandleType const& han, NodeType const& target, - NodeType const& non_target, ActionType const& action = nullptr + [[maybe_unused]] RDMA_HandleType const& han, + [[maybe_unused]] NodeType const& target, + [[maybe_unused]] NodeType const& non_target, + [[maybe_unused]] ActionType const& action = nullptr ) { #if vt_check_enabled(mpi_rdma) diff --git a/src/vt/rdma/state/rdma_state.cc b/src/vt/rdma/state/rdma_state.cc index 21e920850f..89f0bb3f30 100644 --- a/src/vt/rdma/state/rdma_state.cc +++ b/src/vt/rdma/state/rdma_state.cc @@ -178,7 +178,7 @@ bool State::testReadyPutData(TagType const& tag) { /*static*/ RDMA_GetType State::defaultGetHandlerFn( StateMessage* msg, ByteType req_num_bytes, ByteType req_offset, - TagType tag, bool is_local + TagType tag, [[maybe_unused]] bool is_local ) { auto const& state = *msg->state; @@ -201,7 +201,7 @@ bool State::testReadyPutData(TagType const& tag) { /*static*/ void State::defaultPutHandlerFn( StateMessage* msg, RDMA_PtrType in_ptr, ByteType req_num_bytes, - ByteType req_offset, TagType tag, bool is_local + ByteType req_offset, TagType tag, [[maybe_unused]] bool is_local ) { auto const& state = *msg->state; diff --git a/src/vt/rdmahandle/handle.index.impl.h b/src/vt/rdmahandle/handle.index.impl.h index 1fbf6072c7..73ed0ad103 100644 --- a/src/vt/rdmahandle/handle.index.impl.h +++ b/src/vt/rdmahandle/handle.index.impl.h @@ -103,7 +103,7 @@ void Handle< template void Handle< T,E,I,typename std::enable_if_t::value> ->::lock(Lock l, I const& index) { +>::lock([[maybe_unused]] Lock l, [[maybe_unused]] I const& index) { //@todo: implement this } @@ -141,7 +141,7 @@ template void Handle< T,E,I,typename std::enable_if_t::value> >::get( - I const& index, std::size_t len, int offset, Lock l + I const& index, std::size_t len, int offset, [[maybe_unused]] Lock l ) { auto proxy = vt::objgroup::proxy::Proxy>(proxy_); proxy.get()->rget(index, len, offset); diff --git a/src/vt/rdmahandle/handle.node.impl.h b/src/vt/rdmahandle/handle.node.impl.h index 702552a755..cc6a932eca 100644 --- a/src/vt/rdmahandle/handle.node.impl.h +++ b/src/vt/rdmahandle/handle.node.impl.h @@ -80,7 +80,7 @@ template void Handle< T,E,I,typename std::enable_if_t::value> >::get( - vt::NodeType node, std::size_t len, int offset, Lock l + vt::NodeType node, std::size_t len, int offset, [[maybe_unused]] Lock l ) { rget(node, len, offset); } diff --git a/src/vt/rdmahandle/holder.impl.h b/src/vt/rdmahandle/holder.impl.h index 9cf8057d8b..a324808283 100644 --- a/src/vt/rdmahandle/holder.impl.h +++ b/src/vt/rdmahandle/holder.impl.h @@ -53,8 +53,8 @@ namespace vt { namespace rdma { template template void Holder::addHandle( - HandleKey key, ElemType lin, Handle han, std::size_t in_count, - bool uniform_size + HandleKey key, [[maybe_unused]] ElemType lin, + Handle han, std::size_t in_count, bool uniform_size ) { handle_ = han; key_ = key; diff --git a/src/vt/rdmahandle/manager.impl.h b/src/vt/rdmahandle/manager.impl.h index d1fb92591c..4c48e7565d 100644 --- a/src/vt/rdmahandle/manager.impl.h +++ b/src/vt/rdmahandle/manager.impl.h @@ -153,7 +153,7 @@ HandleSet Manager::makeHandleSetCollectiveObjGroup( LookupT max_lookup, std::unordered_map const& map, bool dense_start_with_zero, - bool uniform_size + [[maybe_unused]] bool uniform_size ) { using LookupType = LookupT; using IndexType = typename HandleSet::IndexType; diff --git a/src/vt/runnable/runnable.cc b/src/vt/runnable/runnable.cc index 778d8e1fac..3dddae4860 100644 --- a/src/vt/runnable/runnable.cc +++ b/src/vt/runnable/runnable.cc @@ -220,7 +220,7 @@ void RunnableNew::finish(TimeType time) { #endif } -void RunnableNew::suspend(TimeType time) { +void RunnableNew::suspend([[maybe_unused]] TimeType time) { #if vt_check_enabled(fcontext) contexts_.setcontext.suspend(); if (contexts_.has_td) contexts_.td.suspend(); @@ -233,7 +233,7 @@ void RunnableNew::suspend(TimeType time) { #endif } -void RunnableNew::resume(TimeType time) { +void RunnableNew::resume([[maybe_unused]] TimeType time) { #if vt_check_enabled(fcontext) contexts_.setcontext.resume(); if (contexts_.has_td) contexts_.td.resume(); diff --git a/src/vt/runnable/runnable.h b/src/vt/runnable/runnable.h index a4cc408080..50c929511c 100644 --- a/src/vt/runnable/runnable.h +++ b/src/vt/runnable/runnable.h @@ -106,7 +106,9 @@ struct RunnableNew { * \param[in] in_is_threaded whether the handler can be run with a thread */ template - RunnableNew(MsgSharedPtr const& in_msg, bool in_is_threaded) + RunnableNew( + MsgSharedPtr const& in_msg, [[maybe_unused]] bool in_is_threaded + ) : msg_(in_msg.template to()) #if vt_check_enabled(fcontext) , is_threaded_(in_is_threaded) @@ -118,7 +120,7 @@ struct RunnableNew { * * \param[in] in_is_threaded whether the handler can be run with a thread */ - explicit RunnableNew(bool in_is_threaded) + explicit RunnableNew([[maybe_unused]] bool in_is_threaded) #if vt_check_enabled(fcontext) : is_threaded_(in_is_threaded) #endif diff --git a/src/vt/runtime/component/base.h b/src/vt/runtime/component/base.h index 7ec0b13048..c6d03cf69f 100644 --- a/src/vt/runtime/component/base.h +++ b/src/vt/runtime/component/base.h @@ -103,7 +103,7 @@ struct BaseComponent : Diagnostic, Bufferable, Progressable { friend struct ComponentPack; template - void serialize(Serializer& s) {} + void serialize([[maybe_unused]] Serializer& s) {} }; }}} /* end namespace vt::runtime::component */ diff --git a/src/vt/runtime/component/component.h b/src/vt/runtime/component/component.h index 2a1a1b7d97..720f737349 100644 --- a/src/vt/runtime/component/component.h +++ b/src/vt/runtime/component/component.h @@ -154,7 +154,9 @@ struct Component : BaseComponent { * * \return no units processed */ - virtual int progress(TimeType current_time) override { return 0; } + virtual int progress([[maybe_unused]] TimeType current_time) override { + return 0; + } /** * \brief Empty default diagnostic dump state @@ -188,7 +190,7 @@ struct PollableComponent : Component { * * \return number of units processed---zero */ - virtual int progress(TimeType current_time) override { + virtual int progress([[maybe_unused]] TimeType current_time) override { vtAbort("PollableComponent should override the empty progress function"); return 0; } diff --git a/src/vt/runtime/component/component_dep.h b/src/vt/runtime/component/component_dep.h index 0a313ad94b..859781d94d 100644 --- a/src/vt/runtime/component/component_dep.h +++ b/src/vt/runtime/component/component_dep.h @@ -62,8 +62,7 @@ struct AddDep { template <> struct AddDep<> { - static void add(registry::AutoHandlerType t) { - } + static void add([[maybe_unused]] registry::AutoHandlerType t) { } }; struct ComponentRegistry { diff --git a/src/vt/runtime/component/component_pack.impl.h b/src/vt/runtime/component/component_pack.impl.h index dad871c922..43277ce94b 100644 --- a/src/vt/runtime/component/component_pack.impl.h +++ b/src/vt/runtime/component/component_pack.impl.h @@ -51,7 +51,9 @@ namespace vt { namespace runtime { namespace component { namespace { template -std::unique_ptr tupleConsImpl(Tuple&& tup, std::index_sequence seq) { +std::unique_ptr tupleConsImpl( + Tuple&& tup, [[maybe_unused]] std::index_sequence seq +) { return T::template staticInit(std::get(std::forward(tup))...); } diff --git a/src/vt/runtime/runtime.cc b/src/vt/runtime/runtime.cc index 51ace6b1c9..f8ad7f36d1 100644 --- a/src/vt/runtime/runtime.cc +++ b/src/vt/runtime/runtime.cc @@ -272,7 +272,7 @@ void Runtime::pauseForDebugger() { handleSignalFailure(); } -/*static*/ void Runtime::sigHandlerUsr1(int sig) { +/*static*/ void Runtime::sigHandlerUsr1([[maybe_unused]] int sig) { Runtime::sig_user_1_ = true; } @@ -583,8 +583,8 @@ void Runtime::abort(std::string const abort_str, ErrorCodeType const code) { } void Runtime::output( - std::string const abort_str, ErrorCodeType const code, bool error, - bool decorate, bool formatted + std::string const abort_str, [[maybe_unused]] ErrorCodeType const code, + bool error, bool decorate, bool formatted ) { auto node = theContext ? theContext->getNode() : -1; auto green = debug::green(); @@ -946,7 +946,7 @@ namespace { * \param comm the MPI communicator * \param errc pointer to the error code */ - void mpiErrorHandler(MPI_Comm *comm, int *errc, ...) { + void mpiErrorHandler([[maybe_unused]] MPI_Comm *comm, int *errc, ...) { int len = MPI_MAX_ERROR_STRING; char msg[MPI_MAX_ERROR_STRING]; MPI_Error_string(*errc, msg, &len); diff --git a/src/vt/runtime/runtime_diagnostics.cc b/src/vt/runtime/runtime_diagnostics.cc index fc03ef3b0a..683a081715 100644 --- a/src/vt/runtime/runtime_diagnostics.cc +++ b/src/vt/runtime/runtime_diagnostics.cc @@ -260,7 +260,8 @@ void Runtime::computeAndPrintDiagnostics() { } }, [&]( - std::string const& comp, component::detail::DiagnosticBase* diag, + [[maybe_unused]] std::string const& comp, + component::detail::DiagnosticBase* diag, component::DiagnosticErasedValue* str ) { table[table.cur_row()][1].set_cell_content_fg_color(fort::color::green); diff --git a/src/vt/scheduler/scheduler.impl.h b/src/vt/scheduler/scheduler.impl.h index c7834bbd4e..448f3977b7 100644 --- a/src/vt/scheduler/scheduler.impl.h +++ b/src/vt/scheduler/scheduler.impl.h @@ -138,7 +138,7 @@ void Scheduler::enqueue(RunT r) { } template -void Scheduler::enqueue(PriorityType priority, RunT r) { +void Scheduler::enqueue([[maybe_unused]] PriorityType priority, RunT r) { bool const is_term = false; # if vt_check_enabled(priorities) work_queue_.emplace(UnitType(is_term, std::move(r), priority)); diff --git a/src/vt/scheduler/suspended_units.cc b/src/vt/scheduler/suspended_units.cc index 1e24820253..3f4ebb9ca4 100644 --- a/src/vt/scheduler/suspended_units.cc +++ b/src/vt/scheduler/suspended_units.cc @@ -48,7 +48,9 @@ namespace vt { namespace sched { void SuspendedUnits::addSuspended( - ThreadIDType tid, RunnablePtrType runnable, PriorityType p + [[maybe_unused]] ThreadIDType tid, + [[maybe_unused]] RunnablePtrType runnable, + [[maybe_unused]] PriorityType p ) { #if vt_check_enabled(fcontext) vtAssert(runnable->isSuspended(), "Runnable must be suspended to add"); @@ -65,7 +67,7 @@ void SuspendedUnits::addSuspended( #endif } -void SuspendedUnits::resumeRunnable(ThreadIDType tid) { +void SuspendedUnits::resumeRunnable([[maybe_unused]] ThreadIDType tid) { #if vt_check_enabled(fcontext) auto iter = units_.find(tid); vtAbortIf(iter == units_.end(), "Must have valid thread ID to resume"); diff --git a/src/vt/serialization/messaging/serialized_messenger.impl.h b/src/vt/serialization/messaging/serialized_messenger.impl.h index 5cd8a56cc6..4ad07a4265 100644 --- a/src/vt/serialization/messaging/serialized_messenger.impl.h +++ b/src/vt/serialization/messaging/serialized_messenger.impl.h @@ -431,7 +431,9 @@ template ); auto base_msg = user_msg.template to(); - return messaging::PendingSend(base_msg, [=](MsgPtr in) { + return messaging::PendingSend( + base_msg, [=]([[maybe_unused]] MsgPtr in + ) { bool const is_obj = HandlerManager::isHandlerObjGroup(typed_handler); if (is_obj) { objgroup::dispatchObjGroup( diff --git a/src/vt/termination/dijkstra-scholten/ds.cc b/src/vt/termination/dijkstra-scholten/ds.cc index a38c8c53f9..6a07a4e3e2 100644 --- a/src/vt/termination/dijkstra-scholten/ds.cc +++ b/src/vt/termination/dijkstra-scholten/ds.cc @@ -214,7 +214,8 @@ void TermDS::msgProcessed(NodeType predecessor, CountType count) { template void TermDS::needAck( - NodeType const predecessor, CountType const count + [[maybe_unused]] NodeType const predecessor, + [[maybe_unused]] CountType const count ) { vtAssertInfo( 5 && (C == processedSum - (ackedArbitrary + ackedParent)), diff --git a/src/vt/termination/termination.cc b/src/vt/termination/termination.cc index cd9517510c..d4255f8eb1 100644 --- a/src/vt/termination/termination.cc +++ b/src/vt/termination/termination.cc @@ -542,7 +542,9 @@ void TerminationDetector::startEpochGraphBuild() { } } -/*static*/ void TerminationDetector::hangCheckHandler(HangCheckMsg* msg) { +/*static*/ void TerminationDetector::hangCheckHandler( + [[maybe_unused]] HangCheckMsg* msg +) { fmt::print("{}:hangCheckHandler\n",theContext()->getNode()); theTerm()->hang_.activateEpoch(); } diff --git a/src/vt/topos/location/location.impl.h b/src/vt/topos/location/location.impl.h index d547a16b35..e839c9d812 100644 --- a/src/vt/topos/location/location.impl.h +++ b/src/vt/topos/location/location.impl.h @@ -258,8 +258,8 @@ void EntityLocationCoord::entityEmigrated( template void EntityLocationCoord::entityImmigrated( - EntityID const& id, NodeType const& home_node, NodeType const& from, - LocMsgActionType msg_action + EntityID const& id, NodeType const& home_node, + [[maybe_unused]] NodeType const& from, LocMsgActionType msg_action ) { // @todo: currently `from' is unused, but is passed to this method in case we // need it in the future diff --git a/src/vt/topos/mapping/dense/dense.impl.h b/src/vt/topos/mapping/dense/dense.impl.h index 3b8b43ee87..da1c030d75 100644 --- a/src/vt/topos/mapping/dense/dense.impl.h +++ b/src/vt/topos/mapping/dense/dense.impl.h @@ -75,7 +75,9 @@ NodeType defaultDenseIndexNDMap(IdxNDPtr idx, IdxNDPtr max, NodeType n // Default round robin mappings template -NodeType dense1DRoundRobinMap(Idx1DPtr idx, Idx1DPtr max, NodeType nx) { +NodeType dense1DRoundRobinMap( + Idx1DPtr idx, [[maybe_unused]] Idx1DPtr max, NodeType nx +) { return idx->x() % nx; } diff --git a/src/vt/trace/trace.cc b/src/vt/trace/trace.cc index 7d3b8331a1..833b20eb9a 100644 --- a/src/vt/trace/trace.cc +++ b/src/vt/trace/trace.cc @@ -486,7 +486,7 @@ TraceEventIDType Trace::messageCreationBcast( TraceEventIDType Trace::messageRecv( TraceEntryIDType const ep, TraceMsgLenType const len, - NodeType const from_node, TimeType const time + [[maybe_unused]] NodeType const from_node, TimeType const time ) { if (not checkDynamicRuntimeEnabled()) { return no_trace_event; diff --git a/src/vt/trace/trace_lite.cc b/src/vt/trace/trace_lite.cc index 035d3370e3..06d574c782 100644 --- a/src/vt/trace/trace_lite.cc +++ b/src/vt/trace/trace_lite.cc @@ -182,7 +182,7 @@ void TraceLite::finalizeStandalone() { } #endif -void TraceLite::setupNames(std::string const& in_prog_name) { +void TraceLite::setupNames([[maybe_unused]] std::string const& in_prog_name) { if (not theConfig()->vt_trace) { return; } @@ -714,7 +714,9 @@ void TraceLite::outputControlFile(std::ofstream& file) { } /*static*/ void TraceLite::outputHeader( - vt_gzFile* file, NodeType const node, TimeType const start) { + vt_gzFile* file, [[maybe_unused]] NodeType const node, + [[maybe_unused]] TimeType const start +) { gzFile gzfile = file->file_type; // Output header for projections file // '6' means COMPUTATION_BEGIN to Projections: this starts a trace @@ -723,7 +725,9 @@ void TraceLite::outputControlFile(std::ofstream& file) { } /*static*/ void TraceLite::outputFooter( - vt_gzFile* file, NodeType const node, TimeType const start) { + vt_gzFile* file, [[maybe_unused]] NodeType const node, + TimeType const start +) { gzFile gzfile = file->file_type; // Output footer for projections file, // '7' means COMPUTATION_END to Projections diff --git a/src/vt/trace/trace_log.h b/src/vt/trace/trace_log.h index 3447f2ab4c..1b8443f700 100644 --- a/src/vt/trace/trace_log.h +++ b/src/vt/trace/trace_log.h @@ -259,7 +259,7 @@ struct Log final { // User event Log( TimeType const in_time, TraceConstantsType const in_type, - std::string const& in_note, UserDataType in_data + std::string const& in_note, [[maybe_unused]] UserDataType in_data ) : time(in_time), type(in_type), data(Data::UserData{in_note, 0, 0, false}) { diff --git a/src/vt/utils/memory/memory_reporter.h b/src/vt/utils/memory/memory_reporter.h index ca7c0c84d0..88a41b8573 100644 --- a/src/vt/utils/memory/memory_reporter.h +++ b/src/vt/utils/memory/memory_reporter.h @@ -55,7 +55,7 @@ struct Reporter { virtual std::string getName() = 0; template - void serialize(Serializer& s) { } + void serialize([[maybe_unused]] Serializer& s) { } }; }}} /* end namespace vt::util::memory */ diff --git a/src/vt/vrt/collection/balance/baselb/baselb.cc b/src/vt/vrt/collection/balance/baselb/baselb.cc index 1d94f2ce69..4f19fc9648 100644 --- a/src/vt/vrt/collection/balance/baselb/baselb.cc +++ b/src/vt/vrt/collection/balance/baselb/baselb.cc @@ -93,7 +93,7 @@ LoadType BaseLB::loadMilli(LoadType const& load) { void BaseLB::importProcessorData( StatisticMapType const& in_stats, ElementCommType const& comm_in, - balance::DataMapType const& in_data_map + [[maybe_unused]] balance::DataMapType const& in_data_map ) { vt_debug_print( normal, lb, diff --git a/src/vt/vrt/collection/balance/hierarchicallb/hierlb.cc b/src/vt/vrt/collection/balance/hierarchicallb/hierlb.cc index 3252e65d6b..9eab2a25fe 100644 --- a/src/vt/vrt/collection/balance/hierarchicallb/hierlb.cc +++ b/src/vt/vrt/collection/balance/hierarchicallb/hierlb.cc @@ -405,7 +405,7 @@ void HierarchicalLB::startMigrations() { void HierarchicalLB::downTreeSend( NodeType const node, NodeType const from, ObjSampleType const& excess, - bool const final_child, std::size_t const& approx_size + bool const final_child, [[maybe_unused]] std::size_t const& approx_size ) { proxy[node].template send( from, excess, final_child @@ -460,7 +460,9 @@ void HierarchicalLB::lbTreeUpHandler(LBTreeUpMsg* msg) { ); } -std::size_t HierarchicalLB::getSize(ObjSampleType const& sample) { +std::size_t HierarchicalLB::getSize( + [[maybe_unused]] ObjSampleType const& sample +) { return 0; } diff --git a/src/vt/vrt/collection/balance/lb_common.h b/src/vt/vrt/collection/balance/lb_common.h index ed333c78aa..81fe9a4e13 100644 --- a/src/vt/vrt/collection/balance/lb_common.h +++ b/src/vt/vrt/collection/balance/lb_common.h @@ -147,7 +147,7 @@ struct ReassignmentMsg : vt::Message { { } template - void serialize(SerializerT& s) { + void serialize([[maybe_unused]] SerializerT& s) { vtAssert(false, "Must never be called"); } diff --git a/src/vt/vrt/collection/balance/model/load_model.h b/src/vt/vrt/collection/balance/model/load_model.h index 2bf24f68dc..b3e5111bfc 100644 --- a/src/vt/vrt/collection/balance/model/load_model.h +++ b/src/vt/vrt/collection/balance/model/load_model.h @@ -241,7 +241,9 @@ struct LoadModel * * \return How much computation time the object required */ - virtual LoadType getRawLoad(ElementIDStruct object, PhaseOffset when) const { + virtual LoadType getRawLoad( + [[maybe_unused]] ElementIDStruct object, [[maybe_unused]] PhaseOffset when + ) const { vtAbort( "LoadModel::getRawLoad() called on a model that does not implement it" ); @@ -261,7 +263,9 @@ struct LoadModel * * \return The user data associated with the object */ - virtual ElmUserDataType getUserData(ElementIDStruct object, PhaseOffset when) const { + virtual ElmUserDataType getUserData( + [[maybe_unused]] ElementIDStruct object, [[maybe_unused]] PhaseOffset when + ) const { vtAbort( "LoadModel::getUserData() called on a model that does not implement it" ); @@ -280,7 +284,9 @@ struct LoadModel * The `updateLoads` method must have been called before any call to * this. */ - virtual LoadType getModeledComm(ElementIDStruct object, PhaseOffset when) const { + virtual LoadType getModeledComm( + [[maybe_unused]] ElementIDStruct object, [[maybe_unused]] PhaseOffset when + ) const { return {}; } @@ -345,7 +351,7 @@ struct LoadModel virtual int getNumSubphases() const = 0; template - void serialize(Serializer& s) {} + void serialize([[maybe_unused]] Serializer& s) {} }; // struct LoadModel }}}} // namespaces diff --git a/src/vt/vrt/collection/balance/offlinelb/offlinelb.h b/src/vt/vrt/collection/balance/offlinelb/offlinelb.h index a986133898..0d46f6c102 100644 --- a/src/vt/vrt/collection/balance/offlinelb/offlinelb.h +++ b/src/vt/vrt/collection/balance/offlinelb/offlinelb.h @@ -62,7 +62,7 @@ struct OfflineLB : BaseLB { void init(objgroup::proxy::Proxy in_proxy); void runLB(LoadType) override; - void inputParams(balance::ConfigEntry* config) override { } + void inputParams([[maybe_unused]] balance::ConfigEntry* config) override { } static std::unordered_map getInputKeysWithHelp() { return std::unordered_map{}; diff --git a/src/vt/vrt/collection/balance/rotatelb/rotatelb.cc b/src/vt/vrt/collection/balance/rotatelb/rotatelb.cc index bed2b2cda7..818618458e 100644 --- a/src/vt/vrt/collection/balance/rotatelb/rotatelb.cc +++ b/src/vt/vrt/collection/balance/rotatelb/rotatelb.cc @@ -59,7 +59,7 @@ RotateLB::getInputKeysWithHelp() { return std::unordered_map{}; } -void RotateLB::inputParams(balance::ConfigEntry* config) { } +void RotateLB::inputParams([[maybe_unused]] balance::ConfigEntry* config) { } void RotateLB::runLB(LoadType) { auto const& this_node = theContext()->getNode(); diff --git a/src/vt/vrt/collection/balance/temperedlb/temperedlb.cc b/src/vt/vrt/collection/balance/temperedlb/temperedlb.cc index 5ae5ce94e4..781aa527d0 100644 --- a/src/vt/vrt/collection/balance/temperedlb/temperedlb.cc +++ b/src/vt/vrt/collection/balance/temperedlb/temperedlb.cc @@ -1012,7 +1012,8 @@ std::vector TemperedLB::makeSufficientlyUnderloaded( TemperedLB::ElementLoadType::iterator TemperedLB::selectObject( - LoadType size, ElementLoadType& load, std::set const& available + [[maybe_unused]] LoadType size, ElementLoadType& load, + std::set const& available ) { if (available.size() == 0) { return load.end(); diff --git a/src/vt/vrt/collection/balance/workload_replay.cc b/src/vt/vrt/collection/balance/workload_replay.cc index 91433e5c4b..7d6f8e145b 100644 --- a/src/vt/vrt/collection/balance/workload_replay.cc +++ b/src/vt/vrt/collection/balance/workload_replay.cc @@ -289,7 +289,7 @@ WorkloadDataMigrator::construct(std::shared_ptr model_base) { void WorkloadDataMigrator::runLB(LoadType) { } -void WorkloadDataMigrator::inputParams(ConfigEntry* spec) { } +void WorkloadDataMigrator::inputParams([[maybe_unused]] ConfigEntry* spec) { } std::unordered_map WorkloadDataMigrator::getInputKeysWithHelp() { diff --git a/src/vt/vrt/collection/manager.impl.h b/src/vt/vrt/collection/manager.impl.h index bf1ecd151e..6864393984 100644 --- a/src/vt/vrt/collection/manager.impl.h +++ b/src/vt/vrt/collection/manager.impl.h @@ -252,7 +252,7 @@ template "broadcast apply: size={}\n", elm_holder->numElements() ); elm_holder->foreach([col_msg, msg, handler]( - IndexT const& idx, Indexable* base + [[maybe_unused]] IndexT const& idx, Indexable* base ) { vtAssert(base != nullptr, "Must be valid pointer"); @@ -446,7 +446,9 @@ void CollectionManager::invokeCollective( auto elm_holder = findElmHolder(untyped_proxy); auto const this_node = theContext()->getNode(); - elm_holder->foreach([&](IndexType const& idx, Indexable* ptr) { + elm_holder->foreach( + [&]([[maybe_unused]] IndexType const& idx, Indexable* ptr + ) { // be careful not to forward here as we are reusing args runnable::makeRunnableVoid(false, uninitialized_handler, this_node) .withCollection(ptr) @@ -960,7 +962,8 @@ messaging::PendingSend CollectionManager::reduceMsg( template *f> messaging::PendingSend CollectionManager::reduceMsgExpr( CollectionProxyWrapType const& proxy, - MsgT *const msg, ReduceIdxFuncType expr_fn, + MsgT *const msg, + [[maybe_unused]] ReduceIdxFuncType expr_fn, ReduceStamp stamp, typename ColT::IndexType const& idx ) { auto const mapped_node = getMappedNode(proxy, idx); @@ -1506,7 +1509,8 @@ ColT* CollectionManager::tryGetLocalPtr( template ModifierToken CollectionManager::beginModification( - CollectionProxyWrapType const& proxy, std::string const& label + [[maybe_unused]] CollectionProxyWrapType const& proxy, + std::string const& label ) { auto epoch = theTerm()->makeEpochCollective(label); @@ -2191,7 +2195,8 @@ template template void CollectionManager::restoreFromFileInPlace( - CollectionProxyWrapType proxy, typename ColT::IndexType range, + CollectionProxyWrapType proxy, + [[maybe_unused]] typename ColT::IndexType range, std::string const& file_base ) { using IndexType = typename ColT::IndexType; @@ -2308,7 +2313,9 @@ messaging::PendingSend CollectionManager::schedule( MsgT msg, bool execute_now, EpochType cur_epoch, ActionType action ) { theTerm()->produce(cur_epoch); - return messaging::PendingSend(msg, [=](MsgVirtualPtr inner_msg){ + return messaging::PendingSend( + msg, [=]([[maybe_unused]] MsgVirtualPtr inner_msg + ){ auto fn = [=]{ theMsg()->pushEpoch(cur_epoch); action(); diff --git a/src/vt/vrt/context/context_vrt.h b/src/vt/vrt/context/context_vrt.h index ea7fc29cc4..1fe80eb2fa 100644 --- a/src/vt/vrt/context/context_vrt.h +++ b/src/vt/vrt/context/context_vrt.h @@ -54,12 +54,12 @@ namespace vt { namespace vrt { struct VirtualContext : VrtBase { VirtualContext() = default; - VirtualContext(bool const in_is_main) { } + VirtualContext([[maybe_unused]] bool const in_is_main) { } friend struct VirtualContextAttorney; template - void serialize(Serializer& s) {} + void serialize([[maybe_unused]] Serializer& s) {} }; diff --git a/tests/unit/active/test_active_send.cc b/tests/unit/active/test_active_send.cc index f42c276f3d..cd2dc33e6d 100644 --- a/tests/unit/active/test_active_send.cc +++ b/tests/unit/active/test_active_send.cc @@ -242,7 +242,7 @@ TEST_F(TestActiveSend, test_active_message_serialization) { EXPECT_EQ(handler_count, num_msg_sent); } -void testPropertiesHandler(int a, double b) { +void testPropertiesHandler([[maybe_unused]] int a, [[maybe_unused]] double b) { // do nothing } diff --git a/tests/unit/active/test_async_op_mpi.cc b/tests/unit/active/test_async_op_mpi.cc index dff5e04e59..1e004a584b 100644 --- a/tests/unit/active/test_async_op_mpi.cc +++ b/tests/unit/active/test_async_op_mpi.cc @@ -59,7 +59,7 @@ using MyMsg = Message; struct MyObjGroup { - void handler(MyMsg* msg) { + void handler([[maybe_unused]] MyMsg* msg) { auto const this_node = theContext()->getNode(); auto const num_nodes = theContext()->getNumNodes(); auto const to_node = (this_node + 1) % num_nodes; diff --git a/tests/unit/active/test_async_op_threads.cc b/tests/unit/active/test_async_op_threads.cc index 0faf97c982..6d1dc9ebbf 100644 --- a/tests/unit/active/test_async_op_threads.cc +++ b/tests/unit/active/test_async_op_threads.cc @@ -62,7 +62,7 @@ struct MyCol : vt::Collection { using MyMsg = vt::CollectionMessage; - void handler(MyMsg* msg) { + void handler([[maybe_unused]] MyMsg* msg) { auto const this_node = theContext()->getNode(); auto const num_nodes = theContext()->getNumNodes(); auto const to_node = (this_node + 1) % num_nodes; @@ -130,7 +130,7 @@ struct MyCol : vt::Collection { theMsg()->popEpoch(cur_ep); } - void handlerInvoke(MyMsg* msg) { + void handlerInvoke([[maybe_unused]] MyMsg* msg) { auto const this_node = theContext()->getNode(); auto const num_nodes = theContext()->getNumNodes(); auto const to_node = (this_node + 1) % num_nodes; diff --git a/tests/unit/active/test_pending_send.cc b/tests/unit/active/test_pending_send.cc index 6d18bcd834..fcf1118221 100644 --- a/tests/unit/active/test_pending_send.cc +++ b/tests/unit/active/test_pending_send.cc @@ -60,7 +60,7 @@ struct TestPendingSend : TestParallelHarness { vt::NodeType sender = uninitialized_destination; }; static void handlerPong(TestMsg*) { delivered = true; } - static void handlerPing(TestMsg* in_msg) { + static void handlerPing([[maybe_unused]] TestMsg* in_msg) { auto const this_node = theContext()->getNode(); auto const num_nodes = theContext()->getNumNodes(); auto prev = this_node - 1 >= 0 ? this_node - 1 : num_nodes - 1; diff --git a/tests/unit/collection/test_checkpoint.extended.cc b/tests/unit/collection/test_checkpoint.extended.cc index ff76861d5f..5f7b7c4666 100644 --- a/tests/unit/collection/test_checkpoint.extended.cc +++ b/tests/unit/collection/test_checkpoint.extended.cc @@ -389,7 +389,10 @@ TEST_F(TestCheckpoint, test_checkpoint_in_place_3) { // 2. Checkpoint the collection // 3. Restore the collection and validate it -vt::NodeType map(vt::Index3D* idx, vt::Index3D* max_idx, vt::NodeType num_nodes) { +vt::NodeType map( + vt::Index3D* idx, [[maybe_unused]] vt::Index3D* max_idx, + vt::NodeType num_nodes +) { return (idx->x() % (num_nodes-1))+1; } diff --git a/tests/unit/collection/test_collection_common.h b/tests/unit/collection/test_collection_common.h index e14553966d..84448a69cb 100644 --- a/tests/unit/collection/test_collection_common.h +++ b/tests/unit/collection/test_collection_common.h @@ -114,8 +114,8 @@ static test_data::C magic_C_t_ = test_data::C{"test123",34}; template struct ConstructTuple { static Tuple construct() { return Tuple{}; } - static void print(Tuple t) { } - static void isCorrect(Tuple t) { } + static void print([[maybe_unused]] Tuple t) { } + static void isCorrect([[maybe_unused]] Tuple t) { } }; #define CONSTRUCT_TUPLE_TYPE(PARAM_TYPE,PARAM_NAME) \ diff --git a/tests/unit/collection/test_collection_construct_common.h b/tests/unit/collection/test_collection_construct_common.h index f27a59b0c5..eaa6bb4179 100644 --- a/tests/unit/collection/test_collection_construct_common.h +++ b/tests/unit/collection/test_collection_construct_common.h @@ -71,7 +71,9 @@ struct ConstructHandlers { typename CollectionT, typename MessageT = typename CollectionT::MsgType > - static void handler(CollectionT* col, MessageT* msg) { + static void handler( + [[maybe_unused]] CollectionT* col, [[maybe_unused]] MessageT* msg + ) { // fmt::print( // "{}: constructed TestCol: idx.x()={}\n", // theContext()->getNode(), col->getIndex().x(), print_ptr(col) @@ -98,7 +100,7 @@ struct ConstructParams { IndexType idx, std::string const& label ) { return theCollection()->constructCollective( - idx, [=](IndexType my_idx) { + idx, [=]([[maybe_unused]] IndexType my_idx) { return std::make_unique(); }, label ); diff --git a/tests/unit/collection/test_collection_group.extended.cc b/tests/unit/collection/test_collection_group.extended.cc index cb5c8e26dc..d85ca5282d 100644 --- a/tests/unit/collection/test_collection_group.extended.cc +++ b/tests/unit/collection/test_collection_group.extended.cc @@ -91,7 +91,10 @@ struct ColA : Collection { bool reduce_test = false; }; -void colHandler(typename ColA::TestDataMsg::CollectionType* type, ColA::TestDataMsg*) { +void colHandler( + [[maybe_unused]] typename ColA::TestDataMsg::CollectionType* type, + ColA::TestDataMsg* +) { --elem_counter; } @@ -121,7 +124,7 @@ TEST_F(TestCollectionGroup, test_collection_group_2) { auto const range = Index1D(8); auto const proxy = theCollection()->constructCollective( - range, [](vt::Index1D idx) { + range, []([[maybe_unused]] vt::Index1D idx) { ++elem_counter; return std::make_unique(); }, "test_collection_group_2" @@ -141,7 +144,7 @@ TEST_F(TestCollectionGroup, test_collection_group_3) { auto const range = Index1D(8); auto const proxy = theCollection()->constructCollective( - range, [](vt::Index1D idx) { + range, []([[maybe_unused]] vt::Index1D idx) { ++elem_counter; return std::make_unique(); }, "test_collection_group_3" diff --git a/tests/unit/collection/test_index_types.extended.cc b/tests/unit/collection/test_index_types.extended.cc index 38ac039f18..838cb905f7 100644 --- a/tests/unit/collection/test_index_types.extended.cc +++ b/tests/unit/collection/test_index_types.extended.cc @@ -83,7 +83,7 @@ struct ColMsg : CollectionMessage> { }; template -void TestCol::handler(ColMsg* msg) {} +void TestCol::handler([[maybe_unused]] ColMsg* msg) {} } /* end namespace test_index_types_ */ diff --git a/tests/unit/collection/test_insert.extended.cc b/tests/unit/collection/test_insert.extended.cc index 7c104b38cb..05dff7b715 100644 --- a/tests/unit/collection/test_insert.extended.cc +++ b/tests/unit/collection/test_insert.extended.cc @@ -78,7 +78,7 @@ struct InsertTest : Collection { void work(WorkMsg* msg); }; -void InsertTest::work(WorkMsg* msg) { +void InsertTest::work([[maybe_unused]] WorkMsg* msg) { ::fmt::print("node={}: num_work={}, idx={}\n", theContext()->getNode(), num_work, getIndex()); num_work++; } diff --git a/tests/unit/collection/test_list_insert.cc b/tests/unit/collection/test_list_insert.cc index 7dd0504940..c7aa4720a8 100644 --- a/tests/unit/collection/test_list_insert.cc +++ b/tests/unit/collection/test_list_insert.cc @@ -76,7 +76,7 @@ struct ListInsertTest : Collection { void work(WorkMsg* msg); }; -void ListInsertTest::work(WorkMsg* msg) { +void ListInsertTest::work([[maybe_unused]] WorkMsg* msg) { vt_print(gen, "num_work={}, idx={}\n", num_work, getIndex()); num_work++; } @@ -111,7 +111,7 @@ using ColProxyTypeNDC = CollectionIndexProxy { ).getProxy(); } - vt::NodeType map(IndexT* idx, int ndim, vt::NodeType num_nodes) override { + vt::NodeType map( + IndexT* idx, [[maybe_unused]] int ndim, vt::NodeType num_nodes + ) override { return idx->x() % num_nodes; } }; diff --git a/tests/unit/collection/test_query_context.cc b/tests/unit/collection/test_query_context.cc index 86470e0bde..42a6e6160b 100644 --- a/tests/unit/collection/test_query_context.cc +++ b/tests/unit/collection/test_query_context.cc @@ -63,7 +63,7 @@ struct QueryTest : Collection { struct WorkMsg : CollectionMessage {}; -void QueryTest::work(WorkMsg* msg) { +void QueryTest::work([[maybe_unused]] WorkMsg* msg) { auto idx = vt::theCollection()->queryIndexContext(); auto proxy = vt::theCollection()->queryProxyContext(); EXPECT_EQ(*idx, this->getIndex()); diff --git a/tests/unit/collection/test_reduce_collection_race.cc b/tests/unit/collection/test_reduce_collection_race.cc index ad5cbef589..02e19760a1 100644 --- a/tests/unit/collection/test_reduce_collection_race.cc +++ b/tests/unit/collection/test_reduce_collection_race.cc @@ -52,7 +52,7 @@ struct MyCol : vt::Collection {}; static int multiplier = 0; -static void reduceTarget(MyCol* col, int val) { +static void reduceTarget([[maybe_unused]] MyCol* col, int val) { auto const num_nodes = theContext()->getNumNodes(); auto const num_elems = num_nodes * multiplier; fmt::print("reduce finished: val={}, num_elems={}\n", val, num_elems); diff --git a/tests/unit/collection/test_storage.cc b/tests/unit/collection/test_storage.cc index b707501b5c..356629b3a1 100644 --- a/tests/unit/collection/test_storage.cc +++ b/tests/unit/collection/test_storage.cc @@ -79,7 +79,7 @@ struct TestCol : Collection { testHandlerValues(msg); } - void testHandlerValues(TestMsg* msg) { + void testHandlerValues([[maybe_unused]] TestMsg* msg) { EXPECT_EQ(this->valGet("hello"), this->getIndex().x()); std::vector in_vec{5,4,1,7,3}; diff --git a/tests/unit/collectives/test_collectives_reduce.cc b/tests/unit/collectives/test_collectives_reduce.cc index bd5447ac16..863f68a449 100644 --- a/tests/unit/collectives/test_collectives_reduce.cc +++ b/tests/unit/collectives/test_collectives_reduce.cc @@ -81,7 +81,10 @@ struct Hello : vt::Collection { } }; -vt::NodeType map(vt::Index1D* idx, vt::Index1D* max_idx, vt::NodeType num_nodes) { +vt::NodeType map( + vt::Index1D* idx, [[maybe_unused]] vt::Index1D* max_idx, + vt::NodeType num_nodes +) { return (idx->x() % (num_nodes-1))+1; } diff --git a/tests/unit/group/test_group.cc b/tests/unit/group/test_group.cc index d3c425ae03..3e968fb57e 100644 --- a/tests/unit/group/test_group.cc +++ b/tests/unit/group/test_group.cc @@ -67,7 +67,7 @@ struct TestGroup : TestParallelHarness { SET_MIN_NUM_NODES_CONSTRAINT(2); } - static void groupHandler(TestMsg* msg) { + static void groupHandler([[maybe_unused]] TestMsg* msg) { auto const& this_node = theContext()->getNode(); num_recv++; fmt::print("{}: groupHandler: num_recv={}\n", this_node, num_recv); diff --git a/tests/unit/group/test_group.extended.cc b/tests/unit/group/test_group.extended.cc index a222164da0..628ddd2ab6 100644 --- a/tests/unit/group/test_group.extended.cc +++ b/tests/unit/group/test_group.extended.cc @@ -51,7 +51,7 @@ namespace vt { namespace tests { namespace unit { struct MySimpleMsg : ::vt::Message { }; -static void msgHandlerGroup(MySimpleMsg* msg) { +static void msgHandlerGroup([[maybe_unused]] MySimpleMsg* msg) { auto const cur_node = ::vt::theContext()->getNode(); vtAssert(cur_node % 2 == 0, "This handler should only execute on even nodes"); diff --git a/tests/unit/lb/test_lb_data_comm.cc b/tests/unit/lb/test_lb_data_comm.cc index fbc2b42d34..b0ab4e6c69 100644 --- a/tests/unit/lb/test_lb_data_comm.cc +++ b/tests/unit/lb/test_lb_data_comm.cc @@ -123,7 +123,7 @@ struct ColProxyMsg : vt::Message { }; struct ProxyMsg; struct MyObj { - void dummyHandler(MyObjMsg* msg) {} + void dummyHandler([[maybe_unused]] MyObjMsg* msg) {} void simulateObjGroupColTSends(ColProxyMsg* msg); void simulateObjGroupObjGroupSends(ProxyMsg* msg); void simulateObjGroupHandlerSends(MyMsg* msg); @@ -134,7 +134,7 @@ struct ProxyMsg : vt::CollectionMessage { ProxyType obj_proxy; }; -void handler2(MyCol* col, MyMsg*) {} +void handler2([[maybe_unused]] MyCol* col, MyMsg*) {} void MyObj::simulateObjGroupColTSends(ColProxyMsg* msg) { auto proxy = msg->proxy; @@ -171,7 +171,9 @@ void simulateColTColTSends(MyCol* col) { } } -void simulateColTObjGroupSends(MyCol* col, ProxyMsg* msg) { +void simulateColTObjGroupSends( + [[maybe_unused]] MyCol* col, ProxyMsg* msg +) { auto obj_proxy = msg->obj_proxy; auto this_node = theContext()->getNode(); auto num_nodes = theContext()->getNumNodes(); @@ -181,9 +183,9 @@ void simulateColTObjGroupSends(MyCol* col, ProxyMsg* msg) { } } -void bareDummyHandler(MyObjMsg* msg) {} +void bareDummyHandler([[maybe_unused]] MyObjMsg* msg) {} -void simulateColTHandlerSends(MyCol* col) { +void simulateColTHandlerSends([[maybe_unused]] MyCol* col) { auto this_node = theContext()->getNode(); auto num_nodes = theContext()->getNumNodes(); auto next = (this_node + 1) % num_nodes; @@ -193,7 +195,7 @@ void simulateColTHandlerSends(MyCol* col) { } } -void MyObj::simulateObjGroupHandlerSends(MyMsg* msg) { +void MyObj::simulateObjGroupHandlerSends([[maybe_unused]] MyMsg* msg) { auto this_node = theContext()->getNode(); auto num_nodes = theContext()->getNumNodes(); auto next = (this_node + 1) % num_nodes; @@ -229,7 +231,7 @@ void simulateHandlerObjGroupSends(ProxyMsg* msg) { } } -void simulateHandlerHandlerSends(MyMsg* msg) { +void simulateHandlerHandlerSends([[maybe_unused]] MyMsg* msg) { auto this_node = theContext()->getNode(); auto num_nodes = theContext()->getNumNodes(); auto next = (this_node + 1) % num_nodes; diff --git a/tests/unit/location/test_hops.extended.cc b/tests/unit/location/test_hops.extended.cc index 532c5c576a..4f12c7d89a 100644 --- a/tests/unit/location/test_hops.extended.cc +++ b/tests/unit/location/test_hops.extended.cc @@ -118,9 +118,7 @@ struct TestColl : Collection { EXPECT_TRUE(not m->do_check_ or m->getHops() <= 1); } - void cont(TestMsg* m) { - - } + void cont([[maybe_unused]] TestMsg* m) { } template void serialize(SerializerT& s) { diff --git a/tests/unit/location/test_location.cc b/tests/unit/location/test_location.cc index 190cd2e50d..ec0af5af85 100644 --- a/tests/unit/location/test_location.cc +++ b/tests/unit/location/test_location.cc @@ -135,7 +135,9 @@ TEST_F(TestLocation, test_unregister_multiple_entities) /* NOLINT */ { for (auto i = 0; i < nb_nodes; ++i) { // The entity can be located on the node where it has been registered vt::theLocMan()->virtual_loc->getLocation( - location::default_entity + i, i, [](vt::NodeType node) { + location::default_entity + i, i, + []([[maybe_unused]] vt::NodeType node + ) { // This lambda should not be executed if the unregisterEntity works // correctly FAIL() << "entity should have been yet unregistered"; @@ -366,7 +368,8 @@ TYPED_TEST_P(TestLocationRoute, test_entity_cache_hits) /* NOLINT */ { // register entity and count received messages if (my_node == home) { vt::theLocMan()->virtual_loc->registerEntity( - entity, my_node, [&](vt::BaseMessage* msg){ nb_received++; } + entity, my_node, + [&]([[maybe_unused]] vt::BaseMessage* msg){ nb_received++; } ); } @@ -410,7 +413,7 @@ TYPED_TEST_P(TestLocationRoute, test_entity_cache_migrated_entity) /* NOLINT */{ // receive migrated entity: register it and keep in cache vt::theLocMan()->virtual_loc->entityImmigrated( entity, home, my_node, - [entity, &nb_received](vt::BaseMessage* in_msg) { + [entity, &nb_received]([[maybe_unused]] vt::BaseMessage* in_msg) { vt_debug_print( normal, location, "TestLocationRoute: message arrived to me for a migrated " diff --git a/tests/unit/memory/test_memory_active.cc b/tests/unit/memory/test_memory_active.cc index 53ce419e4a..f2de254f24 100644 --- a/tests/unit/memory/test_memory_active.cc +++ b/tests/unit/memory/test_memory_active.cc @@ -63,7 +63,7 @@ struct TestMemoryActiveMsg { template struct TestMemoryActive : TestParallelHarness { - static void test_handler(MsgT* msg) { } + static void test_handler([[maybe_unused]] MsgT* msg) { } }; static constexpr int32_t const num_msg_sent = 5; diff --git a/tests/unit/memory/test_memory_lifetime.cc b/tests/unit/memory/test_memory_lifetime.cc index b883d05fc4..31a8db3642 100644 --- a/tests/unit/memory/test_memory_lifetime.cc +++ b/tests/unit/memory/test_memory_lifetime.cc @@ -64,8 +64,10 @@ struct SerialTrackMsg : ::vt::Message { vt_msg_serialize_required(); SerialTrackMsg() { ++alloc_count; } - SerialTrackMsg(SerialTrackMsg const& other) { ++alloc_count; } - SerialTrackMsg(SerialTrackMsg&& other) { ++alloc_count; } + SerialTrackMsg([[maybe_unused]] SerialTrackMsg const& other) { + ++alloc_count; + } + SerialTrackMsg([[maybe_unused]] SerialTrackMsg&& other) { ++alloc_count; } template void serialize(Serializer& s) { @@ -99,11 +101,11 @@ struct TestMemoryLifetime : TestParallelHarness { SET_MIN_NUM_NODES_CONSTRAINT(2); } - static void serialHan(SerialTestMsg* msg) { + static void serialHan([[maybe_unused]] SerialTestMsg* msg) { local_count++; } - static void normalHan(NormalTestMsg* msg) { + static void normalHan([[maybe_unused]] NormalTestMsg* msg) { local_count++; //fmt::print("{}: normalHan num={}\n", theContext()->getNode(), local_count); } @@ -221,7 +223,8 @@ static void callbackHan(CallbackMsg* msg) { TEST_F(TestMemoryLifetime, test_active_send_callback_lifetime_1) { auto cb = theCB()->makeFunc( - vt::pipe::LifetimeEnum::Indefinite, [](NormalTestMsg* msg){ } + vt::pipe::LifetimeEnum::Indefinite, + []([[maybe_unused]] NormalTestMsg* msg){ } ); for (int i = 0; i < num_msgs_sent; i++) { @@ -252,7 +255,8 @@ static void callbackHan(CallbackMsg* msg) { TEST_F(TestMemoryLifetime, test_active_serial_callback_lifetime_1) { auto cb = theCB()->makeFunc( - vt::pipe::LifetimeEnum::Indefinite, [](SerialTestMsg* msg){ } + vt::pipe::LifetimeEnum::Indefinite, + []([[maybe_unused]] SerialTestMsg* msg){ } ); for (int i = 0; i < num_msgs_sent; i++) { diff --git a/tests/unit/pipe/test_signal_cleanup.cc b/tests/unit/pipe/test_signal_cleanup.cc index 01bf454ac6..c9b71e02cb 100644 --- a/tests/unit/pipe/test_signal_cleanup.cc +++ b/tests/unit/pipe/test_signal_cleanup.cc @@ -80,7 +80,7 @@ TEST_F(TestSignalCleanup, test_signal_cleanup_3) { if (this_node == 0) { auto cb = theCB()->makeFunc( - vt::pipe::LifetimeEnum::Once, [&c1](DataMsg* msg){ + vt::pipe::LifetimeEnum::Once, [&c1]([[maybe_unused]] DataMsg* msg){ c1++; fmt::print("called A"); } @@ -107,7 +107,7 @@ TEST_F(TestSignalCleanup, test_signal_cleanup_3) { // if (this_node == 0) { auto cb = theCB()->makeFunc( - vt::pipe::LifetimeEnum::Once, [&c2](DataMsg* msg){ + vt::pipe::LifetimeEnum::Once, [&c2]([[maybe_unused]] DataMsg* msg){ c2++; fmt::print("called B"); } diff --git a/tests/unit/pool/test_pool.cc b/tests/unit/pool/test_pool.cc index 6d9fd39316..875f5b8048 100644 --- a/tests/unit/pool/test_pool.cc +++ b/tests/unit/pool/test_pool.cc @@ -69,7 +69,7 @@ struct TestPool : TestParallelHarness { }; template -void TestPool::testPoolFun(TestMsg* prev_msg) { +void TestPool::testPoolFun([[maybe_unused]] TestMsg* prev_msg) { #if DEBUG_TEST_HARNESS_PRINT fmt::print("testPoolFun: num_bytes={}\n", num_bytes); #endif @@ -81,7 +81,9 @@ void TestPool::testPoolFun(TestMsg* prev_msg) { } template <> -void TestPool::testPoolFun(TestMsg* msg) { } +void TestPool::testPoolFun( + [[maybe_unused]] TestMsg* msg +) { } TEST_F(TestPool, pool_message_alloc) { using namespace vt; diff --git a/tests/unit/pool/test_pool_message_sizes.cc b/tests/unit/pool/test_pool_message_sizes.cc index 9ea981e079..6fe3b4b7c6 100644 --- a/tests/unit/pool/test_pool_message_sizes.cc +++ b/tests/unit/pool/test_pool_message_sizes.cc @@ -87,7 +87,9 @@ struct TestPoolMessageSizes : TestParallelHarness { /*static*/ int TestPoolMessageSizes::count; template -void TestPoolMessageSizes::testPoolFun(TestMsg* prev_msg) { +void TestPoolMessageSizes::testPoolFun( + [[maybe_unused]] TestMsg* prev_msg +) { auto const& this_node = theContext()->getNode(); #if DEBUG_TEST_HARNESS_PRINT @@ -114,7 +116,9 @@ void TestPoolMessageSizes::testPoolFun(TestMsg* prev_msg) { } template <> -void TestPoolMessageSizes::testPoolFun(TestMsg* msg) { } +void TestPoolMessageSizes::testPoolFun( + [[maybe_unused]] TestMsg* msg +) { } TEST_F(TestPoolMessageSizes, pool_message_sizes_alloc) { SET_NUM_NODES_CONSTRAINT(2); diff --git a/tests/unit/rdma/test_rdma_common.h b/tests/unit/rdma/test_rdma_common.h index 54a42afa57..bb702753fc 100644 --- a/tests/unit/rdma/test_rdma_common.h +++ b/tests/unit/rdma/test_rdma_common.h @@ -55,7 +55,7 @@ struct UpdateData { static void init( HandleT& handle, int space, std::size_t size, vt::NodeType rank ) { - handle.modifyExclusive([=](T* val, std::size_t count){ + handle.modifyExclusive([=](T* val, [[maybe_unused]] std::size_t count){ setMem(val, space, size, rank, 0); }); } diff --git a/tests/unit/runtime/test_component_construction.cc b/tests/unit/runtime/test_component_construction.cc index c66d439e76..2b6fcb6384 100644 --- a/tests/unit/runtime/test_component_construction.cc +++ b/tests/unit/runtime/test_component_construction.cc @@ -89,7 +89,9 @@ struct MyComponentArgs : runtime::component::Component { explicit MyComponentArgs(Tag) {} public: struct MyTag {}; - static std::unique_ptr construct(int a, int& b, MyTag&& tag) { + static std::unique_ptr construct( + [[maybe_unused]] int a, int& b, [[maybe_unused]] MyTag&& tag + ) { b = 20; return std::make_unique(Tag{}); } diff --git a/tests/unit/runtime/test_mpi_access_guards.cc b/tests/unit/runtime/test_mpi_access_guards.cc index 4f63a80427..0d1c3ce644 100644 --- a/tests/unit/runtime/test_mpi_access_guards.cc +++ b/tests/unit/runtime/test_mpi_access_guards.cc @@ -72,7 +72,7 @@ static void attempt_mpi_access() { } } -static void message_handler(DummyMsg* msg) { +static void message_handler([[maybe_unused]] DummyMsg* msg) { if (expected_to_fail_on_mpi_access) { ASSERT_THROW(attempt_mpi_access(), std::runtime_error) << "MPI functions should not be used inside user code invoked from VT handlers"; diff --git a/tests/unit/serialization/test_serialize_messenger_virtual.extended.cc b/tests/unit/serialization/test_serialize_messenger_virtual.extended.cc index fa0040c4be..05eb2243bc 100644 --- a/tests/unit/serialization/test_serialize_messenger_virtual.extended.cc +++ b/tests/unit/serialization/test_serialize_messenger_virtual.extended.cc @@ -94,7 +94,7 @@ struct DataMsg : vt::vrt::VirtualMessage { struct TestSerialMessengerVirtual : TestParallelHarness { using TestMsg = TestStaticBytesShortMsg<4>; - static void testHandler(TestCtx* ctx, DataMsg* msg) { + static void testHandler([[maybe_unused]] TestCtx* ctx, DataMsg* msg) { msg->check(); } }; diff --git a/tests/unit/termination/test_epoch_guard.cc b/tests/unit/termination/test_epoch_guard.cc index e58360898e..285da2b5ec 100644 --- a/tests/unit/termination/test_epoch_guard.cc +++ b/tests/unit/termination/test_epoch_guard.cc @@ -58,7 +58,7 @@ struct TestEpochGuard : TestParallelHarness { using TestMsg = EpochMessage; static EpochType ep; - static void test_guarded_msg_recv(TestMsg *msg) + static void test_guarded_msg_recv([[maybe_unused]] TestMsg *msg) { EXPECT_EQ(theMsg()->getEpoch(), ep); } diff --git a/tests/unit/termination/test_term_chaining.cc b/tests/unit/termination/test_term_chaining.cc index c7cdf672f4..b938bd0bcd 100644 --- a/tests/unit/termination/test_term_chaining.cc +++ b/tests/unit/termination/test_term_chaining.cc @@ -72,7 +72,7 @@ struct TestTermChaining : TestParallelHarness { int num = 0; }; - static void test_handler_reflector(TestMsg* msg) { + static void test_handler_reflector([[maybe_unused]] TestMsg* msg) { fmt::print("reflector run\n"); handler_count = 12; @@ -82,7 +82,7 @@ struct TestTermChaining : TestParallelHarness { theMsg()->sendMsg(0, msg2); } - static void test_handler_response(TestMsg* msg) { + static void test_handler_response([[maybe_unused]] TestMsg* msg) { fmt::print("response run\n"); EXPECT_EQ(theContext()->getNode(), 0); @@ -90,7 +90,7 @@ struct TestTermChaining : TestParallelHarness { handler_count++; } - static void test_handler_chainer(TestMsg* msg) { + static void test_handler_chainer([[maybe_unused]] TestMsg* msg) { fmt::print("chainer run\n"); EXPECT_EQ(handler_count, 12); @@ -99,7 +99,7 @@ struct TestTermChaining : TestParallelHarness { theMsg()->sendMsg(0, msg2); } - static void test_handler_chained(TestMsg* msg) { + static void test_handler_chained([[maybe_unused]] TestMsg* msg) { fmt::print("chained run\n"); EXPECT_EQ(theContext()->getNode(), 0); @@ -107,7 +107,7 @@ struct TestTermChaining : TestParallelHarness { handler_count = 4; } - static void test_handler_set(TestMsg* msg) { + static void test_handler_set([[maybe_unused]] TestMsg* msg) { handler_count = 1; } @@ -119,7 +119,7 @@ struct TestTermChaining : TestParallelHarness { handler_count = 2; } - static void test_handler_bcast(TestMsg* msg) { + static void test_handler_bcast([[maybe_unused]] TestMsg* msg) { static auto visited = 0; if (theContext()->getNode() == 0) { diff --git a/tests/unit/termination/test_term_cleanup.cc b/tests/unit/termination/test_term_cleanup.cc index 6e587d897f..1093056e28 100644 --- a/tests/unit/termination/test_term_cleanup.cc +++ b/tests/unit/termination/test_term_cleanup.cc @@ -57,7 +57,7 @@ using namespace vt::tests::unit; struct TestTermCleanup : TestParallelHarness { using TestMsgType = TestStaticBytesNormalMsg<64>; - static void handler(TestMsgType* msg) { + static void handler([[maybe_unused]] TestMsgType* msg) { //fmt::print("receive msg\n"); } }; diff --git a/tests/unit/termination/test_term_dep_send_chain.cc b/tests/unit/termination/test_term_dep_send_chain.cc index 232e6651de..bcf2268ee0 100644 --- a/tests/unit/termination/test_term_dep_send_chain.cc +++ b/tests/unit/termination/test_term_dep_send_chain.cc @@ -318,7 +318,9 @@ struct MyObjGroup { void makeColl(std::string const& label, NodeType num_nodes, int k) { auto range = vt::Index2D(static_cast(num_nodes),k); backend_proxy_ = vt::theCollection()->constructCollective( - range, [=](vt::Index2D idx) { return std::make_unique(num_nodes, k); }, + range, [=]([[maybe_unused]] vt::Index2D idx) { + return std::make_unique(num_nodes, k); + }, label ); @@ -517,7 +519,7 @@ struct PrintParam { struct MergeCol : vt::Collection { MergeCol() = default; - MergeCol(NodeType num, double off) : offset_( off ) { + MergeCol([[maybe_unused]] NodeType num, double off) : offset_( off ) { idx_ = getIndex(); } @@ -587,7 +589,7 @@ struct MergeObjGroup auto const node = theContext()->getNode(); auto range = vt::Index2D(static_cast(num_nodes),k); backend_proxy_ = vt::theCollection()->constructCollective( - range, [=](vt::Index2D idx) { + range, [=]([[maybe_unused]] vt::Index2D idx) { return std::make_unique(num_nodes, offset); }, label ); diff --git a/tests/unit/termination/test_termination_reset.cc b/tests/unit/termination/test_termination_reset.cc index 2300e7b491..fa003cd28b 100644 --- a/tests/unit/termination/test_termination_reset.cc +++ b/tests/unit/termination/test_termination_reset.cc @@ -59,7 +59,7 @@ struct TestTermReset : TestParallelHarness { static int32_t handler_count; - static void test_handler(TestMsg* msg) { + static void test_handler([[maybe_unused]] TestMsg* msg) { handler_count = 10; } }; diff --git a/tutorial/tutorial_1e.h b/tutorial/tutorial_1e.h index bd21eacbf8..67fe611c7f 100644 --- a/tutorial/tutorial_1e.h +++ b/tutorial/tutorial_1e.h @@ -87,7 +87,7 @@ static inline void activeMessageGroupRoot() { } // Message handler -static void msgHandlerGroupA(MySimpleMsg* msg) { +static void msgHandlerGroupA([[maybe_unused]] MySimpleMsg* msg) { auto const cur_node = ::vt::theContext()->getNode(); vtAssert(cur_node >= 1, "This handler should only execute on nodes >= 1"); diff --git a/tutorial/tutorial_1f.h b/tutorial/tutorial_1f.h index fc6a79742c..6d6212a425 100644 --- a/tutorial/tutorial_1f.h +++ b/tutorial/tutorial_1f.h @@ -92,7 +92,7 @@ static inline void activeMessageGroupCollective() { } // Message handler -static void msgHandlerGroupB(MySimpleMsg2* msg) { +static void msgHandlerGroupB([[maybe_unused]] MySimpleMsg2* msg) { auto const cur_node = ::vt::theContext()->getNode(); vtAssert(cur_node % 2 == 0, "This handler should only execute on even nodes"); diff --git a/tutorial/tutorial_2a.h b/tutorial/tutorial_2a.h index d3e8f47056..c7df7743ca 100644 --- a/tutorial/tutorial_2a.h +++ b/tutorial/tutorial_2a.h @@ -66,7 +66,7 @@ struct MyCol : ::vt::Collection { // \ / struct MyCollMsg : ::vt::CollectionMessage { }; -void MyCol::msgHandler(MyCollMsg* msg) { +void MyCol::msgHandler([[maybe_unused]] MyCollMsg* msg) { auto cur_node = theContext()->getNode(); auto idx = this->getIndex(); ::fmt::print("MyCol::msgHandler index={}, node={}\n", idx.x(), cur_node); From c094d397e44070535f8f3529558517ddcc4becfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cezary=20Skrzy=C5=84ski?= Date: Tue, 14 May 2024 18:04:55 +0200 Subject: [PATCH 13/21] #2264: fix remaining warnings (gcc) --- src/vt/group/region/group_list.cc | 3 +-- src/vt/messaging/collection_chain_set.impl.h | 1 + src/vt/runtime/component/diagnostic_value.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vt/group/region/group_list.cc b/src/vt/group/region/group_list.cc index bf197b3810..3f6bf87858 100644 --- a/src/vt/group/region/group_list.cc +++ b/src/vt/group/region/group_list.cc @@ -148,8 +148,7 @@ List::List( } /*virtual*/ List::RegionUPtrType List::copy() const { - auto list = std::make_unique(*this); - return std::move(list); + return std::make_unique(*this); } /*virtual*/ void List::splitN(int nsplits, ApplyFnType apply) const { diff --git a/src/vt/messaging/collection_chain_set.impl.h b/src/vt/messaging/collection_chain_set.impl.h index 424ea395fc..53cf6d9f87 100644 --- a/src/vt/messaging/collection_chain_set.impl.h +++ b/src/vt/messaging/collection_chain_set.impl.h @@ -94,6 +94,7 @@ CollectionChainSet::CollectionChainSet( vtAssert(layout == Home, "Must be a home layout"); p[home].template send(idx); } + break; case ElementEventEnum::ElementMigratedOut: if (layout == Local) { removeIndex(idx); diff --git a/src/vt/runtime/component/diagnostic_value.h b/src/vt/runtime/component/diagnostic_value.h index 6d3995dacf..3e8eef2e8c 100644 --- a/src/vt/runtime/component/diagnostic_value.h +++ b/src/vt/runtime/component/diagnostic_value.h @@ -331,7 +331,7 @@ struct DiagnosticSnapshotValues { break; case DiagnosticUpdate::Avg: v.incrementN(); - // no break to include update for Avg after increment + [[fallthrough]]; // no break to include update for Avg after increment case DiagnosticUpdate::Sum: v.update(v.getRawValue() + val); break; From d8b690415e7af93d2bfbe7fca5487adbb0a1087e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cezary=20Skrzy=C5=84ski?= Date: Tue, 14 May 2024 18:23:38 +0200 Subject: [PATCH 14/21] #2264: fix unused variable warnings --- src/vt/context/runnable_context/trace.h | 2 +- src/vt/messaging/active.cc | 4 ++- src/vt/messaging/active.impl.h | 12 +++++-- src/vt/pipe/pipe_manager_tl.impl.h | 2 +- src/vt/pool/pool.cc | 4 ++- src/vt/rdma/state/rdma_state.cc | 4 +-- src/vt/registry/auto/auto_registry_impl.h | 14 ++++++-- .../auto_registry_collection.impl.h | 10 ++++-- src/vt/runnable/make_runnable.h | 10 ++++-- src/vt/runtime/component/meter/counter.h | 4 +-- src/vt/runtime/component/meter/gauge.h | 2 +- src/vt/runtime/component/meter/timer.h | 2 +- src/vt/trace/trace.cc | 5 ++- src/vt/trace/trace_registry.cc | 4 ++- src/vt/trace/trace_user.cc | 34 +++++++++++++------ src/vt/trace/trace_user.h | 2 +- .../collection/balance/zoltanlb/zoltanlb.cc | 15 ++++---- src/vt/vrt/collection/manager.impl.h | 9 ++--- 18 files changed, 94 insertions(+), 45 deletions(-) diff --git a/src/vt/context/runnable_context/trace.h b/src/vt/context/runnable_context/trace.h index aa4577bf28..e60800cfe2 100644 --- a/src/vt/context/runnable_context/trace.h +++ b/src/vt/context/runnable_context/trace.h @@ -130,7 +130,7 @@ struct Trace { struct Trace { template - Trace(Args&&... args) {} + Trace([[maybe_unused]] Args&&... args) {} }; diff --git a/src/vt/messaging/active.cc b/src/vt/messaging/active.cc index fbd69715a3..02f3f61753 100644 --- a/src/vt/messaging/active.cc +++ b/src/vt/messaging/active.cc @@ -167,7 +167,9 @@ void ActiveMessenger::startup() { /*virtual*/ ActiveMessenger::~ActiveMessenger() {} trace::TraceEventIDType ActiveMessenger::makeTraceCreationSend( - HandlerType const handler, ByteType serialized_msg_size, bool is_bcast + [[maybe_unused]] HandlerType const handler, + [[maybe_unused]] ByteType serialized_msg_size, + [[maybe_unused]] bool is_bcast ) { #if vt_check_enabled(trace_enabled) trace::TraceEntryIDType ep = auto_registry::handlerTraceID(handler); diff --git a/src/vt/messaging/active.impl.h b/src/vt/messaging/active.impl.h index 13c94651e3..9df798818d 100644 --- a/src/vt/messaging/active.impl.h +++ b/src/vt/messaging/active.impl.h @@ -71,21 +71,27 @@ void ActiveMessenger::markAsTermMessage(MsgPtrT const msg) { } template -void ActiveMessenger::markAsLocationMessage(MsgPtrT const msg) { +void ActiveMessenger::markAsLocationMessage( + [[maybe_unused]] MsgPtrT const msg +) { #if vt_check_enabled(trace_enabled) envelopeSetTraceRuntimeEnabled(msg->env, theConfig()->traceLocation()); #endif } template -void ActiveMessenger::markAsSerialMsgMessage(MsgPtrT const msg) { +void ActiveMessenger::markAsSerialMsgMessage( + [[maybe_unused]] MsgPtrT const msg +) { #if vt_check_enabled(trace_enabled) envelopeSetTraceRuntimeEnabled(msg->env, theConfig()->traceSerialMsg()); #endif } template -void ActiveMessenger::markAsCollectionMessage(MsgPtrT const msg) { +void ActiveMessenger::markAsCollectionMessage( + [[maybe_unused]] MsgPtrT const msg +) { #if vt_check_enabled(trace_enabled) envelopeSetTraceRuntimeEnabled(msg->env, theConfig()->traceCollection()); #endif diff --git a/src/vt/pipe/pipe_manager_tl.impl.h b/src/vt/pipe/pipe_manager_tl.impl.h index 6ddcecb67e..48c6ef919c 100644 --- a/src/vt/pipe/pipe_manager_tl.impl.h +++ b/src/vt/pipe/pipe_manager_tl.impl.h @@ -228,7 +228,7 @@ auto PipeManagerTL::makeCallbackProxy(ProxyT proxy) { } template -auto PipeManagerTL::makeCallbackSingle(NodeType node) { +auto PipeManagerTL::makeCallbackSingle([[maybe_unused]] NodeType node) { auto const new_pipe_id = makePipeID(true,false); using Trait = FuncTraits; diff --git a/src/vt/pool/pool.cc b/src/vt/pool/pool.cc index 5a9603273f..3dc91077fd 100644 --- a/src/vt/pool/pool.cc +++ b/src/vt/pool/pool.cc @@ -197,7 +197,9 @@ void Pool::dealloc(std::byte* const buf) { } } -Pool::SizeType Pool::remainingSize(std::byte* const buf) const { +Pool::SizeType Pool::remainingSize( + [[maybe_unused]] std::byte* const buf +) const { #if vt_check_enabled(memory_pool) auto const& actual_alloc_size = HeaderManagerType::getHeaderBytes(buf); auto const& oversize = HeaderManagerType::getHeaderOversizeBytes(buf); diff --git a/src/vt/rdma/state/rdma_state.cc b/src/vt/rdma/state/rdma_state.cc index 89f0bb3f30..d4fb1c6293 100644 --- a/src/vt/rdma/state/rdma_state.cc +++ b/src/vt/rdma/state/rdma_state.cc @@ -221,7 +221,7 @@ bool State::testReadyPutData(TagType const& tag) { void State::getData( GetMessage* msg, bool const& is_user_msg, RDMA_InfoType const& info, - NodeType const& from_node + [[maybe_unused]] NodeType const& from_node ) { auto const& tag = info.tag; @@ -289,7 +289,7 @@ void State::getData( void State::putData( PutMessage* msg, bool const& is_user_msg, RDMA_InfoType const& info, - NodeType const& from_node + [[maybe_unused]] NodeType const& from_node ) { auto const& tag = info.tag; diff --git a/src/vt/registry/auto/auto_registry_impl.h b/src/vt/registry/auto/auto_registry_impl.h index fb33045221..e65447e718 100644 --- a/src/vt/registry/auto/auto_registry_impl.h +++ b/src/vt/registry/auto/auto_registry_impl.h @@ -200,7 +200,9 @@ inline AutoActiveType const& getAutoHandler(HandlerType const handler) { template f> void setHandlerTraceNameObjGroup( - HandlerControlType ctrl, std::string const& name, std::string const& parent + [[maybe_unused]] HandlerControlType ctrl, + [[maybe_unused]] std::string const& name, + [[maybe_unused]] std::string const& parent ) { #if vt_check_enabled(trace_enabled) auto const handler = makeAutoHandlerObjGroup(ctrl); @@ -210,7 +212,10 @@ void setHandlerTraceNameObjGroup( } template * f> -void setHandlerTraceName(std::string const& name, std::string const& parent) { +void setHandlerTraceName( + [[maybe_unused]] std::string const& name, + [[maybe_unused]] std::string const& parent +) { #if vt_check_enabled(trace_enabled) auto const handler = makeAutoHandler(); auto const trace_id = handlerTraceID(handler); @@ -219,7 +224,10 @@ void setHandlerTraceName(std::string const& name, std::string const& parent) { } template -void setHandlerTraceName(std::string const& name, std::string const& parent) { +void setHandlerTraceName( + [[maybe_unused]] std::string const& name, + [[maybe_unused]] std::string const& parent +) { #if vt_check_enabled(trace_enabled) auto const handler = makeAutoHandlerParam(); auto const trace_id = handlerTraceID(handler); diff --git a/src/vt/registry/auto/collection/auto_registry_collection.impl.h b/src/vt/registry/auto/collection/auto_registry_collection.impl.h index 062241c4ee..c8edf12f0f 100644 --- a/src/vt/registry/auto/collection/auto_registry_collection.impl.h +++ b/src/vt/registry/auto/collection/auto_registry_collection.impl.h @@ -112,7 +112,10 @@ inline HandlerType makeAutoHandlerCollectionMemParam() { } template * f> -void setHandlerTraceNameColl(std::string const& name, std::string const& parent) { +void setHandlerTraceNameColl( + [[maybe_unused]] std::string const& name, + [[maybe_unused]] std::string const& parent +) { #if vt_check_enabled(trace_enabled) auto const handler = makeAutoHandlerCollection(); auto const trace_id = handlerTraceID(handler); @@ -121,7 +124,10 @@ void setHandlerTraceNameColl(std::string const& name, std::string const& parent) } template f> -void setHandlerTraceNameCollMem(std::string const& name, std::string const& parent) { +void setHandlerTraceNameCollMem( + [[maybe_unused]] std::string const& name, + [[maybe_unused]] std::string const& parent +) { #if vt_check_enabled(trace_enabled) auto const handler = makeAutoHandlerCollectionMem(); auto const trace_id = handlerTraceID(handler); diff --git a/src/vt/runnable/make_runnable.h b/src/vt/runnable/make_runnable.h index 382c6eda03..5f2cc7b275 100644 --- a/src/vt/runnable/make_runnable.h +++ b/src/vt/runnable/make_runnable.h @@ -180,7 +180,9 @@ struct RunnableMaker { * captured one) */ template - RunnableMaker&& withLBData(ElmT* elm, MsgU* msg) { + RunnableMaker&& withLBData( + [[maybe_unused]] ElmT* elm, [[maybe_unused]] MsgU* msg + ) { #if vt_check_enabled(lblite) impl_->addContextLB(elm, msg); #endif @@ -204,7 +206,9 @@ struct RunnableMaker { * \param[in] elm_id the element ID */ template - RunnableMaker&& withLBData(LBDataT* lb_data, T elm_id) { + RunnableMaker&& withLBData( + [[maybe_unused]] LBDataT* lb_data, [[maybe_unused]] T elm_id + ) { #if vt_check_enabled(lblite) impl_->addContextLB(lb_data, elm_id); #endif @@ -217,7 +221,7 @@ struct RunnableMaker { * \param[in] elm the element */ template - RunnableMaker&& withLBData(ElmT* elm) { + RunnableMaker&& withLBData([[maybe_unused]] ElmT* elm) { #if vt_check_enabled(lblite) impl_->addContextLB(elm, msg_.get()); #endif diff --git a/src/vt/runtime/component/meter/counter.h b/src/vt/runtime/component/meter/counter.h index 4c890f61b4..0ba91dbead 100644 --- a/src/vt/runtime/component/meter/counter.h +++ b/src/vt/runtime/component/meter/counter.h @@ -77,7 +77,7 @@ struct Counter : DiagnosticMeter { * * \param[in] val amount to increment */ - void increment(T val = 1) { + void increment([[maybe_unused]] T val = 1) { # if vt_check_enabled(diagnostics) if (impl_) { impl_->update(val); @@ -90,7 +90,7 @@ struct Counter : DiagnosticMeter { * * \param[in] val amount to decrement */ - void decrement(T val = 1) { + void decrement([[maybe_unused]] T val = 1) { # if vt_check_enabled(diagnostics) if (impl_) { impl_->update(-val); diff --git a/src/vt/runtime/component/meter/gauge.h b/src/vt/runtime/component/meter/gauge.h index e343417bb2..13b0be634b 100644 --- a/src/vt/runtime/component/meter/gauge.h +++ b/src/vt/runtime/component/meter/gauge.h @@ -82,7 +82,7 @@ struct Gauge : DiagnosticStatsPack { * * \param[in] val the new value */ - void update(T val) { + void update([[maybe_unused]] T val) { # if vt_check_enabled(diagnostics) this->updateStats(val); # endif diff --git a/src/vt/runtime/component/meter/timer.h b/src/vt/runtime/component/meter/timer.h index 7e1a40efc9..f5dc220980 100644 --- a/src/vt/runtime/component/meter/timer.h +++ b/src/vt/runtime/component/meter/timer.h @@ -84,7 +84,7 @@ struct Timer : DiagnosticStatsPack { * \param[in] begin begin time of event being tracked * \param[in] end end time of event being tracked */ - void update(T begin, T end) { + void update([[maybe_unused]] T begin, [[maybe_unused]] T end) { # if vt_check_enabled(diagnostics) auto const duration = end - begin; this->updateStats(duration); diff --git a/src/vt/trace/trace.cc b/src/vt/trace/trace.cc index 833b20eb9a..83aff586a8 100644 --- a/src/vt/trace/trace.cc +++ b/src/vt/trace/trace.cc @@ -211,7 +211,10 @@ void Trace::registerUserEventManual( user_event_.user(name, id); } -void insertNewUserEvent(UserEventIDType event, std::string const& name) { +void insertNewUserEvent( + [[maybe_unused]] UserEventIDType event, + [[maybe_unused]] std::string const& name +) { #if vt_check_enabled(trace_enabled) theTrace()->user_event_.insertEvent(event, name); #endif diff --git a/src/vt/trace/trace_registry.cc b/src/vt/trace/trace_registry.cc index a2047b9527..9b3d750250 100644 --- a/src/vt/trace/trace_registry.cc +++ b/src/vt/trace/trace_registry.cc @@ -121,7 +121,9 @@ TraceRegistry::registerEventHashed( /*static*/ void TraceRegistry::setTraceName( - TraceEntryIDType id, std::string const& name, std::string const& type_name + [[maybe_unused]] TraceEntryIDType id, + [[maybe_unused]] std::string const& name, + [[maybe_unused]] std::string const& type_name ) { #if vt_check_enabled(trace_enabled) auto* events = TraceContainers::getEventContainer(); diff --git a/src/vt/trace/trace_user.cc b/src/vt/trace/trace_user.cc index ee4754ffbf..0733f68c04 100644 --- a/src/vt/trace/trace_user.cc +++ b/src/vt/trace/trace_user.cc @@ -51,7 +51,9 @@ namespace vt { namespace trace { -UserEventIDType registerEventCollective(std::string const& name) { +UserEventIDType registerEventCollective( + [[maybe_unused]] std::string const& name +) { #if vt_check_enabled(trace_enabled) return theTrace()->registerUserEventColl(name); #else @@ -59,7 +61,7 @@ UserEventIDType registerEventCollective(std::string const& name) { #endif } -UserEventIDType registerEventRooted(std::string const& name) { +UserEventIDType registerEventRooted([[maybe_unused]] std::string const& name) { #if vt_check_enabled(trace_enabled) return theTrace()->registerUserEventRoot(name); #else @@ -67,7 +69,7 @@ UserEventIDType registerEventRooted(std::string const& name) { #endif } -UserEventIDType registerEventHashed(std::string const& name) { +UserEventIDType registerEventHashed([[maybe_unused]] std::string const& name) { #if vt_check_enabled(trace_enabled) return theTrace()->registerUserEventHash(name); #else @@ -75,33 +77,37 @@ UserEventIDType registerEventHashed(std::string const& name) { #endif } -void addUserEvent(UserEventIDType event) { +void addUserEvent([[maybe_unused]] UserEventIDType event) { #if vt_check_enabled(trace_enabled) theTrace()->addUserEvent(event); #endif } -void addUserEventBracketed(UserEventIDType event, TimeType begin, TimeType end) { +void addUserEventBracketed( + [[maybe_unused]] UserEventIDType event, [[maybe_unused]] TimeType begin, + [[maybe_unused]] TimeType end +) { #if vt_check_enabled(trace_enabled) theTrace()->addUserEventBracketed(event, begin, end); #endif } -void addUserNote(std::string const& note) { +void addUserNote([[maybe_unused]] std::string const& note) { #if vt_check_enabled(trace_enabled) theTrace()->addUserNote(note); #endif } -void addUserData(int32_t data) { +void addUserData([[maybe_unused]] int32_t data) { #if vt_check_enabled(trace_enabled) theTrace()->addUserData(data); #endif } void addUserBracketedNote( - TimeType const begin, TimeType const end, std::string const& note, - TraceEventIDType const event + [[maybe_unused]] TimeType const begin, [[maybe_unused]] TimeType const end, + [[maybe_unused]] std::string const& note, + [[maybe_unused]] TraceEventIDType const event ) { #if vt_check_enabled(trace_enabled) theTrace()->addUserBracketedNote(begin, end, note, event); @@ -116,7 +122,10 @@ struct UserSplitHolder final { /*static*/ std::unordered_map UserSplitHolder::split_ = {}; #endif -void addUserNotePre(std::string const& note, TraceEventIDType const) { +void addUserNotePre( + [[maybe_unused]] std::string const& note, + [[maybe_unused]] TraceEventIDType const +) { #if vt_check_enabled(trace_enabled) auto iter = UserSplitHolder::split_.find(note); vtAssertExpr(iter == UserSplitHolder::split_.end()); @@ -128,7 +137,10 @@ void addUserNotePre(std::string const& note, TraceEventIDType const) { #endif } -void addUserNoteEpi(std::string const& in_note, TraceEventIDType const event) { +void addUserNoteEpi( + [[maybe_unused]] std::string const& in_note, + [[maybe_unused]] TraceEventIDType const event +) { #if vt_check_enabled(trace_enabled) auto iter = UserSplitHolder::split_.find(in_note); vtAssertExpr(iter != UserSplitHolder::split_.end()); diff --git a/src/vt/trace/trace_user.h b/src/vt/trace/trace_user.h index a5dbc0809e..a9aa2a8d3e 100644 --- a/src/vt/trace/trace_user.h +++ b/src/vt/trace/trace_user.h @@ -324,7 +324,7 @@ struct TraceScopedNote final { TraceScopedNote(std::string const&, TraceEventIDType const = no_trace_event) { } void end() { } - void setEvent(TraceEventIDType const in_event) { } + void setEvent([[maybe_unused]] TraceEventIDType const in_event) { } }; struct TraceScopedEvent final { diff --git a/src/vt/vrt/collection/balance/zoltanlb/zoltanlb.cc b/src/vt/vrt/collection/balance/zoltanlb/zoltanlb.cc index e457270424..3728fe7b84 100644 --- a/src/vt/vrt/collection/balance/zoltanlb/zoltanlb.cc +++ b/src/vt/vrt/collection/balance/zoltanlb/zoltanlb.cc @@ -595,8 +595,9 @@ std::unique_ptr ZoltanLB::makeGraph() { } /*static*/ void ZoltanLB::getVertexList( - void *data, int gid_size, int lid_size, ZOLTAN_ID_PTR global_id, - ZOLTAN_ID_PTR local_id, int weight_dim, float *obj_weights, int *ierr + void *data, [[maybe_unused]] int gid_size, [[maybe_unused]] int lid_size, + ZOLTAN_ID_PTR global_id, ZOLTAN_ID_PTR local_id, + [[maybe_unused]] int weight_dim, float *obj_weights, int *ierr ) { Graph* graph = reinterpret_cast(data); for (int i = 0; i < graph->num_vertices; i++) { @@ -618,8 +619,9 @@ std::unique_ptr ZoltanLB::makeGraph() { } /*static*/ void ZoltanLB::getHypergraph( - void *data, int gid_size, int num_edges, int num_nonzeroes, int format, - ZOLTAN_ID_PTR edge_gid, int *vertex_ptr, ZOLTAN_ID_PTR vertex_gid, int *ierr + void *data, [[maybe_unused]] int gid_size, int num_edges, int num_nonzeroes, + int format, ZOLTAN_ID_PTR edge_gid, int *vertex_ptr, + ZOLTAN_ID_PTR vertex_gid, int *ierr ) { Graph* graph = reinterpret_cast(data); bool const edge_equal = num_edges == graph->num_edges; @@ -656,8 +658,9 @@ std::unique_ptr ZoltanLB::makeGraph() { } /*static*/ void ZoltanLB::getHypergraphEdgeWeights( - void *data, int num_gid, int num_lid, int num_edges, int edge_weight_dim, - ZOLTAN_ID_PTR edge_gid, ZOLTAN_ID_PTR edge_lid, float *edge_weights, int *ierr + void *data, [[maybe_unused]] int num_gid, [[maybe_unused]] int num_lid, + int num_edges, [[maybe_unused]] int edge_weight_dim, ZOLTAN_ID_PTR edge_gid, + ZOLTAN_ID_PTR edge_lid, float *edge_weights, int *ierr ) { Graph* graph = reinterpret_cast(data); for (int i = 0; i < num_edges; i++) { diff --git a/src/vt/vrt/collection/manager.impl.h b/src/vt/vrt/collection/manager.impl.h index 6864393984..be71efb95e 100644 --- a/src/vt/vrt/collection/manager.impl.h +++ b/src/vt/vrt/collection/manager.impl.h @@ -205,7 +205,7 @@ GroupType CollectionManager::createGroupCollection( template /*static*/ void CollectionManager::collectionAutoMsgDeliver( MsgT* msg, Indexable* base, HandlerType han, NodeType from, - trace::TraceEventIDType event, bool immediate + [[maybe_unused]] trace::TraceEventIDType event, bool immediate ) { // Expand out the index for tracing purposes; Projections takes up to // 4-dimensions @@ -511,7 +511,7 @@ void CollectionManager::invokeMsg( template void CollectionManager::invokeMsgImpl( VirtualElmProxyType const& proxy, MsgSharedPtr msg, - bool instrument + [[maybe_unused]] bool instrument ) { using IndexT = typename ColT::IndexType; @@ -674,7 +674,8 @@ messaging::PendingSend CollectionManager::broadcastCollectiveMsg( template messaging::PendingSend CollectionManager::broadcastCollectiveMsgImpl( - CollectionProxyWrapType const& proxy, MsgPtr& msg, bool instrument + CollectionProxyWrapType const& proxy, MsgPtr& msg, + [[maybe_unused]] bool instrument ) { using IndexT = typename ColT::IndexType; @@ -794,7 +795,7 @@ messaging::PendingSend CollectionManager::broadcastNormalMsg( template messaging::PendingSend CollectionManager::broadcastMsgUntypedHandler( CollectionProxyWrapType const& toProxy, MsgT* raw_msg, - HandlerType const handler, bool instrument + HandlerType const handler, [[maybe_unused]] bool instrument ) { auto const idx = makeVrtDispatch(); auto const col_proxy = toProxy.getProxy(); From 72317d917aa38de33f311470e1ecf5f41f513951 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cezary=20Skrzy=C5=84ski?= Date: Tue, 14 May 2024 22:34:58 +0200 Subject: [PATCH 15/21] #2264: remove unused parameters --- src/vt/termination/dijkstra-scholten/comm.cc | 2 +- src/vt/termination/dijkstra-scholten/ds.cc | 5 +---- src/vt/termination/dijkstra-scholten/ds.h | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/vt/termination/dijkstra-scholten/comm.cc b/src/vt/termination/dijkstra-scholten/comm.cc index 3788348429..1b3bbc7e03 100644 --- a/src/vt/termination/dijkstra-scholten/comm.cc +++ b/src/vt/termination/dijkstra-scholten/comm.cc @@ -132,7 +132,7 @@ StateDS::getTerminator(EpochType const& epoch) { /*static*/ void StateDS::requestAckHan(AckMsg* msg) { auto const epoch = msg->getEpoch(); auto term = getTerminator(epoch); - term->needAck(msg->getNode(),msg->getCount()); + term->needAck(); } /*static*/ void StateDS::acknowledgeHan(AckMsg* msg) { diff --git a/src/vt/termination/dijkstra-scholten/ds.cc b/src/vt/termination/dijkstra-scholten/ds.cc index 6a07a4e3e2..075a92ac5d 100644 --- a/src/vt/termination/dijkstra-scholten/ds.cc +++ b/src/vt/termination/dijkstra-scholten/ds.cc @@ -213,10 +213,7 @@ void TermDS::msgProcessed(NodeType predecessor, CountType count) { } template -void TermDS::needAck( - [[maybe_unused]] NodeType const predecessor, - [[maybe_unused]] CountType const count -) { +void TermDS::needAck() { vtAssertInfo( 5 && (C == processedSum - (ackedArbitrary + ackedParent)), "DS-invariant", C, D, processedSum, ackedArbitrary, diff --git a/src/vt/termination/dijkstra-scholten/ds.h b/src/vt/termination/dijkstra-scholten/ds.h index cf403c5cc4..11f1f0d29e 100644 --- a/src/vt/termination/dijkstra-scholten/ds.h +++ b/src/vt/termination/dijkstra-scholten/ds.h @@ -91,7 +91,7 @@ struct TermDS : EpochDependency, EpochLabel { void gotAck(CountType count); void doneSending(); void msgProcessed(NodeType predecessor, CountType count); - void needAck(NodeType const predecessor, CountType const count); + void needAck(); void tryAck(); void terminated(); bool hasParent(); From ea50fd83c5842ca16b6db83f72e4aff2b6871dd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cezary=20Skrzy=C5=84ski?= Date: Tue, 14 May 2024 23:17:20 +0200 Subject: [PATCH 16/21] #2264: fix unused variable warnings --- src/vt/pipe/pipe_manager_tl.impl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vt/pipe/pipe_manager_tl.impl.h b/src/vt/pipe/pipe_manager_tl.impl.h index 48c6ef919c..ed4ae4cd4d 100644 --- a/src/vt/pipe/pipe_manager_tl.impl.h +++ b/src/vt/pipe/pipe_manager_tl.impl.h @@ -254,7 +254,7 @@ auto PipeManagerTL::makeCallbackSingle([[maybe_unused]] NodeType node) { } template -auto PipeManagerTL::makeCallbackFunctor(NodeType node) { +auto PipeManagerTL::makeCallbackFunctor([[maybe_unused]] NodeType node) { auto const new_pipe_id = makePipeID(true,false); using Trait = FunctorTraits; From d7735faab7218eb45664b6e5786306e67c01b4f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cezary=20Skrzy=C5=84ski?= Date: Wed, 15 May 2024 21:46:40 +0200 Subject: [PATCH 17/21] #2264: fix unused variable warnings (cuda, hip) --- tests/unit/active/test_async_op_cuda.cc | 2 +- tests/unit/active/test_async_op_hip.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/active/test_async_op_cuda.cc b/tests/unit/active/test_async_op_cuda.cc index 6236c3ba2a..46105c0753 100644 --- a/tests/unit/active/test_async_op_cuda.cc +++ b/tests/unit/active/test_async_op_cuda.cc @@ -125,7 +125,7 @@ struct CUDAGroup { checkCudaErrors(cudaStreamDestroy(stream2_), "cudaStreamDestroy(stream2_)"); } - void cudaHandler(MyMsg* msg) { + void cudaHandler([[maybe_unused]] MyMsg* msg) { auto const nBytes = dataSize_ * sizeof(double); checkCudaErrors(cudaStreamCreate(&stream1_), "cudaStreamCreate (stream1_)"); diff --git a/tests/unit/active/test_async_op_hip.cc b/tests/unit/active/test_async_op_hip.cc index b71eea58d3..784041ac5e 100644 --- a/tests/unit/active/test_async_op_hip.cc +++ b/tests/unit/active/test_async_op_hip.cc @@ -126,7 +126,7 @@ struct hipGroup { checkHipErrors(hipStreamDestroy(stream2_), "hipStreamDestroy(stream2_)"); } - void hipHandler(MyMsg* msg) { + void hipHandler([[maybe_unused]] MyMsg* msg) { auto const nBytes = dataSize_ * sizeof(double); checkHipErrors(hipStreamCreate(&stream1_), "hipStreamCreate (stream1_)"); From 70cbc30f15957b7e82b00d5538f3a81c2ba22847 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cezary=20Skrzy=C5=84ski?= Date: Thu, 16 May 2024 17:04:13 +0200 Subject: [PATCH 18/21] #2264: work around gcc-8 limitations --- src/vt/context/runnable_context/trace.h | 2 +- src/vt/runnable/runnable.h | 7 ++- src/vt/vrt/context/context_vrt.cc | 49 ------------------- src/vt/vrt/context/context_vrt.h | 3 +- tests/unit/memory/test_memory_lifetime.cc | 4 +- .../termination/test_term_dep_send_chain.cc | 2 +- 6 files changed, 10 insertions(+), 57 deletions(-) delete mode 100644 src/vt/vrt/context/context_vrt.cc diff --git a/src/vt/context/runnable_context/trace.h b/src/vt/context/runnable_context/trace.h index e60800cfe2..becb7855a3 100644 --- a/src/vt/context/runnable_context/trace.h +++ b/src/vt/context/runnable_context/trace.h @@ -130,7 +130,7 @@ struct Trace { struct Trace { template - Trace([[maybe_unused]] Args&&... args) {} + Trace(Args&&...) {} }; diff --git a/src/vt/runnable/runnable.h b/src/vt/runnable/runnable.h index 50c929511c..62556472ca 100644 --- a/src/vt/runnable/runnable.h +++ b/src/vt/runnable/runnable.h @@ -45,6 +45,7 @@ #define INCLUDED_VT_RUNNABLE_RUNNABLE_H #include "vt/messaging/message/smart_ptr.h" +#include "vt/configs/debug/debug_var_unused.h" #include "vt/context/runnable_context/td.h" #include "vt/context/runnable_context/trace.h" #include "vt/context/runnable_context/set_context.h" @@ -120,11 +121,13 @@ struct RunnableNew { * * \param[in] in_is_threaded whether the handler can be run with a thread */ - explicit RunnableNew([[maybe_unused]] bool in_is_threaded) + explicit RunnableNew(bool in_is_threaded) #if vt_check_enabled(fcontext) : is_threaded_(in_is_threaded) #endif - { } + { + vt_force_use(in_is_threaded); // FIXME gcc-8 errors out on [[maybe_unused]] + } RunnableNew(RunnableNew&&) = default; RunnableNew(RunnableNew const&) = delete; diff --git a/src/vt/vrt/context/context_vrt.cc b/src/vt/vrt/context/context_vrt.cc deleted file mode 100644 index 7dd2c571d7..0000000000 --- a/src/vt/vrt/context/context_vrt.cc +++ /dev/null @@ -1,49 +0,0 @@ -/* -//@HEADER -// ***************************************************************************** -// -// context_vrt.cc -// DARMA/vt => Virtual Transport -// -// Copyright 2019-2021 National Technology & Engineering Solutions of Sandia, LLC -// (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S. -// Government retains certain rights in this software. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * Neither the name of the copyright holder nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact darma@sandia.gov -// -// ***************************************************************************** -//@HEADER -*/ - -#include "vt/config.h" -#include "vt/vrt/context/context_vrt.h" - -namespace vt { namespace vrt { - -}} // end namespace vt::vrt diff --git a/src/vt/vrt/context/context_vrt.h b/src/vt/vrt/context/context_vrt.h index 1fe80eb2fa..c45e492228 100644 --- a/src/vt/vrt/context/context_vrt.h +++ b/src/vt/vrt/context/context_vrt.h @@ -54,7 +54,6 @@ namespace vt { namespace vrt { struct VirtualContext : VrtBase { VirtualContext() = default; - VirtualContext([[maybe_unused]] bool const in_is_main) { } friend struct VirtualContextAttorney; @@ -64,7 +63,7 @@ struct VirtualContext : VrtBase { }; struct MainVirtualContext : VirtualContext { - MainVirtualContext() : VirtualContext(true) { } + MainVirtualContext() : VirtualContext() { } }; }} // end namespace vt::vrt diff --git a/tests/unit/memory/test_memory_lifetime.cc b/tests/unit/memory/test_memory_lifetime.cc index 31a8db3642..612500ac47 100644 --- a/tests/unit/memory/test_memory_lifetime.cc +++ b/tests/unit/memory/test_memory_lifetime.cc @@ -64,10 +64,10 @@ struct SerialTrackMsg : ::vt::Message { vt_msg_serialize_required(); SerialTrackMsg() { ++alloc_count; } - SerialTrackMsg([[maybe_unused]] SerialTrackMsg const& other) { + SerialTrackMsg(SerialTrackMsg const&) { ++alloc_count; } - SerialTrackMsg([[maybe_unused]] SerialTrackMsg&& other) { ++alloc_count; } + SerialTrackMsg(SerialTrackMsg&&) { ++alloc_count; } template void serialize(Serializer& s) { diff --git a/tests/unit/termination/test_term_dep_send_chain.cc b/tests/unit/termination/test_term_dep_send_chain.cc index bcf2268ee0..3a56a6a312 100644 --- a/tests/unit/termination/test_term_dep_send_chain.cc +++ b/tests/unit/termination/test_term_dep_send_chain.cc @@ -519,7 +519,7 @@ struct PrintParam { struct MergeCol : vt::Collection { MergeCol() = default; - MergeCol([[maybe_unused]] NodeType num, double off) : offset_( off ) { + MergeCol(NodeType, double off) : offset_( off ) { idx_ = getIndex(); } From d141682c6726e5c673217f577d4730a4c6fc0953 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cezary=20Skrzy=C5=84ski?= Date: Thu, 16 May 2024 17:47:22 +0200 Subject: [PATCH 19/21] #2264: remove unnecessary #include --- src/vt/vrt/collection/types/has_migrate.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/vt/vrt/collection/types/has_migrate.h b/src/vt/vrt/collection/types/has_migrate.h index 10ab6bfac2..e0f7c58dea 100644 --- a/src/vt/vrt/collection/types/has_migrate.h +++ b/src/vt/vrt/collection/types/has_migrate.h @@ -41,7 +41,6 @@ //@HEADER */ -#include "vt/vrt/context/context_vrtmanager.impl.h" #if !defined INCLUDED_VT_VRT_COLLECTION_TYPES_HAS_MIGRATE_H #define INCLUDED_VT_VRT_COLLECTION_TYPES_HAS_MIGRATE_H From 13c5b76983849722cdef4c8eb0f4db072ba452e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cezary=20Skrzy=C5=84ski?= Date: Tue, 21 May 2024 21:50:50 +0200 Subject: [PATCH 20/21] #2264: simplify ternary expression --- src/vt/rdma/channel/rdma_channel.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/vt/rdma/channel/rdma_channel.cc b/src/vt/rdma/channel/rdma_channel.cc index 528e3a3a5b..afd2db3698 100644 --- a/src/vt/rdma/channel/rdma_channel.cc +++ b/src/vt/rdma/channel/rdma_channel.cc @@ -187,8 +187,7 @@ Channel::lockChannelForOp() { auto const& lock_type = (not is_target_) ? (op_type_ == RDMA_TypeType::Put ? MPI_LOCK_EXCLUSIVE : MPI_LOCK_SHARED) : - (op_type_ == RDMA_TypeType::Put ? MPI_LOCK_SHARED : MPI_LOCK_SHARED); - // FIXME: same expression in both branches of ternary operator + MPI_LOCK_SHARED; vt_debug_print( normal, rdma_channel, From 38de7dbcbd1d8a79e84f107ace765a53e852ae38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cezary=20Skrzy=C5=84ski?= Date: Tue, 21 May 2024 21:54:14 +0200 Subject: [PATCH 21/21] #2264: remove unused parameter --- src/vt/collective/barrier/barrier.cc | 8 ++------ src/vt/collective/barrier/barrier.h | 3 +-- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/vt/collective/barrier/barrier.cc b/src/vt/collective/barrier/barrier.cc index ad8e2a5f64..d54ebab013 100644 --- a/src/vt/collective/barrier/barrier.cc +++ b/src/vt/collective/barrier/barrier.cc @@ -90,11 +90,7 @@ Barrier::BarrierStateType& Barrier::insertFindBarrier( return iter->second; } -void Barrier::removeBarrier( - bool const& is_named, - [[maybe_unused]] bool const& is_wait, - BarrierType const& barrier -) { +void Barrier::removeBarrier(bool const& is_named, BarrierType const& barrier) { auto& state = is_named ? named_barrier_state_ : unnamed_barrier_state_; auto iter = state.find(barrier); @@ -147,7 +143,7 @@ void Barrier::waitBarrier( "waitBarrier: released: named={}, barrier={}\n", is_named, barrier ); - removeBarrier(is_named, is_wait, barrier); + removeBarrier(is_named, barrier); } void Barrier::contBarrier( diff --git a/src/vt/collective/barrier/barrier.h b/src/vt/collective/barrier/barrier.h index 2d2fd0f32c..6ffe0c12be 100644 --- a/src/vt/collective/barrier/barrier.h +++ b/src/vt/collective/barrier/barrier.h @@ -107,11 +107,10 @@ struct Barrier : virtual collective::tree::Tree { * \internal \brief Remove the state of a barrier * * \param[in] is_named whether the barrier is named - * \param[in] is_wait whether the barrier is of waiting type * \param[in] barrier the barrier ID */ void removeBarrier( - bool const& is_named, bool const& is_wait, BarrierType const& barrier + bool const& is_named, BarrierType const& barrier ); /**