Refactor shared memory parallelization #49

Merged
Alexander_KS merged 10 commits from refactor_shared_memory_parallelization into master 2024-07-18 06:50:40 +00:00
Showing only changes of commit 7b46798785 - Show all commits

View File

@@ -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())
{