Changeset 629 for trunk/user


Ignore:
Timestamp:
May 17, 2019, 9:27:04 AM (6 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.

Location:
trunk/user
Files:
3 edited

Legend:

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

    r628 r629  
    538538        exit(0);
    539539    }
    540     printf("\n[sort] file <%s> closed\n", path );
     540    printf("\n[fft] file <%s> closed\n", path );
    541541
    542542    exit( 0 );
     
    570570
    571571#if DEBUG_SLAVE
    572 printf("\n[fft] %s : thread %x enter / cycle %d\n",
     572printf("\n[fft] %s : thread %d enter / cycle %d\n",
    573573__FUNCTION__, MyNum, (unsigned int)parallel_start );
    574574#endif
     575
     576    // BARRIER
     577    get_cycle( &barrier_start );
     578    pthread_barrier_wait( &barrier );
     579    get_cycle( &barrier_stop );
     580    sync_time[MyNum] += (barrier_stop - barrier_start);
     581
     582// printf("\n[@@@] %s : thread %d exit first barrier / cycle %d\n",
     583// __FUNCTION__, MyNum, (unsigned int)barrier_stop );
    575584
    576585    // allocate and initialise local array upriv[]
     
    592601    FFT1D( 1 , data , trans , upriv , twid , MyNum , MyFirst , MyLast );
    593602
    594     // BARRIER
    595     get_cycle( &barrier_start );
    596     pthread_barrier_wait( &barrier );
    597     get_cycle( &barrier_stop );
    598 
    599     sync_time[MyNum] += (barrier_stop - barrier_start);
    600 
    601603#if CHECK
    602604get_cycle( &barrier_start );
    603605pthread_barrier_wait( &barrier );
    604606get_cycle( &barrier_stop );
    605 
    606607sync_time[MyNum] += (long)(barrier_stop - barrier_start);
    607 
    608608FFT1D( -1 , data , trans , upriv , twid , MyNum , MyFirst , MyLast );
    609609#endif
     
    688688{
    689689    unsigned int         i , j;
    690     double       cks;
    691690    unsigned int         c_id;
    692691    unsigned int         c_offset;
     692    double               cks;
    693693
    694694    cks = 0.0;
     
    849849unsigned long long cycle;
    850850get_cycle( &cycle );
    851 printf("\n[fft] %s : thread %x enter / first %d / last %d / cycle %d\n",
     851printf("\n[fft] %s : thread %d enter / first %d / last %d / cycle %d\n",
    852852__FUNCTION__, MyNum, MyFirst, MyLast, (unsigned int)cycle );
    853853#endif
     
    858858#if( DEBUG_FFT1D & 1 )
    859859get_cycle( &cycle );
    860 printf("\n[fft] %s : thread %x after first transpose / cycle %d\n",
     860printf("\n[fft] %s : thread %d after first transpose / cycle %d\n",
    861861__FUNCTION__, MyNum, (unsigned int)cycle );
    862862if( PRINT_ARRAY ) PrintArray( tmp , N );
     
    871871#if( DEBUG_FFT1D & 1 )
    872872get_cycle( &cycle );
    873 printf("\n[fft] %s : thread %x exit barrier after first transpose / cycle %d\n",
     873printf("\n[fft] %s : thread %d exit barrier after first transpose / cycle %d\n",
    874874__FUNCTION__, MyNum, (unsigned int)cycle );
    875875#endif
     
    884884
    885885#if( DEBUG_FFT1D & 1 )
    886 printf("\n[fft] %s : thread %x after first twiddle\n", __FUNCTION__, MyNum);
     886printf("\n[fft] %s : thread %d after first twiddle\n", __FUNCTION__, MyNum);
    887887if( PRINT_ARRAY ) PrintArray( tmp , N );
    888888#endif
     
    894894
    895895#if( DEBUG_FFT1D & 1 )
    896 printf("\n[fft] %s : thread %x exit barrier after first twiddle\n", __FUNCTION__, MyNum);
     896printf("\n[fft] %s : thread %d exit barrier after first twiddle\n", __FUNCTION__, MyNum);
    897897#endif
    898898
     
    903903
    904904#if( DEBUG_FFT1D & 1 )
    905 printf("\n[fft] %s : thread %x after second transpose\n", __FUNCTION__, MyNum);
     905printf("\n[fft] %s : thread %d after second transpose\n", __FUNCTION__, MyNum);
    906906if( PRINT_ARRAY ) PrintArray( x , N );
    907907#endif
     
    913913
    914914#if( DEBUG_FFT1D & 1 )
    915 printf("\n[fft] %s : thread %x exit barrier after second transpose\n", __FUNCTION__, MyNum);
     915printf("\n[fft] %s : thread %d exit barrier after second transpose\n", __FUNCTION__, MyNum);
    916916#endif
    917917
     
    926926
    927927#if( DEBUG_FFT1D & 1 )
    928 printf("\n[fft] %s : thread %x after FFT on rows\n", __FUNCTION__, MyNum);
     928printf("\n[fft] %s : thread %d after FFT on rows\n", __FUNCTION__, MyNum);
    929929if( PRINT_ARRAY ) PrintArray( x , N );
    930930#endif
     
    936936
    937937#if( DEBUG_FFT1D & 1 )
    938 printf("\n[fft] %s : thread %x exit barrier after FFT on rows\n", __FUNCTION__, MyNum);
     938printf("\n[fft] %s : thread %d exit barrier after FFT on rows\n", __FUNCTION__, MyNum);
    939939#endif
    940940    sync_time[MyNum] += (long)(barrier_stop - barrier_start);
     
    954954
    955955#if( DEBUG_FFT1D & 1 )
    956 printf("\n[fft] %s : thread %x exit barrier after third transpose\n", __FUNCTION__, MyNum);
     956printf("\n[fft] %s : thread %d exit barrier after third transpose\n", __FUNCTION__, MyNum);
    957957#endif
    958958
     
    964964
    965965#if DEBUG_FFT1D
    966 printf("\n[fft] %s : thread %x completed\n", __FUNCTION__, MyNum);
     966printf("\n[fft] %s : thread %d completed\n", __FUNCTION__, MyNum);
    967967if( PRINT_ARRAY ) PrintArray( x , N );
    968968#endif
  • trunk/user/ksh/ksh.c

    r628 r629  
    11871187else
    11881188{
    1189     printf("\n[ksh] load bin/user/sort.elf\n");
     1189    printf("\n[ksh] load bin/user/fft.elf\n");
    11901190}
    11911191
    1192 strcpy( cmd , "load bin/user/sort.elf" );
     1192strcpy( cmd , "load bin/user/fft.elf" );
    11931193execute( cmd );
    11941194*/
  • 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.