smirik / mercury

N-body fortran integrator
GNU General Public License v3.0
60 stars 24 forks source link

gfortran with -O2 compiles but does not run in older processors #24

Closed asterismo closed 1 year ago

asterismo commented 4 years ago

Hi, i have a Dell Precision 530MT old workstation with a dual Intel Xeon (Pentium 4s) processors running Debian 7 32bits. I cloned the repo and did "make build" and it builds it with no error, but then ./mercury get stucked in integrating particles to the same epoch. I figured out that the -O2 in the Makefile was the issue, if i remove it, it compiles and executes ok and complete the integration. Any idea why is this?

texadactyl commented 4 years ago

That's a 15-year-old system. Well-built, obviously! The compiler did a good job generating the required P4 code.

Have you tried compiling and executing a simple program with and without the -O2 option? Have you also tried using optimization level 1 i.e. -O1 on mercury? Same or new issue?

I doubt if the 4xxi folks have tried testing mercury on such an elderly system - at least, recently. Glad to hear that you have found a way to successfully use mercury.

asterismo commented 4 years ago

Actually i built this system for recycling purposes and ended up with 2GB of RAM ECC, a RAID1 IDE HDD array and a nice AGP video card and use it as my everyday PC. The old Xeons have MMX, SSE and SSE2 instruction sets. I'll try the -O1 optimization. Anyway, the system is Debian 7 wheezy, that is a lot newer than the system itself. Maybe the compiler version?

asterismo commented 4 years ago

gfortran -v Using built-in specs. COLLECT_GCC=gfortran COLLECT_LTO_WRAPPER=/usr/lib/gcc/i486-linux-gnu/4.7/lto-wrapper Target: i486-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Debian 4.7.2-5' --with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs --enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.7 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.7 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --enable-targets=all --with-arch-32=i586 --with-tune=generic --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu Thread model: posix gcc version 4.7.2 (Debian 4.7.2-5)

asterismo commented 4 years ago

Nope, -O1 optimization does not execute. Strange! Well. I'm running the code without any optimizations for now.