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

Raise an exception if remote open fails #4069

Merged
merged 7 commits into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
45 changes: 34 additions & 11 deletions source/adios2/engine/bp5/BP5Reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,36 @@ std::pair<double, double> BP5Reader::ReadData(adios2::transportman::TransportMan

void BP5Reader::PerformGets()
{
// if dataIsRemote is true and m_Remote is not true, this is our first time through
// PerformGets() Either we don't need a remote open (m_dataIsRemote=false), or we need to Open
// remote file (or die trying)
if (m_dataIsRemote && !m_Remote)
{
bool RowMajorOrdering = (m_IO.m_ArrayOrder == ArrayOrdering::RowMajor);

// If nothing is pending, don't open
if (m_BP5Deserializer->PendingGetRequests.size() == 0)
return;

if (!m_Parameters.RemoteDataPath.empty())
{
m_Remote.Open("localhost", RemoteCommon::ServerPort, m_Parameters.RemoteDataPath,
m_OpenMode, RowMajorOrdering);
}
else if (getenv("DoRemote"))
{
m_Remote.Open("localhost", RemoteCommon::ServerPort, m_Name, m_OpenMode,
RowMajorOrdering);
}
if (!m_Remote)
{
helper::Throw<std::ios_base::failure>(
"Engine", "BP5Reader", "OpenFiles",
"Remote file " + m_Name +
" cannot be opened. Possible server or file specification error.");
}
}

if (m_Remote)
{
PerformRemoteGets();
Expand Down Expand Up @@ -477,18 +507,11 @@ void BP5Reader::Init()
OpenFiles(timeoutInstant, pollSeconds, timeoutSeconds);
UpdateBuffer(timeoutInstant, pollSeconds / 10, timeoutSeconds);

// This isn't how we'll trigger remote ops in the end, but a temporary
// solution
bool RowMajorOrdering = (m_IO.m_ArrayOrder == ArrayOrdering::RowMajor);
// Don't try to open the remote file when we open local metadata. Do that on demand.
if (!m_Parameters.RemoteDataPath.empty())
{
m_Remote.Open("localhost", RemoteCommon::ServerPort, m_Parameters.RemoteDataPath,
m_OpenMode, RowMajorOrdering);
}
else if (getenv("DoRemote"))
{
m_Remote.Open("localhost", RemoteCommon::ServerPort, m_Name, m_OpenMode, RowMajorOrdering);
}
m_dataIsRemote = true;
if (getenv("DoRemote"))
m_dataIsRemote = true;
}

void BP5Reader::InitParameters()
Expand Down
1 change: 1 addition & 0 deletions source/adios2/engine/bp5/BP5Reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ class BP5Reader : public BP5Engine, public Engine

/* transport manager for managing the active flag file */
transportman::TransportMan m_ActiveFlagFileManager;
bool m_dataIsRemote = false;
Remote m_Remote;
bool m_WriterIsActive = true;
adios2::profiling::JSONProfiler m_JSONProfiler;
Expand Down
1 change: 0 additions & 1 deletion thirdparty/EVPath/EVPath/cmsockets.c
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,6 @@ initiate_conn(CManager cm, CMtrans_services svc, transport_entry trans, attr_lis
int err = WSAGetLastError();
if (err != WSAEWOULDBLOCK || err != WSAEINPROGRESS) {
#endif
printf("Errno was %d\n", errno);
svc->trace_out(cm, "CMSocket connect FAILURE --> Connect() to IP %s failed", ip_str);
close(sock);
#ifdef WSAEWOULDBLOCK
Expand Down