Revision 80f4c362 sssim.c

View differences:

sssim.c
26 26

  
27 27
static struct peer *peers;
28 28
extern FILE *resfile;
29
extern FILE *delayfile;
29 30
extern FILE *statusfile;
30 31
static FILE *statsfile;
31 32
static FILE *graphfile;
......
52 53
  printf("\t-n <number of peers>:\t\tSet the number of peers\n");
53 54
  printf("\t-t <trace file>\n");
54 55
  printf("\t-r <results file>:\t\t(dynamically generated during simulation)\n");
56
  printf("\t-d <delay file>:\t\t(dynamically generated during simulation)\n");
55 57
  printf("\t-p <status file>\n");
56 58
  printf("\t-P:\t\t\t\tPrint the neighbourhoods\n");
57 59
  printf("\t-S <stats file>\n");
......
67 69
{
68 70
  int o;
69 71
  
70
  while ((o = getopt(argc, argv, "c:eo:n:t:r:s:p:S:b:T:g:G:hP")) != -1) {
72
  while ((o = getopt(argc, argv, "d:c:eo:n:t:r:s:p:S:b:T:g:G:hP")) != -1) {
71 73
    switch(o) {
72 74
      case 'e':
73 75
        event_driven = 1;
......
94 96
      case 'r':
95 97
        resfile = fopen(optarg, "w");
96 98
        break;
99
      case 'd':
100
        delayfile = fopen(optarg, "w");
101
        break;
97 102
      case 'p':
98 103
        statusfile = fopen(optarg, "w");
99 104
        break;
......
174 179
    if (graphfile) {
175 180
      graph_dotprint(graphfile, &source, peers, n);
176 181
    }
182
    if (delayfile) {
183
	fprintf(delayfile, "Time,Receiver,Chunk,Delay\n");
184
	fflush(delayfile);
185
    }
177 186
    printf("Buf Size: %d\n", buf_size);
178 187
    if(event_driven)
179 188
			ch = ed_loop(peers, num_peers, num_chunks, ts);
......
195 204
      per_node_delay_analysis(statsfile,  ch, num_chunks);
196 205
    }
197 206

  
207
    if (delayfile)
208
	    fclose(delayfile);
209

  
198 210
  return 0;
199 211
}

Also available in: Unified diff