1
+ /*
2
+ * SPDX-License-Identifier: BSD-3-Clause
3
+ */
4
+
1
5
#include <binsparse/binsparse.h>
2
6
#include <stdlib.h>
3
7
#include <time.h>
@@ -61,8 +65,9 @@ int main(int argc, char** argv) {
61
65
char * file_name = argv [1 ];
62
66
63
67
printf ("Opening %s\n" , file_name );
68
+ fflush (stdout );
64
69
65
- const int num_trials = 2 ;
70
+ const int num_trials = 10 ;
66
71
67
72
int num_threads = 6 ;
68
73
@@ -71,11 +76,10 @@ int main(int argc, char** argv) {
71
76
size_t nbytes = 0 ;
72
77
73
78
// To flush the filesystem cache before each trial, change to `true`.
74
- bool cold_cache = true ;
79
+ bool cold_cache = false ;
75
80
76
81
// If running warm cache experiments, read once to warm cache.
77
- if (!cold_cache && false) {
78
- printf ("Warm cache read...\n" );
82
+ if (!cold_cache ) {
79
83
bsp_matrix_t mat = bsp_read_matrix_parallel (file_name , NULL , num_threads );
80
84
bsp_destroy_matrix_t (mat );
81
85
}
@@ -84,6 +88,7 @@ int main(int argc, char** argv) {
84
88
if (cold_cache ) {
85
89
flush_cache ();
86
90
}
91
+ fflush (stdout );
87
92
double begin = gettime ();
88
93
bsp_matrix_t mat = bsp_read_matrix_parallel (file_name , NULL , num_threads );
89
94
double end = gettime ();
@@ -95,6 +100,7 @@ int main(int argc, char** argv) {
95
100
double gbytes = ((double ) nbytes ) / 1024 / 1024 / 1024 ;
96
101
double gbytes_s = gbytes / durations [i ];
97
102
printf ("FORPARSER: %s,%lf,%lf\n" , file_name , durations [i ], gbytes_s );
103
+ fflush (stdout );
98
104
}
99
105
100
106
printf ("[" );
0 commit comments