Skip to content

Commit 01cd346

Browse files
author
Daniel Vickers
committed
fixed stalling issue on multirank cases for cray compilers
1 parent 2126d4e commit 01cd346

1 file changed

Lines changed: 8 additions & 10 deletions

File tree

src/simulation/m_ibm.fpp

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1275,16 +1275,14 @@ contains
12751275
call MPI_UNPACK(recv_buf, buf_size, unpack_pos, pid, 1, MPI_INTEGER, MPI_COMM_WORLD, ierr)
12761276
call MPI_UNPACK(recv_buf, buf_size, unpack_pos, fval, 3, mpi_p, MPI_COMM_WORLD, ierr)
12771277
call MPI_UNPACK(recv_buf, buf_size, unpack_pos, tval, 3, mpi_p, MPI_COMM_WORLD, ierr)
1278-
do j = 1, num_ibs
1279-
if (patch_ib(j)%gbl_patch_id == pid) then
1280-
! add forces and subtract recv_snap prevent double-counting
1281-
forces(j,:) = forces(j,:) + fval(:) - recv_forces_snap(j,:)
1282-
torques(j,:) = torques(j,:) + tval(:) - recv_torques_snap(j,:)
1283-
recv_forces_snap(j,:) = fval(:)
1284-
recv_torques_snap(j,:) = tval(:)
1285-
exit
1286-
end if
1287-
end do
1278+
call s_get_neighborhood_idx(pid, j)
1279+
if (j > 0) then
1280+
! add forces and subtract recv_snap prevent double-counting
1281+
forces(j,:) = forces(j,:) + fval(:) - recv_forces_snap(j,:)
1282+
torques(j,:) = torques(j,:) + tval(:) - recv_torques_snap(j,:)
1283+
recv_forces_snap(j,:) = fval(:)
1284+
recv_torques_snap(j,:) = tval(:)
1285+
end if
12881286
end do
12891287
end if
12901288
tag = tag + 2

0 commit comments

Comments
 (0)