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

Fix: POSIX Open from BPFileReader

parent c50bc87e
No related branches found
No related tags found
1 merge request!294Bp1read : Initial Reading Capabilities and latest API
......@@ -126,8 +126,12 @@ void BPFileReader::ReadVariables(
const std::string subFile(
m_BP3Deserializer.GetBPSubFileName(m_Name, subFileIndex));
m_SubFileManager.OpenFiles({subFile}, adios2::Mode::Read,
{{{"transport", "File"}}}, profile);
// TODO: fix this part
if (m_SubFileManager.m_Transports.count(subFileIndex) == 0)
{
m_SubFileManager.OpenFiles({subFile}, adios2::Mode::Read,
{{{"transport", "File"}}}, profile);
}
for (const auto &stepPair : subFileIndexPair.second) // step
{
......
......@@ -165,7 +165,8 @@ void FilePOSIX::Read(char *buffer, size_t size, size_t start)
throw std::ios_base::failure(
"ERROR: couldn't move to start position " +
std::to_string(start) + " in file " + m_Name +
", in call to POSIX lseek\n");
", in call to POSIX lseek errno " + std::to_string(errno) +
"\n");
}
}
......
......@@ -145,9 +145,12 @@ void FileStdio::Read(char *buffer, size_t size, size_t start)
if (start != MaxSizeT)
{
std::fseek(m_File, static_cast<long int>(start), SEEK_SET);
const auto result =
std::fseek(m_File, static_cast<long int>(start), SEEK_SET);
CheckFile("couldn't move to start position " + std::to_string(start) +
" in file " + m_Name + ", in call to stdio fseek for read");
" in file " + m_Name +
", in call to stdio fseek for read, result=" +
std::to_string(result));
}
if (size > DefaultMaxFileBatchSize)
......
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