<commit_before>/*
 * Distributed under the OSI-approved Apache License, Version 2.0.  See
 * accompanying file Copyright.txt for details.
 *
 * HDF5ReaderP.h
 *
 *  Created on: March 20, 2017
 *      Author: Junmin
 */

#ifndef ADIOS2_ENGINE_HDF5_HDF5READERP_H_
#define ADIOS2_ENGINE_HDF5_HDF5READERP_H_

#include "adios2/core/Engine.h"
#include "adios2/core/IO.h"
#include "adios2/toolkit/interop/hdf5/HDF5Common.h"

namespace adios2
{

class HDF5ReaderP : public Engine
{

public:
    /**
     * Constructor for single HDF5 reader engine, reads from HDF5 format
     * @param name unique name given to the engine
     * @param accessMode
     * @param mpiComm
     * @param method
     */
    HDF5ReaderP(IO &adios, const std::string &name, const Mode openMode,
                MPI_Comm mpiComm);

    ~HDF5ReaderP();

    bool IsValid();

    StepStatus BeginStep(StepMode mode, const float timeoutSeconds = 0.f) final;
    size_t CurrentStep() const final;
    void EndStep() final;

    void PerformGets() final;

private:
    interop::HDF5Common m_H5File;
    void Init() final;

    bool m_InStreamMode = false; // default is not streaming, i.e. set var timestep range
    unsigned int m_StreamAt = 0; // stream step counter
#define declare_type(T)                                                        \
    void DoGetSync(Variable<T> &, T *) final;                                  \
    void DoGetDeferred(Variable<T> &, T *) final;                              \
    void DoGetDeferred(Variable<T> &, T &) final;
    ADIOS2_FOREACH_TYPE_1ARG(declare_type)
#undef declare_type
<commit_msg>added comments<commit_after>/*
 * Distributed under the OSI-approved Apache License, Version 2.0.  See
 * accompanying file Copyright.txt for details.
 *
 * HDF5ReaderP.h
 *
 *  Created on: March 20, 2017
 *      Author: Junmin
 */

#ifndef ADIOS2_ENGINE_HDF5_HDF5READERP_H_
#define ADIOS2_ENGINE_HDF5_HDF5READERP_H_

#include "adios2/core/Engine.h"
#include "adios2/core/IO.h"
#include "adios2/toolkit/interop/hdf5/HDF5Common.h"

namespace adios2
{

class HDF5ReaderP : public Engine
{

public:
    /**
     * Constructor for single HDF5 reader engine, reads from HDF5 format
     * @param name unique name given to the engine
     * @param accessMode
     * @param mpiComm
     * @param method
     */
    HDF5ReaderP(IO &adios, const std::string &name, const Mode openMode,
                MPI_Comm mpiComm);

    ~HDF5ReaderP();

    bool IsValid();

    StepStatus BeginStep(StepMode mode, const float timeoutSeconds = 0.f) final;
    size_t CurrentStep() const final;
    void EndStep() final;

    void PerformGets() final;

private:
    interop::HDF5Common m_H5File;
    void Init() final;

    bool m_InStreamMode =
        false; // default is not streaming, i.e. set var timestep range
    unsigned int m_StreamAt = 0; // stream step counter
#define declare_type(T)                                                        \
    void DoGetSync(Variable<T> &, T *) final;                                  \
    void DoGetDeferred(Variable<T> &, T *) final;                              \
    void DoGetDeferred(Variable<T> &, T &) final;
    ADIOS2_FOREACH_TYPE_1ARG(declare_type)
#undef declare_type

{'fraction_non_alphanumeric': 0.09224057338734809, 'fraction_numerical': 0.019943907759426612, 'mean_word_length': 2.504366812227074, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1773909', 'n_tokens_mistral': 1088, 'n_tokens_neox': 1045, 'n_words': 275}