added json for SPF_CreateParallelVariant pass
This commit is contained in:
@@ -1065,7 +1065,6 @@ int SPF_CreateParallelVariant(void*& context, int winHandler, short *options, sh
|
||||
printf("SAPFOR: set all info done\n");
|
||||
runPassesForVisualizer(projName, { INSERT_PARALLEL_DIRS }, folderName);
|
||||
|
||||
string predictRes = "";
|
||||
PredictorStats summed;
|
||||
for (auto &predFile : allPredictorStats)
|
||||
{
|
||||
@@ -1081,44 +1080,11 @@ int SPF_CreateParallelVariant(void*& context, int winHandler, short *options, sh
|
||||
summed.TotalScoreComm += predFile.second.TotalScoreComm;
|
||||
summed.TotalScoreDist += predFile.second.TotalScoreDist;
|
||||
summed.TotalScorePar += predFile.second.TotalScorePar;
|
||||
}
|
||||
predictRes += summed.to_string();
|
||||
//predictRes += "|" + to_string((summed.TotalScoreComm != 0 ? 1.0 / summed.TotalScoreComm : 0.0 )+ (double)summed.TotalScorePar * 1000 + (countOfDist == 0 ? -5000 : countOfDist));
|
||||
if (countOfDist == 0)
|
||||
predictRes += "|x";
|
||||
else
|
||||
predictRes += "|" + to_string(-1 * (summed.ParallelStat.AcrossCount + summed.ParallelStat.RemoteCount + summed.RedistributeCount + summed.RemoteCount));
|
||||
//predictRes += "|0";
|
||||
|
||||
//TODO: need to rewrite to new algo
|
||||
/*if (folderName == NULL)
|
||||
{
|
||||
SpfInterval *mainIterval = getMainInterval(project, intervals);
|
||||
const int idxBest = mainIterval->getBestTimeIdx();
|
||||
double speedUpBest = 1;
|
||||
int procCount = 1;
|
||||
string topo = "";
|
||||
if (idxBest != -1 && mainIterval->exec_time != 0)
|
||||
{
|
||||
speedUpBest = mainIterval->exec_time / mainIterval->predictedTimes[idxBest];
|
||||
topo += "[";
|
||||
for (int z = 0; z < topologies[idxBest].size(); ++z)
|
||||
{
|
||||
topo += to_string(topologies[idxBest][z]);
|
||||
procCount *= topologies[idxBest][z];
|
||||
if (z != topologies[idxBest].size() - 1)
|
||||
topo += "x";
|
||||
}
|
||||
topo += "]";
|
||||
}
|
||||
char buf[256];
|
||||
sprintf(buf, "%.2f", speedUpBest / procCount * 100.0);
|
||||
predictRes += "|" + string(buf) + topo;
|
||||
}
|
||||
else
|
||||
predictRes += "|0";*/
|
||||
|
||||
string predictRes = summed.toJson().dump();
|
||||
copyStringToShort(predictorStats, predictRes);
|
||||
|
||||
__spf_print(1, " statistic to send: %s\n", predictRes.c_str());
|
||||
retSize = (int)predictRes.size();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user