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

Cleaning up SSC code #2691

Merged
merged 2 commits into from
May 7, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
updated ssc doc
  • Loading branch information
JasonRuonanWang committed May 7, 2021
commit d14612c813323542d86fb6c3aa9034dec9cacd46
2 changes: 1 addition & 1 deletion docs/user_guide/source/engines/ssc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The SSC engine takes the following parameters:

1. ``OpenTimeoutSecs``: Default **10**. Timeout in seconds for opening a stream. The SSC engine's open function will block until the RendezvousAppCount is reached, or timeout, whichever comes first. If it reaches the timeout, SSC will throw an exception.

2. ``Threading``: Default **False**. SSC will use threads to hide the time cost for metadata manipulation and data transfer when this parameter is set to **true**. SSC will check if MPI is initialized with multi-thread enabled, and if not, then SSC will force this parameter to be **false**. Please do NOT enable threading when multiple I/O streams are opened in an application, as it will cause unpredictable errors.
2. ``Threading``: Default **False**. SSC will use threads to hide the time cost for metadata manipulation and data transfer when this parameter is set to **true**. SSC will check if MPI is initialized with multi-thread enabled, and if not, then SSC will force this parameter to be **false**. Please do NOT enable threading when multiple I/O streams are opened in an application, as it will cause unpredictable errors. This parameter is only effective when writer definitions and reader selections are NOT locked. For cases definitions and reader selections are locked, SSC has a more optimized way to do data transfers, and thus it will not use this parameter.

=============================== ================== ================================================
**Key** **Value Format** **Default** and Examples
Expand Down
22 changes: 8 additions & 14 deletions source/adios2/engine/ssc/SscReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,19 +272,12 @@ void SscReader::EndStepFirstFlexible()
{
MPI_Win_free(&m_MpiWin);
SyncReadPattern();
}

void SscReader::EndStepConsequentFlexible() { MPI_Win_free(&m_MpiWin); }

void SscReader::EndBeginStepFirstFlexible()
{
EndStepFirstFlexible();
BeginStepFlexible(m_StepStatus);
}

void SscReader::EndBeginStepConsequentFlexible()
void SscReader::EndStepConsequentFlexible()
{
EndStepConsequentFlexible();
MPI_Win_free(&m_MpiWin);
BeginStepFlexible(m_StepStatus);
}

Expand Down Expand Up @@ -312,23 +305,24 @@ void SscReader::EndStep()
if (m_Threading)
{
m_EndStepThread =
std::thread(&SscReader::EndBeginStepFirstFlexible, this);
std::thread(&SscReader::EndStepFirstFlexible, this);
}
else
{
EndStepFirstFlexible();
MPI_Win_free(&m_MpiWin);
SyncReadPattern();
}
}
else
{
if (m_Threading)
{
m_EndStepThread = std::thread(
&SscReader::EndBeginStepConsequentFlexible, this);
m_EndStepThread =
std::thread(&SscReader::EndStepConsequentFlexible, this);
}
else
{
EndStepConsequentFlexible();
MPI_Win_free(&m_MpiWin);
}
}
}
Expand Down
4 changes: 1 addition & 3 deletions source/adios2/engine/ssc/SscReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ class SscReader : public Engine
void EndStepFixed();
void EndStepFirstFlexible();
void EndStepConsequentFlexible();
void EndBeginStepFirstFlexible();
void EndBeginStepConsequentFlexible();

#define declare_type(T) \
void DoGetSync(Variable<T> &, T *) final; \
Expand All @@ -100,7 +98,7 @@ class SscReader : public Engine

int m_Verbosity = 0;
int m_OpenTimeoutSecs = 10;
bool m_Threading = true;
bool m_Threading = false;
};

} // end namespace engine
Expand Down