From ba62b4111b73d2c4f874429ed7ab52deb85d008e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20P=C3=A9bay?= Date: Tue, 28 May 2024 13:09:22 -0400 Subject: [PATCH] #2174: add initial integration of vt-tv --- CMakeLists.txt | 9 +- ci/build_cpp.sh | 13 +++ ci/deps/vtk.sh | 29 ++++++ ci/docker/ubuntu-gnu-cpp.dockerfile | 10 ++ cmake/configure_options.cmake | 8 ++ cmake/link_vt.cmake | 9 ++ cmake/load_local_packages.cmake | 6 ++ cmake_config.h.in | 1 + docker-compose.yml | 1 + lib/fmt/CMakeLists.txt | 2 + src/vt/configs/arguments/app_config.h | 6 ++ src/vt/configs/arguments/args.cc | 15 +++ src/vt/configs/features/features_defines.h | 1 + .../vrt/collection/balance/lb_data_holder.cc | 98 +++++++++++++++++++ .../vrt/collection/balance/lb_data_holder.h | 24 +++++ .../balance/lb_invoke/lb_manager.cc | 57 +++++++++++ tests/CMakeLists.txt | 4 +- tests/unit/active/test_active_send_large.cc | 2 +- .../collection/test_checkpoint.extended.cc | 6 +- tests/unit/collection/test_lb.extended.cc | 8 +- .../test_model_select_subphases.nompi.cc | 4 +- tests/unit/lb/test_lb_data_comm.cc | 18 ++-- tests/unit/lb/test_lb_reader.nompi.cc | 4 +- tests/unit/objgroup/test_objgroup.cc | 2 +- tests/unit/phase/test_phase_management.cc | 6 +- tests/unit/termination/test_integral_set.cc | 2 +- .../unit/utils/test_histogram_approx.nompi.cc | 4 +- 27 files changed, 316 insertions(+), 33 deletions(-) create mode 100644 ci/deps/vtk.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index 9b24765221..dc406cf6bd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,16 +59,17 @@ set(PROJECT_TOOLS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/tools) # Import the linking macros for VT-related targets include(cmake/link_vt.cmake) -# Load packages that are required for core VT build -include(cmake/load_packages.cmake) - # Some options use TPL information (whether Perl was found etc.) include(cmake/configure_options.cmake) -include(cmake/check_compiler.cmake) include(cmake/nvcc_no_deprecated_gpu_targets.cmake) include(cmake/load_bundled_libraries.cmake) +# Load packages that are required for core VT build +# We need to do this after bundled libraries so we avoid library duplication +include(cmake/load_packages.cmake) +include(cmake/check_compiler.cmake) + # Primary VT build add_subdirectory(src) diff --git a/ci/build_cpp.sh b/ci/build_cpp.sh index 92c8a28e75..6d1871ecfe 100755 --- a/ci/build_cpp.sh +++ b/ci/build_cpp.sh @@ -96,6 +96,19 @@ else fi fi +if test "${VT_TV_ENABLED}" -eq 1 +then + if test -d "${source_dir}/lib/vt-tv" + then + { echo "vt-tv already in lib... not downloading"; } 2>/dev/null + else + cd "${source_dir}/lib" + vt_tv_rev="master" + git clone -b "${vt_tv_rev}" --depth 1 https://github.com/DARMA-tasking/vt-tv.git + cd - + fi +fi + if test "${VT_ZOLTAN_ENABLED:-0}" -eq 1 then export Zoltan_DIR=${ZOLTAN_DIR:-""} diff --git a/ci/deps/vtk.sh b/ci/deps/vtk.sh new file mode 100644 index 0000000000..6cdcc6f0bf --- /dev/null +++ b/ci/deps/vtk.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +set -exo pipefail + +if test $# -lt 2 +then + echo "usage: ./$0 " + exit 1 +fi + +vtk_version="$1" +vtk_tar_name="v${vtk_version}.tar.gz" +vtk_name="VTK-${vtk_version}" +install_dir="${2-}" +build_dir=/vtk-build/ + +wget "https://github.com/Kitware/VTK/archive/refs/tags/$vtk_tar_name" +tar xzf ${vtk_tar_name} +rm ${vtk_tar_name} +cd ${vtk_name} + +mkdir -p ${build_dir} +mkdir -p ${install_dir} + +cd ${build_dir} +cmake \ + -DCMAKE_INSTALL_PREFIX:FILEPATH=${install_dir} \ + ../${vtk_name} +cmake --build ${build_dir} --target install diff --git a/ci/docker/ubuntu-gnu-cpp.dockerfile b/ci/docker/ubuntu-gnu-cpp.dockerfile index e5bf682cf7..2c0cbe56a6 100644 --- a/ci/docker/ubuntu-gnu-cpp.dockerfile +++ b/ci/docker/ubuntu-gnu-cpp.dockerfile @@ -32,6 +32,11 @@ RUN apt-get update -y -q && \ wget \ zlib1g \ zlib1g-dev \ + libncurses5-dev \ + m4 \ + libgl1-mesa-dev \ + libglu1-mesa-dev \ + mesa-common-dev \ brotli \ python3 \ python3-brotli \ @@ -64,6 +69,11 @@ RUN ./cmake.sh 3.23.4 ${arch} ENV PATH=/cmake/bin/:$PATH ENV LESSCHARSET=utf-8 +COPY ./ci/deps/vtk.sh vtk.sh +RUN if [ "$VT_TV_ENABLED" -eq 1]; then \ + ./vtk.sh 9.3.0 /vtk-install; \ + fi + COPY ./ci/deps/mpich.sh mpich.sh RUN if [ "$ubuntu" = "18.04" ]; then \ ./mpich.sh 3.3.2 -j4; else \ diff --git a/cmake/configure_options.cmake b/cmake/configure_options.cmake index edf15845bf..c9cbbab35a 100644 --- a/cmake/configure_options.cmake +++ b/cmake/configure_options.cmake @@ -79,6 +79,14 @@ if(vt_trace_only) set(vt_mpi_guards ON) endif() +if (TV_LIBRARY) + message(STATUS "vt-tv found and enabled") + set(vt_feature_cmake_tv "1") +else() + message(STATUS "vt-tv not found") + set(vt_feature_cmake_tv "0") +endif() + define_option(vt_mpi_guards "user MPI prevention guards" "Build VT with poison MPI calls: code invoked from VT callbacks cannot invoke MPI functions" ON vt_feature_cmake_mpi_access_guards diff --git a/cmake/link_vt.cmake b/cmake/link_vt.cmake index 1114cf7fbd..3e99f89522 100644 --- a/cmake/link_vt.cmake +++ b/cmake/link_vt.cmake @@ -33,6 +33,7 @@ function(link_target_with_vt) LINK_FORT LINK_JSON LINK_BROTLI + LINK_VT_TV ) set( multiValueArg @@ -70,6 +71,14 @@ function(link_target_with_vt) endif() endif() + if (NOT DEFINED ARG_LINK_VT_TV AND ${ARG_DEFAULT_LINK_SET} OR ARG_LINK_VT_TV) + if (TV_LIBRARY) + target_link_libraries( + ${ARG_TARGET} PUBLIC ${ARG_BUILD_TYPE} ${TV_LIBRARY} + ) + endif() + endif() + if (NOT DEFINED ARG_LINK_ZOLTAN AND ${ARG_DEFAULT_LINK_SET} OR ARG_LINK_ZOLTAN) if (vt_zoltan_enabled) if (${ARG_DEBUG_LINK}) diff --git a/cmake/load_local_packages.cmake b/cmake/load_local_packages.cmake index 8fad9402ca..315ebb0c14 100644 --- a/cmake/load_local_packages.cmake +++ b/cmake/load_local_packages.cmake @@ -13,3 +13,9 @@ else() endif() set(CHECKPOINT_LIBRARY vt::lib::checkpoint) + +if (EXISTS "${PROJECT_LIB_DIR}/vt-tv") + set(vt_tv_python_bindings_enabled OFF) + add_subdirectory(${PROJECT_LIB_DIR}/vt-tv) + set(TV_LIBRARY vt::lib::vt-tv) +endif() diff --git a/cmake_config.h.in b/cmake_config.h.in index c10bea5e62..b0909af701 100644 --- a/cmake_config.h.in +++ b/cmake_config.h.in @@ -66,6 +66,7 @@ #define vt_feature_cmake_debug_verbose @vt_feature_cmake_debug_verbose@ #define vt_feature_cmake_rdma_tests @vt_feature_cmake_rdma_tests@ #define vt_feature_cmake_external_fmt @vt_feature_cmake_external_fmt@ +#define vt_feature_cmake_tv @vt_feature_cmake_tv@ #define vt_detected_max_num_nodes @cmake_detected_max_num_nodes@ diff --git a/docker-compose.yml b/docker-compose.yml index 6ed7dbba12..29ba208b37 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -120,6 +120,7 @@ x-vtopts: &vtopts CODECOV_TOKEN: ${CODECOV_TOKEN:-} TEST_LB_SCHEMA: ${TEST_LB_SCHEMA:-0} CMAKE_CXX_STANDARD: ${CMAKE_CXX_STANDARD:-17} + VT_TV_ENABLED: ${VT_TV:-0} services: ############################################################################## diff --git a/lib/fmt/CMakeLists.txt b/lib/fmt/CMakeLists.txt index 0357be8374..a4a54c7292 100644 --- a/lib/fmt/CMakeLists.txt +++ b/lib/fmt/CMakeLists.txt @@ -12,6 +12,8 @@ endfunction() add_headers(FMT_HEADERS core.h format.h format-inl.h ostream.h) set(FMT_SOURCES src/format.cc) +set(CMAKE_POSITION_INDEPENDENT_CODE ON) + add_library(fmt ${FMT_SOURCES} ${FMT_HEADERS}) add_library(fmt::fmt ALIAS fmt) set_target_properties(fmt PROPERTIES OUTPUT_NAME fmt-vt) diff --git a/src/vt/configs/arguments/app_config.h b/src/vt/configs/arguments/app_config.h index bdabfed535..58c4492f66 100644 --- a/src/vt/configs/arguments/app_config.h +++ b/src/vt/configs/arguments/app_config.h @@ -229,6 +229,9 @@ struct AppConfig { bool vt_debug_print_flush = false; + bool vt_tv = false; + std::string vt_tv_config_file = ""; + bool vt_user_1 = false; bool vt_user_2 = false; bool vt_user_3 = false; @@ -391,6 +394,9 @@ struct AppConfig { | vt_debug_print_flush + | vt_tv + | vt_tv_config_file + | vt_user_1 | vt_user_2 | vt_user_3 diff --git a/src/vt/configs/arguments/args.cc b/src/vt/configs/arguments/args.cc index ae2f7f84ef..c1522408ee 100644 --- a/src/vt/configs/arguments/args.cc +++ b/src/vt/configs/arguments/args.cc @@ -675,6 +675,20 @@ void addRuntimeArgs(CLI::App& app, AppConfig& appConfig) { a3->group(configRuntime); } +void addTVArgs(CLI::App& app, AppConfig& appConfig) { + auto tv_enabled = "Enable vt-tv visualization/mesh streaming"; + auto tv_file = "File name for YAML vt-tv configuraton file"; + + auto a1 = app.add_flag("--vt_tv", appConfig.vt_tv, tv_enabled); + auto a2 = app.add_option( + "--vt_tv_config_file", appConfig.vt_tv_config_file, tv_file + ); + + auto configTV = "vt-tv Configuration"; + a1->group(configTV); + a2->group(configTV); +} + void addThreadingArgs( [[maybe_unused]] CLI::App& app, [[maybe_unused]] AppConfig& appConfig @@ -777,6 +791,7 @@ std::tuple ArgConfig::parseToConfig( addSchedulerArgs(app, appConfig); addConfigFileArgs(app, appConfig); addRuntimeArgs(app, appConfig); + addTVArgs(app, appConfig); addThreadingArgs(app, appConfig); std::tuple result = parseArguments(app, argc, argv, appConfig); diff --git a/src/vt/configs/features/features_defines.h b/src/vt/configs/features/features_defines.h index d1455cc10d..f9c7b55e71 100644 --- a/src/vt/configs/features/features_defines.h +++ b/src/vt/configs/features/features_defines.h @@ -73,6 +73,7 @@ #define vt_feature_production_build 0 || vt_feature_cmake_production_build #define vt_feature_debug_verbose 0 || vt_feature_cmake_debug_verbose #define vt_feature_fmt_external 0 || vt_feature_cmake_external_fmt +#define vt_feature_tv 1 || vt_feature_cmake_tv #define vt_check_enabled(test_option) (vt_feature_ ## test_option != 0) diff --git a/src/vt/vrt/collection/balance/lb_data_holder.cc b/src/vt/vrt/collection/balance/lb_data_holder.cc index 5ed8b917c0..9d5ae5da01 100644 --- a/src/vt/vrt/collection/balance/lb_data_holder.cc +++ b/src/vt/vrt/collection/balance/lb_data_holder.cc @@ -44,6 +44,10 @@ #include "vt/vrt/collection/balance/lb_data_holder.h" #include "vt/context/context.h" +#if vt_check_enabled(tv) +# include +#endif + #include namespace vt { namespace vrt { namespace collection { namespace balance { @@ -275,6 +279,100 @@ std::unique_ptr LBDataHolder::toJson(PhaseType phase) const { return std::make_unique(std::move(j)); } +#if vt_check_enabled(tv) +std::unique_ptr LBDataHolder::toTV(PhaseType phase) const { + using vt::tv::PhaseWork; + using vt::tv::ObjectWork; + using vt::tv::ObjectCommunicator; + + std::unordered_map objects; + + if (node_data_.find(phase) != node_data_.end()) { + for (auto&& elm : node_data_.at(phase)) { + ElementIDStruct id = elm.first; + TimeType whole_phase_load = elm.second.whole_phase_load; + auto const& subphase_loads = elm.second.subphase_loads; + + typename DataMapType::mapped_type user_defined; + if ( + user_defined_lb_info_.find(phase) != user_defined_lb_info_.end() and + user_defined_lb_info_.at(phase).find(id) != + user_defined_lb_info_.at(phase).end() + ) { + user_defined = user_defined_lb_info_.at(phase).at(id); + } + std::unordered_map subphase_map; + for (std::size_t i = 0; i < subphase_loads.size(); i++) { + subphase_map[i] = subphase_loads[i]; + } + objects.try_emplace( + id.id, + id.id, whole_phase_load, std::move(subphase_map), std::move(user_defined) + ); + } + } + + if (node_comm_.find(phase) != node_comm_.end()) { + for (auto&& elm : node_comm_.at(phase)) { + auto const& key = elm.first; + auto const& volume = elm.second; + auto const& bytes = volume.bytes; + switch(key.cat_) { + case elm::CommCategory::SendRecv: { + auto from_id = key.fromObj(); + auto to_id = key.toObj(); + + if (objects.find(from_id.id) != objects.end()) { + objects.at(from_id.id).addSentCommunications(to_id.id, bytes); + } else if (objects.find(to_id.id) != objects.end()) { + objects.at(to_id.id).addReceivedCommunications(from_id.id, bytes); + } + break; + } + default: + // skip all other communications for now + break; + } + } + } + + return std::make_unique(phase, objects);; +} + +std::unordered_map LBDataHolder::getObjInfo( + PhaseType phase +) const { + std::unordered_map map; + if (node_data_.find(phase) != node_data_.end()) { + for (auto&& elm : node_data_.at(phase)) { + ElementIDStruct id = elm.first; + + bool is_collection = false; + bool is_objgroup = false; + + std::vector idx; + if (node_idx_.find(id) != node_idx_.end()) { + is_collection = true; + idx = std::get<1>(node_idx_.find(id)->second); + } + + if (node_objgroup_.find(id) != node_objgroup_.end()) { + is_objgroup = true; + } + + tv::ObjectInfo oi{ + id.id, id.getHomeNode(), id.isMigratable(), std::move(idx) + }; + oi.setIsCollection(is_collection); + oi.setIsObjGroup(is_objgroup); + map[id.id] = std::move(oi); + } + } + return map; +} + +#endif + LBDataHolder::LBDataHolder(nlohmann::json const& j) { auto this_node = theContext()->getNode(); diff --git a/src/vt/vrt/collection/balance/lb_data_holder.h b/src/vt/vrt/collection/balance/lb_data_holder.h index a3badad166..d0252384b5 100644 --- a/src/vt/vrt/collection/balance/lb_data_holder.h +++ b/src/vt/vrt/collection/balance/lb_data_holder.h @@ -48,6 +48,10 @@ #include "vt/vrt/collection/balance/lb_common.h" #include "vt/elm/elm_comm.h" +#if vt_check_enabled(tv) +# include +#endif + #include #include #include @@ -97,6 +101,26 @@ struct LBDataHolder { */ std::unique_ptr toJson(PhaseType phase) const; +#if vt_check_enabled(tv) + /** + * \brief Generate vt-tv data structure for visualization + * + * \param[in] phase the phase to generate + * + * \return a \c vt::tv::PhaseWork data structure + */ + std::unique_ptr toTV(PhaseType phase) const; + + /** + * \brief Get all object info mapped here for a given phase + * + * \return map with object info + */ + std::unordered_map getObjInfo( + PhaseType phase + ) const; +#endif + /** * \brief Output a LB phase's metadata to JSON * diff --git a/src/vt/vrt/collection/balance/lb_invoke/lb_manager.cc b/src/vt/vrt/collection/balance/lb_invoke/lb_manager.cc index 873632ae90..f70e307081 100644 --- a/src/vt/vrt/collection/balance/lb_invoke/lb_manager.cc +++ b/src/vt/vrt/collection/balance/lb_invoke/lb_manager.cc @@ -73,6 +73,10 @@ #include "vt/vrt/collection/manager.h" #include "vt/utils/json/json_appender.h" +#if vt_check_enabled(tv) +# include +#endif + namespace vt { namespace vrt { namespace collection { namespace balance { /*static*/ std::unique_ptr LBManager::construct() { @@ -487,6 +491,42 @@ void LBManager::fatalError() { closeStatisticsFile(); } +#if vt_check_enabled(tv) + struct GatherTVInfo { + GatherTVInfo() = default; + + std::unordered_map rank_map; + std::unordered_map info; + PhaseType phase = 0; + + template + void serialize(SerializerT& s) { + s | rank_map | info | phase; + } + + friend GatherTVInfo operator+(GatherTVInfo a1, GatherTVInfo const& a2) { + for (auto& [node, rank] : a2.rank_map) { + a1.rank_map[node] = rank; + } + for (auto& [elm, oi] : a2.info) { + a1.info[elm] = oi; + } + return a1; + } +}; + + +static void collectTVData(GatherTVInfo& gather) { + using tv::utility::ParseRender; + ParseRender pr{theConfig()->vt_tv_config_file}; + auto info = std::make_unique( + std::move(gather.info), + std::move(gather.rank_map) + ); + pr.parseAndRender(gather.phase, std::move(info)); +} +#endif + void LBManager::finishedLB(PhaseType phase) { vt_debug_print( normal, lb, @@ -497,6 +537,23 @@ void LBManager::finishedLB(PhaseType phase) { theNodeLBData()->outputLBDataForPhase(phase); destroyLB(); + +#if vt_check_enabled(tv) + if (theConfig()->vt_tv) { + vt::runInEpochCollective([&]{ + auto phase_work = theNodeLBData()->getLBData()->toTV(phase); + auto object_info = theNodeLBData()->getLBData()->getObjInfo(phase); + std::unordered_map map; + map[phase] = std::move(*phase_work); + auto this_node = theContext()->getNode(); + vt::tv::Rank r{this_node, std::move(map)}; + std::unordered_map rank_map; + rank_map[this_node] = std::move(r); + GatherTVInfo gather{rank_map, object_info, phase}; + proxy_.reduce(0, std::move(gather)); + }); + } +#endif } void LBManager::statsHandler(std::vector const& in_stat_vec) { diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index e0d10b060e..b7fbec95cb 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -44,7 +44,9 @@ subdirlist( set(BUILD_GMOCK OFF CACHE BOOL "Builds the googlemock subproject" FORCE) set(INSTALL_GTEST OFF CACHE BOOL "Enable installation of googletest. (Projects embedding googletest may want to turn this OFF.)" FORCE) -add_subdirectory(extern/googletest) +if (NOT TARGET gtest) + add_subdirectory(extern/googletest) +endif() set(GOOGLETEST_LIBRARY gtest) set_darma_compiler_flags(${GOOGLETEST_LIBRARY}) diff --git a/tests/unit/active/test_active_send_large.cc b/tests/unit/active/test_active_send_large.cc index 7833fd87a5..25ac33b187 100644 --- a/tests/unit/active/test_active_send_large.cc +++ b/tests/unit/active/test_active_send_large.cc @@ -91,7 +91,7 @@ template void checkMsg(T msg) { auto arr = reinterpret_cast(&msg->payload[0]); for (std::size_t i = 0; i < msg->bytes / sizeof(int64_t); i++) { - EXPECT_EQ(arr[i], i); + EXPECT_EQ(arr[i], static_cast(i)); } } diff --git a/tests/unit/collection/test_checkpoint.extended.cc b/tests/unit/collection/test_checkpoint.extended.cc index 5f7b7c4666..28af0b2ed5 100644 --- a/tests/unit/collection/test_checkpoint.extended.cc +++ b/tests/unit/collection/test_checkpoint.extended.cc @@ -242,7 +242,7 @@ TEST_F(TestCheckpoint, test_checkpoint_1) { }); // Ensure that all elements were properly destroyed - EXPECT_EQ(counter, 0); + EXPECT_EQ(counter, 0ull); } } @@ -315,7 +315,7 @@ TEST_F(TestCheckpoint, test_checkpoint_in_place_2) { }); // Ensure that all elements were properly destroyed - EXPECT_EQ(counter, 0); + EXPECT_EQ(counter, 0ull); } TEST_F(TestCheckpoint, test_checkpoint_in_place_3) { @@ -428,7 +428,7 @@ TEST_F(TestCheckpoint, test_checkpoint_no_elements_on_root_rank) { //verify that root node has no elements, by construction with map if(this_node == 0) { auto local_set = theCollection()->getLocalIndices(proxy); - EXPECT_EQ(local_set.size(), 0); + EXPECT_EQ(local_set.size(), 0ull); } vt_print(gen, "checkpointToFile\n"); diff --git a/tests/unit/collection/test_lb.extended.cc b/tests/unit/collection/test_lb.extended.cc index 2c6379cc38..39b6756610 100644 --- a/tests/unit/collection/test_lb.extended.cc +++ b/tests/unit/collection/test_lb.extended.cc @@ -178,7 +178,7 @@ TEST_F(TestLoadBalancerOther, test_make_graph_symmetric) { auto const phase = thePhase()->getCurrentPhase(); auto const comm_data = theNodeLBData()->getNodeComm(phase); ASSERT_NE(comm_data, nullptr); - ASSERT_EQ(comm_data->size(), 1); + ASSERT_EQ(comm_data->size(), 1ull); // test auto proxy = theLBManager()->makeLB(); @@ -190,11 +190,11 @@ TEST_F(TestLoadBalancerOther, test_make_graph_symmetric) { // assert if (num_nodes == 1) { - ASSERT_EQ(comm_data->size(), 1); + ASSERT_EQ(comm_data->size(), 1ull); return; } - ASSERT_EQ(comm_data->size(), 2); + ASSERT_EQ(comm_data->size(), 2ull); auto const prev_node = (this_node + num_nodes - 1) % num_nodes; bool this_to_next = false, prev_to_this = false; @@ -429,7 +429,7 @@ TEST_P(TestNodeLBDataDumper, test_node_lb_data_dumping_with_interval) { auto& json = *json_ptr; EXPECT_TRUE(json.find("phases") != json.end()); - EXPECT_EQ(json["phases"].size(), num_phases); + EXPECT_EQ(json["phases"].size(), static_cast(num_phases)); for(const auto& phase : json["phases"]){ EXPECT_TRUE(phase.find("user_defined") != phase.end()); EXPECT_TRUE(phase["user_defined"].contains("time")); diff --git a/tests/unit/collection/test_model_select_subphases.nompi.cc b/tests/unit/collection/test_model_select_subphases.nompi.cc index ec2ee0ec5a..4ab01ce4df 100644 --- a/tests/unit/collection/test_model_select_subphases.nompi.cc +++ b/tests/unit/collection/test_model_select_subphases.nompi.cc @@ -125,7 +125,7 @@ TEST_F(TestModelSelectSubphases, test_model_select_subphases_1) { auto test_model = std::make_shared(std::make_shared(), subphases); - EXPECT_EQ(test_model->getNumSubphases(), subphases.size()); + EXPECT_EQ(test_model->getNumSubphases(), static_cast(subphases.size())); test_model->setLoads(&proc_load, nullptr, nullptr); test_model->updateLoads(0); @@ -174,7 +174,7 @@ TEST_F(TestModelSelectSubphases, test_model_select_subphases_2) { auto test_model = std::make_shared(std::make_shared(), subphases); - EXPECT_EQ(test_model->getNumSubphases(), subphases.size()); + EXPECT_EQ(test_model->getNumSubphases(), static_cast(subphases.size())); test_model->setLoads(&proc_load, nullptr, nullptr); test_model->updateLoads(0); diff --git a/tests/unit/lb/test_lb_data_comm.cc b/tests/unit/lb/test_lb_data_comm.cc index b0ab4e6c69..ada04dbe63 100644 --- a/tests/unit/lb/test_lb_data_comm.cc +++ b/tests/unit/lb/test_lb_data_comm.cc @@ -302,7 +302,7 @@ TEST_F(TestLBDataComm, test_lb_data_comm_col_to_col_send) { EXPECT_TRUE(key.from_.isMigratable()); EXPECT_EQ(key.from_.id, idxToElmID(prev_idx)); EXPECT_EQ(vol.bytes, sizeof(MyMsg) * num_sends); - EXPECT_EQ(vol.messages, num_sends); + EXPECT_EQ(vol.messages, static_cast(num_sends)); found = true; } } @@ -367,7 +367,7 @@ TEST_F(TestLBDataComm, test_lb_data_comm_col_to_objgroup_send) { EXPECT_FALSE(key.to_.isMigratable()); EXPECT_EQ(key.to_.id, idb); EXPECT_EQ(vol.bytes, sizeof(MyObjMsg) * num_sends); - EXPECT_EQ(vol.messages, num_sends); + EXPECT_EQ(vol.messages, static_cast(num_sends)); found = true; } } @@ -430,7 +430,7 @@ TEST_F(TestLBDataComm, test_lb_data_comm_objgroup_to_col_send) { EXPECT_FALSE(key.from_.isMigratable()); EXPECT_EQ(key.from_.id, vt::elm::ElmIDBits::createObjGroup(op, prev).id); EXPECT_EQ(vol.bytes, sizeof(MyMsg) * num_sends); - EXPECT_EQ(vol.messages, num_sends); + EXPECT_EQ(vol.messages, static_cast(num_sends)); found = true; } } @@ -484,7 +484,7 @@ TEST_F(TestLBDataComm, test_lb_data_comm_objgroup_to_objgroup_send) { EXPECT_FALSE(key.from_.isMigratable()); EXPECT_EQ(key.to_.id, idb); EXPECT_EQ(vol.bytes, sizeof(MyObjMsg) * num_sends); - EXPECT_EQ(vol.messages, num_sends); + EXPECT_EQ(vol.messages, static_cast(num_sends)); found = true; } } @@ -541,7 +541,7 @@ TEST_F(TestLBDataComm, test_lb_data_comm_handler_to_col_send) { EXPECT_FALSE(key.from_.isMigratable()); EXPECT_EQ(key.from_.id, vt::elm::ElmIDBits::createBareHandler(prev).id); EXPECT_EQ(vol.bytes, sizeof(MyMsg) * num_sends); - EXPECT_EQ(vol.messages, num_sends); + EXPECT_EQ(vol.messages, static_cast(num_sends)); found = true; } } @@ -602,7 +602,7 @@ TEST_F(TestLBDataComm, test_lb_data_comm_col_to_handler_send) { EXPECT_FALSE(key.to_.isMigratable()); EXPECT_EQ(key.to_.id, vt::elm::ElmIDBits::createBareHandler(next).id); EXPECT_EQ(vol.bytes, sizeof(MyObjMsg) * num_sends); - EXPECT_EQ(vol.messages, num_sends); + EXPECT_EQ(vol.messages, static_cast(num_sends)); found = true; } } @@ -649,7 +649,7 @@ TEST_F(TestLBDataComm, test_lb_data_comm_objgroup_to_handler_send) { EXPECT_EQ(key.to_.id, vt::elm::ElmIDBits::createBareHandler(next).id); EXPECT_FALSE(key.from_.isMigratable()); EXPECT_EQ(vol.bytes, sizeof(MyObjMsg) * num_sends); - EXPECT_EQ(vol.messages, num_sends); + EXPECT_EQ(vol.messages, static_cast(num_sends)); found = true; } } @@ -694,7 +694,7 @@ TEST_F(TestLBDataComm, test_lb_data_comm_handler_to_objgroup_send) { EXPECT_EQ(key.from_.id, vt::elm::ElmIDBits::createBareHandler(this_node).id); EXPECT_FALSE(key.from_.isMigratable()); EXPECT_EQ(vol.bytes, sizeof(MyObjMsg) * num_sends); - EXPECT_EQ(vol.messages, num_sends); + EXPECT_EQ(vol.messages, static_cast(num_sends)); found = true; } } @@ -734,7 +734,7 @@ TEST_F(TestLBDataComm, test_lb_data_comm_handler_to_handler_send) { EXPECT_FALSE(key.to_.isMigratable()); EXPECT_FALSE(key.from_.isMigratable()); EXPECT_GE(vol.bytes, sizeof(MyObjMsg) * num_sends); - EXPECT_GE(vol.messages, num_sends); + EXPECT_EQ(vol.messages, static_cast(num_sends)); found = true; } } diff --git a/tests/unit/lb/test_lb_reader.nompi.cc b/tests/unit/lb/test_lb_reader.nompi.cc index 5da78769d9..1ac64cfb7c 100644 --- a/tests/unit/lb/test_lb_reader.nompi.cc +++ b/tests/unit/lb/test_lb_reader.nompi.cc @@ -69,8 +69,8 @@ TEST_F(TestLBReader, test_lb_read_1) { EXPECT_EQ(Config::hasOfflineLB(), false); EXPECT_EQ(Config::numEntries(), 3); - EXPECT_EQ(Config::getExactEntries().size(), 2); - EXPECT_EQ(Config::getModEntries().size(), 1); + EXPECT_EQ(Config::getExactEntries().size(), 2u); + EXPECT_EQ(Config::getModEntries().size(), 1u); for (ConfigIdx i = 0; i < 21; i++) { auto entry = Config::entry(i); diff --git a/tests/unit/objgroup/test_objgroup.cc b/tests/unit/objgroup/test_objgroup.cc index ddfc690cd0..0d742a606a 100644 --- a/tests/unit/objgroup/test_objgroup.cc +++ b/tests/unit/objgroup/test_objgroup.cc @@ -79,7 +79,7 @@ struct TestObjGroup : TestParallelHarness { void verifyVec(VectorPayload vec) { auto final_size = vec.vec_.size(); auto n = vt::theContext()->getNumNodes(); - EXPECT_EQ(final_size, n); + EXPECT_EQ(final_size, static_cast(n)); total_verify_expected_++; } }; diff --git a/tests/unit/phase/test_phase_management.cc b/tests/unit/phase/test_phase_management.cc index 98f7baf147..a32ca0513e 100644 --- a/tests/unit/phase/test_phase_management.cc +++ b/tests/unit/phase/test_phase_management.cc @@ -55,7 +55,7 @@ TEST_F(TestPhaseManagement, test_phase_manager_1) { auto phase_mgr = phase::PhaseManager::construct(); // start with phase 0 - EXPECT_EQ(phase_mgr->getCurrentPhase(), 0); + EXPECT_EQ(phase_mgr->getCurrentPhase(), 0ull); int start_hooks = 0; int end_hooks = 0; @@ -97,13 +97,13 @@ TEST_F(TestPhaseManagement, test_phase_manager_1) { EXPECT_EQ(start_hooks, 3); EXPECT_EQ(end_hooks, 1); EXPECT_EQ(end_post_hooks, 1); - EXPECT_EQ(phase_mgr->getCurrentPhase(), 1); + EXPECT_EQ(phase_mgr->getCurrentPhase(), 1ull); phase_mgr->nextPhaseCollective(); EXPECT_EQ(start_hooks, 4); EXPECT_EQ(end_hooks, 2); EXPECT_EQ(end_post_hooks, 2); - EXPECT_EQ(phase_mgr->getCurrentPhase(), 2); + EXPECT_EQ(phase_mgr->getCurrentPhase(), 2ull); } }}} // end namespace vt::tests::unit diff --git a/tests/unit/termination/test_integral_set.cc b/tests/unit/termination/test_integral_set.cc index adc4b39cc1..b5df66fe5e 100644 --- a/tests/unit/termination/test_integral_set.cc +++ b/tests/unit/termination/test_integral_set.cc @@ -177,7 +177,7 @@ TEST_F(TestIntegralSet, test_interval_set_3) { i.insert(0); EXPECT_FALSE(i.empty()); - EXPECT_EQ(i.size(), 1); + EXPECT_EQ(i.size(), 1ull); } }}} // end namespace vt::tests::unit diff --git a/tests/unit/utils/test_histogram_approx.nompi.cc b/tests/unit/utils/test_histogram_approx.nompi.cc index ab21d3a8e9..f0379bc356 100644 --- a/tests/unit/utils/test_histogram_approx.nompi.cc +++ b/tests/unit/utils/test_histogram_approx.nompi.cc @@ -93,7 +93,7 @@ TEST_F(TestHistogramApprox, test_histogram_2) { EXPECT_EQ(h.getMin(), 1); EXPECT_EQ(h.getMax(), 92); EXPECT_EQ(h.getCount(), len); - EXPECT_EQ(h.getCentroids().size(), 4); + EXPECT_EQ(h.getCentroids().size(), 4u); } TEST_F(TestHistogramApprox, test_histogram_sum_3) { @@ -247,7 +247,7 @@ TEST_F(TestHistogramApprox, test_histogram_merge_7) { auto centroids = h1.getCentroids(); // Must be 8 centroids if merge/max was applied correctly - EXPECT_EQ(centroids.size(), 8); + EXPECT_EQ(centroids.size(), 8ull); // We should have all the original centroids, except the last one, which // should be a single combined centroids of the last three values if optimal