Skip to content

Commit

Permalink
Update notes
Browse files Browse the repository at this point in the history
  • Loading branch information
josephzhang8 committed Dec 19, 2024
1 parent 5539588 commit a576255
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Core/schism_glbl.F90
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ module schism_glbl
real(4),save,allocatable :: ath2(:,:,:,:,:) !used to read *.nc for b.c. time series
#ifdef SH_MEM_COMM
!Use more efficient share mem communicator for I/O
real(4),public,save,pointer :: ath3(:,:,:,:)
real(4),save,pointer :: ath3(:,:,:,:)
#else
real(4),save,allocatable :: ath3(:,:,:,:) !used to read source/sink inputs
#endif
Expand Down
4 changes: 2 additions & 2 deletions src/Core/schism_msgp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -452,14 +452,14 @@ subroutine parallel_init(communicator)
CALL MPI_Comm_size(comm_node, nproc_node, ierr)
CALL MPI_Comm_rank(comm_node, myrank_node,ierr)

!Ensure that myrank_node=0 includes myrank=0 for some bcast (read in by
!Ensure that myrank_node=0 (nonunique) includes myrank=0 for some bcast (read in by
!myrank_node=0 and then bcast from myrank=0 in comm)
if(myrank_node==0.and.myrank==0) then
itmp=1 !true
else
itmp=0
endif
!comm_node seems to cause error, maybe due to non-unique ranks?
!Collectives on comm_node won't work as they are on per node basis!
call mpi_allreduce(itmp,itmp2,1,itype,MPI_SUM,comm,ierr)
if(itmp2==0) then
write(*,*)'Ranks:',myrank_node,myrank,itmp,itmp2
Expand Down
3 changes: 2 additions & 1 deletion src/Hydro/misc_subs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,8 @@ subroutine other_hot_init(time)
call mpi_bcast(th_dt3,nthfiles3,rtype,0,comm,istat)
call mpi_bcast(th_time3,2*nthfiles3,rtype,0,comm,istat)
#ifdef SH_MEM_COMM
!For share mem, ath3 is already filled
!For share mem, ath3 is already filled. Collective on comm_node is per node
!The barrier may not be necessary
call mpi_barrier(comm_node, istat)
#else
call mpi_bcast(ath3,max(1,nsources,nsinks)*ntracers*2*nthfiles3,MPI_REAL4,0,comm,istat)
Expand Down
3 changes: 2 additions & 1 deletion src/Hydro/schism_step.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1685,7 +1685,8 @@ subroutine schism_step(it)
call mpi_bcast(th_time3,2*nthfiles3,rtype,0,comm,istat)
#ifdef SH_MEM_COMM
! ath3 data in shared buffer, no longer necessary to broadcast
!Sync to ensure the buffer is filled
!Sync (on each compute node) to ensure the buffer is filled
!The barrier may not be necessary
call mpi_barrier(comm_node, istat)
#else
call mpi_bcast(ath3,max(1,nsources,nsinks)*ntracers*2*nthfiles3,MPI_REAL4,0,comm,istat)
Expand Down

0 comments on commit a576255

Please sign in to comment.