diff --git a/libs/full/parcelport_mpi/include/hpx/parcelport_mpi/sender_connection.hpp b/libs/full/parcelport_mpi/include/hpx/parcelport_mpi/sender_connection.hpp index 9eb969d3708..42cfb4419b3 100644 --- a/libs/full/parcelport_mpi/include/hpx/parcelport_mpi/sender_connection.hpp +++ b/libs/full/parcelport_mpi/include/hpx/parcelport_mpi/sender_connection.hpp @@ -201,7 +201,9 @@ namespace hpx::parcelset::policies::mpi { request_ = util::mpi_environment::isend( const_cast( reinterpret_cast(chunks.data())), - chunks.size(), dst_, tag_); + chunks.size() * + sizeof(parcel_buffer_type::transmission_chunk_type), + dst_, tag_); request_ptr_ = &request_; state_ = connection_state::sent_transmission_chunks; diff --git a/libs/full/parcelset/tests/regressions/CMakeLists.txt b/libs/full/parcelset/tests/regressions/CMakeLists.txt index b0a7ef5d7ea..7c48ce0967a 100644 --- a/libs/full/parcelset/tests/regressions/CMakeLists.txt +++ b/libs/full/parcelset/tests/regressions/CMakeLists.txt @@ -12,7 +12,9 @@ if(HPX_WITH_NETWORKING) set(tests ${tests} very_big_parcel) + set(tests ${tests} very_big_tchunk) set(very_big_parcel_PARAMETERS LOCALITIES 2) + set(very_big_tchunk_PARAMETERS LOCALITIES 2) endif() foreach(test ${tests}) @@ -29,10 +31,13 @@ foreach(test ${tests}) FOLDER "Tests/Regressions/Modules/Full/Parcelset" ) - # Disable the test due to limited CircleCI resources - - # add_hpx_regression_test( "modules.parcelset" ${test} ${${test}_PARAMETERS} - # TIMEOUT 900 ) + # Disable the test for very_big_parcel due to limited CircleCI resources + if(${test} STREQUAL "very_big_parcel") + continue() + endif() + add_hpx_regression_test( + "modules.parcelset" ${test} ${${test}_PARAMETERS} TIMEOUT 900 + ) endforeach() diff --git a/libs/full/parcelset/tests/regressions/very_big_tchunk.cpp b/libs/full/parcelset/tests/regressions/very_big_tchunk.cpp new file mode 100644 index 00000000000..2bb93d4f379 --- /dev/null +++ b/libs/full/parcelset/tests/regressions/very_big_tchunk.cpp @@ -0,0 +1,100 @@ +// Copyright (c) 2025 Jiakun Yan +// Copyright (c) 2025 Marco Diers +// +// SPDX-License-Identifier: BSL-1.0 +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include + +class Data +{ +public: + Data() = default; + + Data(std::size_t size) + { + for (auto i(0ul); i < size; ++i) + { + _data.emplace(std::make_tuple(i), std::vector(3001)); + } + } + + auto size() const + { + return _data.size(); + } + + template + friend auto serialize(Archive& archive, Data& object, unsigned int) + { + archive& object._data; + return; + } + +private: + std::map, std::vector> _data{}; +}; + +class Component : public hpx::components::component_base +{ +public: + Component() = default; + + auto call(Data data) -> void + { + std::cout << "Data size: " << data.size() << '\n'; + return; + } + + HPX_DEFINE_COMPONENT_ACTION(Component, call) +}; + +HPX_REGISTER_COMPONENT(hpx::components::component, Component); +HPX_REGISTER_ACTION(Component::call_action) + +class ComponentClient + : public hpx::components::client_base +{ + using BaseType = hpx::components::client_base; + +public: + template + ComponentClient(Arguments... arguments) + : BaseType(std::move(arguments)...) + { + } + + template + auto call(Arguments... arguments) + { + return hpx::async( + this->get_id(), std::move(arguments)...); + } +}; + +int hpx_main() +{ + std::vector clients; + auto localities(hpx::find_all_localities()); + std::transform(std::begin(localities), std::end(localities), + std::back_inserter(clients), + [](auto& loc) { return hpx::new_(loc); }); + Data data(1444); + std::vector calls; + for (auto& client : clients) + { + calls.emplace_back(client.call(data)); + } + hpx::wait_all(calls); + + return hpx::finalize(); +} + +int main(int argc, char* argv[]) +{ + return hpx::init(argc, argv); +}