use (also) PETSc error trapping

This commit is contained in:
Martin Diehl 2020-11-11 11:46:12 +01:00
parent 9c87142e6d
commit 53110ccf35
1 changed files with 8 additions and 1 deletions

View File

@ -53,7 +53,14 @@ subroutine parallelization_init
call PETScInitializeNoArguments(petsc_err) ! first line in the code according to PETSc manual
CHKERRQ(petsc_err)
call MPI_Comm_rank(PETSC_COMM_WORLD,worldrank,err)
#ifdef DEBUG
call PetscSetFPTrap(PETSC_FP_TRAP_ON,petsc_err)
#else
call PetscSetFPTrap(PETSC_FP_TRAP_OFF,petsc_err)
#endif
CHKERRQ(petsc_err)
call MPI_Comm_rank(PETSC_COMM_WORLD,worldrank,err)
if (err /= 0) error stop 'Could not determine worldrank'
if (worldrank == 0) print'(/,a)', ' <<<+- parallelization init -+>>>'