; ;-------------------------------------------------------------------- pro addtext,text,xstart,ystart spacedown = .04 ntext = n_elements(text) ;print,'addtext: ntext=',ntext if (ntext eq 0) then return for i=1,ntext do begin xyouts,xstart,ystart-(i-1)*spacedown,text(i-1),/normal,$ charsize=1.5 endfor end ;-------------------------------------------------------------------- pro legend,nitems,descrip,linestyle,psym,color,xul,yul,ips ; print,'legend: nitems=',nitems,' xul=',xul,' yul=',yul,' ips=',ips print,' linestyle=',linestyle print,' psym =',psym print,' color =',color ; if (nitems gt 0) then begin x = xul y = yul chsize = 1.3 xoff = .35 if (ips gt 0) then begin chsize = 1.0 xoff = .5 endif for i=0,nitems-1 do begin addtext,descrip[i],x,y xbeg = x+xoff & xend = xbeg+0.1 plots,[xbeg,xend],y,linestyle=linestyle[i],psym=psym[i],color=color[i],/norm y = y-.05 endfor endif end ;-------------------------------------------------------------------- pro perf,ps=ps,gif=gif,tiff=tiff ; ; Set device (ps or x) ; if (keyword_set(ps)) then begin set_plot,'ps' device,file='perf.ps',/bold ips = 1 ; pson,filename='perf.ps' endif else begin set_plot,'x' ips = 0 endelse ; ; Plot nprocs on x-axis, wall-clock time on y-axis: ; spval = 9999. legend_lite = [ $ "Solid: blackforest with dynamo",$ "Dashed: bluesky with dynamo",$ "Other: blackforest without dynamo"] ; "Solid: bluesky with dynamo"] ; "Dashed: bluesky without dynamo"] ; ; "Dashed: blackforest",$ ; "Solid: bluesky"] ; "Dotted: "] ; nruns = 7 ;xrange = [0,50] xrange = [0,35] ; ; Number of cpus: ; x1 = [1, 4, 8, 12, 16, 24, 32] ; # pe's ;x1 = [1, 4, 8, 16, 24, 32, 48] ; # pe's ; ; Elapsed times (secs): ; y1 = [1202., 408., 310., 328., 277., 288., 325.] ; elapsed secs (bs_dyn) y2 = [ 854., 265., 173., 126., 103., 94., 78.] ; elapsed secs (bs_nodyn) y3 = [2392., 956., 745., 681., 668., 685., 730.] ; elapsed secs (bf_dyn) y4 = [2048., 618., 366., 280., 227., 195., 178.] ; elapsed secs (bf_nodyn) ; ;yrange = [0,2400] ; for elapsed (dyn bs and bf) yrange = [0,40] ; for elapsed minutes (dyn bs and bf) ;yrange = [0,1000] ; for elapsed (dyn) ;yrange = [0,2500] ; for elapsed ;yrange = [0,2100] ; for elapsed (nodyn) ;yrange = [0,5] ; for speedup ;yrange = [0,7] ; for speedup (nodyn) ; ; Plot titles: ; title = 'TIEGCM1.6: 1-day runs (480 steps) (step = 3min)' ;ytitle='Elapsed seconds' ; ytitle='Elapsed minutes' y1 = y1/60. ; seconds to minutes y2 = y2/60. ; seconds to minutes y3 = y3/60. ; seconds to minutes y4 = y4/60. ; seconds to minutes ; ;ytitle='Speedup (elapsed serial/nproc)' xtitle='Total MPI tasks (' for i=0,nruns-1 do begin xtitle = xtitle+string(format="(i3)",x1(i)) &end xtitle = xtitle+')' ; chsize = 1.3 if (keyword_set(ps)) then chsize = 1.0 ; ; Order of plots: bs_dyn, bs_nodyn, bf_dyn, bf_nodyn ; psyms = [-4,-2,-4,-2] linestyles = [0,0,2,2] colors = [255,255,255,255] if (keyword_set(ps)) then colors = [0,0,0,0] if (keyword_set(ps)) then begin plot,x1,y1,yrange=yrange,xrange=xrange,title=title,charsize=chsize,$ xcharsize=chsize, ycharsize=chsize,xtitle=xtitle,ytitle=ytitle,psym=psyms[0],$ position=[.15,.10,.95,.95],/norm,xstyle=1,linestyle=linestyles[0],color=colors[0] ; addtext,legend_lite,.36,.5 ; addtext,legend_lite,.36,.7 endif else begin plot,x1,y1,yrange=yrange,xrange=xrange,title=title,charsize=chsize,$ xcharsize=chsize, ycharsize=chsize,xtitle=xtitle,ytitle=ytitle,psym=psyms[0],$ position=[.18,.25,.95,.90],/norm,xstyle=1,linestyle=linestyles[0],color=colors[0] ; addtext,legend_lite,.36,.50 ; addtext,legend_lite,.36,.70 endelse ; ; Over plot remaining curves: ; ; linestyle = 0 -> solid ; linestyle = 1 -> dotted ; linestyle = 2 -> dashed ; linestyle = 3 -> dash-dot ; linestyle = 4 -> dash dot dot ; linestyle = 5 -> long dashes ; ; psym = 1 -> '+' ; psym = 2 -> '*' ; psym = 3 -> '.' ; psym = 4 -> diamond ; psym = 5 -> triangle ; psym = 6 -> square ; psym = 7 -> 'X' ; psym = 8 -> user-defined ; oplot,x1,y2,psym=psyms[1],linestyle=linestyles[1],color=colors[1] oplot,x1,y3,psym=psyms[2],linestyle=linestyles[2],color=colors[2] oplot,x1,y4,psym=psyms[3],linestyle=linestyles[3],color=colors[3] ; ; Add legend: ; pro legend, nitems,descrip,linestyle,psym,color,xul,yul,ps=keyword_set(ps) descrip = [ $ 'Bluesky with dynamo ',$ 'Bluesky without dynamo ',$ 'Blackforest with dynamo ',$ 'Blackforest without dynamo'] ips=0 & if (keyword_set(ps)) then ips=1 legend,4,descrip,linestyles,psyms,colors,0.3,0.75,ips ; ; Close ps file: ; if (keyword_set(ps)) then begin device,/close ; psoff if keyword_set(gif) then $ print,'>>> Cannot do both ps and gif -- making only ps file' if keyword_set(tiff) then $ print,'>>> Cannot do both ps and tiff -- making only ps file' endif else if keyword_set(gif) or keyword_set(tiff) then begin if keyword_set(gif) then saveimage,'perf.gif',/gif if keyword_set(tiff) then saveimage,'perf.tiff',/tiff endif end