From 694f7bf9ecca83c4c3e0062ccc324ff58cde69cf Mon Sep 17 00:00:00 2001 From: Mikhail Kocharmin Date: Thu, 7 Nov 2024 22:13:51 +0300 Subject: [PATCH] replace_dist_arrays_in_io: fix code style, replace only distributed arrays --- .../Transformations/replace_dist_arrays_in_io.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/sapfor/experts/Sapfor_2017/_src/Transformations/replace_dist_arrays_in_io.cpp b/sapfor/experts/Sapfor_2017/_src/Transformations/replace_dist_arrays_in_io.cpp index 81a6e71..6870074 100644 --- a/sapfor/experts/Sapfor_2017/_src/Transformations/replace_dist_arrays_in_io.cpp +++ b/sapfor/experts/Sapfor_2017/_src/Transformations/replace_dist_arrays_in_io.cpp @@ -9,6 +9,7 @@ using std::map; using std::set; using std::string; +using std::vector; using std::to_string; using std::make_pair; @@ -104,6 +105,8 @@ static void populateDistributedIoArrays(map>& ar break; } + default: + break; } } @@ -119,7 +122,7 @@ static void populateDistributedIoArrays(map>& ar { string array_name = string(by_symb->identifier()); DIST::Array* array_p = getArrayFromDeclarated(declaratedInStmt(by_symb), array_name); - if (arrays[array_p].insert(stat).second) + if (array_p && array_p->GetDistributeFlagVal() == Distribution::distFlag::DISTR && arrays[array_p].insert(stat).second) __spf_print(DEBUG_TRACE, "[%d]: add array %s\n", stat->lineNumber(), array_p->GetName().c_str()); } @@ -325,10 +328,10 @@ static bool ioReginBound(SgStatement* stat, SgStatement* last_io_bound) return false; } -void replaceDistributedArraysInIO(std::vector& regions, - const std::map>& allFuncInfo, - std::map>& SPF_messages, - map>>& newDeclsToInclude) +void replaceDistributedArraysInIO(vector& regions, + const map>& allFuncInfo, + map>& SPF_messages, + map>>& newDeclsToInclude) { map created_copies; map>> copied;