Merge remote-tracking branch 'origin/development' into re-fit-phenopowerlaw

This commit is contained in:
Martin Diehl 2023-01-23 21:57:32 +01:00
commit 532ec2d26f
3 changed files with 20 additions and 19 deletions

View File

@ -1 +1 @@
3.0.0-alpha7-316-g8a7655a9e 3.0.0-alpha7-326-g510f59b4b

View File

@ -65,10 +65,12 @@ subroutine parallelization_init()
PetscErrorCode :: err_PETSc PetscErrorCode :: err_PETSc
#ifdef _OPENMP #ifdef _OPENMP
! If openMP is enabled, check if the MPI libary supports it and initialize accordingly. ! If openMP is enabled, check if the MPI libary supports it and initialize accordingly.
! Otherwise, the first call to PETSc will do the initialization.
call MPI_Init_Thread(MPI_THREAD_FUNNELED,threadLevel,err_MPI) call MPI_Init_Thread(MPI_THREAD_FUNNELED,threadLevel,err_MPI)
if (err_MPI /= 0_MPI_INTEGER_KIND) error stop 'MPI init failed' if (err_MPI /= 0_MPI_INTEGER_KIND) error stop 'MPI init failed'
if (threadLevel<MPI_THREAD_FUNNELED) error stop 'MPI library does not support OpenMP' if (threadLevel<MPI_THREAD_FUNNELED) error stop 'MPI library does not support OpenMP'
#else
call MPI_Init(err_MPI)
if (err_MPI /= 0_MPI_INTEGER_KIND) error stop 'MPI init failed'
#endif #endif
#if defined(DEBUG) #if defined(DEBUG)

View File

@ -5,6 +5,7 @@
!> everything is fine. Exit code 1 signals an error, message according to IO_error. !> everything is fine. Exit code 1 signals an error, message according to IO_error.
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine quit(stop_id) subroutine quit(stop_id)
use, intrinsic :: ISO_fortran_env, only: ERROR_UNIT
#include <petsc/finclude/petscsys.h> #include <petsc/finclude/petscsys.h>
use PETScSys use PETScSys
#if (PETSC_VERSION_MAJOR==3 && PETSC_VERSION_MINOR>14) && !defined(PETSC_HAVE_MPI_F90MODULE_VISIBILITY) #if (PETSC_VERSION_MAJOR==3 && PETSC_VERSION_MINOR>14) && !defined(PETSC_HAVE_MPI_F90MODULE_VISIBILITY)
@ -22,23 +23,16 @@ subroutine quit(stop_id)
integer, dimension(8) :: dateAndTime integer, dimension(8) :: dateAndTime
integer :: err_HDF5 integer :: err_HDF5
integer(MPI_INTEGER_KIND) :: err_MPI integer(MPI_INTEGER_KIND) :: err_MPI, worldsize
PetscErrorCode :: err_PETSc PetscErrorCode :: err_PETSc
call h5open_f(err_HDF5)
if (err_HDF5 /= 0_MPI_INTEGER_KIND) write(6,'(a,i5)') ' Error in h5open_f ',err_HDF5 ! prevents error if not opened yet call h5open_f(err_HDF5) ! prevents error if not opened yet
if (err_HDF5 /= 0) write(ERROR_UNIT,'(a,i5)') ' Error in h5open_f ',err_HDF5
call h5close_f(err_HDF5) call h5close_f(err_HDF5)
if (err_HDF5 /= 0_MPI_INTEGER_KIND) write(6,'(a,i5)') ' Error in h5close_f ',err_HDF5 if (err_HDF5 /= 0) write(ERROR_UNIT,'(a,i5)') ' Error in h5close_f ',err_HDF5
call PetscFinalize(err_PETSc) call PetscFinalize(err_PETSc)
CHKERRQ(err_PETSc)
#ifdef _OPENMP
call MPI_finalize(err_MPI)
if (err_MPI /= 0_MPI_INTEGER_KIND) write(6,'(a,i5)') ' Error in MPI_finalize',err_MPI
#else
err_MPI = 0_MPI_INTEGER_KIND
#endif
call date_and_time(values = dateAndTime) call date_and_time(values = dateAndTime)
write(6,'(/,a)') ' DAMASK terminated on:' write(6,'(/,a)') ' DAMASK terminated on:'
@ -49,10 +43,15 @@ subroutine quit(stop_id)
dateAndTime(6),':',& dateAndTime(6),':',&
dateAndTime(7) dateAndTime(7)
if (stop_id == 0 .and. & if (stop_id == 0 .and. err_HDF5 == 0 .and. err_PETSC == 0) then
err_HDF5 == 0 .and. & call MPI_Finalize(err_MPI)
err_MPI == 0_MPI_INTEGER_KIND .and. & if (err_MPI /= 0_MPI_INTEGER_KIND) error stop 'MPI_Finalize error'
err_PETSC == 0) stop 0 ! normal termination stop 0 ! normal termination
stop 1 ! error (message from IO_error) else
call MPI_Comm_size(MPI_COMM_WORLD,worldsize,err_MPI)
if (err_MPI /= 0_MPI_INTEGER_KIND) error stop 'MPI_Comm error'
if (stop_id /= 0 .and. worldsize > 1) call MPI_Abort(MPI_COMM_WORLD,1,err_MPI)
stop 1 ! error (message from IO_error)
endif
end subroutine quit end subroutine quit