Changeset 630 for trunk/user/fft
- Timestamp:
- May 21, 2019, 6:00:06 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/user/fft/fft.c
r629 r630 91 91 #define MODE COSIN // DATA array initialisation mode 92 92 #define CHECK 0 93 #define DEBUG_MAIN 1// trace main() function (detailed if odd)93 #define DEBUG_MAIN 0 // trace main() function (detailed if odd) 94 94 #define DEBUG_SLAVE 0 // trace slave() function (detailed if odd) 95 95 #define DEBUG_FFT1D 0 // trace FFT1D() function (detailed if odd) … … 404 404 } 405 405 406 407 // register sequencial initalisation completion cycle 406 printf("\n[fft] main completes threads creation\n"); 407 408 408 get_cycle( &end_init_cycle ); 409 410 // register sequencial time 409 411 init_time = (unsigned int)(end_init_cycle - start_init_cycle); 410 411 printf("\n[fft] main completes threads creation\n");412 412 413 413 // main itself executes the slave() function … … 510 510 unsigned int max_sync = sync_time[0]; 511 511 512 for (tid = 1; tid < nthreads ; tid++)512 for (tid = 0 ; tid < nthreads ; tid++) 513 513 { 514 514 if (parallel_time[tid] > max_para) max_para = parallel_time[tid]; … … 566 566 MainNum = args->main_tid; 567 567 568 // initialise instrumentation569 568 get_cycle( ¶llel_start ); 570 569 … … 578 577 pthread_barrier_wait( &barrier ); 579 578 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 ); 579 sync_time[MyNum] += (unsigned int)(barrier_stop - barrier_start); 580 581 #if DEBUG_SLAVE 582 printf("\n[@@@] %s : thread %d exit first barrier / cycle %d\n", 583 __FUNCTION__, MyNum, (unsigned int)barrier_stop ); 584 #endif 584 585 585 586 // allocate and initialise local array upriv[] … … 605 606 pthread_barrier_wait( &barrier ); 606 607 get_cycle( &barrier_stop ); 607 sync_time[MyNum] += ( long)(barrier_stop - barrier_start);608 sync_time[MyNum] += (unsigned int)(barrier_stop - barrier_start); 608 609 FFT1D( -1 , data , trans , upriv , twid , MyNum , MyFirst , MyLast ); 609 610 #endif 610 611 611 // register computation time612 612 get_cycle( ¶llel_stop ); 613 parallel_time[MyNum] = (parallel_stop - parallel_start); 613 614 // register parallel time 615 parallel_time[MyNum] = (unsigned int)(parallel_stop - parallel_start); 614 616 615 617 #if DEBUG_SLAVE 616 printf("\n[fft] %s : thread %x exit / cycle %d\n", __FUNCTION__, MyNum, parallel_stop ); 618 printf("\n[fft] %s : thread %x completes fft / p_start %d / p_stop %d\n", 619 __FUNCTION__, MyNum, (unsigned int)parallel_start, (unsigned int)parallel_stop ); 620 int tid; 621 for (tid = 0 ; tid < nthreads ; tid++) 622 { 623 printf("- tid %d : Sequencial %d / Parallel %d / Barrier %d\n", 624 tid , init_time, parallel_time[tid], sync_time[tid] ); 625 } 617 626 #endif 618 627 … … 867 876 pthread_barrier_wait( &barrier ); 868 877 get_cycle( &barrier_stop ); 869 sync_time[MyNum] = ( long)(barrier_stop - barrier_start);878 sync_time[MyNum] = (unsigned int)(barrier_stop - barrier_start); 870 879 871 880 #if( DEBUG_FFT1D & 1 ) … … 897 906 #endif 898 907 899 sync_time[MyNum] += ( long)(barrier_stop - barrier_start);908 sync_time[MyNum] += (unsigned int)(barrier_stop - barrier_start); 900 909 901 910 // transpose tmp to x … … 916 925 #endif 917 926 918 sync_time[MyNum] += ( long)(barrier_stop - barrier_start);927 sync_time[MyNum] += (unsigned int)(barrier_stop - barrier_start); 919 928 920 929 // do FFTs on rows of x and apply the scaling factor … … 938 947 printf("\n[fft] %s : thread %d exit barrier after FFT on rows\n", __FUNCTION__, MyNum); 939 948 #endif 940 sync_time[MyNum] += ( long)(barrier_stop - barrier_start);949 sync_time[MyNum] += (unsigned int)(barrier_stop - barrier_start); 941 950 942 951 // transpose x to tmp … … 957 966 #endif 958 967 959 sync_time[MyNum] += ( long)(barrier_stop - barrier_start);968 sync_time[MyNum] += (unsigned int)(barrier_stop - barrier_start); 960 969 sync_time[MyNum] += (long)(barrier_stop - barrier_start); 961 970
Note: See TracChangeset
for help on using the changeset viewer.