Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use BP3Deserializer's PreDataRead() with different threadIDs for conc… #1441

Merged
merged 1 commit into from
May 21, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions source/adios2/engine/sst/SstReader.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ void SstReader::ReadVariableBlocks(Variable<T> &variable)
std::vector<void *> sstReadHandlers;
std::vector<std::vector<char>> buffers;

size_t threadID = 0;
for (typename Variable<T>::Info &blockInfo : variable.m_BlocksInfo)
{
T *originalBlockData = blockInfo.Data;
Expand All @@ -55,10 +56,13 @@ void SstReader::ReadVariableBlocks(Variable<T> &variable)

m_BP3Deserializer->PreDataRead(
variable, blockInfo, subStreamInfo, buffer, payloadSize,
payloadStart, 0);
payloadStart, threadID);

std::stringstream ss;
ss << "SST Bytes Read from remote rank " << rank;
std::cout << "PreRead " << variable.m_Name
<< " subblock to buffer " << (void *)buffer
<< " threadID = " << threadID << std::endl;
TAU_SAMPLE_COUNTER(ss.str().c_str(), payloadSize);
auto ret = SstReadRemoteMemory(m_Input, rank, CurrentStep(),
payloadStart, payloadSize,
Expand Down Expand Up @@ -104,6 +108,7 @@ void SstReader::ReadVariableBlocks(Variable<T> &variable)
sstReadHandlers.push_back(ret);
}
}
++threadID;
}
// advance pointer to next step
blockInfo.Data += helper::GetTotalSize(blockInfo.Count);
Expand All @@ -119,7 +124,7 @@ void SstReader::ReadVariableBlocks(Variable<T> &variable)
}

size_t iter = 0;

threadID = 0;
for (typename Variable<T>::Info &blockInfo : variable.m_BlocksInfo)
{
T *originalBlockData = blockInfo.Data;
Expand Down Expand Up @@ -153,9 +158,13 @@ void SstReader::ReadVariableBlocks(Variable<T> &variable)
// subStreamInfo.BlockBox,
// subStreamInfo.IntersectionBox);

std::cout << "Post Read " << variable.m_Name
<< " subblock threadID = " << threadID
<< std::endl;

m_BP3Deserializer->PostDataRead(
variable, blockInfo, subStreamInfo,
helper::IsRowMajor(m_IO.m_HostLanguage), 0);
helper::IsRowMajor(m_IO.m_HostLanguage), threadID);
++iter;
}
// if remote data buffer is not compressed
Expand Down Expand Up @@ -183,6 +192,7 @@ void SstReader::ReadVariableBlocks(Variable<T> &variable)
++iter;
}
}
++threadID;
}
// advance pointer to next step
blockInfo.Data += helper::GetTotalSize(blockInfo.Count);
Expand Down