comm_env_finalize Subroutine

public subroutine comm_env_finalize()

Finalise MPI. No-op if the comm-env was never initialised, so it is safe to call unconditionally at program exit – the shared per-test main does this for the few tests that init MPI, and it costs nothing for the rest (and on serial builds via the stub).

Arguments

None

Calls

proc~~comm_env_finalize~~CallsGraph proc~comm_env_finalize comm_env_finalize finalize finalize proc~comm_env_finalize->finalize pic_mpi_finalize pic_mpi_finalize proc~comm_env_finalize->pic_mpi_finalize

Source Code

   subroutine comm_env_finalize()
      !! Finalise MPI.  No-op if the comm-env was never initialised, so it
      !! is safe to call unconditionally at program exit -- the shared
      !! per-test main does this for the few tests that init MPI, and it
      !! costs nothing for the rest (and on serial builds via the stub).
      if (.not. env_initialised) return
      if (allocated(cached_node_compute_ranks)) deallocate (cached_node_compute_ranks)
      call comm_global%finalize()
      call pic_mpi_finalize()
      env_initialised = .false.
   end subroutine comm_env_finalize