|
MADNESS 0.10.1
|
Regression tests for storing >INT_MAX data through the parallel-container archives. More...
#include <cstdint>#include <cstdlib>#include <cstring>#include <string>#include <vector>#include <madness/world/MADworld.h>#include <madness/world/worlddc.h>#include <madness/world/vector_archive.h>#include <madness/world/parallel_archive.h>#include <madness/world/parallel_dc_archive.h>
Functions | |
| int | main (int argc, char **argv) |
Regression tests for storing >INT_MAX data through the parallel-container archives.
Two independent paths are exercised, both relevant to the cloud (Cloud uses ContainerRecord{Output,Input}Archive, and its StoreFunction policy serializes a function's coefficient WorldContainer through ParallelOutputArchive):
test_record_chunk: a single record whose serialized size exceeds INT_MAX, stored/loaded via ContainerRecord{Output,Input}Archive. Exercises the chunking added in commit 1953b906. EXPECTED: passes (chunking is correct).
test_container_store: a WorldContainer whose total serialized size exceeds INT_MAX, stored via ParallelOutputArchive<VectorOutputArchive> (the path Cloud's StoreFunction uses for Function coeffs). This hits the int-typed size/offset arithmetic in worlddc.h ArchiveStoreImpl<ParallelOutputArchive,WorldContainer>: const int size = local_size; // truncates size_t total_size = offsets.back()+sizes.back(); // int overflow new unsigned char[total_size]; // -> std::bad_alloc EXPECTED (before fix): std::bad_alloc. (after fix): byte-exact.
test_adjacent_keys, test_lookalike, test_unframed, test_erase: the chunk framing must not touch neighbouring records, must not misread ordinary records that look like headers, must leave unframed (batch) records as the bare payload, and must free chunks on erase.
test_chunk_collision, test_close_once: a record overwriting a chunk is detected on read, and close() followed by the destructor writes only once.
Run -np 1 for the simplest reproduction (single rank => local_size == total > INT_MAX); -np 2 also exercises the MPI_Gather/Gatherv displacement path.
| int main | ( | int | argc, |
| char ** | argv ) |
References e(), madness::error(), madness::finalize(), madness::initialize(), madness::print(), and madness::World::rank().