Skip to content

Commit

Permalink
FDS Source: Issue firemodels#12074. Fix bug related to single process…
Browse files Browse the repository at this point in the history
… HT3D calcs
  • Loading branch information
mcgratta committed Sep 7, 2023
1 parent 3ac877f commit a9dac8f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 19 deletions.
10 changes: 9 additions & 1 deletion Source/init.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1305,6 +1305,10 @@ SUBROUTINE INITIALIZE_MESH_VARIABLES_2(NM)

DO NOM=1,NMESHES
OS => MESHES(NM)%OMESH(NOM)%WALL_RECV_BUFFER
IF (PROCESS(NM)==PROCESS(NOM)) THEN
OS%N_ITEMS = MESHES(NOM)%N_WALL_CELLS
CYCLE
ENDIF
WSCS = WALL_SAVE(NOM)%START
WSC = WALL_SAVE(NOM)%COUNTER
OS%N_ITEMS = MAX(0,WSC-WSCS+1)
Expand Down Expand Up @@ -1412,9 +1416,13 @@ SUBROUTINE INITIALIZE_MESH_VARIABLES_2(NM)
ENDDO

DO NOM=1,NMESHES
OS => MESHES(NM)%OMESH(NOM)%THIN_WALL_RECV_BUFFER
IF (PROCESS(NM)==PROCESS(NOM)) THEN
OS%N_ITEMS = MESHES(NOM)%N_THIN_WALL_CELLS
CYCLE
ENDIF
WSCS = THIN_WALL_SAVE(NOM)%START
WSC = THIN_WALL_SAVE(NOM)%COUNTER
OS => MESHES(NM)%OMESH(NOM)%THIN_WALL_RECV_BUFFER
OS%N_ITEMS = MAX(0,WSC-WSCS+1)
OS%START_INDEX = THIN_WALL_SAVE(NOM)%START
IF (WSC==0) CYCLE
Expand Down
25 changes: 7 additions & 18 deletions Source/main.f90
Original file line number Diff line number Diff line change
Expand Up @@ -2135,6 +2135,7 @@ SUBROUTINE INITIALIZE_BACK_WALL_EXCHANGE

DO NM=LOWER_MESH_INDEX,UPPER_MESH_INDEX
DO NOM=1,NMESHES
IF (PROCESS(NM)==PROCESS(NOM)) CYCLE
OS => MESHES(NM)%OMESH(NOM)%WALL_SEND_BUFFER
IF (OS%N_ITEMS>0) ALLOCATE(OS%ITEM_INDEX(OS%N_ITEMS))
IF (OS%N_ITEMS>0) ALLOCATE(OS%SURF_INDEX(OS%N_ITEMS))
Expand Down Expand Up @@ -2930,27 +2931,15 @@ SUBROUTINE MESH_EXCHANGE(CODE)
ENDIF

OS => M3%WALL_RECV_BUFFER
IF (CODE==9 .AND. OS%N_ITEMS>0) THEN
IF (RNODE/=SNODE) THEN
N_REQ=N_REQ+1 ; CALL MPI_ISEND(OS%ITEM_INDEX,SIZE(OS%ITEM_INDEX),MPI_INTEGER,RNODE,NM,MPI_COMM_WORLD,REQ(N_REQ),IERR)
N_REQ=N_REQ+1 ; CALL MPI_ISEND(OS%SURF_INDEX,SIZE(OS%SURF_INDEX),MPI_INTEGER,RNODE,NM,MPI_COMM_WORLD,REQ(N_REQ),IERR)
ELSE
OS2=>MESHES(NOM)%OMESH(NM)%WALL_SEND_BUFFER
OS2%ITEM_INDEX = OS%ITEM_INDEX
OS2%SURF_INDEX = OS%SURF_INDEX
ENDIF
IF (CODE==9 .AND. OS%N_ITEMS>0 .AND. RNODE/=SNODE) THEN
N_REQ=N_REQ+1 ; CALL MPI_ISEND(OS%ITEM_INDEX,SIZE(OS%ITEM_INDEX),MPI_INTEGER,RNODE,NM,MPI_COMM_WORLD,REQ(N_REQ),IERR)
N_REQ=N_REQ+1 ; CALL MPI_ISEND(OS%SURF_INDEX,SIZE(OS%SURF_INDEX),MPI_INTEGER,RNODE,NM,MPI_COMM_WORLD,REQ(N_REQ),IERR)
ENDIF

OS => M3%THIN_WALL_RECV_BUFFER
IF (CODE==9 .AND. OS%N_ITEMS>0) THEN
IF (RNODE/=SNODE) THEN
N_REQ=N_REQ+1 ; CALL MPI_ISEND(OS%ITEM_INDEX,SIZE(OS%ITEM_INDEX),MPI_INTEGER,RNODE,NM,MPI_COMM_WORLD,REQ(N_REQ),IERR)
N_REQ=N_REQ+1 ; CALL MPI_ISEND(OS%SURF_INDEX,SIZE(OS%SURF_INDEX),MPI_INTEGER,RNODE,NM,MPI_COMM_WORLD,REQ(N_REQ),IERR)
ELSE
OS2=>MESHES(NOM)%OMESH(NM)%THIN_WALL_SEND_BUFFER
OS2%ITEM_INDEX = OS%ITEM_INDEX
OS2%SURF_INDEX = OS%SURF_INDEX
ENDIF
IF (CODE==9 .AND. OS%N_ITEMS>0 .AND. RNODE/=SNODE) THEN
N_REQ=N_REQ+1 ; CALL MPI_ISEND(OS%ITEM_INDEX,SIZE(OS%ITEM_INDEX),MPI_INTEGER,RNODE,NM,MPI_COMM_WORLD,REQ(N_REQ),IERR)
N_REQ=N_REQ+1 ; CALL MPI_ISEND(OS%SURF_INDEX,SIZE(OS%SURF_INDEX),MPI_INTEGER,RNODE,NM,MPI_COMM_WORLD,REQ(N_REQ),IERR)
ENDIF

OS => M3%WALL_SEND_BUFFER
Expand Down

0 comments on commit a9dac8f

Please sign in to comment.