summaryrefslogtreecommitdiff
path: root/src/Output.cpp
diff options
context:
space:
mode:
authorTim Besard <tim.besard@gmail.com>2011-11-02 09:13:38 +0100
committerTim Besard <tim.besard@gmail.com>2011-11-02 09:13:38 +0100
commitc108197c20aa7b93849e383a3aaaf7b2bba30405 (patch)
treef05aa2ff019892dfc936ad2242d43373191f16cd /src/Output.cpp
parenteb6995fb5a0f4382cb4a01d301423e74ea8babe6 (diff)
Formatting the source.
Diffstat (limited to 'src/Output.cpp')
-rw-r--r--src/Output.cpp74
1 files changed, 32 insertions, 42 deletions
diff --git a/src/Output.cpp b/src/Output.cpp
index 9f9c09a..84eb0df 100644
--- a/src/Output.cpp
+++ b/src/Output.cpp
@@ -9,7 +9,6 @@
* Douglas M. Pase - initial API and implementation *
*******************************************************************************/
-
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -19,25 +18,20 @@
#include "Types.h"
#include "Experiment.h"
-
-void
-Output::print( Experiment &e, int64 ops, double secs, double ck_res )
-{
- if (e.output_mode == Experiment::CSV) {
- Output::csv(e, ops, secs, ck_res);
- } else if (e.output_mode == Experiment::BOTH) {
- Output::header(e, ops, secs, ck_res);
- Output::csv(e, ops, secs, ck_res);
- } else if (e.output_mode == Experiment::HEADER) {
- Output::header(e, ops, secs, ck_res);
- } else {
- Output::table(e, ops, secs, ck_res);
- }
+void Output::print(Experiment &e, int64 ops, double secs, double ck_res) {
+ if (e.output_mode == Experiment::CSV) {
+ Output::csv(e, ops, secs, ck_res);
+ } else if (e.output_mode == Experiment::BOTH) {
+ Output::header(e, ops, secs, ck_res);
+ Output::csv(e, ops, secs, ck_res);
+ } else if (e.output_mode == Experiment::HEADER) {
+ Output::header(e, ops, secs, ck_res);
+ } else {
+ Output::table(e, ops, secs, ck_res);
+ }
}
-void
-Output::header( Experiment &e, int64 ops, double secs, double ck_res )
-{
+void Output::header(Experiment &e, int64 ops, double secs, double ck_res) {
printf("pointer size (bytes),");
printf("cache line size (bytes),");
printf("page size (bytes),");
@@ -65,9 +59,7 @@ Output::header( Experiment &e, int64 ops, double secs, double ck_res )
fflush(stdout);
}
-void
-Output::csv( Experiment &e, int64 ops, double secs, double ck_res )
-{
+void Output::csv(Experiment &e, int64 ops, double secs, double ck_res) {
printf("%ld,", e.pointer_size);
printf("%ld,", e.bytes_per_line);
printf("%ld,", e.bytes_per_page);
@@ -86,16 +78,16 @@ Output::csv( Experiment &e, int64 ops, double secs, double ck_res )
printf("\"");
printf("%d:", e.thread_domain[0]);
printf("%d", e.chain_domain[0][0]);
- for (int j=1; j < e.chains_per_thread; j++) {
- printf(",%d", e.chain_domain[0][j]);
- }
- for (int i=1; i < e.num_threads; i++) {
- printf(";%d:", e.thread_domain[i]);
- printf("%d", e.chain_domain[i][0]);
- for (int j=1; j < e.chains_per_thread; j++) {
- printf(",%d", e.chain_domain[i][j]);
+ for (int j = 1; j < e.chains_per_thread; j++) {
+ printf(",%d", e.chain_domain[0][j]);
+ }
+ for (int i = 1; i < e.num_threads; i++) {
+ printf(";%d:", e.thread_domain[i]);
+ printf("%d", e.chain_domain[i][0]);
+ for (int j = 1; j < e.chains_per_thread; j++) {
+ printf(",%d", e.chain_domain[i][j]);
+ }
}
- }
printf("\",");
printf("%ld,", ops);
printf("%ld,", ops * e.chains_per_thread * e.num_threads);
@@ -108,9 +100,7 @@ Output::csv( Experiment &e, int64 ops, double secs, double ck_res )
fflush(stdout);
}
-void
-Output::table( Experiment &e, int64 ops, double secs, double ck_res )
-{
+void Output::table(Experiment &e, int64 ops, double secs, double ck_res) {
printf("pointer size = %ld (bytes)\n", e.pointer_size);
printf("cache line size = %ld (bytes)\n", e.bytes_per_line);
printf("page size = %ld (bytes)\n", e.bytes_per_page);
@@ -130,16 +120,16 @@ Output::table( Experiment &e, int64 ops, double secs, double ck_res )
printf("\"");
printf("%d:", e.thread_domain[0]);
printf("%d", e.chain_domain[0][0]);
- for (int j=1; j < e.chains_per_thread; j++) {
- printf(",%d", e.chain_domain[0][j]);
- }
- for (int i=1; i < e.num_threads; i++) {
- printf(";%d:", e.thread_domain[i]);
- printf("%d", e.chain_domain[i][0]);
- for (int j=1; j < e.chains_per_thread; j++) {
- printf(",%d", e.chain_domain[i][j]);
+ for (int j = 1; j < e.chains_per_thread; j++) {
+ printf(",%d", e.chain_domain[0][j]);
+ }
+ for (int i = 1; i < e.num_threads; i++) {
+ printf(";%d:", e.thread_domain[i]);
+ printf("%d", e.chain_domain[i][0]);
+ for (int j = 1; j < e.chains_per_thread; j++) {
+ printf(",%d", e.chain_domain[i][j]);
+ }
}
- }
printf("\"\n");
printf("operations per chain = %ld\n", ops);
printf("total operations = %ld\n", ops * e.chains_per_thread * e.num_threads);