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(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.
What do you think is the root of the problem?