#endif
#include <errno.h>
+#include <inttypes.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "event_matching_broadcast.h"
-#ifndef g_info
-#define g_info(format...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_INFO, format)
-#endif
-
-
// Functions common to all matching modules
static void initMatchingBroadcast(SyncState* const syncState);
static void destroyMatchingBroadcast(SyncState* const syncState);
static void openGraphDataFiles(SyncState* const syncState);
static void writeAccuracyPoints(MatchingGraphsBroadcast* graphs, const
Broadcast* const broadcast);
-void gfAddToArray(gpointer data, gpointer user_data);
static void closeGraphDataFiles(SyncState* const syncState);
.matchEvent= &matchEventBroadcast,
.finalizeMatching= &finalizeMatchingBroadcast,
.printMatchingStats= &printMatchingStatsBroadcast,
- .writeMatchingGraphsPlots= &writeMatchingGraphsPlotsBroadcast,
- .writeMatchingGraphsOptions= NULL,
+ .graphFunctions= {
+ .writeTraceTimeForePlots= &writeMatchingGraphsPlotsBroadcast,
+ }
};
MatchingGraphsBroadcast* graphs= ((MatchingDataBroadcast*)
syncState->matchingData)->graphs;
- cwd= changeToGraphDir(syncState->graphsDir);
+ cwd= changeToGraphsDir(syncState->graphsDir);
graphs->accuracyPoints= malloc(syncState->traceNb * sizeof(FILE**));
graphs->pointsNb= malloc(syncState->traceNb * sizeof(unsigned int*));
unsigned int eventNb= broadcast->events->length;
events= g_array_sized_new(FALSE, FALSE, sizeof(Event*), eventNb);
- g_queue_foreach(broadcast->events, &gfAddToArray, events);
+ g_queue_foreach(broadcast->events, &gfAddEventToArray, events);
for (i= 0; i < eventNb; i++)
{
if (eventI->traceNum < eventJ->traceNum)
{
fprintf(graphs->accuracyPoints[eventJ->traceNum][eventI->traceNum],
- "%20llu %20lld\n", eventI->cpuTime, (int64_t) eventJ->cpuTime -
- eventI->cpuTime);
+ "%20" PRIu64 " %20.9f\n", eventI->cpuTime,
+ wallTimeSub(&eventJ->wallTime, &eventI->wallTime));
graphs->pointsNb[eventJ->traceNum][eventI->traceNum]++;
}
}
}
-}
-
-/*
- * A GFunc for g_queue_foreach()
- *
- * Args:
- * data Event*, event to add
- * user_data GArray*, array to add to
- */
-void gfAddToArray(gpointer data, gpointer user_data)
-{
- g_array_append_val((GArray*) user_data, data);
+ g_array_free(events, TRUE);
}
{
fprintf(syncState->graphsStream,
"\t\"matching_broadcast-%03d_and_%03d.data\" "
- "title \"Broadcast delays\" with points "
+ "title \"Broadcast differential delays\" with points "
"linecolor rgb \"black\" pointtype 6 pointsize 2, \\\n", i,
j);
}