File tree Expand file tree Collapse file tree 5 files changed +28
-10
lines changed Expand file tree Collapse file tree 5 files changed +28
-10
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,10 @@ typedef struct ModelInfo
4343
4444 float **vel2d, **rho2d; // 2D array to store velocity and density model
4545 float vmax, vmin;
46-
46+ ModelInfo () {
47+ memset (velfile, 0 , 224 );
48+ memset (densfile, 0 , 224 );
49+ }
4750}mod_t ;
4851
4952typedef struct Wavelet
Original file line number Diff line number Diff line change 2121
2222// #define DEBUG_TIME
2323#define CPP_MODULE " MAIN"
24+ #define ITERATIONS 10
2425
2526#define TIMER_START () time_start = std::chrono::steady_clock::now();
2627#define TIMER_END () \
@@ -170,7 +171,11 @@ START_TIMER();
170171#ifdef DEBUG_TIME
171172STOP_TIMER ();
172173PRINT_TIMER (" init " );
174+ #endif
173175
176+ std::vector<KeyValue> kvs;
177+ for (int iter = 0 ; iter < ITERATIONS; iter++){
178+ #ifdef DEBUG_TIME
174179START_TIMER ();
175180#endif
176181 // Allocates device memory for the hashtable and
@@ -231,7 +236,7 @@ PRINT_TIMER("delete_hashtable ");
231236START_TIMER ();
232237#endif
233238 // Get all the key-values from the hash table
234- std::vector<KeyValue> kvs = iterate_hashtable (pHashTable);
239+ kvs = iterate_hashtable (pHashTable);
235240#ifdef DEBUG_TIME
236241STOP_TIMER ();
237242PRINT_TIMER (" iterate_hashtable " );
@@ -244,9 +249,10 @@ PRINT_TIMER("iterate_hashtable ");
244249
245250 destroy_hashtable (pHashTable);
246251
252+ }
247253 TIMER_END ()
248254 TIMER_PRINT (" hashtable - total time for whole calculation" )
249- printf (" %f million keys/second\n " , kNumKeyValues / (time_total / 1000 .0f ) / 1000000 .0f );
255+ printf (" %f million keys/second\n " , kNumKeyValues / (time_total / ITERATIONS / 1000 .0f ) / 1000000 .0f );
250256
251257 bool verify = true ;
252258 if (argc > 1 && strcmp (argv[1 ], " --no-verify" ) == 0 ) {
Original file line number Diff line number Diff line change 2121
2222// #define DEBUG_TIME
2323#define CPP_MODULE " MAIN"
24+ #define ITERATIONS 10
2425
2526#define TIMER_START () time_start = std::chrono::steady_clock::now();
2627#define TIMER_END () \
@@ -170,7 +171,11 @@ START_TIMER();
170171#ifdef DEBUG_TIME
171172STOP_TIMER ();
172173PRINT_TIMER (" init " );
174+ #endif
173175
176+ std::vector<KeyValue> kvs;
177+ for (int iter = 0 ; iter < ITERATIONS; iter++){
178+ #ifdef DEBUG_TIME
174179START_TIMER ();
175180#endif
176181 // Allocates device memory for the hashtable and
@@ -231,7 +236,7 @@ PRINT_TIMER("delete_hashtable ");
231236START_TIMER ();
232237#endif
233238 // Get all the key-values from the hash table
234- std::vector<KeyValue> kvs = iterate_hashtable (pHashTable);
239+ kvs = iterate_hashtable (pHashTable);
235240#ifdef DEBUG_TIME
236241STOP_TIMER ();
237242PRINT_TIMER (" iterate_hashtable " );
@@ -243,10 +248,10 @@ PRINT_TIMER("iterate_hashtable ");
243248 // seconds = milliseconds / 1000.0f;
244249
245250 destroy_hashtable (pHashTable);
246-
251+ }
247252 TIMER_END ()
248253 TIMER_PRINT (" hashtable - total time for whole calculation" )
249- printf (" %f million keys/second\n " , kNumKeyValues / (time_total / 1000 .0f ) / 1000000 .0f );
254+ printf (" %f million keys/second\n " , kNumKeyValues / (time_total / ITERATIONS / 1000 .0f ) / 1000000 .0f );
250255
251256 bool verify = true ;
252257 if (argc > 1 && strcmp (argv[1 ], " --no-verify" ) == 0 ) {
Original file line number Diff line number Diff line change 2121
2222// #define DEBUG_TIME
2323#define CPP_MODULE " MAIN"
24+ #define ITERATIONS 10
2425
2526#define TIMER_START () time_start = std::chrono::steady_clock::now();
2627#define TIMER_END () \
@@ -169,7 +170,11 @@ START_TIMER();
169170#ifdef DEBUG_TIME
170171STOP_TIMER ();
171172PRINT_TIMER (" init " );
173+ #endif
172174
175+ std::vector<KeyValue> kvs;
176+ for (int iter = 0 ; iter < ITERATIONS; iter++) {
177+ #ifdef DEBUG_TIME
173178START_TIMER ();
174179#endif
175180 // Allocates device memory for the hashtable and
@@ -233,7 +238,7 @@ PRINT_TIMER("delete_hashtable ");
233238START_TIMER ();
234239#endif
235240 // Get all the key-values from the hash table
236- std::vector<KeyValue> kvs = iterate_hashtable (pHashTable, qht);
241+ kvs = iterate_hashtable (pHashTable, qht);
237242#ifdef DEBUG_TIME
238243STOP_TIMER ();
239244PRINT_TIMER (" iterate_hashtable " );
@@ -246,9 +251,10 @@ PRINT_TIMER("iterate_hashtable ");
246251
247252 destroy_hashtable (pHashTable, qht);
248253
254+ }
249255 TIMER_END ()
250256 TIMER_PRINT (" hashtable - total time for whole calculation" )
251- printf (" %f million keys/second\n " , kNumKeyValues / (time_total / 1000 .0f ) / 1000000 .0f );
257+ printf (" %f million keys/second\n " , kNumKeyValues / (time_total / ITERATIONS / 1000 .0f ) / 1000000 .0f );
252258
253259 bool verify = true ;
254260 if (argc > 1 && strcmp (argv[1 ], " --no-verify" ) == 0 ) {
Original file line number Diff line number Diff line change @@ -149,8 +149,6 @@ include_directories(
149149 ${CMAKE_SOURCE_DIR} /src/
150150 ${CMAKE_SOURCE_DIR} /src/include
151151 ${CMAKE_SOURCE_DIR} /../data
152- /nfs/pdx/home/mgrabban/oneDPL/include
153- /nfs/pdx/home/mgrabban/oneTBB/include
154152)
155153
156154add_executable (tsne ${SOURCES} )
You can’t perform that action at this time.
0 commit comments