Skip to content

Commit

Permalink
FDS Source: Reduce frequency of MPI call
Browse files Browse the repository at this point in the history
  • Loading branch information
mcgratta committed Aug 16, 2024
1 parent fc820e2 commit ab733ef
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions Source/main.f90
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,7 @@ PROGRAM FDS
CORRECTOR = .FALSE.

! Process externally controlled variables

IF (READ_EXTERNAL) THEN
IF (MY_RANK==0 .AND. T > T_EXTERNAL) THEN
CALL READ_EXTERNAL_FILE(EXTERNAL_FAIL)
Expand All @@ -613,6 +614,7 @@ PROGRAM FDS
IF (HEARTBEAT_FAIL) CALL STOP_CHECK(1)
CALL EXCHANGE_EXTERNAL
ENDIF

! Begin the finite differencing of the PREDICTOR step

COMPUTE_FINITE_DIFFERENCES_1: DO NM=LOWER_MESH_INDEX,UPPER_MESH_INDEX
Expand Down Expand Up @@ -991,15 +993,15 @@ PROGRAM FDS

! Dump a restart file if necessary

CALL MPI_ALLGATHERV(MPI_IN_PLACE,0,MPI_DATATYPE_NULL,RADIATION_COMPLETED(1:NMESHES),&
COUNTS,DISPLS,MPI_LOGICAL,MPI_COMM_WORLD,IERR)

IF ( (T>=RSRT_CLOCK(RSRT_COUNTER(1)) .OR. STOP_STATUS==USER_STOP) .AND. &
(T>=T_END .OR. ALL(RADIATION_COMPLETED) .OR. STOP_STATUS==CTRL_STOP )) THEN
DO NM=LOWER_MESH_INDEX,UPPER_MESH_INDEX
CALL DUMP_RESTART(T,DT,NM)
ENDDO
RSRT_COUNTER(1) = RSRT_COUNTER(1) + 1
IF ( T>=RSRT_CLOCK(RSRT_COUNTER(1)) .OR. STOP_STATUS==USER_STOP) THEN
CALL MPI_ALLGATHERV(MPI_IN_PLACE,0,MPI_DATATYPE_NULL,RADIATION_COMPLETED(1:NMESHES),&
COUNTS,DISPLS,MPI_LOGICAL,MPI_COMM_WORLD,IERR)
IF (T>=T_END .OR. ALL(RADIATION_COMPLETED) .OR. STOP_STATUS==CTRL_STOP) THEN
DO NM=LOWER_MESH_INDEX,UPPER_MESH_INDEX
CALL DUMP_RESTART(T,DT,NM)
ENDDO
RSRT_COUNTER(1) = RSRT_COUNTER(1) + 1
ENDIF
ENDIF

! Check for abnormal run stop
Expand Down

0 comments on commit ab733ef

Please sign in to comment.