Intel compiler V11 and OpenMP - problem

FDSUser
Total Points:
165
Status Points:
0
Green Belt
November 21, 2008 4:24 PM PST
Rate
 
#5 Reply to #4
Quoting - tim18

The -openmp option should make local arrays dynamic, even if they were not already automatic (in the standard Fortran sense) by definition, so the lack of change is to be expected.  The problem usually cited with Fortran automatic arrays is the lack of error diagnosis.  Supposing the allocation fails, which might happen simply because the stack size limit is reached at this point, you don't have a satisfactory way to catch it.  Hence the usual recommendation for ALLOCATABLE arrays with STAT= checking.  This would apply equally to the serial version, but the OpenMP version will consume more stack.

Now I debuuged every line of the code for this specific problem, and I found the problem and I think it is not a stacksize or programming problem, I think it's a compiler problem:

In the first subroutine, which I posted the error starts:

# IF (MIXTURE_FRACTION) THEN  
# !$OMP PARALLEL DO COLLAPSE(3) PRIVATE(K,J,I,ITMP,Z_VECTOR,CP_SUM,CP_MF,N)  
#    DO K=1,KBAR  
#       DO J=1,JBAR  
#          DO I=1,IBAR  
#             !IF (SOLID(CELL_INDEX(I,J,K))) CYCLE  
#             OpenMP_DIVG_005: IF (SOLID(CELL_INDEX(I,J,K))) THEN  
#                CALL DO_NOTHING('DIVG_PART1_MIXTURE_FRACTION_RTRM')  
#             ELSE !OpenMP  
#                ITMP = 0.1_EB*TMP(I,J,K)  
#                Z_VECTOR = YYP(I,J,K,I_Z_MIN:I_Z_MAX)

At the last line the error occurs. The Z_VECTOR variable is correctly allocated in another module, in my test case it has a size of 2, so Z_VECTOR(1:2) is allocated, not in the same module where this subroutine (code fragment above) is running. The variable YYP is also correctly allocated, the value of I_Z_MIN = 1 and the value of I_Z_MAX = 2, so YYP and Z_VECTOR have the same size, so they must match. But the problem is, that Z_VECTOR = YYP(...) is not done, and so Z_VECTOR has no values. I wrote out with WRITE(*,*) YYP(I,J,K,I_Z_MIN:I_Z_MAX) the values of YYP, and that is done perfectly, two values appear on the screen. After the line Z_VECTOR = YYP(...) I wrote out with WRITE(*,*) Z_VECTOR, and there the program hangs with the error in the first post. Stack-size is not the problem, I have 2GB of stack and max 100MB are used, so I think it is a compiler based problem. To ensure, that the size and values of Z_VECTOR and YYP(...) are correctly matching, I tried instead of Z_VECTOR = YYP(...) a new possibility with Z_VECTOR(I_Z_MIN:I_Z_MAX) = YYP(...,I_Z_MIN:I_Z_MAX) but this has also no success. If I compile without the -openmp flag, Z_VECTOR = YYP(...) or Z_VECTOR(I_Z_MIN:I_Z_MAX) = YYP(...) runs fine and no problem occurs. The values of I_Z_MIN and I_Z_MAX are calculated at the start of the program and they are not changed any more, so this could also be not the problem.

I tried the code with two other compilers and the OpenMP flags for this compilers, this is the XLF 12.1.0.0 compiler for AIX and the actual SUN Express compiler for Linux, and both compilers produce a perfectly running code. With the Intel Fortran 11 Compiler, the code fails, and I do not use any optimizations (compiling with -O0), so I think, this is not a programming problem, it's a compiler problem. My OS is Ubuntu 8.04, if this helps for debugging. If the code helpful, I can email it.

Thanks for your help!



Intel Software Network Forums Statistics

8487 users have contributed to 31622 threads and 100698 posts to date.
In the past 24 hours, we have 35 new thread(s) 121 new posts(s), and 186 new user(s).

In the past 3 days, the most popular thread for everyone has been gemm(A,A,A) like possible? The most posts were made to gemm(A,A,A) like possible? The post with the most views is Dear Steve, excuse me for a d

Please welcome our newest member chat1983