replace_dist_arrays_in_io: choose arrays for copying more carefully #54

Merged
Alexander_KS merged 2 commits from replace_dist_arrays_in_io into master 2024-11-17 14:17:22 +00:00
2 changed files with 4 additions and 4 deletions

View File

@@ -19,7 +19,7 @@ static void findArrays(SgExpression* exp, set<SgSymbol*>& arrays)
{ {
if (exp) if (exp)
{ {
if (isSgArrayRefExp(exp)) if (isArrayRef(exp))
arrays.insert(exp->symbol()); arrays.insert(exp->symbol());
findArrays(exp->lhs(), arrays); findArrays(exp->lhs(), arrays);
@@ -53,7 +53,7 @@ static void populateDistributedIoArrays(map<DIST::Array*, set<SgStatement*>>& ar
if (!arg) if (!arg)
return; return;
if (arg->variant() != ARRAY_REF) if (!isArrayRef(arg))
return; return;
if (arg->lhs()) if (arg->lhs())
@@ -122,7 +122,7 @@ static void populateDistributedIoArrays(map<DIST::Array*, set<SgStatement*>>& ar
{ {
string array_name = string(by_symb->identifier()); string array_name = string(by_symb->identifier());
DIST::Array* array_p = getArrayFromDeclarated(declaratedInStmt(by_symb), array_name); DIST::Array* array_p = getArrayFromDeclarated(declaratedInStmt(by_symb), array_name);
if (array_p && array_p->GetDistributeFlagVal() == Distribution::distFlag::DISTR && arrays[array_p].insert(stat).second) if (array_p && array_p->GetDistributeFlagVal() == Distribution::distFlag::IO_PRIV && arrays[array_p].insert(stat).second)
__spf_print(DEBUG_TRACE, "[%d]: add array %s\n", stat->lineNumber(), array_p->GetName().c_str()); __spf_print(DEBUG_TRACE, "[%d]: add array %s\n", stat->lineNumber(), array_p->GetName().c_str());
} }

View File

@@ -1,3 +1,3 @@
#pragma once #pragma once
#define VERSION_SPF "2367" #define VERSION_SPF "2368"