; ; AC 03/03/2007 ; Quick time_tests for FFTw (or not !) ; pro TEST_FFTW, power_max=power_max, double=double, $ display=display, help=help, save=save, test=test ; if KEYWORD_SET(help) then begin print, 'pro TEST_FFTW, power_max=power_max, double=double, $' print, ' display=display, help=help, save=save, test=test' return endif ; ; if (N_ELEMENTS(power_max) NE 1) then power_max=16 ; if power_max GT 31 then begin MESSAGE, "[Power_max=] was to large. Set back to 31", /continue power_max=31 endif ; ; store times ... st=DBLARR(power_max-1) x=DBLARR(power_max-1) ; print, 'Using POWER_MAX=', power_max print, ' nbp, time' ; for ii=2, power_max do begin nbp=2L^ii a=randomu(seed,nbp) t0=SYSTIME(1) b=FFT(a, double=double) t1=SYSTIME(1)-t0 x[ii-2]=nbp st[ii-2]=t1 print, nbp, t1 endfor ; if KEYWORD_SET(display) then begin plot, x, st, /xlog,/ylog, min=1e-6, psym=2 endif ; if KEYWORD_SET(save) then begin ;; nom de la machine SPAWN, 'hostname', resu_hostname ;; SPAWN, 'more /proc/cpuinfo | grep MHz', resu_Mhz resu_mhz=STRMID(resu_Mhz[0], STRPOS(resu_Mhz[0],':')+2) resu_mhz=FLOAT(resu_mhz) ;; SPAWN, 'more /proc/cpuinfo | grep bogo', resu_bogo resu_bogo=STRMID(resu_bogo[0], STRPOS(resu_bogo[0],':')+2) resu_bogo=FLOAT(resu_bogo) ;; defsysv, '!gdl', exist=exist if (exist EQ 1) then prefix='fftw_GDL_' else prefix='fftw_IDL_' ;; SAVE, file=prefix+resu_hostname+'.xdr', $ resu_mhz, resu_bogo, x, st endif ; if KEYWORD_SET(test) then STOP end ; pro plot_fftw_resu, norm=norm ; liste=FINDFILE('fftw_*.xdr') if N_ELEMENTS(liste) LE 0 then begin print, 'No FFTW test data found.' return endif ; for ii=0, N_ELEMENTS(liste)-1 do begin print, 'Restoring '+liste[ii] restore, liste[ii] if Keyword_SET(norm) then st=st*1e3/resu_mhz if STRCMP('fftw_GDL', liste[ii],8) then begin ;; GDL print, 'GDL' mypsym=-2 myline=2 endif else begin ;; IDL print, 'IDL' mypsym=-3 myline=3 endelse ;; if ii EQ 0 then begin plot, x, st, /xlog,/ylog, min=1e-6, psym=mypsym, line=myline endif else begin oplot, x, st, psym=mypsym, line=myline endelse endfor end