mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-29 06:35:48 -04:00
moved cmfd communicator to be able to deallocate it
This commit is contained in:
parent
1d6a85394e
commit
434f2097c5
3 changed files with 9 additions and 8 deletions
|
|
@ -20,9 +20,6 @@ contains
|
|||
|
||||
use cmfd_header, only: allocate_cmfd
|
||||
|
||||
#ifdef PETSC
|
||||
integer :: new_comm ! new mpi communicator
|
||||
#endif
|
||||
integer :: color ! color group of processor
|
||||
|
||||
! Read in cmfd input file
|
||||
|
|
@ -37,12 +34,10 @@ contains
|
|||
|
||||
! Split up procs
|
||||
#ifdef PETSC
|
||||
call MPI_COMM_SPLIT(MPI_COMM_WORLD, color, 0, new_comm, mpi_err)
|
||||
#endif
|
||||
call MPI_COMM_SPLIT(MPI_COMM_WORLD, color, 0, cmfd_comm, mpi_err)
|
||||
|
||||
! assign to PETSc
|
||||
#ifdef PETSC
|
||||
PETSC_COMM_WORLD = new_comm
|
||||
PETSC_COMM_WORLD = cmfd_comm
|
||||
|
||||
! Initialize PETSc on all procs
|
||||
call PetscInitialize(PETSC_NULL_CHARACTER, mpi_err)
|
||||
|
|
|
|||
|
|
@ -40,7 +40,10 @@ contains
|
|||
|
||||
#ifdef PETSC
|
||||
! Finalize PETSc
|
||||
if (cmfd_run) call PetscFinalize(mpi_err)
|
||||
if (cmfd_run) then
|
||||
call PetscFinalize(mpi_err)
|
||||
call MPI_COMM_FREE(cmfd_comm, mpi_err)
|
||||
end if
|
||||
#endif
|
||||
|
||||
! Stop timers and show timing statistics
|
||||
|
|
|
|||
|
|
@ -303,6 +303,9 @@ module global
|
|||
|
||||
! Is CMFD active
|
||||
logical :: cmfd_run = .false.
|
||||
|
||||
! CMFD communicator
|
||||
integer :: cmfd_comm
|
||||
|
||||
! Timing objects
|
||||
type(Timer) :: time_cmfd ! timer for whole cmfd calculation
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue