diff --git a/source/adios2/core/Engine.cpp b/source/adios2/core/Engine.cpp index fdbb85cca8bf02d7c7bc93c762a9c9b662baff91..5911be7bd7d86725f5478f9ccd19890426293b6d 100644 --- a/source/adios2/core/Engine.cpp +++ b/source/adios2/core/Engine.cpp @@ -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*/){}; diff --git a/source/adios2/core/Engine.h b/source/adios2/core/Engine.h index 72850a746205db792aae7b610c147e1003eb7258..34478a89113172da7ac866dbdaf0faa2a8ad0e52 100644 --- a/source/adios2/core/Engine.h +++ b/source/adios2/core/Engine.h @@ -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