#pragma once #include #include #include #include #include #include "ParallelizationRegions/ParRegions.h" #include "Distribution/Array.h" #include "GraphCall/graph_calls.h" #include "GraphLoop/graph_loops.h" #include "Utils/AstWrapper.h" #include "DynamicAnalysis/gcov_info.h" #include "Sapfor.h" #include "Utils/errors.h" #include "DynamicAnalysis/createParallelRegions.h" extern std::map shortFileNames; static int activeState = 0; int staticShadowAnalysis = 0; int staticPrivateAnalysis = 0; int keepDvmDirectives = 0; int keepFiles = 0; int keepSpfDirs = 0; int predictOn = 0; //int consoleMode = 0; moved to utils.cpp int genAllVars = 0; //generate ALL distribution variants int genSpecificVar = -1; //generate specific distribution variant int ignoreDvmChecker = 0; // temporary flag int automaticDeprecateArrays = 0; // automatic change DIST status to NON_DIST of Array int maxShadowWidth = 50; // in percent int intervals_threshold = 100; // threshold for intervals bool removeNestedIntervals = false; // nested intervals removal flag int langOfMessages = 1; // 0 - ENG, 1 - RUS int parallizeFreeLoops = 0; // parallize free calculations int sharedMemoryParallelization = 0; // detected mpi calls int ignoreIO = 0; // ignore io checker for arrays (DVM IO limitations) int parseForInlining = 0; // special regime for files parsing for inliner int dumpIR = 0; // allow dump IR after BUILD_IR pass int dumpRD = 0; // allow dump RD with IR after BUILD_IR pass int dumpLive = 0; // allow dump live variables after LIVE_VARIABLE_ANALYSIS pass int debSh = 0; // shadow optimization debugging bool ignoreArrayDistributeState = false; bool fullDepGraph = false; bool noLogo = false; bool withTemplateInfo = false; bool inlcudeAllFiles = false; // for pass INSERT_INLCUDES bool runAsClient = false; // run console project as client for Visualizer bool printSymbTable = false; const char* VISUALIZER_DATA_PATH = "visualiser_data"; uint64_t currentAvailMemory = 0; int QUALITY; // quality of conflicts search in graph int SPEED; // speed of conflicts search in graph std::map> tableOfUniqNamesByArray; std::vector parallelRegions; std::map, std::set> usersDirectives; // for LOOP_ANALYZER_DATA_DIST std::map, DIST::Array*> createdArrays; std::map, std::pair> declaredArrays; std::map>> declaratedArraysSt; // St -> set //for CALL_GRAPH std::map> allFuncInfo; // file -> Info std::map> arrayLinksByFuncCalls; // //for LOOP_GRAPH std::map> loopGraph; // file -> Info std::map depInfoForLoopGraph; // //for directive creator std::map> createdDirectives; //file -> directive to insert // //for directive inserter std::map>> commentsToInclude; // //for INSERT_INCLUDES std::map>> filesToInclude; // file -> includes [nearest line, include] // //for PASSES DEPENDENSIES std::map> passesDependencies; std::set passesIgnoreStateDone; // //for files info std::map lineInfo; // file -> lines count std::map, std::set>> dirsInfo; // file -> dirs count std::map>> includeDependencies; // file -> includes [nearest line, include] std::vector filesCompilationOrder; // order of files for unite to one file std::map>> exctactedModuleStats; // file -> hided excluded modules // //for FILL_COMMON_BLOCKS std::map commonBlocks; // name -> commonBlock // std::map> SPF_messages; //file ->messages //for PARALLEL REGIONS + DVM_CHECKER + SET_IMPLICIT_NONE std::map> dvmDirErrors; // file->lines // //for RESOLVE PARALLEL REGIONS std::map>> newCopyDeclToIncl; // file->[line, newDecls] // //for DEF USE std::map> defUseByFunctions; // //for EXPR SUBSTITUTION and IR std::map> allFuncInfo_IR; // file -> Info map> fullIR; // function -> basic blocks std::vector subs_parallelRegions; // //for predictior statistic std::map allPredictorStats; //for DVM INTERVALS std::map> intervals; // file -> intervals std::vector> topologies; // current topologies // //for GCOV_PARSER std::map> gCovInfo; // file -> [lines, info] // //for SPF CHANGING std::tuple inData; // file, startLine, endLine, del/add std::map outData; // file -> new unparsed text // //for SPF INLINE PROCEDURES std::vector> inDataProc; // [] std::map>> inDataChains; std::set inDataChainsStart; std::map> hiddenData; // [ all hidden stmts] // //module includes across all files, need to correct lines and out versions std::map> moduleUsesByFile; // file -> use module name std::map moduleDecls; // module -> file where declared // //for LOOPS_COMBINER std::pair inOnlyForloopOnPlace; // //cache for declaration arrays state switching std::map distrStateFromGUI; // //for PROCESS_IO std::map filesInfo; // information about open,close,write and read statements // //for FIND_PARAMETERS std::set> parametersOfProject; // [file, line, varname] // //for GET_MIN_MAX_BLOCK_DIST std::pair min_max_block = std::make_pair(-1, -1); // const char* passNames[EMPTY_PASS + 1]; const char* optionNames[EMPTY_OPTION + 1]; bool passNamesWasInit = false; std::map> sgStats; std::map> sgExprs;