diff --git a/src/Transformations/ReplaceArraysInIO/replace_dist_arrays_in_io.cpp b/src/Transformations/ReplaceArraysInIO/replace_dist_arrays_in_io.cpp index 9a1ad21..4cf9961 100644 --- a/src/Transformations/ReplaceArraysInIO/replace_dist_arrays_in_io.cpp +++ b/src/Transformations/ReplaceArraysInIO/replace_dist_arrays_in_io.cpp @@ -74,10 +74,7 @@ static void populateDistributedIoArrays(map>& array { SgExpression* fmt = stat->expr(1); if (!fmt || fmt->variant() != SPEC_PAIR || fmt->lhs()->variant() != KEYWORD_VAL) - { printInternalError(convertFileName(__FILE__).c_str(), __LINE__); - return; - } if (fmt->rhs()->variant() != KEYWORD_VAL || fmt->rhs()->sunparse() != "*") need_replace = true; @@ -104,10 +101,7 @@ static void populateDistributedIoArrays(map>& array { auto *kv = spec->lhs(); if (!kv || kv->variant() != SPEC_PAIR || !kv->rhs()) - { printInternalError(convertFileName(__FILE__).c_str(), __LINE__); - return; - } if (kv->rhs()->variant() != KEYWORD_VAL || kv->rhs()->sunparse() != "*") { @@ -368,11 +362,8 @@ void replaceDistributedArraysInIO(vector& regions, { const auto& filename = linesByFile.first; - if (SgFile::switchToFile(filename) < 0) - { + if (SgFile::switchToFile(filename) == -1) printInternalError(convertFileName(__FILE__).c_str(), __LINE__); - return; - } for (auto& lines : linesByFile.second) { @@ -481,9 +472,7 @@ void replaceDistributedArraysInIO(vector& regions, insertPlace->insertStmtAfter(*stat, *st); } else - { copied = copyArray(place, array_p, linesByFile.second, suffix + to_string(region->GetId()), fileName, newDeclsToInclude, copied_syms); - } SgStatement* decl = SgStatement::getStatementByFileAndLine(place.first, place.second); @@ -504,6 +493,9 @@ void replaceDistributedArraysInIO(vector& regions, decl->addComment(dir_str.c_str()); } created_copies.insert({ array_to_copy, copied.second }); + + if (curr_stmt->switchToFile() == -1) + printInternalError(convertFileName(__FILE__).c_str(), __LINE__); } } @@ -517,10 +509,7 @@ void replaceDistributedArraysInIO(vector& regions, if (it != created_copies.end()) replaceArrayInFragment(p.first, p.second, it->second, last_io_bound, curr_stmt, filename); else - { printInternalError(convertFileName(__FILE__).c_str(), __LINE__); - return; - } } } diff --git a/src/Utils/version.h b/src/Utils/version.h index 7b18d84..08f8d2d 100644 --- a/src/Utils/version.h +++ b/src/Utils/version.h @@ -1,3 +1,3 @@ #pragma once -#define VERSION_SPF "2439" +#define VERSION_SPF "2440"