HiPERiSM - High Performance Algorism Consulting
HCTR-2004-5: Compiler Performance 11
COMPARING COMPILERS ON INTEL™ PENTIUM 3 and PENTIUM 4 PROCESSORS WITH THE PARALLEL STREAM BENCHMARK
HiPERiSM Consulting, LLC.
This is part of a series of reports on a project to evaluate industry standard fortran 90/95 compilers for IA-32 Linux™ commodity platforms. This report shows results, in a side-by-side comparison for each compiler, for the Intel™ Pentium 3 (P3) and Pentium 4 Xeon (P4) processors for the serial STREAM benchmark. The purpose of this benchmark in this application is to measure memory bandwidth on these commodity platforms. In this report results of the STREAM benchmark are reported for the (tuned) parallel OpenMP version. This is a continuation of the previous report for the serial version and more detail on the motivation for this study may be found there.
2.0 CHOICE OF HARDWARE AND OPERATING SYSTEM
Results for the memory bandwidth in MB/second are compared for benchmarks compiled using four different Fortran compilers with the Linux™ operating system. For this report benchmarks were executed in parallel OpenMP mode on a dual processor Intel™ Pentium III (256KB L2 cache, Supermicro 370DL3 motherboard) and a dual processor Pentium 4 Xeon 3.06GHz (1MB L3 cache, Supermicro X5DPA-TGM motherboard). While the STREAM benchmark is designed to avoid compiler optimization differences, these were observed, and are reported. For these reasons results are presented both without and with compiler optimizations.
3.0 CHOICE OF COMPILERS
The choice of compilers for Linux™ IA-32 platforms now includes several vendor-supported products. The importance of this category is that vendor products have technical support and undergo continuous development with ports to new architectures as they arrive in the marketplace. The three compilers chosen in this survey support OpenMP directives and are described separately in the following sections.
The Intel Fortran Compiler version 8.0 targets both Intel IA-32 and IA-64 (Itanium) architectures, but only the former has been used in this project so far. Details on the compiler features are available at HiPERiSM Consulting, LLC’s URL. In this report this compiler is used with the Pentium 4 Xeon processor.
The Lahey/Fujitsu Fortran 95 compiler (hereafter Lahey) for Linux™ is available from Lahey Computer Systems, Inc., (http://www.lahey.com). Release 6.2 for Linux was used with the Pentium 4 Xeon processor.
The pgf90™ fortran compiler (Linux™ distribution) from the Portland Group, (http://www.pgroup.com) was used in the CDK 4.0 release on HiPERiSM’s IA-32 Linux™ Pentium 3 cluster. Note that the CDK 5.1 release (not used here) may offer additional performance enhancement on the Pentium 4 Xeon processor.
4.0 CHOICE OF BENCHMARKS
The STREAM (Sustainable Memory Bandwidth) benchmark is fully described (and obtainable from) http://www.cs.virginia.edu/stream. It was developed and is maintained by John D. McCalpin, and this URL contains detailed descriptions, technical papers, and numerous results. In what follows only some salient features are outlined.
4.2 The STREAM benchmark and timing
The STREAM benchmark consists of multiple repetitions of the four Kernels in Table 4.1 and the best results of typically ten trials are chosen. Only the memory bandwidth is reported here (in units of MB/second) and for the definition of how memory bandwidth is measured in STREAM visit the above URL.
For this report the iteration range of the loop is chosen to range from 1 to 20x106 data points with unit stride as this should ensure the data range will exceed the cache capacity. Also, the version of STREAM used here is a variant of the original stream_tuned.f code. A portable timing routine was added to record time intervals computed with calls to the Fortran 90/95 system_clock routine as follows
integer, parameter:: b8 = selected_real_kind(14)
end function mysecond
Negligible differences resulted from use of this procedure when compared with the non-portable fortran timing routines delivered with STREAM.
The compiler commands and the corresponding choice of command line switches are shown in Table 4.2 where switches without (column 2) and with (column 3) optimizations are distinguished.
The next section presents the results of the STREAM benchmark using the respective compilers without optimization and Section 6 presents results with optimization.
5.0 COMPARING BANDWIDTH RATES WITHOUT COMPILER OPTIMIZATION
5.1 STREAM results with no optimizations
This section reports results with three compilers for the STREAM benchmarks with no compiler optimizations with the compiler switches shown in the second column of Table 4.2. Tables 5.1 (Pentium 3), 5.2, and 5.3 (Pentium 4) show the numerical values and Figures 1 and 2, show these memory rates as bar charts, for Pentium 3 and Pentium 4, respectively.
Surprisingly, the P=2 thread result for the P3 shows an increased memory bandwidth with no compiler optimization and the expected decrease with optimization enabled. For the P4 there are only small changes when P=1 and P=2 results are compared. However, for the P4 the P=4 thread case shows a distinct reduction in memory bandwidth. This loss of bandwidth in parallel mode is as much as 29% for kernel 3 with the Intel compiler, and 28% for kernel 4 with the Lahey compiler. To show this relative reduction more clearly, Figure 4 has the ratio of P=2 and P=4 values normalized to the P=1 result. Note that the dual Xeon processors have hyper-threading technology and each can support two OpenMP threads, but at the cost of some lost memory bandwidth.
Fig. 1 Memory bandwidth for the Portland compiler with the STREAM benchmark (without and with optimization) on the Pentium 3.
Fig. 2 Memory bandwidth of the Intel compiler for the STREAM benchmarks (without optimization) on the Pentium 4 Xeon.
Fig. 3 Memory bandwidth of the Lahey compiler for the STREAM benchmarks (without optimization) on the Pentium 4 Xeon.
Fig. 4 Ratio of memory bandwidth for P>1 threads to those for P=1 with Intel and Lahey compilers on the Pentium 4 Xeon for the STREAM benchmark (without optimization).
5.2 STREAM statistics for no optimizations
Figures 5 and 6 show the basic statistics for averages and dispersion over P=1, 2, and 4 OpenMP threads. The mean for the Lahey compiler tends to fall below that for the Intel compiler and dispersion in values fluctuates for both with different kernels. However, the standard deviation is seen to be small for all four kernels with both compilers.
Fig. 5 Memory bandwidth statistics for the Intel compiler with P=1, 2, and 4 threads using the STREAM benchmark (without optimization) on the Pentium 4 Xeon.
Fig. 6 Memory bandwidth statistics for the Lahey compiler with P=1, 2, and 4 threads using the STREAM benchmark (without optimization) on the Pentium 4 Xeon.
6.0 COMPARING BANDWIDTH RATES WITH COMPILER OPTIMIZATION
6.1 STREAM results with optimizations
This section reports results with three compilers for the STREAM benchmarks with compiler optimizations using the compiler switches shown in the third column of Table 4.2. Tables 6.1 (Pentium 3), 6.2, and 6.3 (Pentium 4) show the numerical values and Figures 1, 7 and 8, show these memory rates as bar charts, for Pentium 3 and Pentium 4 processors.
As mentioned above the P=2 result for the P3 shows the expected decrease in memory bandwidth with optimization in Figure 1. For the P4 there are significant reductions when P=1 and P=2 results are compared (particularly for kernels 3 and 4). The P=4 thread case shows a loss of bandwidth in parallel mode by as much as 29% for kernel 4 with both compilers. To show this relative reduction more clearly, Figure 9 has the ratio of P=2 and P=4 values normalized to the P=1 result. Note that since code is generally compiled with optimizations a progressively increasing loss of bandwidth is to be expected as the thread count increases. That this is also true of the P3 is demonstrated in Figure 10. There is one interesting observation to be made on the behavior of the Intel compiler with optimizations enabled. If Figure 7 here is compared with the Intel compiler results shown in Figure 8 of the previous report for the serial STREAM benchmark it is obvious that the exceptionally large memory bandwidth reported there is not evident here. The only difference is the addition of the –auto and –openmp compiler switches and it can only be assumed that when these are enabled the Intel compiler allocates hardware resources in ways different to that done in the serial case, with a consequent reduction in bandwidth.
Fig. 7 Memory bandwidth of the Intel compiler for the STREAM benchmarks (with optimization) on the Pentium 4 Xeon.
Fig. 8 Memory bandwidth of the Lahey compiler for the STREAM benchmarks (with optimization) on the Pentium 4 Xeon.
Fig. 9 Ratio of memory bandwidth for P>1 threads to those for P=1 with Intel and Lahey compilers on the Pentium 4 Xeon for the STREAM benchmark (with optimization).
Fig. 10 Ratio of memory bandwidth of the Portland compiler on the Pentium 3 for results without and with compiler optimization for the STREAM benchmark.
6.2 STREAM statistics for optimizations
Figures 11 and 12 show the basic statistics for averages and dispersion over P=1, 2, and 4 OpenMP threads. The mean for both compilers is similar but variability is larger for the Lahey compiler with kernels 1-3.
Fig. 11 Memory bandwidth statistics for the Intel compiler with P=1, 2, and 4 threads using the STREAM benchmark (with optimization) on the Pentium 4 Xeon.
Fig. 12 Memory bandwidth statistics for the Lahey compiler with P=1, 2, and 4 threads using the STREAM benchmark (with optimization) on the Pentium 4 Xeon.
This report presented performance results of three fortran compilers in the IA-32 environment for the parallel STREAM memory bandwidth metric. The measurements were performed without and with compiler optimizations on Intel Pentium 3 and Pentium 4 Xeon processors used in parallel mode on dual processor motherboards.
As observed in the previous report the P4 Xeon architecture when compared to the P3 can deliver a four-fold improvement in bandwidth. But when more than one process (or thread) executes the overall conclusion is that memory bandwidth is, in general, significantly decreased. The observed reductions are as large as 29% in some cases, and are progressively increasing as threads are added and compiler optimizations are enabled.
The parallel STREAM benchmark was valuable as a quantitative metric in addressing the memory bandwidth issues raised in the introduction of the previous report. However, as a caution, we note that for “real-world” multiprocessor codes, memory bandwidth contention has been observed to have more severe consequences than the results reported here would suggest.
HiPERiSM Consulting, LLC, (919) 484-9803 (Voice)
(919) 806-2813 (Facsimile)