Changeset 629 for trunk/user/sort/sort.c


Ignore:
Timestamp:
May 17, 2019, 9:27:04 AM (5 years ago)
Author:
alain
Message:

Remove the "giant" rwlock protecting the GPT, and
use the GPT_LOCKED attribute in each PTE to prevent
concurrent modifications of one GPT entry.
The version number has been incremented to 2.1.

File:
1 edited

Legend:

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

    r628 r629  
    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
     
    423423
    424424#if CHECK_RESULT
    425    
    426425    int    success = 1;
    427426    int *  res_array = ( (total_threads ==   2) ||
     
    444443    if ( success ) printf("\n[sort] success\n");
    445444    else           printf("\n[sort] failure\n");
    446 
    447445#endif
    448446
    449447#if INSTRUMENTATION
    450 
    451448    char               name[64];
    452449    char               path[128];
    453450    unsigned long long instru_cycle;
    454451
    455     // build a file name from n_items / n_clusters / n_cores
    456     if( USE_DQT_BARRIER ) snprintf( name , 64 , "sort_dqt_%d_%d_%d",
    457                           ARRAY_LENGTH, x_size * y_size, ncores );
    458     else                  snprintf( name , 64 , "sort_smp_%d_%d_%d",
    459                           ARRAY_LENGTH, x_size * y_size, ncores );
     452    // build file name
     453    if( USE_DQT_BARRIER )
     454    snprintf( name , 64 , "sort_dqt_%d_%d_%d", ARRAY_LENGTH, x_size * y_size, ncores );
     455    else
     456    snprintf( name , 64 , "sort_smp_%d_%d_%d", ARRAY_LENGTH, x_size * y_size, ncores );
    460457
    461458    // build file pathname
     
    471468           " - parallel   : %d cycles\n",
    472469           name, sequencial, parallel );
    473 
    474 #if IDBG
    475 idbg();
    476 #endif
    477470
    478471    // open file
Note: See TracChangeset for help on using the changeset viewer.