6
6
#include "numa.h"
7
7
#include <pthread.h>
8
8
9
- #ifdef PROFILE_RUSAGE
9
+ #if PROFILE_RUSAGE
10
10
#include <sys/time.h>
11
11
#include <sys/resource.h>
12
- #endif // defined( PROFILE_RUSAGE)
12
+ #endif // PROFILE_RUSAGE
13
13
14
- #ifdef MATRIX_PROFILE
14
+ #if MATRIX_PROFILE
15
15
#include <assert.h>
16
16
17
17
void * tm_data__ ;
@@ -25,7 +25,7 @@ void init_transfer_matrix(void) {
25
25
void dump_transfer_matrix (unsigned int num_workers )
26
26
{
27
27
unsigned int i , j ;
28
- FILE * matrix_fp = fopen (MATRIX_PROFILE , "w+" );
28
+ FILE * matrix_fp = fopen (MATRIX_PROFILE_OUTPUT , "w+" );
29
29
assert (matrix_fp );
30
30
31
31
for (i = 0 ; i < num_workers ; ++ i ) {
@@ -247,7 +247,7 @@ wqueue_counters_enter_runtime(struct wstream_df_thread* th)
247
247
{
248
248
}
249
249
250
- #ifdef PROFILE_RUSAGE
250
+ #if PROFILE_RUSAGE
251
251
252
252
void wqueue_counters_profile_rusage (struct wstream_df_thread * th ) {
253
253
struct rusage usage ;
@@ -263,15 +263,15 @@ void wqueue_counters_profile_rusage(struct wstream_df_thread *th) {
263
263
th -> inv_context_switches = usage .ru_nivcsw ;
264
264
}
265
265
266
- #endif // defined( PROFILE_RUSAGE)
266
+ #endif // PROFILE_RUSAGE
267
267
268
268
void init_wqueue_counters (wstream_df_thread_p th ) {
269
269
th -> steals_owncached = 0 ;
270
270
th -> steals_ownqueue = 0 ;
271
271
th -> steals_mem = calloc (topology_depth , sizeof (* th -> steals_mem ));
272
272
if (bind_memory_to_cpu_memspace (
273
273
th -> steals_mem , topology_depth * sizeof (* th -> steals_mem ), th -> cpu )) {
274
- #ifdef HWLOC_VERBOSE
274
+ #if HWLOC_VERBOSE
275
275
perror ("hwloc_membind" );
276
276
#endif // HWLOC_VERBOSE
277
277
}
@@ -284,7 +284,7 @@ void init_wqueue_counters(wstream_df_thread_p th) {
284
284
th -> bytes_mem = calloc (topology_depth , sizeof (* th -> bytes_mem ));
285
285
if (bind_memory_to_cpu_memspace (
286
286
th -> bytes_mem , topology_depth * sizeof (* th -> bytes_mem ), th -> cpu )) {
287
- #ifdef HWLOC_VERBOSE
287
+ #if HWLOC_VERBOSE
288
288
perror ("hwloc_membind" );
289
289
#endif // HWLOC_VERBOSE
290
290
}
@@ -297,13 +297,13 @@ void init_wqueue_counters(wstream_df_thread_p th) {
297
297
298
298
th -> reuse_addr = 0 ;
299
299
th -> reuse_copy = 0 ;
300
- #ifdef PROFILE_RUSAGE
300
+ #if PROFILE_RUSAGE
301
301
th -> system_time_us = 0 ;
302
302
th -> major_page_faults = 0 ;
303
303
th -> minor_page_faults = 0 ;
304
304
th -> max_resident_size = 0 ;
305
305
th -> inv_context_switches = 0 ;
306
- #endif // defined( PROFILE_RUSAGE)
306
+ #endif // PROFILE_RUSAGE
307
307
308
308
init_papi (th );
309
309
}
@@ -316,7 +316,7 @@ dump_wqueue_counters_single (wstream_df_thread_p th)
316
316
int i ;
317
317
const char * events [] = WS_PAPI_EVENTS ;
318
318
#endif // defined(WS_PAPI_PROFILE)
319
- #ifdef PROFILE_RUSAGE
319
+ #if PROFILE_RUSAGE
320
320
printf ("Thread %d: system_time_us = %lld\n" ,
321
321
th -> worker_id ,
322
322
th -> system_time_us );
@@ -332,7 +332,7 @@ dump_wqueue_counters_single (wstream_df_thread_p th)
332
332
printf ("Thread %d: inv_context_switches = %lld\n" ,
333
333
th -> worker_id ,
334
334
th -> inv_context_switches );
335
- #endif // defined( PROFILE_RUSAGE)
335
+ #endif // PROFILE_RUSAGE
336
336
printf ("Thread %d: tasks_created = %lld\n" ,
337
337
th -> worker_id ,
338
338
th -> tasks_created );
0 commit comments