diff --git a/bindings/CXX11/adios2/cxx11/Query.cpp b/bindings/CXX11/adios2/cxx11/Query.cpp index 23bbd8c6c6..ae5b3f3eb0 100644 --- a/bindings/CXX11/adios2/cxx11/Query.cpp +++ b/bindings/CXX11/adios2/cxx11/Query.cpp @@ -14,7 +14,13 @@ QueryWorker::QueryWorker(const std::string &configFile, adios2::Engine &reader) delete m; } -void QueryWorker::GetResultCoverage(adios2::Box &outputSelection, +void QueryWorker::GetResultCoverage(std::vector> &touched_blocks) +{ + adios2::Box empty; + GetResultCoverage(empty, touched_blocks); +} + +void QueryWorker::GetResultCoverage(const adios2::Box &outputSelection, std::vector> &touched_blocks) { if (m_Worker) diff --git a/bindings/CXX11/adios2/cxx11/Query.h b/bindings/CXX11/adios2/cxx11/Query.h index a4dd046d38..1b26ab62d6 100644 --- a/bindings/CXX11/adios2/cxx11/Query.h +++ b/bindings/CXX11/adios2/cxx11/Query.h @@ -26,9 +26,15 @@ class Worker; class QueryWorker { public: + // configFile has query, can be either xml or json QueryWorker(const std::string &configFile, adios2::Engine &engine); - void GetResultCoverage(adios2::Box &, + // touched_blocks is a list of regions specified by (start, count), + // that contains data that satisfies the query file + void GetResultCoverage(std::vector> &touched_blocks); + + // supply output bound for the results + void GetResultCoverage(const adios2::Box &, std::vector> &touched_blocks); private: diff --git a/bindings/Python/py11Query.cpp b/bindings/Python/py11Query.cpp index 87c2014967..0e82cae6bb 100644 --- a/bindings/Python/py11Query.cpp +++ b/bindings/Python/py11Query.cpp @@ -30,9 +30,8 @@ Query::operator bool() const noexcept { return (m_QueryWorker == nullptr) ? fals std::vector> Query::GetResult() { - // std::cout<<"Do something"< empty; // look into all data std::vector> touched_blocks; + adios2::Box empty; m_QueryWorker->GetResultCoverage(empty, touched_blocks); return touched_blocks; } diff --git a/bindings/Python/py11Query.h b/bindings/Python/py11Query.h index df04fd3e59..b8cd29018b 100644 --- a/bindings/Python/py11Query.h +++ b/bindings/Python/py11Query.h @@ -34,8 +34,6 @@ class Query explicit operator bool() const noexcept; std::vector> GetResult(); - // const Box< Dims > & refinedSelectionIfAny, - // std::vector< Box< Dims > > &touched_blocks private: Query(adios2::query::Worker *qw); diff --git a/examples/query/test.cpp b/examples/query/test.cpp index 8d866a3085..c825fbfea6 100644 --- a/examples/query/test.cpp +++ b/examples/query/test.cpp @@ -22,8 +22,7 @@ void queryWithStreaming(adios2::IO &queryIO, std::string &dataFileName, std::str while (reader.BeginStep() == adios2::StepStatus::OK) { adios2::QueryWorker w = adios2::QueryWorker(queryFile, reader); - adios2::Box empty; - w.GetResultCoverage(empty, touched_blocks); + w.GetResultCoverage(touched_blocks); std::cout << " ... now can read out touched blocks ... size=" << touched_blocks.size() << std::endl; diff --git a/testing/adios2/performance/query/TestBPQuery.cpp b/testing/adios2/performance/query/TestBPQuery.cpp index d84784db59..a3ff5ae4a2 100644 --- a/testing/adios2/performance/query/TestBPQuery.cpp +++ b/testing/adios2/performance/query/TestBPQuery.cpp @@ -107,8 +107,7 @@ void BPQueryTest::QueryIntVar(const std::string &fname, adios2::ADIOS &adios, { adios2::QueryWorker w = adios2::QueryWorker(queryFile, bpReader); std::vector> touched_blocks; - adios2::Box empty; - w.GetResultCoverage(empty, touched_blocks); + w.GetResultCoverage(touched_blocks); ASSERT_EQ(touched_blocks.size(), rr[bpReader.CurrentStep()]); bpReader.EndStep(); } @@ -143,8 +142,7 @@ void BPQueryTest::QueryDoubleVar(const std::string &fname, adios2::ADIOS &adios, { adios2::QueryWorker w = adios2::QueryWorker(queryFile, bpReader); std::vector> touched_blocks; - adios2::Box empty; - w.GetResultCoverage(empty, touched_blocks); + w.GetResultCoverage(touched_blocks); ASSERT_EQ(touched_blocks.size(), rr[bpReader.CurrentStep()]); bpReader.EndStep(); } @@ -263,7 +261,7 @@ TEST_F(BPQueryTest, BP4) std::string engineName = "BP4"; // Each process would write a 1x8 array and all processes would // form a mpiSize * Nx 1D array - const std::string fname(engineName + "4Query1D.bp"); + const std::string fname(engineName + "Query1D.bp"); #if ADIOS2_USE_MPI adios2::ADIOS adios(MPI_COMM_WORLD);