Newer
Older
* Distributed under the OSI-approved Apache License, Version 2.0. See
* accompanying file Copyright.txt for details.
*
* MdtmMan.h
*
* Created on: Jan 18, 2017
* Author: wfg
*/
#ifndef MDTMMAN_H_
#define MDTMMAN_H_
#include "ADIOSConfig.h"
#include "utilities/realtime/dataman/DataManBase.h"
namespace transport
{
class MdtmMan : public Transport
{
public:
/**
*
* @param localIP
* @param remoteIP
* @param mode
* @param prefix
* @param numberOfPipes
* @param tolerances
* @param priorities
* @param mpiComm
* @param debugMode
*/
MdtmMan(const std::string localIP, const std::string remoteIP,
const std::string mode, const std::string prefix,
const int numberOfPipes, const std::vector<int> tolerances,
const std::vector<int> priorities, MPI_Comm mpiComm,
const bool debugMode);
void Open(const std::string name, const std::string accessMode);
void SetBuffer(char *buffer, std::size_t size);
/**
* We can always overload this function in the base class and accept other
* types of data pointers, e.g. Write( json* );
* I'm sticking with char* as it's more general (only C++ libraries, e.g.
* boost understand std::std::vector, MPI, POSIX, Infiniband use pointer*)
* @param buffer
* @param size
*/
void Write(const char *buffer, std::size_t size);
void Flush(); ///< not sure if this one is needed...
void Close();
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
std::string m_LocalIP; ///< local ip address, can change over time
std::string m_RemoteIP; ///< remote ip address, can change over time
std::string m_Mode; ///< send/write, receive/read
std::string m_Prefix; ///< prefix given to message
int m_NumberOfPipes = -1; ///< should it be unsigned int?
std::vector<int> m_Tolerances;
std::vector<int> m_Priorities;
/**
* Should we change data to char* ?
* @param data
* @param doid
* @param variable
* @param dType
* @param putShape
* @param varShape
* @param offset
* @param timestep
* @param tolerance
* @param priority
* @return
*/
int Put(const void *data, const std::string doid,
const std::string variable, const std::string dType,
const std::vector<std::uint64_t> &putShape,
const std::vector<uint64_t> &varShape,
const std::vector<uint64_t> &offset, const std::uint64_t timestep,
const int tolerance, const int priority);
/**
*
* @param data
* @param doid
* @param variable
* @param dType
* @param putShape
* @param varShape
* @param offset
* @param timestep
* @param tolerance
* @param priority
* @return
*/
int Get(void *data, const std::string doid, const std::string variable,
const std::string dType, const std::vector<std::uint64_t> &putShape,
const std::vector<uint64_t> &varShape,
const std::vector<uint64_t> &offset, const std::uint64_t timestep,
const int tolerance, const int priority);
/**
*
* @param data
* @param doid
* @param variable
* @param dType
* @param varShape
* @param timestep
* @return
*/
int Get(void *data, const std::string doid, const std::string variable,
const std::string dType, std::vector<std::uint64_t> &varShape,
const std::uint64_t timestep);
/**
*
* @param jData
*/
void OnReceive(nlohmann::json &jData);
} // end namespace transport
} // end namespace