#include <stdio.h>
#include <unistd.h>
-#include "sync_chain_lttv.h"
+#include "sync_chain.h"
#include "event_analysis_chull.h"
message);
static GArray* finalizeAnalysisCHull(SyncState* const syncState);
static void printAnalysisStatsCHull(SyncState* const syncState);
-static void writeAnalysisGraphsPlotsCHull(FILE* stream, SyncState* const
- syncState, const unsigned int i, const unsigned int j);
+static void writeAnalysisGraphsPlotsCHull(SyncState* const syncState, const
+ unsigned int i, const unsigned int j);
// Functions specific to this module
static void registerAnalysisCHull() __attribute__((constructor (101)));
analysisData->stats->allFactors= NULL;
}
- if (syncState->graphs)
+ if (syncState->graphsStream)
{
analysisData->graphsData= malloc(sizeof(AnalysisGraphsDataCHull));
openGraphFiles(syncState);
analysisData= (AnalysisDataCHull*) syncState->analysisData;
- cwd= changeToGraphDir(syncState->graphs);
+ cwd= changeToGraphDir(syncState->graphsDir);
analysisData->graphsData->hullPoints= malloc(syncState->traceNb *
sizeof(FILE**));
free(analysisData->stats);
}
- if (syncState->graphs)
+ if (syncState->graphsStream)
{
if (analysisData->graphsData->hullPoints != NULL)
{
if (message->inE->traceNum < message->outE->traceNum)
{
// CA is inE->traceNum
- newPoint->x= message->inE->time;
- newPoint->y= message->outE->time;
+ newPoint->x= message->inE->cpuTime;
+ newPoint->y= message->outE->cpuTime;
hullType= UPPER;
g_debug("Reception point hullArray[%lu][%lu] x= inE->time= %llu y= outE->time= %llu",
message->inE->traceNum, message->outE->traceNum, newPoint->x,
else
{
// CA is outE->traceNum
- newPoint->x= message->outE->time;
- newPoint->y= message->inE->time;
+ newPoint->x= message->outE->cpuTime;
+ newPoint->y= message->inE->cpuTime;
hullType= LOWER;
g_debug("Send point hullArray[%lu][%lu] x= inE->time= %llu y= outE->time= %llu",
message->inE->traceNum, message->outE->traceNum, newPoint->x,
analysisData= (AnalysisDataCHull*) syncState->analysisData;
- if (syncState->graphs)
+ if (syncState->graphsStream && analysisData->graphsData->hullPoints != NULL)
{
writeGraphFiles(syncState);
closeGraphFiles(syncState);
factors= reduceFactors(syncState, allFactors);
- if (syncState->stats || syncState->graphs)
+ if (syncState->stats || syncState->graphsStream)
{
if (syncState->stats)
{
analysisData->stats->allFactors= allFactors;
}
- if (syncState->graphs)
+ if (syncState->graphsStream)
{
analysisData->graphsData->allFactors= allFactors;
}
* Write the analysis-specific graph lines in the gnuplot script.
*
* Args:
- * stream: stream where to write the data
* syncState: container for synchronization data
* i: first trace number
* j: second trace number, garanteed to be larger than i
*/
-void writeAnalysisGraphsPlotsCHull(FILE* stream, SyncState* const syncState,
- const unsigned int i, const unsigned int j)
+void writeAnalysisGraphsPlotsCHull(SyncState* const syncState, const unsigned
+ int i, const unsigned int j)
{
AnalysisDataCHull* analysisData;
FactorsCHull* factorsCHull;
analysisData= (AnalysisDataCHull*) syncState->analysisData;
- fprintf(stream,
+ fprintf(syncState->graphsStream,
"\t\"analysis_chull-%1$03d_to_%2$03d.data\" "
"title \"Lower half-hull\" with linespoints "
"linecolor rgb \"#015a01\" linetype 4 pointtype 8 pointsize 0.8, \\\n"
factorsCHull= &analysisData->graphsData->allFactors[j][i];
if (factorsCHull->type == EXACT)
{
- fprintf(stream,
+ fprintf(syncState->graphsStream,
"\t%7g + %7g * x "
"title \"Exact conversion\" with lines "
"linecolor rgb \"black\" linetype 1, \\\n",
}
else if (factorsCHull->type == MIDDLE)
{
- fprintf(stream,
+ fprintf(syncState->graphsStream,
"\t%.2f + %.10f * x "
"title \"Min conversion\" with lines "
"linecolor rgb \"black\" linetype 5, \\\n",
factorsCHull->min->offset, factorsCHull->min->drift);
- fprintf(stream,
+ fprintf(syncState->graphsStream,
"\t%.2f + %.10f * x "
"title \"Max conversion\" with lines "
"linecolor rgb \"black\" linetype 8, \\\n",
factorsCHull->max->offset, factorsCHull->max->drift);
- fprintf(stream,
+ fprintf(syncState->graphsStream,
"\t%.2f + %.10f * x "
"title \"Middle conversion\" with lines "
"linecolor rgb \"gray60\" linetype 1, \\\n",
}
else if (factorsCHull->type == FALLBACK)
{
- fprintf(stream,
+ fprintf(syncState->graphsStream,
"\t%.2f + %.10f * x "
"title \"Fallback conversion\" with lines "
"linecolor rgb \"gray60\" linetype 1, \\\n",
{
if (factorsCHull->min->drift != -INFINITY)
{
- fprintf(stream,
+ fprintf(syncState->graphsStream,
"\t%.2f + %.10f * x "
"title \"Min conversion\" with lines "
"linecolor rgb \"black\" linetype 5, \\\n",
if (factorsCHull->max->drift != INFINITY)
{
- fprintf(stream,
+ fprintf(syncState->graphsStream,
"\t%.2f + %.10f * x "
"title \"Max conversion\" with lines "
"linecolor rgb \"black\" linetype 8, \\\n",
{
if (factorsCHull->min != NULL && factorsCHull->min->drift != -INFINITY)
{
- fprintf(stream,
+ fprintf(syncState->graphsStream,
"\t%.2f + %.10f * x "
"title \"Min conversion\" with lines "
"linecolor rgb \"black\" linetype 5, \\\n",
if (factorsCHull->max != NULL && factorsCHull->max->drift != INFINITY)
{
- fprintf(stream,
+ fprintf(syncState->graphsStream,
"\t%.2f + %.10f * x "
"title \"Max conversion\" with lines "
"linecolor rgb \"black\" linetype 8, \\\n",