made PETSc silent by removing -snes_view from default options.
introduced PETSc option for debugging that introduces some debugging options into the petsc options and move PETSc initialization from numerics to DAMASK_spectral_utilities
This commit is contained in:
parent
566b680319
commit
5c0c7121e7
|
@ -13,6 +13,9 @@ module DAMASK_spectral_utilities
|
||||||
pInt
|
pInt
|
||||||
|
|
||||||
implicit none
|
implicit none
|
||||||
|
#ifdef PETSc
|
||||||
|
#include <finclude/petscsys.h>
|
||||||
|
#endif
|
||||||
logical, public :: cutBack =.false. !< cut back of BVP solver in case convergence is not achieved or a material point is terminally ill
|
logical, public :: cutBack =.false. !< cut back of BVP solver in case convergence is not achieved or a material point is terminally ill
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
|
@ -47,7 +50,8 @@ module DAMASK_spectral_utilities
|
||||||
debugDivergence, & !< debugging of divergence calculation (comparison to function used for post processing)
|
debugDivergence, & !< debugging of divergence calculation (comparison to function used for post processing)
|
||||||
debugRestart, & !< debbuging of restart features
|
debugRestart, & !< debbuging of restart features
|
||||||
debugFFTW, & !< doing additional FFT on scalar field and compare to results of strided 3D FFT
|
debugFFTW, & !< doing additional FFT on scalar field and compare to results of strided 3D FFT
|
||||||
debugRotation !< also printing out results in lab frame
|
debugRotation, & !< also printing out results in lab frame
|
||||||
|
debugPETSc !< use some in debug defined options for more verbose PETSc solution
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
! derived types
|
! derived types
|
||||||
|
@ -99,7 +103,8 @@ subroutine utilities_init()
|
||||||
DAMASK_NumThreadsInt, &
|
DAMASK_NumThreadsInt, &
|
||||||
fftw_planner_flag, &
|
fftw_planner_flag, &
|
||||||
fftw_timelimit, &
|
fftw_timelimit, &
|
||||||
memory_efficient
|
memory_efficient, &
|
||||||
|
petsc_options
|
||||||
use debug, only: &
|
use debug, only: &
|
||||||
debug_level, &
|
debug_level, &
|
||||||
debug_spectral, &
|
debug_spectral, &
|
||||||
|
@ -107,6 +112,10 @@ subroutine utilities_init()
|
||||||
debug_spectralDivergence, &
|
debug_spectralDivergence, &
|
||||||
debug_spectralRestart, &
|
debug_spectralRestart, &
|
||||||
debug_spectralFFTW, &
|
debug_spectralFFTW, &
|
||||||
|
#ifdef PETSc
|
||||||
|
debug_spectralPETSc, &
|
||||||
|
PETScDebug, &
|
||||||
|
#endif
|
||||||
debug_spectralRotation
|
debug_spectralRotation
|
||||||
use mesh, only: &
|
use mesh, only: &
|
||||||
res, &
|
res, &
|
||||||
|
@ -115,6 +124,9 @@ subroutine utilities_init()
|
||||||
use math ! must use the whole module for use of FFTW
|
use math ! must use the whole module for use of FFTW
|
||||||
|
|
||||||
implicit none
|
implicit none
|
||||||
|
#ifdef PETSc
|
||||||
|
PetscErrorCode :: ierr
|
||||||
|
#endif
|
||||||
integer(pInt) :: i, j, k
|
integer(pInt) :: i, j, k
|
||||||
integer(pInt), dimension(3) :: k_s
|
integer(pInt), dimension(3) :: k_s
|
||||||
type(C_PTR) :: &
|
type(C_PTR) :: &
|
||||||
|
@ -122,7 +134,6 @@ subroutine utilities_init()
|
||||||
scalarField_realC, & !< field cotaining data for FFTW in real space when debugging FFTW (no in place)
|
scalarField_realC, & !< field cotaining data for FFTW in real space when debugging FFTW (no in place)
|
||||||
scalarField_fourierC, & !< field cotaining data for FFTW in fourier space when debugging FFTW (no in place)
|
scalarField_fourierC, & !< field cotaining data for FFTW in fourier space when debugging FFTW (no in place)
|
||||||
divergence !< field cotaining data for FFTW in real and fourier space when debugging divergence (in place)
|
divergence !< field cotaining data for FFTW in real and fourier space when debugging divergence (in place)
|
||||||
|
|
||||||
write(6,'(/,a)') ' <<<+- DAMASK_spectral_utilities init -+>>>'
|
write(6,'(/,a)') ' <<<+- DAMASK_spectral_utilities init -+>>>'
|
||||||
write(6,'(a)') ' $Id$'
|
write(6,'(a)') ' $Id$'
|
||||||
#include "compilation_info.f90"
|
#include "compilation_info.f90"
|
||||||
|
@ -135,7 +146,17 @@ subroutine utilities_init()
|
||||||
debugRestart = iand(debug_level(debug_spectral),debug_spectralRestart) /= 0
|
debugRestart = iand(debug_level(debug_spectral),debug_spectralRestart) /= 0
|
||||||
debugFFTW = iand(debug_level(debug_spectral),debug_spectralFFTW) /= 0
|
debugFFTW = iand(debug_level(debug_spectral),debug_spectralFFTW) /= 0
|
||||||
debugRotation = iand(debug_level(debug_spectral),debug_spectralRotation) /= 0
|
debugRotation = iand(debug_level(debug_spectral),debug_spectralRotation) /= 0
|
||||||
|
#ifdef PETSc
|
||||||
|
debugPETSc = iand(debug_level(debug_spectral),debug_spectralPETSc) /= 0
|
||||||
|
if(debugPETSc) write(6,'(a)') ' Initializing PETSc with debug options: ', trim(PETScDebug), &
|
||||||
|
' add more using the PETSc_Options keyword in numerics.config '
|
||||||
|
call PetscOptionsClear(ierr)
|
||||||
|
CHKERRQ(ierr)
|
||||||
|
if(debugPETSc) call PetscOptionsInsertString(trim(PETScDebug),ierr)
|
||||||
|
CHKERRQ(ierr)
|
||||||
|
call PetscOptionsInsertString(trim(petsc_options),ierr)
|
||||||
|
CHKERRQ(ierr)
|
||||||
|
#endif
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
! allocation
|
! allocation
|
||||||
allocate (xi(3,res1_red,res(2),res(3)),source = 0.0_pReal) ! frequencies, only half the size for first dimension
|
allocate (xi(3,res1_red,res(2),res(3)),source = 0.0_pReal) ! frequencies, only half the size for first dimension
|
||||||
|
|
|
@ -16,7 +16,7 @@ constitutive # constitutive_*.f90 possible values: ba
|
||||||
crystallite # crystallite.f90 possible values: basic, extensive, selective
|
crystallite # crystallite.f90 possible values: basic, extensive, selective
|
||||||
homogenization # homogenization_*.f90 possible values: basic, extensive, selective
|
homogenization # homogenization_*.f90 possible values: basic, extensive, selective
|
||||||
CPFEM # CPFEM.f90 possible values: basic, extensive, selective
|
CPFEM # CPFEM.f90 possible values: basic, extensive, selective
|
||||||
spectral # DAMASK_spectral.f90 possible values: basic, fft, restart, divergence
|
spectral # DAMASK_spectral.f90 possible values: basic, fft, restart, divergence, rotation, petsc
|
||||||
abaqus # ABAQUS FEM solver possible values: basic
|
abaqus # ABAQUS FEM solver possible values: basic
|
||||||
#
|
#
|
||||||
# Parameters for selective
|
# Parameters for selective
|
||||||
|
|
|
@ -44,7 +44,8 @@ module debug
|
||||||
debug_spectralRestart = debug_maxGeneral*2_pInt**1_pInt, &
|
debug_spectralRestart = debug_maxGeneral*2_pInt**1_pInt, &
|
||||||
debug_spectralFFTW = debug_maxGeneral*2_pInt**2_pInt, &
|
debug_spectralFFTW = debug_maxGeneral*2_pInt**2_pInt, &
|
||||||
debug_spectralDivergence = debug_maxGeneral*2_pInt**3_pInt, &
|
debug_spectralDivergence = debug_maxGeneral*2_pInt**3_pInt, &
|
||||||
debug_spectralRotation = debug_maxGeneral*2_pInt**4_pInt
|
debug_spectralRotation = debug_maxGeneral*2_pInt**4_pInt, &
|
||||||
|
debug_spectralPETSc = debug_maxGeneral*2_pInt**5_pInt
|
||||||
|
|
||||||
integer(pInt), parameter, public :: &
|
integer(pInt), parameter, public :: &
|
||||||
debug_debug = 1_pInt, &
|
debug_debug = 1_pInt, &
|
||||||
|
@ -104,6 +105,10 @@ module debug
|
||||||
character(len=64), parameter, private :: &
|
character(len=64), parameter, private :: &
|
||||||
debug_configFile = 'debug.config' ! name of configuration file
|
debug_configFile = 'debug.config' ! name of configuration file
|
||||||
|
|
||||||
|
#ifdef PETSc
|
||||||
|
character(len=1024), parameter, public :: &
|
||||||
|
PETScDebug = ' -snes_view -snes_monitor'
|
||||||
|
#endif
|
||||||
public :: debug_init, &
|
public :: debug_init, &
|
||||||
debug_reset, &
|
debug_reset, &
|
||||||
debug_info
|
debug_info
|
||||||
|
@ -139,7 +144,6 @@ subroutine debug_init
|
||||||
integer(pInt), dimension(1+2*maxNchunks) :: positions
|
integer(pInt), dimension(1+2*maxNchunks) :: positions
|
||||||
character(len=64) :: tag
|
character(len=64) :: tag
|
||||||
character(len=1024) :: line
|
character(len=1024) :: line
|
||||||
|
|
||||||
!$OMP CRITICAL (write2out)
|
!$OMP CRITICAL (write2out)
|
||||||
write(6,*)
|
write(6,*)
|
||||||
write(6,*) '<<<+- debug init -+>>>'
|
write(6,*) '<<<+- debug init -+>>>'
|
||||||
|
@ -235,6 +239,8 @@ subroutine debug_init
|
||||||
debug_level(what) = ior(debug_level(what), debug_spectralDivergence)
|
debug_level(what) = ior(debug_level(what), debug_spectralDivergence)
|
||||||
case('rotation')
|
case('rotation')
|
||||||
debug_level(what) = ior(debug_level(what), debug_spectralRotation)
|
debug_level(what) = ior(debug_level(what), debug_spectralRotation)
|
||||||
|
case('petsc')
|
||||||
|
debug_level(what) = ior(debug_level(what), debug_spectralPETSc)
|
||||||
end select
|
end select
|
||||||
enddo
|
enddo
|
||||||
endif
|
endif
|
||||||
|
@ -310,6 +316,7 @@ subroutine debug_init
|
||||||
if(iand(debug_level(i),debug_spectralFFTW) /= 0) write(6,'(a)') ' FFTW'
|
if(iand(debug_level(i),debug_spectralFFTW) /= 0) write(6,'(a)') ' FFTW'
|
||||||
if(iand(debug_level(i),debug_spectralDivergence)/= 0) write(6,'(a)') ' divergence'
|
if(iand(debug_level(i),debug_spectralDivergence)/= 0) write(6,'(a)') ' divergence'
|
||||||
if(iand(debug_level(i),debug_spectralRotation) /= 0) write(6,'(a)') ' rotation'
|
if(iand(debug_level(i),debug_spectralRotation) /= 0) write(6,'(a)') ' rotation'
|
||||||
|
if(iand(debug_level(i),debug_spectralPETSc) /= 0) write(6,'(a)') ' PETSc'
|
||||||
!$OMP END CRITICAL (write2out)
|
!$OMP END CRITICAL (write2out)
|
||||||
endif
|
endif
|
||||||
enddo
|
enddo
|
||||||
|
|
|
@ -25,9 +25,6 @@ module numerics
|
||||||
use prec, only: pInt, pReal
|
use prec, only: pInt, pReal
|
||||||
|
|
||||||
implicit none
|
implicit none
|
||||||
#ifdef PETSc
|
|
||||||
#include <finclude/petscsys.h>
|
|
||||||
#endif
|
|
||||||
character(len=64), parameter, private :: &
|
character(len=64), parameter, private :: &
|
||||||
numerics_configFile = 'numerics.config' !< name of configuration file
|
numerics_configFile = 'numerics.config' !< name of configuration file
|
||||||
|
|
||||||
|
@ -98,7 +95,8 @@ character(len=64), protected, public :: &
|
||||||
myspectralsolver = 'basic' , & !< spectral solution method
|
myspectralsolver = 'basic' , & !< spectral solution method
|
||||||
myfilter = 'none' !< spectral filtering method
|
myfilter = 'none' !< spectral filtering method
|
||||||
character(len=1024), protected, public :: &
|
character(len=1024), protected, public :: &
|
||||||
petsc_options = '-snes_type ngmres -snes_ngmres_anderson -snes_view'
|
petsc_options = '-snes_type ngmres &
|
||||||
|
-snes_ngmres_anderson '
|
||||||
integer(pInt), protected, public :: &
|
integer(pInt), protected, public :: &
|
||||||
fftw_planner_flag = 32_pInt, & !< conversion of fftw_plan_mode to integer, basically what is usually done in the include file of fftw
|
fftw_planner_flag = 32_pInt, & !< conversion of fftw_plan_mode to integer, basically what is usually done in the include file of fftw
|
||||||
itmax = 20_pInt, & !< maximum number of iterations
|
itmax = 20_pInt, & !< maximum number of iterations
|
||||||
|
@ -122,7 +120,8 @@ contains
|
||||||
subroutine numerics_init
|
subroutine numerics_init
|
||||||
|
|
||||||
use, intrinsic :: iso_fortran_env ! to get compiler_version and compiler_options (at least for gfortran 4.6 at the moment)
|
use, intrinsic :: iso_fortran_env ! to get compiler_version and compiler_options (at least for gfortran 4.6 at the moment)
|
||||||
use IO, only: IO_error, &
|
use IO, only: &
|
||||||
|
IO_error, &
|
||||||
IO_open_file_stat, &
|
IO_open_file_stat, &
|
||||||
IO_isBlank, &
|
IO_isBlank, &
|
||||||
IO_stringPos, &
|
IO_stringPos, &
|
||||||
|
@ -131,15 +130,13 @@ subroutine numerics_init
|
||||||
IO_floatValue, &
|
IO_floatValue, &
|
||||||
IO_intValue, &
|
IO_intValue, &
|
||||||
IO_warning
|
IO_warning
|
||||||
|
|
||||||
#ifndef Marc
|
#ifndef Marc
|
||||||
!$ use OMP_LIB, only: omp_set_num_threads ! Use the standard conforming module file for omp if not using MSC.Marc
|
!$ use OMP_LIB, only: omp_set_num_threads ! Use the standard conforming module file for omp if not using MSC.Marc
|
||||||
#endif
|
#endif
|
||||||
implicit none
|
implicit none
|
||||||
#ifdef Marc
|
#ifdef Marc
|
||||||
!$ include "omp_lib.h" ! use the non F90 standard include file to prevent crashes with some versions of MSC.Marc
|
!$ include "omp_lib.h" ! use the non F90 standard include file to prevent crashes with some versions of MSC.Marc
|
||||||
#endif
|
|
||||||
#ifdef PETSc
|
|
||||||
PetscErrorCode :: ierr
|
|
||||||
#endif
|
#endif
|
||||||
integer(pInt), parameter :: fileunit = 300_pInt ,&
|
integer(pInt), parameter :: fileunit = 300_pInt ,&
|
||||||
maxNchunks = 2_pInt
|
maxNchunks = 2_pInt
|
||||||
|
@ -338,13 +335,6 @@ subroutine numerics_init
|
||||||
fftw_planner_flag = 32_pInt
|
fftw_planner_flag = 32_pInt
|
||||||
end select
|
end select
|
||||||
#endif
|
#endif
|
||||||
#ifdef PETSc
|
|
||||||
write(6,'(a)') ' Initializing PETSc'
|
|
||||||
call PetscOptionsClear(ierr)
|
|
||||||
CHKERRQ(ierr)
|
|
||||||
call PetscOptionsInsertString(petsc_options,ierr)
|
|
||||||
CHKERRQ(ierr)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
numerics_timeSyncing = numerics_timeSyncing .and. all(numerics_integrator==2_pInt) ! timeSyncing only allowed for explicit Euler integrator
|
numerics_timeSyncing = numerics_timeSyncing .and. all(numerics_integrator==2_pInt) ! timeSyncing only allowed for explicit Euler integrator
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue