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:
Martin Diehl 2012-12-15 18:07:49 +00:00
parent 566b680319
commit 5c0c7121e7
4 changed files with 50 additions and 32 deletions

View File

@ -13,6 +13,9 @@ module DAMASK_spectral_utilities
pInt
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
!--------------------------------------------------------------------------------------------------
@ -47,7 +50,8 @@ module DAMASK_spectral_utilities
debugDivergence, & !< debugging of divergence calculation (comparison to function used for post processing)
debugRestart, & !< debbuging of restart features
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
@ -99,7 +103,8 @@ subroutine utilities_init()
DAMASK_NumThreadsInt, &
fftw_planner_flag, &
fftw_timelimit, &
memory_efficient
memory_efficient, &
petsc_options
use debug, only: &
debug_level, &
debug_spectral, &
@ -107,14 +112,21 @@ subroutine utilities_init()
debug_spectralDivergence, &
debug_spectralRestart, &
debug_spectralFFTW, &
#ifdef PETSc
debug_spectralPETSc, &
PETScDebug, &
#endif
debug_spectralRotation
use mesh, only: &
res, &
res1_red, &
virt_dim
use math ! must use the whole module for use of FFTW
implicit none
#ifdef PETSc
PetscErrorCode :: ierr
#endif
integer(pInt) :: i, j, k
integer(pInt), dimension(3) :: k_s
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_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)
write(6,'(/,a)') ' <<<+- DAMASK_spectral_utilities init -+>>>'
write(6,'(a)') ' $Id$'
#include "compilation_info.f90"
@ -135,7 +146,17 @@ subroutine utilities_init()
debugRestart = iand(debug_level(debug_spectral),debug_spectralRestart) /= 0
debugFFTW = iand(debug_level(debug_spectral),debug_spectralFFTW) /= 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
allocate (xi(3,res1_red,res(2),res(3)),source = 0.0_pReal) ! frequencies, only half the size for first dimension

View File

@ -16,10 +16,10 @@ constitutive # constitutive_*.f90 possible values: ba
crystallite # crystallite.f90 possible values: basic, extensive, selective
homogenization # homogenization_*.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
#
# Parameters for selective
element 1 # selected element for debugging (synonymous: "el", "e")
ip 1 # selected integration point for debugging (synonymous: "integrationpoint", "i")
grain 1 # selected grain at ip for debugging (synonymous: "gr", "g")
grain 1 # selected grain at ip for debugging (synonymous: "gr", "g")

View File

@ -44,7 +44,8 @@ module debug
debug_spectralRestart = debug_maxGeneral*2_pInt**1_pInt, &
debug_spectralFFTW = debug_maxGeneral*2_pInt**2_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 :: &
debug_debug = 1_pInt, &
@ -104,6 +105,10 @@ module debug
character(len=64), parameter, private :: &
debug_configFile = 'debug.config' ! name of configuration file
#ifdef PETSc
character(len=1024), parameter, public :: &
PETScDebug = ' -snes_view -snes_monitor'
#endif
public :: debug_init, &
debug_reset, &
debug_info
@ -139,7 +144,6 @@ subroutine debug_init
integer(pInt), dimension(1+2*maxNchunks) :: positions
character(len=64) :: tag
character(len=1024) :: line
!$OMP CRITICAL (write2out)
write(6,*)
write(6,*) '<<<+- debug init -+>>>'
@ -235,6 +239,8 @@ subroutine debug_init
debug_level(what) = ior(debug_level(what), debug_spectralDivergence)
case('rotation')
debug_level(what) = ior(debug_level(what), debug_spectralRotation)
case('petsc')
debug_level(what) = ior(debug_level(what), debug_spectralPETSc)
end select
enddo
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_spectralDivergence)/= 0) write(6,'(a)') ' divergence'
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)
endif
enddo

View File

@ -25,9 +25,6 @@ module numerics
use prec, only: pInt, pReal
implicit none
#ifdef PETSc
#include <finclude/petscsys.h>
#endif
character(len=64), parameter, private :: &
numerics_configFile = 'numerics.config' !< name of configuration file
@ -98,7 +95,8 @@ character(len=64), protected, public :: &
myspectralsolver = 'basic' , & !< spectral solution method
myfilter = 'none' !< spectral filtering method
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 :: &
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
@ -122,24 +120,23 @@ contains
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 IO, only: IO_error, &
IO_open_file_stat, &
IO_isBlank, &
IO_stringPos, &
IO_stringValue, &
IO_lc, &
IO_floatValue, &
IO_intValue, &
IO_warning
use IO, only: &
IO_error, &
IO_open_file_stat, &
IO_isBlank, &
IO_stringPos, &
IO_stringValue, &
IO_lc, &
IO_floatValue, &
IO_intValue, &
IO_warning
#ifndef Marc
!$ use OMP_LIB, only: omp_set_num_threads ! Use the standard conforming module file for omp if not using MSC.Marc
#endif
implicit none
#ifdef 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
integer(pInt), parameter :: fileunit = 300_pInt ,&
maxNchunks = 2_pInt
@ -338,13 +335,6 @@ subroutine numerics_init
fftw_planner_flag = 32_pInt
end select
#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