Changeset 627 for trunk/user/sort
- Timestamp:
- May 1, 2019, 5:13:47 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/user/sort/sort.c
r626 r627 29 29 #include <hal_macros.h> 30 30 31 #define ARRAY_LENGTH 1024// number of items31 #define ARRAY_LENGTH 4096 // number of items 32 32 #define MAX_THREADS 1024 // 16 * 16 * 4 33 33 34 34 #define USE_DQT_BARRIER 1 // use DQT barrier if non zero 35 35 #define DISPLAY_ARRAY 0 // display items values before and after 36 #define VERBOSE 0 // for debug 37 #define INTERACTIVE_MODE 0 // for debug 36 #define DEBUG_MAIN 1 // trace main function 37 #define DEBUG_SORT 0 // trace sort function 38 #define INTERACTIVE_MODE 0 // activate idbg() during instrumentation 38 39 #define CHECK_RESULT 0 // for debug 39 40 #define INSTRUMENTATION 1 // register computation times on file … … 163 164 pthread_barrier_wait( &barrier ); 164 165 165 #if VERBOSE 166 #if DEBUG_SORT 167 if( thread_uid == 0 ) 166 168 printf("\n[sort] thread[%d] exit barrier 0\n", thread_uid ); 167 169 #endif … … 170 172 unsigned int stages = __builtin_ctz( threads ) + 1; 171 173 172 #if VERBOSE 174 #if DEBUG_SORT 175 if( thread_uid == 0 ) 173 176 printf("\n[sort] thread[%d] : start\n", thread_uid ); 174 177 #endif … … 176 179 bubbleSort( array0, items, items * thread_uid ); 177 180 178 #if VERBOSE 181 #if DEBUG_SORT 182 if( thread_uid == 0 ) 179 183 printf("\n[sort] thread[%d] : stage 0 completed\n", thread_uid ); 180 184 #endif … … 183 187 pthread_barrier_wait( &barrier ); 184 188 185 #if VERBOSE 189 #if DEBUG_SORT 190 if( thread_uid == 0 ) 186 191 printf("\n[sort] thread[%d] exit barrier 0\n", thread_uid ); 187 192 #endif … … 213 218 { 214 219 215 #if VERBOSE 220 #if DEBUG_SORT 221 if( thread_uid == 0 ) 216 222 printf("\n[sort] thread[%d] : stage %d start\n", thread_uid , i ); 217 223 #endif … … 223 229 items * thread_uid ); 224 230 225 #if VERBOSE 231 #if DEBUG_SORT 232 if( thread_uid == 0 ) 226 233 printf("\n[sort] thread[%d] : stage %d completed\n", thread_uid , i ); 227 234 #endif … … 231 238 pthread_barrier_wait( &barrier ); 232 239 233 #if VERBOSE 240 #if DEBUG_SORT 241 if( thread_uid == 0 ) 234 242 printf("\n[sort] thread[%d] exit barrier %d\n", thread_uid , i ); 235 243 #endif … … 328 336 } 329 337 330 #if VERBOSE338 #if DEBUG_MAIN 331 339 printf("\n[sort] main completes barrier init\n"); 332 340 #endif … … 338 346 } 339 347 340 #if VERBOSE348 #if DEBUG_MAIN 341 349 printf("\n[sort] main completes array init\n"); 342 350 #endif … … 376 384 else 377 385 { 378 #if VERBOSE386 #if DEBUG_MAIN 379 387 printf("\n[sort] main created thread %x \n", thread_uid ); 380 388 #endif … … 388 396 get_cycle( &seq_end_cycle ); 389 397 390 #if VERBOSE398 #if DEBUG_MAIN 391 399 printf("\n[sort] main completes sequencial init at cycle %d\n", 392 400 (unsigned int)seq_end_cycle );
Note: See TracChangeset
for help on using the changeset viewer.