Commit 2e172a51 authored by Lorenz Huedepohl's avatar Lorenz Huedepohl
Browse files

Intel compilers don't like sizeof() on unallocated

Apparently with "-check all" some versions of the Intel compiler
complain about the use of

  C_SIZEOF(a(1,1,1))

and similar, when a is not already allocated.
parent 82a32c65
...@@ -1782,6 +1782,8 @@ module ELPA2_compute ...@@ -1782,6 +1782,8 @@ module ELPA2_compute
#else #else
real(kind=rk), pointer :: a(:,:,:) real(kind=rk), pointer :: a(:,:,:)
#endif #endif
real(kind=rk) :: a_real
type(c_ptr) :: a_ptr type(c_ptr) :: a_ptr
real(kind=rk), allocatable :: row(:) real(kind=rk), allocatable :: row(:)
...@@ -1896,9 +1898,9 @@ module ELPA2_compute ...@@ -1896,9 +1898,9 @@ module ELPA2_compute
a_dim2 = max_blk_size + nbw a_dim2 = max_blk_size + nbw
#ifdef WITH_OPENMP #ifdef WITH_OPENMP
if (posix_memalign(a_ptr, 64_C_SIZE_T, stripe_width*a_dim2*stripe_count*max_threads*C_SIZEOF(a(1,1,1,1))) /= 0) then if (posix_memalign(a_ptr, 64_C_SIZE_T, stripe_width*a_dim2*stripe_count*max_threads*C_SIZEOF(a_real)) /= 0) then
#else #else
if (posix_memalign(a_ptr, 64_C_SIZE_T, stripe_width*a_dim2*stripe_count*C_SIZEOF(a(1,1,1))) /= 0) then if (posix_memalign(a_ptr, 64_C_SIZE_T, stripe_width*a_dim2*stripe_count*C_SIZEOF(a_real)) /= 0) then
#endif #endif
write(error_unit,*) "Cannot allocate memory" write(error_unit,*) "Cannot allocate memory"
success = .false. success = .false.
...@@ -4206,6 +4208,7 @@ top_msg_length, current_local_n-top_msg_length-bottom_msg_length, i, & ...@@ -4206,6 +4208,7 @@ top_msg_length, current_local_n-top_msg_length-bottom_msg_length, i, &
#else #else
complex(kind=ck), pointer :: a(:,:,:) complex(kind=ck), pointer :: a(:,:,:)
#endif #endif
complex(kind=ck) :: a_complex
complex(kind=ck), allocatable :: row(:) complex(kind=ck), allocatable :: row(:)
type(c_ptr) :: a_ptr type(c_ptr) :: a_ptr
...@@ -4329,9 +4332,9 @@ top_msg_length, current_local_n-top_msg_length-bottom_msg_length, i, & ...@@ -4329,9 +4332,9 @@ top_msg_length, current_local_n-top_msg_length-bottom_msg_length, i, &
a_dim2 = max_blk_size + nbw a_dim2 = max_blk_size + nbw
#ifdef WITH_OPENMP #ifdef WITH_OPENMP
if (posix_memalign(a_ptr, 64_C_SIZE_T, stripe_width*a_dim2*stripe_count*max_threads*C_SIZEOF(a(1,1,1,1))) /= 0) then if (posix_memalign(a_ptr, 64_C_SIZE_T, stripe_width*a_dim2*stripe_count*max_threads*C_SIZEOF(a_complex)) /= 0) then
#else #else
if (posix_memalign(a_ptr, 64_C_SIZE_T, stripe_width*a_dim2*stripe_count*C_SIZEOF(a(1,1,1))) /= 0) then if (posix_memalign(a_ptr, 64_C_SIZE_T, stripe_width*a_dim2*stripe_count*C_SIZEOF(a_complex)) /= 0) then
#endif #endif
write(error_unit,*) "Cannot allocate memory" write(error_unit,*) "Cannot allocate memory"
success = .false. success = .false.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment