Skip to content
Snippets Groups Projects
Commit 9b4284dc authored by Podhorszki, Norbert's avatar Podhorszki, Norbert
Browse files

Reorg Read() and ScheduleRead()

parent 408e9b87
No related branches found
No related tags found
1 merge request!102Variables3
......@@ -280,14 +280,23 @@ VariableCompound *Engine::InquireVariableCompound(const std::string & /*name*/,
return nullptr;
}
void Engine::Read(Variable<double> & /*variable*/, const double * /*values*/) {}
void Engine::ScheduleRead(Variable<unsigned int> & /*variable*/,
unsigned int * /*values*/)
{
}
void Engine::ScheduleRead(Variable<double> & /*variable*/, double * /*values*/)
{
}
void Engine::ScheduleRead(const std::string /*variableName*/,
void Engine::ScheduleRead(const std::string & /*variableName*/,
unsigned int * /*values*/)
{
}
void Engine::ScheduleRead(const std::string & /*variableName*/,
double * /*values*/)
{
}
void Engine::ScheduleRead(const std::string & /*variableName*/) {}
void Engine::ScheduleRead() {}
void Engine::Release() {}
void Engine::PerformReads(PerformReadMode /*mode*/){};
......
......@@ -242,9 +242,10 @@ public:
* must use Read(variable) instead intentionally
*/
template <class T>
void Read(Variable<T> &variable, const T *values)
void Read(Variable<T> &variable, T *values)
{
Read(variable, values);
ScheduleRead(variable, values);
PerformReads(PerformReadMode::BLOCKINGREAD);
}
/**
......@@ -253,9 +254,10 @@ public:
* @param values
*/
template <class T>
void Read(const std::string variableName, const T *values)
void Read(const std::string &variableName, T *values)
{
Read(variableName, values);
ScheduleRead(variableName, values);
PerformReads(PerformReadMode::BLOCKINGREAD);
}
/**
......@@ -264,9 +266,10 @@ public:
* @param values
*/
template <class T>
void Read(Variable<T> &variable, const T &values)
void Read(Variable<T> &variable, T &values)
{
Read(variable, &values);
ScheduleRead(variable, &values);
PerformReads(PerformReadMode::BLOCKINGREAD);
}
/**
......@@ -275,9 +278,10 @@ public:
* @param values
*/
template <class T>
void Read(const std::string variableName, const T &values)
void Read(const std::string &variableName, T &values)
{
Read(variableName, &values);
ScheduleRead(variableName, &values);
PerformReads(PerformReadMode::BLOCKINGREAD);
}
/**
......@@ -287,7 +291,8 @@ public:
template <class T>
void Read(Variable<T> &variable)
{
Read(variable, nullptr);
ScheduleRead(variable);
PerformReads(PerformReadMode::BLOCKINGREAD);
}
/**
......@@ -295,13 +300,12 @@ public:
* @param variableName
*/
template <class T>
void Read(const std::string variableName)
void Read(const std::string &variableName)
{
Read(variableName, nullptr);
ScheduleRead(variableName);
PerformReads(PerformReadMode::BLOCKINGREAD);
}
virtual void Read(Variable<double> &variable, const double *values);
/**
* Read function that adds static checking on the variable to be passed by
* values
......@@ -322,7 +326,7 @@ public:
* @param values
*/
template <class T>
void ScheduleRead(const std::string variableName, T *values)
void ScheduleRead(const std::string &variableName, T *values)
{
ScheduleRead(variableName, values);
}
......@@ -344,7 +348,7 @@ public:
* @param values
*/
template <class T>
void ScheduleRead(const std::string variableName, T &values)
void ScheduleRead(const std::string &variableName, T &values)
{
ScheduleRead(variableName, &values);
}
......@@ -353,19 +357,13 @@ public:
* Unallocated version, ADIOS will allocate space for incoming data
* @param variableName
*/
void ScheduleRead(const std::string variableName)
{
ScheduleRead(variableName, nullptr);
}
virtual void ScheduleRead(const std::string &variableName);
/**
* Unallocated unspecified version, ADIOS will receive any variable and will
* allocate space for incoming data
*/
void ScheduleRead() { ScheduleRead(nullptr, nullptr); }
virtual void ScheduleRead(Variable<double> &variable, double *values);
virtual void ScheduleRead(const std::string variableName, double *values);
virtual void ScheduleRead();
/**
* Perform all scheduled reads, either blocking until all reads completed,
......@@ -536,6 +534,13 @@ protected:
* @param transportIndex must be in the range [ -1 , m_Transports.size()-1 ]
*/
void CheckTransportIndex(const int transportIndex);
virtual void ScheduleRead(Variable<unsigned int> &variable,
unsigned int *values);
virtual void ScheduleRead(Variable<double> &variable, double *values);
virtual void ScheduleRead(const std::string &variableName,
unsigned int *values);
virtual void ScheduleRead(const std::string &variableName, double *values);
};
} // end namespace
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment