Unverified Commit aae3ce8f authored by Graham, Aaron's avatar Graham, Aaron Committed by GitHub
Browse files

Exception handler surrogates (#331)

* Create addExceptionHandlerSurrogates in FutilityComputingEnvironment

This allows a client code to easily add its own exception handler as
a surrogate to all Futility exception handlers in a single call

* Fix a couple mistakes

* Fix reference to eXDMF when HDF5 is not enabled

* If at first you don't succeed...
parent e52b46e0
......@@ -76,6 +76,7 @@ TRIBITS_ADD_LIBRARY(Utils
VTUFiles.f90
IOutil.f90
ParameterLists.f90
XDMFMesh.f90
CommandLineProcessor.f90
MatrixTypes_Base.f90
MatrixTypes_Native.f90
......@@ -94,18 +95,17 @@ TRIBITS_ADD_LIBRARY(Utils
MultigridMesh.f90
EigenvalueSolverTypes.f90
ODESolverTypes.f90
NonLinearSolver.f90
SolutionAcceleration.f90
AndersonAcceleration.f90
StochasticSampling.f90
Sorting.f90
MeshTransfer.f90
ArrayUtils.f90
PartitionGraph.f90
FutilityComputingEnvironment.f90
SchemaParser.f90
SpeciesElements.f90
XDMFMesh.f90
FutilityComputingEnvironment.f90
NonLinearSolver.f90
SolutionAcceleration.f90
AndersonAcceleration.f90
DEPLIBS
CUtils
TrilinosUtils
......
......@@ -63,7 +63,6 @@
MODULE FileType_DA32
USE ISO_FORTRAN_ENV
USE IntrType
USE ExceptionHandler
USE IO_Strings
USE FileType_Fortran
......
......@@ -30,6 +30,7 @@ IMPLICIT NONE
PRIVATE
PUBLIC :: FutilityComputingEnvironment
PUBLIC :: addExceptionHandlerSurrogates
!> This type bundles together objects that are commonly needed throughout
!> all parts of the calling code. It is intended that each package would
......@@ -381,4 +382,51 @@ RECURSIVE SUBROUTINE clearSubCompEnvs(this)
ENDSUBROUTINE clearSubCompEnvs
!
!-------------------------------------------------------------------------------
!> @brief Adds exception handler as surrogate to all lower level Futility handlers
!> @param ce the exception handler to use as a surrogate
!>
SUBROUTINE addExceptionHandlerSurrogates(ce)
USE Allocs, ONLY : eAllocs
USE EigenvalueSolverTypes, ONLY : eEigenvalueSolverType
USE ElementsIsotopes, ONLY : eElementsIsotopes
USE ExpTables, ONLY : eExpTable
USE FMU_Wrapper, ONLY : eFMU_Wrapper
USE IAPWSWaterPropertiesModule, ONLY : eWaterProp
USE LinearSolverTypes, ONLY : eLinearSolverType
USE MatrixTypes, ONLY : eMatrixType
USE ODESolverTypes, ONLY : eODESolverType
USE ParameterLists, ONLY : eParams
USE PartitionGraph, ONLY : ePartitionGraph
USE PreconditionerTypes, ONLY : ePreCondType
USE SchemaParserModule, ONLY : eSchemaParser
USE StochasticSampling, ONLY : eStochasticSampler
USE VectorTypes, ONLY : eVectorType
USE VTKFiles, ONLY : eVTK
USE XDMFMesh, ONLY : eXDMF
USE MeshTransfer, ONLY : eMeshTransfer
TYPE(ExceptionHandlerType),TARGET,INTENT(IN) :: ce
CALL eAllocs%addSurrogate(ce)
CALL eEigenvalueSolverType%addSurrogate(ce)
CALL eElementsIsotopes%addSurrogate(ce)
CALL eMeshTransfer%addSurrogate(ce)
CALL eExpTable%addSurrogate(ce)
CALL eFMU_Wrapper%addSurrogate(ce)
CALL eWaterProp%addSurrogate(ce)
CALL eLinearSolverType%addSurrogate(ce)
CALL eMatrixType%addSurrogate(ce)
CALL eODESolverType%addSurrogate(ce)
CALL eParEnv%addSurrogate(ce)
CALL eParams%addSurrogate(ce)
CALL ePartitionGraph%addSurrogate(ce)
CALL ePreCondType%addSurrogate(ce)
CALL eSchemaParser%addSurrogate(ce)
CALL eStochasticSampler%addSurrogate(ce)
CALL eVectorType%addSurrogate(ce)
CALL eVTK%addSurrogate(ce)
CALL eXDMF%addSurrogate(ce)
ENDSUBROUTINE addExceptionHandlerSurrogates
!
ENDMODULE FutilityComputingEnvironmentModule
\ No newline at end of file
......@@ -34,7 +34,6 @@
!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
MODULE LinearSolverTypes_Multigrid
USE IntrType
USE ExceptionHandler
USE ParameterLists
USE VectorTypes
USE MatrixTypes
......
......@@ -68,7 +68,6 @@
!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
MODULE MatrixTypes
USE IntrType
USE ExceptionHandler
USE Allocs
USE BLAS2, ONLY: BLAS2_matvec => BLAS_matvec
USE BLAS3, ONLY: BLAS3_matmult => BLAS_matmat
......
......@@ -12,7 +12,6 @@ MODULE MatrixTypes_Native
#include "Futility_DBC.h"
USE Futility_DBC
USE IntrType
USE ExceptionHandler
USE ParameterLists
USE Allocs
USE MatrixTypes_Base
......
......@@ -12,7 +12,6 @@ MODULE MatrixTypes_PETSc
#include "Futility_DBC.h"
USE Futility_DBC
USE IntrType
USE ExceptionHandler
USE ParameterLists
USE MatrixTypes_Base
USE BLAS2, ONLY: BLAS2_matvec => BLAS_matvec
......
......@@ -12,7 +12,6 @@ MODULE MatrixTypes_Trilinos
#include "Futility_DBC.h"
USE Futility_DBC
USE IntrType
USE ExceptionHandler
USE ParameterLists
USE VectorTypes
USE MatrixTypes_Base
......
......@@ -14,7 +14,6 @@ USE IntrType
USE Strings
USE FileType_Fortran
USE FileType_Log
USE ExceptionHandler
USE ParameterLists
USE ParallelEnv
......
......@@ -50,7 +50,6 @@
!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
MODULE VectorTypes
USE IntrType
USE ExceptionHandler
USE Allocs
USE ParameterLists
USE VectorTypes_Base
......@@ -310,7 +309,7 @@ ENDSUBROUTINE VectorFactory
!> this routine will attempt to adopt parameters from the source vector to initialize the dest vector.
!> This is only done for required parameters that are not provided in the passed
!> parameter list. Providing the parameters on the parameter list will override
!> the corresponding parameters from the source matrix. This behavior will be
!> the corresponding parameters from the source matrix. This behavior will be
!> consistent for all VectorResemble routines
SUBROUTINE VectorResemble(dest, source, params)
CHARACTER(LEN=*),PARAMETER :: myName="VectorResemble"
......@@ -534,7 +533,7 @@ SUBROUTINE VectorResembleAllocArray(dest, source, nvec, inparams)
IF(PRESENT(inparams)) CALL inparams%clear()
CALL params%clear()
ENDSUBROUTINE VectorResembleAllocArray
!
!-------------------------------------------------------------------------------
......
......@@ -10,7 +10,6 @@
!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
MODULE VectorTypes_Native
USE IntrType
USE ExceptionHandler
#include "Futility_DBC.h"
USE Futility_DBC
USE ParameterLists
......@@ -497,7 +496,7 @@ SUBROUTINE init_NativeDistributedVectorType(thisVector,Params)
CALL eVectorType%raiseError('Incorrect call to '// &
modName//'::'//myName//' - VectorType already initialized')
ENDIF
ENDSUBROUTINE init_NativeDistributedVectorType
!
!-------------------------------------------------------------------------------
......
......@@ -12,7 +12,6 @@ MODULE VectorTypes_PETSc
USE IntrType
#include "Futility_DBC.h"
USE Futility_DBC
USE ExceptionHandler
USE ParameterLists
USE VectorTypes_Base
......
......@@ -10,7 +10,6 @@
!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
MODULE VectorTypes_Trilinos
USE IntrType
USE ExceptionHandler
USE ParameterLists
USE VectorTypes_Base
USE trilinos_interfaces
......
......@@ -26,20 +26,22 @@ USE ParameterLists
IMPLICIT NONE
PRIVATE
#ifdef FUTILITY_HAVE_HDF5
! Public members
PUBLIC :: eXDMF
#ifdef FUTILITY_HAVE_HDF5
PUBLIC :: XDMFMeshType
PUBLIC :: XDMFTopologyList
PUBLIC :: ImportXDMFMesh
PUBLIC :: ExportXDMFMesh
PUBLIC :: ASSIGNMENT(=)
!> The module name
CHARACTER(LEN=*),PARAMETER :: modName='FILETYPE_XDMF'
#endif
!> Exception handler for the module
TYPE(ExceptionHandlerType),SAVE :: eXDMF
#ifdef FUTILITY_HAVE_HDF5
!> Parameter list that holds XDMF topology names, ids, etc.
TYPE(ParamType),SAVE :: XDMFTopologyList
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment