Commit cbb27bec authored by Pádraig Ó Conbhuí's avatar Pádraig Ó Conbhuí
Browse files

WIP: Probing freeze on [MPI_Binary_file] test

parent a0f12815
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -324,6 +324,8 @@ if(EXSEISDAT_TEST_ENABLE_MPI_SPECTESTS)
            ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} ${EXSEISDAT_TEST_NPROCS}
                ${MPIEXEC_PREFLAGS}
                $<TARGET_FILE:catch2_unit_tests>
                "MPI_Binary_file" -c "Contiguous access"
                -r console -d yes
                ${MPIEXEC_POSTFLAGS}
    )
endif(EXSEISDAT_TEST_ENABLE_MPI_SPECTESTS)
+28 −0
Original line number Diff line number Diff line
#ifndef EXSEISDAT_TEST_PIOL_BINARY_FILE_TEST_HH
#define EXSEISDAT_TEST_PIOL_BINARY_FILE_TEST_HH

/* DELETE ME */
#include <iostream>

#include "exseisdat/piol/Binary_file.hh"
#include "exseisdat/utils/decomposition/block_decomposition.hh"

@@ -31,14 +34,18 @@ void test_binary_file(

    SECTION (
        "is_open() should be true for a properly constructed Binary_file.") {
        std::cerr
            << "starting: is_open() should be true for a properly constructed Binary_file.\n";
        REQUIRE(binary_file.is_open() == true);
    }

    SECTION ("get_file_size() should return the file size.") {
        std::cerr << "starting: get_file_size() should return the file size.\n";
        REQUIRE(binary_file.get_file_size() == generator.file_size());
    }

    SECTION ("set_file_size() should set the file size.") {
        std::cerr << "starting: set_file_size() should set the file size.\n";
        size_t original_size = binary_file.get_file_size();

        binary_file.set_file_size(original_size + 1);
@@ -50,6 +57,8 @@ void test_binary_file(
        REQUIRE(generator.file_size() == original_size);

        SECTION ("Any data within the old size should still be there.") {
            std::cerr
                << "starting: Any data within the old size should still be there.\n";
            generator.for_each([=](size_t global_i,
                                   unsigned char original_value,
                                   unsigned char current_value) {
@@ -61,6 +70,7 @@ void test_binary_file(
    }

    SECTION ("Contiguous access") {
        std::cerr << "starting: Contiguous access\n";
        enum class Access { parallel, single };

        Access access = GENERATE_COPY(filter(
@@ -105,6 +115,8 @@ void test_binary_file(
        size_t local_size   = decomposition.local_size;

        SECTION ("read() should read a contiguous chunk of the file.") {
            std::cerr
                << "starting: read() should read a contiguous chunk of the file.\n";

            Buffer<unsigned char> buffer(communicator, local_size);

@@ -131,6 +143,8 @@ void test_binary_file(
        }

        SECTION ("write() should write a contiguous chunk of the file") {
            std::cerr
                << "starting: write() should write a contiguous chunk of the file\n";

            // Set the buffer to the new values
            Buffer<unsigned char> buffer = ([=] {
@@ -165,6 +179,7 @@ void test_binary_file(
    }

    SECTION ("Strided access") {
        std::cerr << "starting: Strided access\n";
        enum class Access { parallel, single };

        Access access = GENERATE_COPY(filter(
@@ -296,6 +311,8 @@ void test_binary_file(

        SECTION (
            "read_noncontiguous() should read strided data from the file.") {
            std::cerr
                << "starting: read_noncontiguous() should read strided data from the file.\n";
            Buffer<unsigned char> buffer(
                communicator, local_number_of_blocks * block_size);

@@ -331,6 +348,8 @@ void test_binary_file(

        SECTION (
            "write_noncontiguous() should write strided data to the file.") {
            std::cerr
                << "starting: write_noncontiguous() should write strided data to the file.\n";
            // Set the buffer to the new values
            Buffer<unsigned char> buffer = ([=] {
                Buffer<unsigned char> buffer(
@@ -386,6 +405,7 @@ void test_binary_file(
    }

    SECTION ("Unstructured access") {
        std::cerr << "starting: Unstructured access\n";

        //
        // Set unstructured read/write parameters
@@ -502,6 +522,8 @@ void test_binary_file(

        SECTION (
            "read_noncontiguous_irregular() should read data from a file at arbitrary offsets") {
            std::cerr
                << "starting: read_noncontiguous_irregular() should read data from a file at arbitrary offsets\n";
            Buffer<unsigned char> buffer(
                communicator, local_offsets.size() * block_size);

@@ -548,6 +570,8 @@ void test_binary_file(

        SECTION (
            "write_noncontiguous_irregular() should write data to a file at arbitrary offsets") {
            std::cerr
                << "starting: write_noncontiguous_irregular() should write data to a file at arbitrary offsets\n";
            // Set the buffer to the new values
            Buffer<unsigned char> buffer = ([&] {
                Buffer<unsigned char> buffer(
@@ -630,6 +654,7 @@ void test_binary_file_2gb_limit(


    SECTION ("write and read") {
        std::cerr << "starting: write and read\n";
        for (size_t i = 0; i < buffer.size(); i++) {
            buffer[i] = static_cast<Buffer::value_type>(i);
        }
@@ -650,6 +675,7 @@ void test_binary_file_2gb_limit(
    }

    SECTION ("write_noncontiguous and read_noncontiguous") {
        std::cerr << "starting: write_noncontiguous and read_noncontiguous\n";
        for (size_t i = 0; i < buffer.size(); i++) {
            buffer[i] = static_cast<Buffer::value_type>(i);
        }
@@ -672,6 +698,8 @@ void test_binary_file_2gb_limit(
    }

    SECTION ("write_noncontiguous_irregular and read_noncontiguous_irregular") {
        std::cerr
            << "starting: write_noncontiguous_irregular and read_noncontiguous_irregular\n";
        for (size_t i = 0; i < buffer.size(); i++) {
            buffer[i] = static_cast<Buffer::value_type>(i);
        }
+8 −1
Original line number Diff line number Diff line
/* DELETE ME */
#include <iostream>

#include "exseisdat/piol/mpi/MPI_Binary_file.hh"

#include "piol/Binary_file.test.hh"
@@ -177,12 +180,16 @@ TEST_CASE("MPI_Binary_file", "[MPI_Binary_file][Binary_file][PIOL]")

    size_t file_size = GENERATE(1, 10, 1000, 1024 * 1024);

    std::cerr << "\n\n file size: " << file_size << '\n';

    // 0 for default
    size_t max_array_size = GENERATE(0, 10);
    // size_t max_array_size = GENERATE(0, 512*1024);
    size_t max_array_size = 0;
    exseis::piol::MPI_Binary_file::Opt options{};
    if (max_array_size != 0) {
        options.max_size = max_array_size;
    }
    std::cerr << "\n\n max_array_size: " << max_array_size << '\n';

    auto generator = MPI_Binary_file_generator(file_size, options);