shared memory parallelization: avoid use of arrays struct in shared memory case

This commit is contained in:
2024-07-06 20:11:07 +03:00
parent 06f908c1b2
commit 793408f9a8
3 changed files with 6 additions and 6 deletions

View File

@@ -780,7 +780,7 @@ ParallelDirective::genDirective(File* file, const vector<pair<DIST::Array*, cons
}
bool isOut = acrossOutAttribute.find(currArray) != acrossOutAttribute.end();
string bounds = genBounds(across[i1], acrossShifts[i1], reducedG, allArrays, remoteReads, readOps, true, regionId, distribution, arraysInAcross, shiftsByAccess, arrayLinksByFuncCalls);
string bounds = genBounds(across[i1], acrossShifts[i1], reducedG, allArrays, currArray, remoteReads, readOps, true, regionId, distribution, arraysInAcross, shiftsByAccess, arrayLinksByFuncCalls);
if (bounds != "")
{
if (inserted != 0)
@@ -869,7 +869,8 @@ ParallelDirective::genDirective(File* file, const vector<pair<DIST::Array*, cons
{
const int i1 = ordered[k];
vector<map<pair<int, int>, int>> shiftsByAccess;
const string bounds = genBounds(shadowRenew[i1], shadowRenewShifts[i1], reducedG, allArrays, remoteReads, readOps, false, regionId, distribution, arraysInAcross, shiftsByAccess, arrayLinksByFuncCalls);
DIST::Array* shadowArray = allArrays.GetArrayByName(shadowRenew[i1].first.second);
const string bounds = genBounds(shadowRenew[i1], shadowRenewShifts[i1], reducedG, allArrays, shadowArray, remoteReads, readOps, false, regionId, distribution, arraysInAcross, shiftsByAccess, arrayLinksByFuncCalls);
if (bounds != "")
{
DIST::Array* currArray = allArrays.GetArrayByName(shadowRenew[i1].first.second);

View File

@@ -162,7 +162,7 @@ private:
std::string genBounds(std::pair<std::pair<std::string, std::string>, std::vector<std::pair<int, int>>> &shadowOp,
std::vector<std::pair<int, int>> &shadowOpShift,
DIST::GraphCSR<int, double, attrType> &reducedG,
DIST::Arrays<int> &allArrays,
DIST::Arrays<int> &allArrays, DIST::Array* shadowArray,
std::map<DIST::Array*, std::vector<ArrayOp>>& remoteRegularReads,
const std::map<DIST::Array*, std::pair<std::vector<ArrayOp>, std::vector<bool>>> &readOps,
const bool isAcross, const uint64_t regionId,

View File

@@ -461,7 +461,7 @@ static inline string calculateShifts(DIST::GraphCSR<int, double, attrType> &redu
string ParallelDirective::genBounds(pair<pair<string, string>, vector<pair<int, int>>> &shadowOp,
vector<pair<int, int>> &shadowOpShift,
DIST::GraphCSR<int, double, attrType> &reducedG,
DIST::Arrays<int> &allArrays,
DIST::Arrays<int> &allArrays, DIST::Array* shadowArray,
map<DIST::Array*, vector<ArrayOp>>& remoteRegularReads,
const map<DIST::Array*, pair<vector<ArrayOp>, vector<bool>>> &readOps,
const bool isAcross,
@@ -471,8 +471,7 @@ string ParallelDirective::genBounds(pair<pair<string, string>, vector<pair<int,
vector<map<pair<int, int>, int>> &shiftsByAccess,
const map<DIST::Array*, set<DIST::Array*>> &arrayLinksByFuncCalls) const
{
DIST::Array *shadowArray = allArrays.GetArrayByName(shadowOp.first.second);
checkNull(shadowArray, convertFileName(__FILE__).c_str(), __LINE__);
checkNull(shadowArray, convertFileName(__FILE__).c_str(), __LINE__);
auto on_ext = on;