Revision 80f4c362 ed.c

View differences:

ed.c
9 9
#include "ed.h"
10 10

  
11 11
FILE *resfile;
12
FILE *delayfile;
12 13
FILE *statusfile;
13 14

  
14 15
struct ed_simulator {
......
128 129
		p->chunks[idx]->completed = event_scheduler_elapsed_time(eds->sched);
129 130
//		fprintf(stderr,"[DEBUG] peer %d receives chunk %d ", p->id, chunk);
130 131
		ed_simulator_update_chunk_delay(eds, chunk);
132
		if (delayfile) {
133
		    fprintf(delayfile, "%f,%d,%d,%f\n", ed_simulator_time(eds), p->id, p->chunks[idx]->chunk, ed_simulator_time(eds) - p->chunks[idx]->chunk);
134
		    fflush(delayfile);
135
		}
131 136
		if (eds->chunks[chunk].received == eds->num_peers && resfile) 
132 137
		{
133 138
		    fprintf(resfile, "Chunk %d received at %f in %f\n", p->chunks[idx]->chunk, ed_simulator_time(eds), ed_simulator_time(eds) - p->chunks[idx]->chunk);

Also available in: Unified diff