option -r8 error

Hi all

I use pgf90 to compile my code on AMD Opteron™ Processor. When the -r8 switch is on, the code can run but with wrong results. However, when using -r4, the code output is correct.

Anybody here can help me to solve this problem?


Can you post your program here?


The program is too big, it uses a lot of pointers and user defined data. The information of executive files are
[xqyuan@nar317 run]$ ldd SWMF_SC_mpich.exe
libpthread.so.0 => /lib64/libpthread.so.0 (0x0000002a9557a000)
librt.so.1 => /lib64/librt.so.1 (0x0000002a95710000)
libm.so.6 => /lib64/libm.so.6 (0x0000002a95828000)
libc.so.6 => /lib64/libc.so.6 (0x0000002a959ae000)
/lib64/ld-linux-x86-64.so.2 (0x0000003083300000)

compiler switches are:
SWMF library /nar_sfs/work/xqyuan/SWMF2.2/lib/libSWMF.a has been brought up to date.

make[2]: Entering directory /nar_sfs/work/xqyuan/SWMF2.2/CON/Control/src' /work/xqyuan/mpich_pgi7.0/bin/mpif90 -I/nar_sfs/work/xqyuan/SWMF2.2/share/Library/src -I/nar_sfs/work/xqyuan/SWMF2.2/CON/Interface/src -I/nar_sfs/work/xqyuan/SWMF2.2/CON/Library/src -I/nar_sfs/work/xqyuan/SWMF2.2/CON/Coupler/src -c -r8 -pc 64 -Mnobuiltin -Kieee -g swmf.f90 make[3]: Entering directory /nar_sfs/work/xqyuan/SWMF2.2/CON/Control/src’
/work/xqyuan/mpich_pgi7.0/bin/mpif90 -o /nar_sfs/work/xqyuan/SWMF2.2/bin/SWMF.exe
swmf.o -L/nar_sfs/work/xqyuan/SWMF2.2/lib -lSWMF -r8 -pc 64 -Mnobuiltin -Kieee -L/work/xqyuan/mpich_pgi7.0/lib -lmpichf90 -g
make[3]: Leaving directory /nar_sfs/work/xqyuan/SWMF2.2/CON/Control/src' make[2]: Leaving directory /nar_sfs/work/xqyuan/SWMF2.2/CON/Control/src’

Program /nar_sfs/work/xqyuan/SWMF2.2/bin/SWMF.exe has been brought up to date.

make[1]: Leaving directory `/nar_sfs/work/xqyuan/SWMF2.2/CON/Control/src’


It is really hard to tell what the problem is when we don’t see the source. How does the program fail? If it gives you core dump, you can trace back to the source easily. You say -r4 pass, it could be somewhere that you mix r4 and r8 together. Why do you need to compile with -r8 when -r4 works?


Hi Hongyon

the executive file can be generated when using -r8 -pc 64 -Mnobuiltin -Kieee, but when you run the executive file, it gives you negative pressure and density. However, using -r4, the code gives you the correct answer which is the same as the code output in our other cluster.


Unfortunately, we can’t diagnose without seeing the program. If you can provide us a small test case, we certainly can look at it.