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,6 +53,13 @@ subroutine parallelization_init
call PETScInitializeNoArguments(petsc_err) ! first line in the code according to PETSc manual call PETScInitializeNoArguments(petsc_err) ! first line in the code according to PETSc manual
CHKERRQ(petsc_err) CHKERRQ(petsc_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) call MPI_Comm_rank(PETSC_COMM_WORLD,worldrank,err)
if (err /= 0) error stop 'Could not determine worldrank' if (err /= 0) error stop 'Could not determine worldrank'