Skip to content

Commit

Permalink
Merge pull request #3310 from GEOS-ESM/bugfix/atrayano/fix_of_mpi_com…
Browse files Browse the repository at this point in the history
…m_free_fix
  • Loading branch information
mathomp4 authored Jan 13, 2025
2 parents 99b1564 + eede063 commit 5e3f8f9
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions base/FileIOShared.F90
Original file line number Diff line number Diff line change
Expand Up @@ -544,12 +544,12 @@ subroutine ArrDescrInit(ArrDes,comm,im_world,jm_world,lm_world,nx,ny,num_readers
ArrDes%jm_world=jm_world
ArrDes%lm_world=lm_world

ArrDes%readers_comm = readers_comm
ArrDes%ioscattercomm = ioscattercomm
ArrDes%writers_comm = writers_comm
ArrDes%iogathercomm = iogathercomm
ArrDes%xcomm = xcomm
ArrDes%ycomm = ycomm
call MPI_Comm_Dup(readers_comm, ArrDes%readers_comm, status)
call MPI_Comm_Dup(ioscattercomm, ArrDes%IOscattercomm, status)
call MPI_Comm_Dup(writers_comm, ArrDes%writers_comm, status)
call MPI_Comm_Dup(iogathercomm, ArrDes%IOgathercomm, status)
call MPI_Comm_Dup(xcomm, ArrDes%Xcomm, status)
call MPI_Comm_Dup(ycomm, ArrDes%Ycomm, status)
call mpi_comm_rank(arrdes%ycomm,arrdes%myrow,status)
_VERIFY(status)

Expand Down Expand Up @@ -598,13 +598,13 @@ subroutine ArrDescrSet(ArrDes, offset, &
call MPI_Comm_Dup(readers_comm, ArrDes%readers_comm, status)
end if
if(present(ioscattercomm)) then
call MPI_Comm_Dup(ioscattercomm, ArrDes%ioscattercomm, status)
call MPI_Comm_Dup(IOscattercomm, ArrDes%IOscattercomm, status)
end if
if(present(writers_comm )) then
call MPI_Comm_Dup(writers_comm, ArrDes%writers_comm, status)
end if
if(present(iogathercomm)) then
call MPI_Comm_Dup(iogathercomm, ArrDes%iogathercomm, status)
call MPI_Comm_Dup(IOgathercomm, ArrDes%IOgathercomm, status)
end if
if(present(i1 )) ArrDes%i1 => i1
if(present(in )) ArrDes%in => in
Expand Down Expand Up @@ -645,7 +645,7 @@ subroutine ArrDescrCreateWriterComm(arrdes, full_comm, num_writers, rc)
call MPI_COMM_SPLIT(full_comm, color, myid, arrdes%writers_comm, status)
_VERIFY(status)
if (num_writers==ny) then
arrdes%IOgathercomm = arrdes%Xcomm
call MPI_Comm_Dup(arrdes%Xcomm, ArrDes%IOgathercomm, status)
else
j = arrdes%NY0 - mod(arrdes%NY0-1,ny_by_writers)
call MPI_COMM_SPLIT(full_comm, j, myid, arrdes%IOgathercomm, status)
Expand Down Expand Up @@ -693,7 +693,7 @@ subroutine ArrDescrCreateReaderComm(arrdes, full_comm, num_readers, rc)
call MPI_COMM_SPLIT(full_comm, color, MYID, arrdes%readers_comm, status)
_VERIFY(status)
if (num_readers==ny) then
arrdes%IOscattercomm = arrdes%Xcomm
call MPI_Comm_Dup(arrdes%Xcomm, ArrDes%IOscattercomm, status)
else
j = arrdes%NY0 - mod(arrdes%NY0-1,ny_by_readers)
call MPI_COMM_SPLIT(full_comm, j, MYID, arrdes%IOscattercomm, status)
Expand Down

0 comments on commit 5e3f8f9

Please sign in to comment.