shared memory parallelization: do not include private arrays in TIE list
This commit is contained in:
@@ -243,7 +243,8 @@ static vector<SgExpression*>
|
||||
const map<DIST::Array*, set<DIST::Array*>>& arrayLinksByFuncCalls,
|
||||
const map<string, set<SgSymbol*>>& byUseInFunc,
|
||||
File* file, const pair<int, int>& lineRange,
|
||||
const set<DIST::Array*>& onlyFor)
|
||||
const set<DIST::Array*>& onlyFor,
|
||||
const set<string>& privates)
|
||||
{
|
||||
vector<SgExpression*> tieList;
|
||||
vector<pair<DIST::Array*, DIST::Array*>> realRefsUsed;
|
||||
@@ -269,6 +270,9 @@ static vector<SgExpression*>
|
||||
|
||||
for (auto& pairs : realRefsUsed)
|
||||
{
|
||||
if (privates.find(pairs.second->GetShortName()) != privates.end())
|
||||
continue;
|
||||
|
||||
auto type = pairs.second->GetDeclSymbol(currLoop->fileName, lineRange, getAllFilesInProject())->GetOriginal()->type();
|
||||
SgSymbol* arrayS = getFromModule(byUseInFunc, findSymbolOrCreate(file, pairs.second->GetShortName(), type));
|
||||
SgArrayRefExp* array = new SgArrayRefExp(*arrayS);
|
||||
@@ -706,9 +710,9 @@ ParallelDirective::genDirective(File* file, const vector<pair<DIST::Array*, cons
|
||||
}
|
||||
vector<SgExpression*> tieList;
|
||||
if (sharedMemoryParallelization)
|
||||
tieList = compliteTieList(currLoop, loopsTie, arrayLinksByFuncCalls, byUseInFunc, file, lineRange, onlyFor);
|
||||
tieList = compliteTieList(currLoop, loopsTie, arrayLinksByFuncCalls, byUseInFunc, file, lineRange, onlyFor, uniqNamesOfPrivates);
|
||||
else if (onlyFor.size()) // not MPI regime
|
||||
tieList = compliteTieList(currLoop, loopsTie, arrayLinksByFuncCalls, byUseInFunc, file, lineRange, onlyFor);
|
||||
tieList = compliteTieList(currLoop, loopsTie, arrayLinksByFuncCalls, byUseInFunc, file, lineRange, onlyFor, uniqNamesOfPrivates);
|
||||
|
||||
if (tieList.size())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user