Skip to content

Commit a90a08f

Browse files
sbryngelsonclaude
andcommitted
Fix NaN diagnostic print to log correct offset indices
The Intel-compiler NaN check prints logged raw loop indices (j,k,l) instead of the actual array indices used (j+unpack_offset, etc.), making the diagnostic misleading when debugging MPI recv errors. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent f6cd29c commit a90a08f

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/common/m_mpi_common.fpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -937,7 +937,7 @@ contains
937937
q_comm(i)%sf(j + unpack_offset, k, l) = real(buff_recv(r), kind=stp)
938938
#if defined(__INTEL_COMPILER)
939939
if (ieee_is_nan(q_comm(i)%sf(j + unpack_offset, k, l))) then
940-
print *, "Error", j, k, l, i
940+
print *, "Error", j + unpack_offset, k, l, i
941941
error stop "NaN(s) in recv"
942942
end if
943943
#endif
@@ -992,7 +992,7 @@ contains
992992
q_comm(i)%sf(j, k + unpack_offset, l) = real(buff_recv(r), kind=stp)
993993
#if defined(__INTEL_COMPILER)
994994
if (ieee_is_nan(q_comm(i)%sf(j, k + unpack_offset, l))) then
995-
print *, "Error", j, k, l, i
995+
print *, "Error", j, k + unpack_offset, l, i
996996
error stop "NaN(s) in recv"
997997
end if
998998
#endif
@@ -1051,7 +1051,7 @@ contains
10511051
q_comm(i)%sf(j, k, l + unpack_offset) = real(buff_recv(r), kind=stp)
10521052
#if defined(__INTEL_COMPILER)
10531053
if (ieee_is_nan(q_comm(i)%sf(j, k, l + unpack_offset))) then
1054-
print *, "Error", j, k, l, i
1054+
print *, "Error", j, k, l + unpack_offset, i
10551055
error stop "NaN(s) in recv"
10561056
end if
10571057
#endif

0 commit comments

Comments
 (0)