Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29252 Discussions

Intel Fortran Compiler 11.1 and OpenMPI 1.4 bug - Inconsistent Output

oacikgoz
Beginner
410 Views
Hi everyone,
I'm going nuts with my code, because what is happening is beyond my comprehension. When I compile my code with -g option, or -check all, or -check bounds flag, the code runs perfectly fine, though, as you can guess, very slow.
Whenever I use any optimization flag, the code fails to run, gives random segmentation faults. More importantly, the code has something of this sort:
x(1)=...
x(2)=...
.
.
.
x(64)=...
When I add WRITE(6,*) x(1) at the end, it gives me a number totally different from what I set it to. (gives me zero) x is an allocatable array which is properly allocated to be of size 64.
Here are some technical details:
I do not have Intel C/C++ compiler and therefore OpenMPI was compiled with gcc, g++ and ifort combined, with no special flags. If I use gfortran, the code runs with no problems, regardless of the optimization level.
I also tried to use MPICH2 and still the problem persists. It's not specific to OpenMPI. There is a compiler bug in Intel Compiler, or, there is an incompatibility between GCC 4.2 and ifort.
Do you think that the problem would disappear if I use Intel MPI? What do you think is the root of the problem?
Thanks.
0 Kudos
1 Reply
TimP
Honored Contributor III
410 Views
If you want to refer the question to the Intel MPI team, the HPC forum would be more suitable.
I have worked using ifort with both OpenMPI and Intel MPI, and don't recognize such a problem. write(6,*) isn't ideal, as it depends on undisturbed pre-assignment of unit 6, and it's possible for accidents like array over-runs to produce a result such as you report. I would use write(*,*) or write to a specific file. But all that doesn't seem directly related to your problem.
Array over-runs, or, more often, problems due to lack of data initialization, may be exposed with optimization turned on, and might be suppressed by -check even with the optimization level set. Sometimes, problems with uninitialized data and optimization respond to -zero -save (if you don't use threading together with MPI), in case that may help locate it. I would agree that when you first try -check, you would likely set -g and allow optimization to drop off.
0 Kudos
Reply