Changeset d334782
 Timestamp:
 11/15/18 17:37:17 (2 years ago)
 Branches:
 develop
 Children:
 1f79936
 Parents:
 f611921
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

examples/tutorial/ipdistparallel.c
rf611921 rd334782 443 443 444 444 /* Finaly output the results */ 445 printf("Generating output \"%sipdist% u\"\n", stats_outputdir, tick);445 printf("Generating output \"%sipdist%lu\"\n", stats_outputdir, tick); 446 446 447 447 /* Output the results */ 448 448 char outputfile[255]; 449 snprintf(outputfile, sizeof(outputfile), "%sipdist% u.data", stats_outputdir, tick);449 snprintf(outputfile, sizeof(outputfile), "%sipdist%lu.data", stats_outputdir, tick); 450 450 FILE *tmp = fopen(outputfile, "w"); 451 451 fprintf(tmp, "#time\t\trank\toctet1\t\t\t\toctet2\t\t\t\toctet3\t\t\t\toctet4\n"); 452 452 fprintf(tmp, "#\t\t\tsrc\thits\tdst\thits\tsrc\thits\tdst\thits\tsrc\thits\tdst\thits\tsrc\thits\tdst\thits\n"); 453 453 for(i=0;i<256;i++) { 454 fprintf(tmp, "% d\t%d", tick, i+1);454 fprintf(tmp, "%lu\t%d", tick, i+1); 455 455 for(j=0;j<4;j++) { 456 456 /* Get the highest ranking to lowest ranking octets */ 457 fprintf(tmp, "\t% d", peak(&tally>stats>rank_src[j]));458 fprintf(tmp, "\t% d", peak_count(&tally>stats>rank_src[j]));459 fprintf(tmp, "\t% d", peak(&tally>stats>rank_dst[j]));460 fprintf(tmp, "\t% d", peak_count(&tally>stats>rank_dst[j]));457 fprintf(tmp, "\t%u", peak(&tally>stats>rank_src[j])); 458 fprintf(tmp, "\t%lu", peak_count(&tally>stats>rank_src[j])); 459 fprintf(tmp, "\t%u", peak(&tally>stats>rank_dst[j])); 460 fprintf(tmp, "\t%lu", peak_count(&tally>stats>rank_dst[j])); 461 461 pop(&tally>stats>rank_src[j]); 462 462 pop(&tally>stats>rank_dst[j]); … … 467 467 468 468 char outputfile_stats[255]; 469 snprintf(outputfile_stats, sizeof(outputfile_stats), "%sipdist% u.stats", stats_outputdir, tick);469 snprintf(outputfile_stats, sizeof(outputfile_stats), "%sipdist%lu.stats", stats_outputdir, tick); 470 470 tmp = fopen(outputfile_stats, "w"); 471 471 /* append stats data to end of file */ … … 498 498 tmp = fopen(outputfile2, "a"); 499 499 } 500 fprintf(tmp, "% d\t", tick);500 fprintf(tmp, "%lu\t", tick); 501 501 for(i=0;i<256;i++) { 502 502 if(k) { 503 fprintf(tmp, "% d\t", tally>dst[j][i]);503 fprintf(tmp, "%lu\t", tally>dst[j][i]); 504 504 } else { 505 fprintf(tmp, "% d\t", tally>src[j][i]);505 fprintf(tmp, "%lu\t", tally>src[j][i]); 506 506 } 507 507 } … … 514 514 for(i=0;i<4;i++) { 515 515 char outputplot[255]; 516 snprintf(outputplot, sizeof(outputplot), "%sipdist% uoctet%d.png", stats_outputdir, tick, i+1);516 snprintf(outputplot, sizeof(outputplot), "%sipdist%luoctet%d.png", stats_outputdir, tick, i+1); 517 517 /* Open pipe to gnuplot */ 518 518 FILE *gnuplot = popen("gnuplot persistent", "w");
Note: See TracChangeset
for help on using the changeset viewer.