@@ -18461,7 +18461,13 @@ pure subroutine FP_REAL_COMM_EXPAND_1D(array, buffer)
1846118461 if (all(bnd /= FP_NOT_ALLOC)) then
1846218462 allocate(array(bnd(1):bnd(2)))
1846318463 n = FP_RCOMMS_PER_BITS(size(array, kind=FP_SIZE) * storage_size(array))
18464+ #if defined(__INTEL_COMPILER) || defined(__INTEL_LLVM_COMPILER)
18465+ ! Intel: avoid transfer() — temporary overflows the stack for large arrays.
18466+ ! FP_REAL == FP_COMM (both c_double), so direct assignment is valid.
18467+ array(:) = buffer(header+1:header+n)
18468+ #else
1846418469 array = transfer(buffer(header+1:header+n), array)
18470+ #endif
1846518471 end if
1846618472 end subroutine FP_REAL_COMM_EXPAND_1D
1846718473
@@ -18478,7 +18484,13 @@ pure subroutine FP_REAL_COMM_EXPAND_2D(array, buffer)
1847818484 if (all(bnd /= FP_NOT_ALLOC)) then
1847918485 allocate(array(bnd(1,1):bnd(2,1), bnd(1,2):bnd(2,2)))
1848018486 n = FP_RCOMMS_PER_BITS(size(array, kind=FP_SIZE) * storage_size(array))
18487+ #if defined(__INTEL_COMPILER) || defined(__INTEL_LLVM_COMPILER)
18488+ ! Intel: avoid transfer() — temporary overflows the stack for large arrays.
18489+ ! FP_REAL == FP_COMM (both c_double), so reshape buffer directly.
18490+ array(:,:) = reshape(buffer(header+1:header+n), shape(array))
18491+ #else
1848118492 array = reshape(transfer(buffer(header+1:header+n), array, size(array)), shape(array))
18493+ #endif
1848218494 end if
1848318495 end subroutine FP_REAL_COMM_EXPAND_2D
1848418496
@@ -18495,7 +18507,13 @@ pure subroutine FP_REAL_COMM_EXPAND_3D(array, buffer)
1849518507 if (all(bnd /= FP_NOT_ALLOC)) then
1849618508 allocate(array(bnd(1,1):bnd(2,1), bnd(1,2):bnd(2,2), bnd(1,3):bnd(2,3)))
1849718509 n = FP_RCOMMS_PER_BITS(size(array, kind=FP_SIZE) * storage_size(array))
18510+ #if defined(__INTEL_COMPILER) || defined(__INTEL_LLVM_COMPILER)
18511+ ! Intel: avoid transfer() — temporary overflows the stack for large arrays.
18512+ ! FP_REAL == FP_COMM (both c_double), so reshape buffer directly.
18513+ array(:,:,:) = reshape(buffer(header+1:header+n), shape(array))
18514+ #else
1849818515 array = reshape(transfer(buffer(header+1:header+n), array, size(array)), shape(array))
18516+ #endif
1849918517 end if
1850018518 end subroutine FP_REAL_COMM_EXPAND_3D
1850118519
@@ -18512,7 +18530,11 @@ pure subroutine FP_SIZE_COMM_EXPAND_1D(array, buffer)
1851218530 if (all(bnd /= FP_NOT_ALLOC)) then
1851318531 allocate(array(bnd(1):bnd(2)))
1851418532 ndoubles = FP_RCOMMS_PER_BITS(size(array, kind=FP_SIZE) * storage_size(array))
18533+ #if defined(__INTEL_COMPILER) || defined(__INTEL_LLVM_COMPILER)
18534+ array(:) = transfer(buffer(header+1:header+ndoubles), 0_FP_SIZE, size(array))
18535+ #else
1851518536 array = transfer(buffer(header+1:header+ndoubles), array)
18537+ #endif
1851618538 end if
1851718539 end subroutine FP_SIZE_COMM_EXPAND_1D
1851818540
0 commit comments