Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix MPI synchronization in real.exe #1600

Merged
merged 1 commit into from
Dec 16, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions main/real_em.F
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ PROGRAM real_data

USE module_machine
#ifdef DM_PARALLEL
USE module_dm, ONLY : wrf_dm_initialize
USE module_dm, ONLY : wrf_dm_initialize, mpi_comm_allcompute
#endif
USE module_domain, ONLY : domain, alloc_and_configure_domain, &
domain_clock_set, head_grid, program_name, domain_clockprint, &
Expand Down Expand Up @@ -56,9 +56,9 @@ END SUBROUTINE med_read_wrf_chem_bioemiss

INTEGER :: max_dom, domain_id , grid_id , parent_id , parent_id1 , id
INTEGER :: e_we , e_sn , i_parent_start , j_parent_start
INTEGER :: idum1, idum2
INTEGER :: idum1, idum2
#ifdef DM_PARALLEL
INTEGER :: nbytes
INTEGER :: nbytes, save_comm
INTEGER, PARAMETER :: configbuflen = 4* CONFIG_BUF_LEN
INTEGER :: configbuf( configbuflen )
LOGICAL , EXTERNAL :: wrf_dm_on_monitor
Expand Down Expand Up @@ -119,13 +119,16 @@ END SUBROUTINE Setup_Timekeeping
! The configuration switches mostly come from the NAMELIST input.

#ifdef DM_PARALLEL
CALL wrf_get_dm_communicator( save_comm )
CALL wrf_set_dm_communicator( mpi_comm_allcompute )
IF ( wrf_dm_on_monitor() ) THEN
CALL initial_config
END IF
CALL get_config_as_buffer( configbuf, configbuflen, nbytes )
CALL wrf_dm_bcast_bytes( configbuf, nbytes )
CALL set_config_as_buffer( configbuf, configbuflen )
CALL wrf_dm_initialize
CALL wrf_set_dm_communicator( save_comm )
#else
CALL initial_config
#endif
Expand Down