Changeset 629 for trunk/user/fft/fft.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/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
Note: See TracChangeset for help on using the changeset viewer.