|
|
|
|
![]() |
|
|
|
About McStas Documentation |
Compiling McStas simulationsChoosing the right compiler and compilation options can make a huge difference in the performance of the simulations generated by McStas. Experiments show that using the HP C compiler with the right options generates code that runs more than twice as fast as code generated using GCC. Using the wrong options causes the HP compiler to generate worse code than GCC! The performance of McStas has been tested on two systems. One, fys-hp-2, is an HPPA 9000/780 machine running HP-UX 10.20. The other, elm-298, is a 300MHz Pentium II PC running Linux 2.0. On the HP machine, the best performance was found with the following compilation options: cc -Aa +Oall -Wl,-a,archive ...This makes cc spend a lot of time on compilation, but
the resulting code is twice as fast as that generated by gcc -O3,
not to mention cc -Aa -O which is even slower.
On the PII, the best performance seem to be obtained using gcc -O3 ... Using the fastest compilations options on both machines, the HP is about 50% faster than the PII. UpdateIt is possible to obtain better results on the PC by using other compilers. The EGCS compiler (a gcc variant) produces about 20% faster code than stock gcc. Even better results can be obtained using PGCC, the pentium-optimized EGCS compiler, but some versions of PGCC have bugs that may lead to incorrect results. See this note for comparison and details.Kristian Nielsen <kristian.nielsen@risoe.dk> / Sep 3, 1998. |
|||||
| ||||||