From 020f2a1109074a77787260907947183b0ee68d6c Mon Sep 17 00:00:00 2001 From: ALEXks Date: Sat, 7 Oct 2023 13:16:09 +0300 Subject: [PATCH] fixed -tinfo option --- sapfor/experts/Sapfor_2017/_src/Sapfor.cpp | 16 +++++++++------- sapfor/experts/Sapfor_2017/_src/SapforData.h | 1 + sapfor/experts/Sapfor_2017/_src/Utils/version.h | 2 +- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/sapfor/experts/Sapfor_2017/_src/Sapfor.cpp b/sapfor/experts/Sapfor_2017/_src/Sapfor.cpp index 88753d3..980bf30 100644 --- a/sapfor/experts/Sapfor_2017/_src/Sapfor.cpp +++ b/sapfor/experts/Sapfor_2017/_src/Sapfor.cpp @@ -2537,10 +2537,10 @@ void runPass(const int curr_regime, const char *proj_name, const char *folderNam } FILE* templatesInfo = NULL; - if (consoleMode) { + if (consoleMode && withTemplateInfo) { string file = (folderName) ? (folderName + string("/")) : ""; file += "templates_info_"; - file += to_string(i); + file += to_string(i + 1); file += ".txt"; templatesInfo = fopen(file.c_str(), "w"); @@ -2550,7 +2550,7 @@ void runPass(const int curr_regime, const char *proj_name, const char *folderNam for (int z = 0; z < parallelRegions.size(); ++z) { - if (consoleMode) + if (consoleMode && withTemplateInfo) fprintf(templatesInfo, "FOR region %s\n", parallelRegions[z]->GetName().c_str()); const DataDirective& dataDirectives = parallelRegions[z]->GetDataDir(); @@ -2561,10 +2561,10 @@ void runPass(const int curr_regime, const char *proj_name, const char *folderNam { if (tmp[z1].first->IsTemplate()) { - if (consoleMode) + if (consoleMode && withTemplateInfo) { SgExpression* rule = new SgExpression(EXPR_LIST); - tmp[z1].second[currentVariants[z1][z]].GenRule(new File(current_file), new Expression(rule), tmp[z1].first->GetNewTemplateDimsOrder()); + tmp[z1].second[currentVariant[z1]].GenRule(new File(current_file), new Expression(rule), tmp[z1].first->GetNewTemplateDimsOrder()); fprintf(templatesInfo, "%s(%s)\n", tmp[z1].first->GetShortName().c_str(), rule->unparse()); } tmp[z1].first->ClearTemplateClones(); @@ -2575,7 +2575,7 @@ void runPass(const int curr_regime, const char *proj_name, const char *folderNam if (tmpFolder != "" && consoleMode) folderName = NULL; - if (consoleMode) + if (consoleMode && withTemplateInfo) fclose(templatesInfo); } } @@ -2760,7 +2760,9 @@ int main(int argc, char **argv) SPEED = 100; } } - else if (curr_arg[1] == 't') // deprecated + else if (string(curr_arg) == "-tinfo") + withTemplateInfo = true; + else if (string(curr_arg) == "-t") // deprecated { i++; int par = atoi(argv[i]); diff --git a/sapfor/experts/Sapfor_2017/_src/SapforData.h b/sapfor/experts/Sapfor_2017/_src/SapforData.h index 78d7912..89c00b3 100644 --- a/sapfor/experts/Sapfor_2017/_src/SapforData.h +++ b/sapfor/experts/Sapfor_2017/_src/SapforData.h @@ -45,6 +45,7 @@ int debSh = 0; // shadow optimization debugging bool ignoreArrayDistributeState = false; bool fullDepGraph = false; bool noLogo = false; +bool withTemplateInfo = false; uint64_t currentAvailMemory = 0; int QUALITY; // quality of conflicts search in graph diff --git a/sapfor/experts/Sapfor_2017/_src/Utils/version.h b/sapfor/experts/Sapfor_2017/_src/Utils/version.h index 7c6d1bb..78f71bd 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 "2223" +#define VERSION_SPF "2224"