Changeset 640 for trunk/user/fft


Ignore:
Timestamp:
Oct 1, 2019, 1:19:00 PM (5 years ago)
Author:
alain
Message:

Remove all RPCs in page-fault handling.

File:
1 edited

Legend:

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

    r638 r640  
    9696#define MODE                    COSIN           // DATA array initialisation mode
    9797#define CHECK                   0               
    98 #define DEBUG_MAIN              1               // trace main() function (detailed if odd)
     98#define DEBUG_MAIN              0               // trace main() function (detailed if odd)
    9999#define DEBUG_WORK              0               // trace work() function (detailed if odd)
    100100#define DEBUG_FFT1D             0               // trace FFT1D() function (detailed if odd)
    101101#define DEBUG_ROW               0               // trace FFTRow() function (detailed if odd)
    102102#define PRINT_ARRAY             0
     103#define DISPLAY_SCHED_AND_VMM   0               // display final VMM state in all clusters
    103104
    104105// macro to swap two variables
     
    234235    unsigned int        ncores;            // max number of cores per cluster
    235236
     237
    236238    unsigned int        x;                 // current index for cluster X coordinate
    237239    unsigned int        y;                 // current index for cluster Y coordinate
     
    258260#endif
    259261   
     262    int                 pid = getpid();
     263
    260264    // get FFT application start cycle
    261265    get_cycle( &start_init_cycle );
     
    311315
    312316    printf("\n[fft] starts / %d points / %d thread(s) / PID %x / cycle %d\n",
    313     N, nthreads, getpid(), (unsigned int)start_init_cycle );
     317    N, nthreads, pid, (unsigned int)start_init_cycle );
    314318
    315319    // build instrumentation file name
     
    498502    }
    499503
    500     // close instrumentation file
    501     ret = fclose( f );
    502     if( ret )
    503     {
    504         printf("\n[fft error] cannot close file <%s>\n", path );
    505         exit(0);
    506     }
    507  
    508504#if DEBUG_MAIN
    509505get_cycle( &debug_cycle );
     
    553549    {
    554550        unsigned int data_size = (N / nclusters) * 2 * sizeof(double);
    555         unsigned int coefs_size = (rootN - 1) * 2 * sizeof(double); 
    556551
    557552        data[cid] = (double *)malloc( data_size );
     
    589584printf("\n[fft] %s : thread %d exit barrier for buffer allocation / cycle %d\n",
    590585__FUNCTION__, tid, (unsigned int)barrier_stop );
     586#endif
     587
     588#if DISPLAY_SCHED_AND_VMM
     589    unsigned int x_size;
     590    unsigned int y_size;
     591    unsigned int ncores;
     592    get_config( &x_size , &y_size , &ncores );
     593    unsigned int x   = cid / y_size;
     594    unsigned int y   = cid % y_size;
     595    unsigned int cxy = HAL_CXY_FROM_XY( x , y );
     596display_sched( cxy , lid );
     597if( lid == 0 ) display_vmm( cxy , getpid() , 0 );
    591598#endif
    592599
     
    652659printf("\n[fft] %s : thread %d exit\n",
    653660__FUNCTION__, tid );
     661#endif
     662
     663#if DISPLAY_SCHED_AND_VMM
     664printf("\n[fft] %s : thread %d exit\n", __FUNCTION__, tid );
     665if( lid == 0 ) display_vmm( cxy , getpid() , 0 );
    654666#endif
    655667
Note: See TracChangeset for help on using the changeset viewer.