Fortran:
:::fortran
subroutine PMTM_finalize(err_code)
Finalises all PMTM instances, writing any remaining timers to the output files before closing them and destroying all global state. Upon successful completion of this routine PMTM will be left in a state where it can be reinitialised with PMTM_init.
Notes This must be called before MPI_FINALIZE.
:::fortran
integer, intent(out)::err_code
Will be set to PMTM_SUCCESS if the call was successful and the appropriate error code if not.
Notes: OpenMP PMTM_finalize should be called outside of a parallel section or if inside by one thread only. All usage of PMTM facilities should have ceased in all threads prior to the call. A synchronisation mechanism should be applied to ensure this if it cannot be guaranteed any other way.
C:
:::C
PMTM_error_t PMTM_finalize()