fixed shared memory parallelization, moved messages to single file

This commit is contained in:
ALEXks
2025-06-14 12:50:04 +03:00
parent 10636427ed
commit 9e777ceeab
8 changed files with 133 additions and 70 deletions

View File

@@ -398,11 +398,7 @@ static bool runAnalysis(SgProject &project, const int curr_regime, const bool ne
__spf_print(DEBUG_LVL1, "RUN PASS with name %s\n", passNames[curr_regime]);
auto toSendStrMessage = string(passNames[curr_regime]);
#ifdef _WIN32
sendMessage_1lvl(wstring(L"выполняется проход '") + wstring(toSendStrMessage.begin(), toSendStrMessage.end()) + L"'");
#else
sendMessage_1lvl(wstring(L"running pass '") + wstring(toSendStrMessage.begin(), toSendStrMessage.end()) + L"'");
#endif
sendMessage_1lvl(1, toSendStrMessage);
const int n = project.numberOfFiles();
bool verifyOK = true;
@@ -450,11 +446,7 @@ static bool runAnalysis(SgProject &project, const int curr_regime, const bool ne
SgFile *file = &(project.file(i));
toSendStrMessage = file->filename();
#ifdef _WIN32
sendMessage_2lvl(wstring(L"обработка файла '") + wstring(toSendStrMessage.begin(), toSendStrMessage.end()) + L"'");
#else
sendMessage_2lvl(wstring(L"processing file '") + wstring(toSendStrMessage.begin(), toSendStrMessage.end()) + L"'");
#endif
sendMessage_2lvl(3, toSendStrMessage);
sendMessage_progress(std::to_wstring((int)(((double)(n - i) / n) * 100)));
const char *file_name = file->filename();
@@ -1057,7 +1049,7 @@ static bool runAnalysis(SgProject &project, const int curr_regime, const bool ne
throw -11;
}
sendMessage_2lvl(wstring(L""));
sendMessage_2lvl(2);
// ********************************** ///
/// SECOND AGGREGATION STEP ///
// ********************************** ///
@@ -1928,7 +1920,7 @@ static bool runAnalysis(SgProject &project, const int curr_regime, const bool ne
const float elapsedGlobal = duration_cast<milliseconds>(high_resolution_clock::now() - globalTime).count() / 1000.;
__spf_print(1, "PROFILE: time for this pass = %f sec (total %f sec)\n", elapsed, elapsedGlobal);
sendMessage_2lvl(wstring(L""));
sendMessage_2lvl(2);
if (internalExit != 0)
throw -1;