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

Fix extra "performGets" problem #2291

Merged
merged 1 commit into from
May 27, 2020
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 17 additions & 8 deletions source/adios2/engine/sst/SstReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -428,35 +428,44 @@ void SstReader::Init()
size_t *Start = NULL; \
size_t *Count = NULL; \
size_t DimCount = 0; \
int NeedSync; \
\
if (variable.m_SelectionType == \
adios2::SelectionType::BoundingBox) \
{ \
DimCount = variable.m_Shape.size(); \
Start = variable.m_Start.data(); \
Count = variable.m_Count.data(); \
SstFFSGetDeferred(m_Input, (void *)&variable, \
variable.m_Name.c_str(), DimCount, Start, \
Count, data); \
NeedSync = SstFFSGetDeferred(m_Input, (void *)&variable, \
variable.m_Name.c_str(), \
DimCount, Start, Count, data); \
} \
else if (variable.m_SelectionType == \
adios2::SelectionType::WriteBlock) \
{ \
DimCount = variable.m_Count.size(); \
Count = variable.m_Count.data(); \
SstFFSGetLocalDeferred(m_Input, (void *)&variable, \
variable.m_Name.c_str(), DimCount, \
variable.m_BlockID, Count, data); \
NeedSync = SstFFSGetLocalDeferred( \
m_Input, (void *)&variable, variable.m_Name.c_str(), \
DimCount, variable.m_BlockID, Count, data); \
} \
if (NeedSync) \
{ \
SstFFSPerformGets(m_Input); \
} \
SstFFSPerformGets(m_Input); \
} \
if (m_WriterMarshalMethod == SstMarshalBP) \
{ \
/* DoGetSync() is going to have terrible performance 'cause */ \
/* it's a bad idea in an SST-like environment. But do */ \
/* whatever you do forDoGetDeferred() and then PerformGets() */ \
DoGetDeferred(variable, data); \
PerformGets(); \
if (!variable.m_SingleValue) \
{ \
/* Don't need to do gets if this was a SingleValue (in \
* metadata) */ \
PerformGets(); \
} \
} \
} \
\
Expand Down
19 changes: 11 additions & 8 deletions source/adios2/toolkit/sst/cp/ffs_marshal.c
Original file line number Diff line number Diff line change
Expand Up @@ -760,10 +760,9 @@ void NO_SANITIZE_THREAD SstReaderInitFFSCallback(
Stream->SetupUpcallReader = Reader;
}

extern void SstFFSGetDeferred(SstStream Stream, void *Variable,
const char *Name, size_t DimCount,
const size_t *Start, const size_t *Count,
void *Data)
extern int SstFFSGetDeferred(SstStream Stream, void *Variable, const char *Name,
size_t DimCount, const size_t *Start,
const size_t *Count, void *Data)
{
struct FFSReaderMarshalBase *Info = Stream->ReaderMarshalData;
int GetFromWriter = 0;
Expand All @@ -778,6 +777,7 @@ extern void SstFFSGetDeferred(SstStream Stream, void *Variable,
Var->PerWriterMetaFieldDesc[GetFromWriter]->field_offset;
memcpy(Data, IncomingDataBase,
Var->PerWriterMetaFieldDesc[GetFromWriter]->field_size);
return 0; // No Sync needed
}
else
{
Expand All @@ -793,13 +793,14 @@ extern void SstFFSGetDeferred(SstStream Stream, void *Variable,
Req->Data = Data;
Req->Next = Info->PendingVarRequests;
Info->PendingVarRequests = Req;
return 1; // Later Sync needed
}
}

extern void SstFFSGetLocalDeferred(SstStream Stream, void *Variable,
const char *Name, size_t DimCount,
const int BlockID, const size_t *Count,
void *Data)
extern int SstFFSGetLocalDeferred(SstStream Stream, void *Variable,
const char *Name, size_t DimCount,
const int BlockID, const size_t *Count,
void *Data)
{
struct FFSReaderMarshalBase *Info = Stream->ReaderMarshalData;
int GetFromWriter = 0;
Expand All @@ -814,6 +815,7 @@ extern void SstFFSGetLocalDeferred(SstStream Stream, void *Variable,
Var->PerWriterMetaFieldDesc[GetFromWriter]->field_offset;
memcpy(Data, IncomingDataBase,
Var->PerWriterMetaFieldDesc[GetFromWriter]->field_size);
return 0; // No Sync needed
}
else
{
Expand All @@ -829,6 +831,7 @@ extern void SstFFSGetLocalDeferred(SstStream Stream, void *Variable,
Req->Data = Data;
Req->Next = Info->PendingVarRequests;
Info->PendingVarRequests = Req;
return 1; // Later Sync needed
}
}

Expand Down
17 changes: 9 additions & 8 deletions source/adios2/toolkit/sst/sst.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,15 @@ extern void SstFFSMarshal(SstStream Stream, void *Variable, const char *Name,
extern void SstFFSMarshalAttribute(SstStream Stream, const char *Name,
const char *Type, size_t ElemSize,
size_t ElemCount, const void *data);
extern void SstFFSGetDeferred(SstStream Stream, void *Variable,
const char *Name, size_t DimCount,
const size_t *Start, const size_t *Count,
void *Data);
extern void SstFFSGetLocalDeferred(SstStream Stream, void *Variable,
const char *Name, size_t DimCount,
const int BlockID, const size_t *Count,
void *Data);
/* GetDeferred calls return true if need later sync */
extern int SstFFSGetDeferred(SstStream Stream, void *Variable, const char *Name,
size_t DimCount, const size_t *Start,
const size_t *Count, void *Data);
/* GetDeferred calls return true if need later sync */
extern int SstFFSGetLocalDeferred(SstStream Stream, void *Variable,
const char *Name, size_t DimCount,
const int BlockID, const size_t *Count,
void *Data);

extern SstStatusValue SstFFSPerformGets(SstStream Stream);

Expand Down