Skip to content

Commit d243d07

Browse files
committed
Add a test of delayed serialization and de-serialization of parcels
delayed_serialization runs on one locality and takes a parcel through what a parcelport does with it: parcel_await_apply, encoding, decoding with load_schedule, and scheduling the action after on_receive_complete. Its argument produces its data asynchronously while the parcel is preprocessed (a keep-alive buffer and a future handed to preprocess_future) and sends it as a zero-copy chunk. With zero-copy receive the data is received into a staging buffer and a post-receive step copies it into place later. The test checks that one buffer is created whatever the number of preprocessing rounds, that the parcel keeps it until it has been sent, that the action runs only after the post-receive step, and the paths without zero-copy receive, without chunks, and of a plain archive. The enumeration hpx::serialization::detail::fundamental_types, which save_binary, save_binary_chunk, load_binary and load_binary_chunk take, is exported from the C++ module, so serialization code outside of it can call these functions. Signed-off-by: Hartmut Kaiser <hartmut.kaiser@gmail.com>
1 parent 5bdec6e commit d243d07

3 files changed

Lines changed: 508 additions & 3 deletions

File tree

‎libs/core/serialization/include/hpx/serialization/basic_archive.hpp‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,9 @@ namespace hpx::serialization {
7979

8080
namespace detail {
8181

82-
enum class fundamental_types : std::uint8_t
83-
{
82+
// the type information save_binary, save_binary_chunk, load_binary
83+
// and load_binary_chunk take
84+
HPX_CXX_CORE_EXPORT enum class fundamental_types : std::uint8_t {
8485
none = static_cast<std::uint8_t>(~0x0),
8586
unknown = 0,
8687
bool_ = 1,

‎libs/full/parcelset/tests/unit/CMakeLists.txt‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ if(NOT HPX_WITH_NETWORKING)
1010
return()
1111
endif()
1212

13-
set(tests put_parcels set_parcel_write_handler zero_copy_parcel)
13+
set(tests delayed_serialization put_parcels set_parcel_write_handler
14+
zero_copy_parcel
15+
)
1416

1517
set(put_parcels_PARAMETERS LOCALITIES 2)
1618
set(set_parcel_write_handler_PARAMETERS LOCALITIES 2)

0 commit comments

Comments
 (0)