Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

new test: very big tchunk #6620

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,9 @@ namespace hpx::parcelset::policies::mpi {
request_ = util::mpi_environment::isend(
const_cast<void*>(
reinterpret_cast<const void*>(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;
Expand Down
13 changes: 9 additions & 4 deletions libs/full/parcelset/tests/regressions/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand All @@ -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()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be better to add an exclusion here: https://github.com/STEllAR-GROUP/hpx/blob/master/.circleci/config.yml#L706?

add_hpx_regression_test(
"modules.parcelset" ${test} ${${test}_PARAMETERS} TIMEOUT 900
)

endforeach()

Expand Down
100 changes: 100 additions & 0 deletions libs/full/parcelset/tests/regressions/very_big_tchunk.cpp
Original file line number Diff line number Diff line change
@@ -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 <hpx/future.hpp>
#include <hpx/hpx.hpp>
#include <hpx/hpx_init.hpp>
#include <hpx/runtime_distributed/find_all_localities.hpp>

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<float>(3001));
}
}

auto size() const
{
return _data.size();
}

template <typename Archive>
friend auto serialize(Archive& archive, Data& object, unsigned int)
{
archive& object._data;
return;
}

private:
std::map<std::tuple<std::size_t>, std::vector<float>> _data{};
};

class Component : public hpx::components::component_base<Component>
{
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>, Component);
HPX_REGISTER_ACTION(Component::call_action)

class ComponentClient
: public hpx::components::client_base<ComponentClient, Component>
{
using BaseType = hpx::components::client_base<ComponentClient, Component>;

public:
template <typename... Arguments>
ComponentClient(Arguments... arguments)
: BaseType(std::move(arguments)...)
{
}

template <typename... Arguments>
auto call(Arguments... arguments)
{
return hpx::async<Component::call_action>(
this->get_id(), std::move(arguments)...);
}
};

int hpx_main()
{
std::vector<ComponentClient> clients;
auto localities(hpx::find_all_localities());
std::transform(std::begin(localities), std::end(localities),
std::back_inserter(clients),
[](auto& loc) { return hpx::new_<ComponentClient>(loc); });
Data data(1444);
std::vector<decltype(clients.front().call(data))> 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);
}
Loading