#include "spfft.h" /* #define expertcall*/ void output(arr,pos,ctrl) struct FFTCTL *ctrl; PLCPLX* arr; int pos; { int tadr,madr,padr; plural unsigned itmp1, itmpM1; plural FLTYP tmp0,tmp1; tadr = pos; mp_adr(tadr, madr, padr, ctrl->mb); tmp0 = arr[madr][0]; tmp1 = arr[madr][1]; printf("total address: %6d arr. contains: %8.2f %8.2f\n", tadr,proc[padr].tmp0 ,proc[padr].tmp1); } /* initialize data for whole array */ void init(arr, ctrl) PLCPLX *arr; struct FFTCTL *ctrl; { int *mb; plural int procadr, tadr; int i0,i1,i2, madr; mb = ctrl->mb; madr = 0; procadr = iyproc<<(mb[1]+mb[0]+lnxproc) | (ixproc< ordered -> ordered */ /* do forwards fft */ sp_fft(arr,1,ctrl); printf("here are some output, after sorted fft\n"); output(arr,0,ctrl); output(arr,1,ctrl); output(arr,457,ctrl); output(arr,16383,ctrl); output(arr,32000,ctrl); output(arr,asiz*nproc-1,ctrl); /* do inverse fft */ sp_fft(arr,-1,ctrl); printf("here are some output (after inv.fft+scale) \n"); output(arr,0,ctrl); output(arr,1,ctrl); output(arr,457,ctrl); output(arr,16383,ctrl); output(arr,32000,ctrl); output(arr,asiz*nproc-1,ctrl); { printf("Timing:\n"); printf( "Flop rate are based on the cost of a similar complex transform\n"); { int nops,lg2n,numiter,numit,i,ib; unsigned ibmsk; struct timeval beg,end; double stime, etime, eltime; float mflop; /* count no. of active bits */ for (igr=0,ibmsk=1,lg2n=0;igr<32;igr++,ibmsk<<=1) if ((ctrl->actbits) & ibmsk) lg2n++; nops = 5*asiz*nproc*lg2n; numiter = 2*(300000000)/nops + 1; /* initialize data */ for (madr=0;madr