From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,8dee7c8da12e3d6c,start X-Google-Attributes: gid1164f8,public From: trey@mps.ohio-state.edu (James B. White III) Subject: DEC f77 vs. f90 vs. cc Date: 1995/09/25 Message-ID: #1/1 X-Deja-AN: 110734193 organization: The Ohio State University newsgroups: comp.sys.dec I wrote and executed some simple test programs to compare the DEC AXP FORTRAN 77, Fortran 90, and C compilers. Here are my results for those simple codes, along with Linpack and Livermore Loops benchmarks. Programs were run on an AlphaServer 2100 4/233 (one processor) under DEC OSF/1 V3.2B. Fortran matrix codes are SAXPY form, while C codes are dot-product form. The codes use the optimized BLAS routines from the Digital Extended Math Library. Compile options: f77 -fast -O5 ... -ldxml f90 -fast -O5 ... -ldxml cc -D_INTRINSICS -D_INLINE_INTRINSICS -fp-reorder -O4 ... -ldxml Measurements are in MFLOPS (bigger is better). f77 f90 cc Vector Addition (double) DO loop 27.45 16.29 23.00 BLAS routine (DAXPY) 29.42 23.14 29.68 Array syntax ***** 28.93 ***** FORALL loop ***** 16.46 ***** Dot product (double) DO loop 21.86 16.31 21.49 BLAS routine (DDOT) 22.84 22.05 22.15 SUM w/array notation ***** 16.21 ***** DOT_PRODUCT ***** 16.21 ***** Matrix-vector multiplication (double) DO loop (no unrolling) 44.69 42.86 23.34 2-way unrolling 55.91 47.96 35.27 4-way unrolling 70.91 52.09 46.54 8-way unrolling 60.03 56.24 35.75 BLAS routine (DGEMV) 65.00 64.35 56.68 Array syntax ***** 25.97 ***** MATMUL ***** 23.70 ***** LINPACK Benchmark Single precision 70.36 63.96 20.63 Double precision 50.25 43.97 25.22 Livermore Loops Benchmark Single precision max 178.04 114.23 ***** Single precision avg 51.40 43.60 ***** Single precision min 10.59 10.06 ***** Double precision max 144.72 109.75 ***** Double precision avg 42.05 37.46 ***** Double precision min 9.71 11.36 ***** *** END OF TESTS *** Some of the results for f90 were confusing and disappointing. For example, why aren't the intrinsic functions MATMUL and DOT_PRODUCT almost as fast as the BLAS routines? The optimized BLAS routines were already around. Why didn't DEC just code MATMUL and DOT_PRODUCT as wrappers for _DOT and _GEMV? -- James B. White III (Trey) Theoretical Nuclear Physics Graduate Student The Ohio State University trey@mps.ohio-state.edu