|
|
|
|
@@ -598,7 +598,7 @@ static void findArrayRef(const vector<SgForStmt*> &parentLoops, SgExpression *cu
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (currRegime == DATA_DISTR && side == LEFT)
|
|
|
|
|
if ((currRegime == DATA_DISTR || currRegime == SHARED_MEMORY_PAR) && side == LEFT)
|
|
|
|
|
{
|
|
|
|
|
auto symb = OriginalSymbol(currExp->symbol());
|
|
|
|
|
SgStatement *decl = declaratedInStmt(symb);
|
|
|
|
|
@@ -1609,8 +1609,9 @@ void loopAnalyzer(SgFile *file, vector<ParallelRegion*> ®ions, map<tuple<int,
|
|
|
|
|
modulesByName[modules[i]->symbol()->identifier()] = modules[i];
|
|
|
|
|
|
|
|
|
|
map<string, set<string>> privatesByModule;
|
|
|
|
|
for (int i = 0; i < modules.size(); ++i)
|
|
|
|
|
privatesByModule[modules[i]->symbol()->identifier()] = getPrivatesFromModule(modules[i], declaredArrays, declaratedArraysSt, modulesByName);
|
|
|
|
|
if(!sharedMemoryParallelization)
|
|
|
|
|
for (int i = 0; i < modules.size(); ++i)
|
|
|
|
|
privatesByModule[modules[i]->symbol()->identifier()] = getPrivatesFromModule(modules[i], declaredArrays, declaratedArraysSt, modulesByName);
|
|
|
|
|
|
|
|
|
|
map<string, FuncInfo*> funcByName;
|
|
|
|
|
createMapOfFunc(AllfuncInfo, funcByName);
|
|
|
|
|
@@ -1674,13 +1675,17 @@ void loopAnalyzer(SgFile *file, vector<ParallelRegion*> ®ions, map<tuple<int,
|
|
|
|
|
loopsForFunction.push_back(loop);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SgStatement* tmpModFind = st;
|
|
|
|
|
while (tmpModFind->variant() != GLOBAL)
|
|
|
|
|
if(!sharedMemoryParallelization)
|
|
|
|
|
{
|
|
|
|
|
tmpModFind = tmpModFind->controlParent();
|
|
|
|
|
if (tmpModFind->variant() == MODULE_STMT)
|
|
|
|
|
fillFromModule(tmpModFind->symbol(), privatesByModule, privatesVars);
|
|
|
|
|
SgStatement* tmpModFind = st;
|
|
|
|
|
while (tmpModFind->variant() != GLOBAL)
|
|
|
|
|
{
|
|
|
|
|
tmpModFind = tmpModFind->controlParent();
|
|
|
|
|
if (tmpModFind->variant() == MODULE_STMT)
|
|
|
|
|
fillFromModule(tmpModFind->symbol(), privatesByModule, privatesVars);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
commonBlocks.clear();
|
|
|
|
|
getCommonBlocksRef(commonBlocks, st, st->lastNodeOfStmt());
|
|
|
|
|
__spf_print(PRINT_PROF_INFO, " number of common blocks %d\n", (int)commonBlocks.size());
|
|
|
|
|
@@ -1727,7 +1732,8 @@ void loopAnalyzer(SgFile *file, vector<ParallelRegion*> ®ions, map<tuple<int,
|
|
|
|
|
|
|
|
|
|
if (isSgExecutableStatement(st) == NULL)
|
|
|
|
|
delcsStatViewed.insert(st);
|
|
|
|
|
else if (!isDVM_stat(st) && !isSPF_stat(st))
|
|
|
|
|
else if (!sharedMemoryParallelization &&
|
|
|
|
|
!isDVM_stat(st) && !isSPF_stat(st))
|
|
|
|
|
for (int i = 0; i < 3; ++i)
|
|
|
|
|
fillPrivatesFromDecl(st->expr(i), delcsSymbViewed, delcsStatViewed, declaredArrays, declaratedArraysSt, privatesVars);
|
|
|
|
|
|
|
|
|
|
@@ -1735,8 +1741,11 @@ void loopAnalyzer(SgFile *file, vector<ParallelRegion*> ®ions, map<tuple<int,
|
|
|
|
|
const int currV = st->variant();
|
|
|
|
|
if (currV == FOR_NODE)
|
|
|
|
|
{
|
|
|
|
|
tryToFindPrivateInAttributes(st, privatesVars);
|
|
|
|
|
fillNonDistrArraysAsPrivate(st, declaredArrays, declaratedArraysSt, privatesVars);
|
|
|
|
|
if(!sharedMemoryParallelization)
|
|
|
|
|
{
|
|
|
|
|
tryToFindPrivateInAttributes(st, privatesVars);
|
|
|
|
|
fillNonDistrArraysAsPrivate(st, declaredArrays, declaratedArraysSt, privatesVars);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set<string> toAdd;
|
|
|
|
|
tryToFindPrivateInAttributes(st, toAdd);
|
|
|
|
|
@@ -1783,9 +1792,10 @@ void loopAnalyzer(SgFile *file, vector<ParallelRegion*> ®ions, map<tuple<int,
|
|
|
|
|
unitedPrivates.insert(privVar);
|
|
|
|
|
|
|
|
|
|
set<string> setDiff;
|
|
|
|
|
for (auto &privVars : privatesVars)
|
|
|
|
|
if (unitedPrivates.find(privVars) == unitedPrivates.end())
|
|
|
|
|
setDiff.insert(privVars);
|
|
|
|
|
if(!sharedMemoryParallelization)
|
|
|
|
|
for (auto &privVars : privatesVars)
|
|
|
|
|
if (unitedPrivates.find(privVars) == unitedPrivates.end())
|
|
|
|
|
setDiff.insert(privVars);
|
|
|
|
|
|
|
|
|
|
allLoops[contrlParent->lineNumber()] = make_pair((SgForStmt*)contrlParent, make_pair(unitedPrivates, setDiff));
|
|
|
|
|
parentLoops.pop_back();
|
|
|
|
|
|