2023-09-14 19:43:13 +03:00
|
|
|
#pragma once
|
|
|
|
|
#include <vector>
|
|
|
|
|
#include "dvm.h"
|
2024-08-30 12:17:35 +03:00
|
|
|
#include "../GraphCall/graph_calls.h"
|
2023-09-14 19:43:13 +03:00
|
|
|
|
|
|
|
|
class ParallelStats
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
ParallelStats()
|
|
|
|
|
{
|
|
|
|
|
RemoteCount = ShadowCount = ReductionCount = AcrossCount = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int RemoteCount;
|
|
|
|
|
int ShadowCount;
|
|
|
|
|
int ReductionCount;
|
|
|
|
|
int AcrossCount;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class PredictorStats
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
PredictorStats()
|
|
|
|
|
{
|
|
|
|
|
ParallelCount = RemoteCount = RedistributeCount = IntervalCount = 0;
|
|
|
|
|
TotalScorePar = TotalScoreComm = TotalScoreDist = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ParallelStats ParallelStat;
|
|
|
|
|
int ParallelCount;
|
|
|
|
|
int RemoteCount;
|
|
|
|
|
int RedistributeCount;
|
|
|
|
|
int IntervalCount;
|
|
|
|
|
int TotalScoreComm;
|
|
|
|
|
int TotalScorePar;
|
|
|
|
|
int TotalScoreDist;
|
|
|
|
|
|
|
|
|
|
std::string to_string()
|
|
|
|
|
{
|
|
|
|
|
std::string res = "";
|
|
|
|
|
res += std::to_string(ParallelCount) + "|";
|
|
|
|
|
res += std::to_string(RemoteCount) + "|";
|
|
|
|
|
res += std::to_string(RedistributeCount) + "|";
|
|
|
|
|
res += std::to_string(IntervalCount) + "|";
|
|
|
|
|
|
|
|
|
|
res += std::to_string(ParallelStat.RemoteCount) + "|";
|
|
|
|
|
res += std::to_string(ParallelStat.ShadowCount) + "|";
|
|
|
|
|
res += std::to_string(ParallelStat.ReductionCount) + "|";
|
|
|
|
|
res += std::to_string(ParallelStat.AcrossCount);
|
|
|
|
|
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2024-08-30 12:17:35 +03:00
|
|
|
void processFileToPredict(SgFile *file, PredictorStats &predictorCounts);
|
|
|
|
|
|
2024-10-07 14:50:37 +03:00
|
|
|
void calculateStatsForPredictor(const std::map<std::string, std::vector<FuncInfo*>>& allFuncInfo, const std::map<std::string, std::map<int, Gcov_info>>& gCovInfo);
|
2024-11-14 12:37:38 +03:00
|
|
|
void parseDvmDirForPredictor(const std::map<std::tuple<int, std::string, std::string>, std::pair<DIST::Array*, DIST::ArrayAccessInfo*>>& declaredArrays, const std::map<std::string, CommonBlock*>& commonBlocks, const std::map<std::string, std::vector<FuncInfo*>>& allFuncInfo, const std::map<std::string, std::map<int, Gcov_info>>& gCovInfo);
|