Skip to content

Workaround for reading block decomposition files with OpenMPI v5.x #1318

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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
14 changes: 8 additions & 6 deletions src/framework/mpas_block_decomp.F
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ subroutine mpas_block_decomp_cells_for_proc(dminfo, partial_global_graph_info, l
character (len=*), intent(in) :: blockFilePrefix, & !< Input: File prefix for block decomposition
procFilePrefix !< Input: File prefix for processor decomposition

integer, dimension(:), pointer :: global_list
integer, dimension(:), allocatable, target :: global_list
integer, dimension(:), pointer :: global_list_ptr
integer, dimension(:), pointer :: global_start

integer, dimension(:), allocatable :: local_block_list
Expand Down Expand Up @@ -93,7 +94,8 @@ subroutine mpas_block_decomp_cells_for_proc(dminfo, partial_global_graph_info, l
allocate(local_nvertices(dminfo % nprocs))
allocate(global_start(dminfo % nprocs))
allocate(global_list(partial_global_graph_info % nVerticesTotal))

global_list_ptr => global_list

if (dminfo % my_proc_id == IO_NODE) then

iunit = 50 + dminfo % my_proc_id
Expand Down Expand Up @@ -169,7 +171,7 @@ subroutine mpas_block_decomp_cells_for_proc(dminfo, partial_global_graph_info, l
allocate(local_block_list(local_nvertices(dminfo % my_proc_id + 1)))

call mpas_dmpar_scatter_ints(dminfo, dminfo % nprocs, local_nvertices(dminfo % my_proc_id + 1), &
global_start, local_nvertices, global_list, local_cell_list)
global_start, local_nvertices, global_list_ptr, local_cell_list)

! Reset global start for second read of global_block_list
global_start(1) = 1
Expand All @@ -193,7 +195,7 @@ subroutine mpas_block_decomp_cells_for_proc(dminfo, partial_global_graph_info, l
end do

call mpas_dmpar_scatter_ints(dminfo, dminfo % nprocs, local_nvertices(dminfo % my_proc_id + 1), &
global_start, local_nvertices, global_list, local_block_list)
global_start, local_nvertices, global_list_ptr, local_block_list)

close(unit=iunit)

Expand All @@ -204,10 +206,10 @@ subroutine mpas_block_decomp_cells_for_proc(dminfo, partial_global_graph_info, l
allocate(local_block_list(local_nvertices(dminfo % my_proc_id + 1)))

call mpas_dmpar_scatter_ints(dminfo, dminfo % nprocs, local_nvertices(dminfo % my_proc_id + 1), &
global_start, local_nvertices, global_list, local_cell_list)
global_start, local_nvertices, global_list_ptr, local_cell_list)

call mpas_dmpar_scatter_ints(dminfo, dminfo % nprocs, local_nvertices(dminfo % my_proc_id + 1), &
global_start, local_nvertices, global_list, local_block_list)
global_start, local_nvertices, global_list_ptr, local_block_list)
end if

if(blocks_per_proc == 0) then
Expand Down