Skip to content
Snippets Groups Projects
Commit 3e8892c3 authored by William F Godoy's avatar William F Godoy
Browse files

Debugging Read

parent 1756bed3
No related branches found
No related tags found
1 merge request!294Bp1read : Initial Reading Capabilities and latest API
......@@ -37,7 +37,7 @@ int main(int argc, char *argv[])
/*** IO class object: settings and factory of Settings: Variables,
* Parameters, Transports, and Execution: Engines */
adios2::IO &bpIO = adios.DeclareIO("ReadBP");
bpIO.SetParameter("Threads", "2");
// /bpIO.SetParameter("Threads", "2");
/** Engine derived class, spawned to start IO operations */
adios2::Engine &bpReader =
......
......@@ -111,7 +111,7 @@ ADIOS2_FOREACH_TYPE_1ARG(declare_type)
void BPFileReader::ReadVariables(
IO &io, const std::map<std::string, SubFileInfoMap> &variablesSubFileInfo)
{
const bool &profile = m_BP3Deserializer.m_Profiler.IsActive;
const bool profile = m_BP3Deserializer.m_Profiler.IsActive;
// sequentially request bytes from transport manager
// threaded here?
......@@ -138,13 +138,14 @@ void BPFileReader::ReadVariables(
const auto &seek = blockInfo.Seeks;
const size_t blockStart = seek.first;
const size_t blockSize = seek.second - seek.first;
std::vector<char> contiguousData(blockSize);
m_SubFileManager.ReadFile(contiguousData.data(), blockStart,
blockSize, subFileIndex);
// will go to BP3Deserializer along with contiguous data
// m_BP3Deserializer
std::vector<char> contiguousMemory(blockSize);
m_SubFileManager.ReadFile(contiguousMemory.data(),
blockStart, blockSize,
subFileIndex);
m_BP3Deserializer.ClipContiguousMemory(
variableName, m_IO, contiguousMemory,
blockInfo.IntersectionBox);
} // end block
} // end step
} // end subfile
......
......@@ -20,6 +20,8 @@ template <class T>
void BPFileReader::GetSyncCommon(Variable<T> &variable, T *data)
{
// subfile info
variable.SetData(data);
const std::map<std::string, SubFileInfoMap> variableSubfileInfo =
m_BP3Deserializer.GetSyncVariableSubFileInfo(variable);
......
......@@ -135,7 +135,8 @@ BP3Deserializer::GetSubFileInfo(const Variable<T> &variable) const
const auto &buffer = m_Metadata.m_Buffer;
const size_t stepStart = variable.m_StepStart;
const size_t stepEnd = stepStart + variable.m_StepCount;
const size_t stepEnd =
stepStart + variable.m_StepCount; // inclusive or exclusive?
// selection, start and count
const Box<Dims> selection{variable.m_Start, variable.m_Count};
......@@ -171,14 +172,16 @@ BP3Deserializer::GetSubFileInfo(const Variable<T> &variable) const
// if they intersect get info Seeks (first: start, second: end)
// TODO: map to sizeof(T)?
info.Seeks.first =
blockCharacteristics.Statistics.PayloadOffset +
LinearIndex(blockDimensions, info.IntersectionBox.first,
m_IsRowMajor, m_IsZeroIndex) *
sizeof(T);
sizeof(T);
info.Seeks.second =
blockCharacteristics.Statistics.PayloadOffset +
LinearIndex(blockDimensions, info.IntersectionBox.second,
m_IsRowMajor, m_IsZeroIndex) *
sizeof(T);
sizeof(T);
const size_t fileIndex = static_cast<const size_t>(
blockCharacteristics.Statistics.FileIndex);
......
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