From 7b46798785de5bf62b336b5af995f46aa689180a Mon Sep 17 00:00:00 2001 From: Mikhail Kocharmin Date: Wed, 17 Jul 2024 20:01:50 +0300 Subject: [PATCH] shared memory parallelization: do not include private arrays in TIE list --- .../Sapfor_2017/_src/Distribution/DvmhDirective.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sapfor/experts/Sapfor_2017/_src/Distribution/DvmhDirective.cpp b/sapfor/experts/Sapfor_2017/_src/Distribution/DvmhDirective.cpp index a853945..33afba1 100644 --- a/sapfor/experts/Sapfor_2017/_src/Distribution/DvmhDirective.cpp +++ b/sapfor/experts/Sapfor_2017/_src/Distribution/DvmhDirective.cpp @@ -243,7 +243,8 @@ static vector const map>& arrayLinksByFuncCalls, const map>& byUseInFunc, File* file, const pair& lineRange, - const set& onlyFor) + const set& onlyFor, + const set& privates) { vector tieList; vector> realRefsUsed; @@ -269,6 +270,9 @@ static vector 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 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()) {