diff --git a/sapfor/experts/Sapfor_2017/_src/DvmhRegions/DvmhRegionInserter.cpp b/sapfor/experts/Sapfor_2017/_src/DvmhRegions/DvmhRegionInserter.cpp index 034aa4c..dce7b0e 100644 --- a/sapfor/experts/Sapfor_2017/_src/DvmhRegions/DvmhRegionInserter.cpp +++ b/sapfor/experts/Sapfor_2017/_src/DvmhRegions/DvmhRegionInserter.cpp @@ -327,10 +327,13 @@ static void analyzeFunctionParameters(SgExpression* paramList, set& exce while (paramList) { SgExpression* ex = paramList->lhs(); - if (ex->variant() != FUNC_CALL) - analyzeFunctionParameter(ex, except, arrays); + if (ex->variant() == FUNC_CALL) + { + if (!isIntrinsicFunctionName(ex->symbol()->identifier())) + analyzeFunctionParameters(ex->lhs(), except, arrays); + } else - analyzeFunctionParameters(ex->lhs(), except, arrays); + analyzeFunctionParameter(ex, except, arrays); paramList = paramList->rhs(); } @@ -341,7 +344,10 @@ static void createExceptList(SgExpression* ex, set& except, ArraySet& ar if (ex) { if (ex->variant() == FUNC_CALL) - analyzeFunctionParameters(ex->lhs(), except, arrays); + { + if (!isIntrinsicFunctionName(ex->symbol()->identifier())) + analyzeFunctionParameters(ex->lhs(), except, arrays); + } else { createExceptList(ex->lhs(), except, arrays); @@ -419,7 +425,7 @@ ArraySet DvmhRegionInserter::excludeRemotes(const ArraySet& block, SgStatement* void DvmhRegionInserter::insertForProcCall(SgStatement* st, bool& skipGetActualIfProcCall, bool& skipActualIfProcCall) { const char* procName = st->symbol()->identifier(); - if (isIntrinsicFunctionName(procName) == 0) + if (isIntrinsicFunctionName(procName) == 0 || isMpiProgram) { skipGetActualIfProcCall = skipActualIfProcCall = true; @@ -591,10 +597,6 @@ void DvmhRegionInserter::insertActualDirectives(const vector* r printInternalError(convertFileName(__FILE__).c_str(), __LINE__); __spf_print(1, "Insert actuals for file %s\n", file->filename()); - - /*int funcNum = file->numberOfFunctions(); - if (funcsForFile.size() != funcNum) - printInternalError(convertFileName(__FILE__).c_str(), __LINE__); */ for (auto& func : funcsForFile) { @@ -774,7 +776,6 @@ void DvmhRegionInserter::insertActualDirective(SgStatement *st, const ArraySet & } else if (variant == ACC_ACTUAL_DIR) { - auto prev = st->lexPrev(); if (prev && prev->variant() == ASSIGN_STAT && !hasFuncCalls(prev->expr(1)) && !hasFuncCalls(prev->expr(0))) { diff --git a/sapfor/experts/Sapfor_2017/_src/DvmhRegions/DvmhRegionInserter.h b/sapfor/experts/Sapfor_2017/_src/DvmhRegions/DvmhRegionInserter.h index f3c533b..d6abf3e 100644 --- a/sapfor/experts/Sapfor_2017/_src/DvmhRegions/DvmhRegionInserter.h +++ b/sapfor/experts/Sapfor_2017/_src/DvmhRegions/DvmhRegionInserter.h @@ -27,6 +27,7 @@ class DvmhRegionInserter const std::vector loopGraph; const std::map allFunctions; const std::vector funcsForFile; + bool isMpiProgram; ReadWriteAnalyzer& rw_analyzer; std::set parallel_functions; @@ -63,8 +64,9 @@ public: ReadWriteAnalyzer& rws, const std::map>& arrayLinksByFuncCalls, const std::map& allFunctions, - const std::vector& funcsForFile - ) : file(curFile), loopGraph(curLoopGraph), rw_analyzer(rws), arrayLinksByFuncCalls(arrayLinksByFuncCalls), allFunctions(allFunctions), funcsForFile(funcsForFile) + const std::vector& funcsForFile, + bool mpi_program + ) : file(curFile), loopGraph(curLoopGraph), rw_analyzer(rws), arrayLinksByFuncCalls(arrayLinksByFuncCalls), allFunctions(allFunctions), funcsForFile(funcsForFile), isMpiProgram(mpi_program) { if (loopGraph.size()) createMapLoopGraph(loopGraph, loopGraphMap); diff --git a/sapfor/experts/Sapfor_2017/_src/Sapfor.cpp b/sapfor/experts/Sapfor_2017/_src/Sapfor.cpp index b8b8df3..04eafba 100644 --- a/sapfor/experts/Sapfor_2017/_src/Sapfor.cpp +++ b/sapfor/experts/Sapfor_2017/_src/Sapfor.cpp @@ -2110,7 +2110,7 @@ static bool runAnalysis(SgProject &project, const int curr_regime, const bool ne for (auto& loop : loopsForFile) loop->analyzeParallelDirs(); - DvmhRegionInserter* regionInserter = new DvmhRegionInserter(file, loopsForFile, rw_analyzer, arrayLinksByFuncCalls, mapOfFuncs, funcsForFile); + DvmhRegionInserter* regionInserter = new DvmhRegionInserter(file, loopsForFile, rw_analyzer, arrayLinksByFuncCalls, mapOfFuncs, funcsForFile, mpiProgram == 1); inserters.push_back(regionInserter); //collect info about functions diff --git a/sapfor/experts/Sapfor_2017/_src/Utils/version.h b/sapfor/experts/Sapfor_2017/_src/Utils/version.h index 0bdcabc..db16f7e 100644 --- a/sapfor/experts/Sapfor_2017/_src/Utils/version.h +++ b/sapfor/experts/Sapfor_2017/_src/Utils/version.h @@ -1,3 +1,3 @@ #pragma once -#define VERSION_SPF "2217" +#define VERSION_SPF "2218"