Newer
Older
* Distributed under the OSI-approved Apache License, Version 2.0. See
* accompanying file Copyright.txt for details.
*
* Author: William F Godoy godoywf@ornl.gov
#ifndef ADIOS2_ENGINE_BP_BPFILEWRITER_H_
#define ADIOS2_ENGINE_BP_BPFILEWRITER_H_
#include "adios2/ADIOSConfig.h"
#include "adios2/core/Engine.h"
#include "adios2/toolkit/format/bp1/BP1.h" //format::BP1Writer
#include "adios2/toolkit/transportman/TransportMan.h" //transport::TransportsMan
* Constructor for file Writer in BP format
* @param name unique name given to the engine
* @param openMode w (supported), r, a from OpenMode in ADIOSTypes.h
* @param mpiComm MPI communicator
BPFileWriter(IO &io, const std::string &name, const OpenMode openMode,
MPI_Comm mpiComm);
void Advance(const float timeoutSeconds = 0.0) final;
/**
* Closes a single transport or all transports
* @param transportIndex, if -1 (default) closes all transports, otherwise
* it
* closes a transport in m_Transport[transportIndex]. In debug mode the
* latter
* is bounds-checked.
*/
void Close(const int transportIndex = -1) final;
private:
/** Single object controlling BP buffering */
/** single object controlling a vector of Transports from IO AddTransport */
transportman::TransportMan m_TransportsManager;
/** true: due to buffer overflow, move to transports manager */
void Init() final;
/** Parses parameters from IO SetParameters */
void InitParameters() final;
/** Parses transports and parameters from IO AddTransport */
void InitTransports() final;
#define declare_type(T) \
void DoWrite(Variable<T> &variable, const T *values) final;
ADIOS2_FOREACH_TYPE_1ARG(declare_type)
#undef declare_type
/**
* Common function for primitive (including std::complex) writes
* @param variable
void DoWriteCommon(Variable<T> &variable, const T *values);
/** Write a profiling.json file from m_BP1Writer and m_TransportsManager
* profilers*/
void WriteProfilingJSONFile();
#endif /* ADIOS2_ENGINE_BP_BPFILEWRITER_H_ */