Changeset 627 for trunk/user/sort


Ignore:
Timestamp:
May 1, 2019, 5:13:47 PM (6 years ago)
Author:
alain
Message:

Replace the queuelock protectingthe FAT by a rwlock in the FATFS.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/user/sort/sort.c

    r626 r627  
    2929#include <hal_macros.h>
    3030
    31 #define ARRAY_LENGTH        1024       // number of items
     31#define ARRAY_LENGTH        4096       // number of items
    3232#define MAX_THREADS         1024       // 16 * 16 * 4
    3333
    3434#define USE_DQT_BARRIER     1          // use DQT barrier if non zero
    3535#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
    3839#define CHECK_RESULT        0          // for debug
    3940#define INSTRUMENTATION     1          // register computation times on file
     
    163164    pthread_barrier_wait( &barrier );
    164165
    165 #if VERBOSE
     166#if DEBUG_SORT
     167if( thread_uid == 0 )
    166168printf("\n[sort] thread[%d] exit barrier 0\n", thread_uid );
    167169#endif
     
    170172    unsigned int  stages     = __builtin_ctz( threads ) + 1;
    171173
    172 #if VERBOSE
     174#if DEBUG_SORT
     175if( thread_uid == 0 )
    173176printf("\n[sort] thread[%d] : start\n", thread_uid );
    174177#endif
     
    176179    bubbleSort( array0, items, items * thread_uid );
    177180
    178 #if VERBOSE
     181#if DEBUG_SORT
     182if( thread_uid == 0 )
    179183printf("\n[sort] thread[%d] : stage 0 completed\n", thread_uid );
    180184#endif
     
    183187    pthread_barrier_wait( &barrier );
    184188
    185 #if VERBOSE
     189#if DEBUG_SORT
     190if( thread_uid == 0 )
    186191printf("\n[sort] thread[%d] exit barrier 0\n", thread_uid );
    187192#endif
     
    213218        {
    214219
    215 #if VERBOSE
     220#if DEBUG_SORT
     221if( thread_uid == 0 )
    216222printf("\n[sort] thread[%d] : stage %d start\n", thread_uid , i );
    217223#endif
     
    223229                   items * thread_uid );
    224230
    225 #if VERBOSE
     231#if DEBUG_SORT
     232if( thread_uid == 0 )
    226233printf("\n[sort] thread[%d] : stage %d completed\n", thread_uid , i );
    227234#endif
     
    231238        pthread_barrier_wait( &barrier );
    232239
    233 #if VERBOSE
     240#if DEBUG_SORT
     241if( thread_uid == 0 )
    234242printf("\n[sort] thread[%d] exit barrier %d\n", thread_uid , i );
    235243#endif
     
    328336    }
    329337
    330 #if VERBOSE
     338#if DEBUG_MAIN
    331339printf("\n[sort] main completes barrier init\n");
    332340#endif
     
    338346    }
    339347
    340 #if VERBOSE
     348#if DEBUG_MAIN
    341349printf("\n[sort] main completes array init\n");
    342350#endif
     
    376384                    else
    377385                    {
    378 #if VERBOSE
     386#if DEBUG_MAIN
    379387printf("\n[sort] main created thread %x \n", thread_uid );
    380388#endif
     
    388396    get_cycle( &seq_end_cycle );
    389397
    390 #if VERBOSE
     398#if DEBUG_MAIN
    391399printf("\n[sort] main completes sequencial init at cycle %d\n",
    392400(unsigned int)seq_end_cycle );
Note: See TracChangeset for help on using the changeset viewer.