Changes: 3.18#
Changes you should make for main and version 3.18 so that it is portable to previous versions of PETSc
Remove the error handling from uses of
PetscOptionsBegin()
,PetscOptionsEnd()
,PetscObjectOptionsBegin()
,PetscOptionsHead()
, andPetscOptionsTail()
Remove the error handling from uses of
PetscDrawCollectiveBegin()
andPetscDrawCollectiveEnd()
Remove the error handling from uses of
MatPreallocateInitialize()
andMatPreallocateFinalize()
Replace
MatUpdateMPIAIJWithArrays()
withMatUpdateMPIAIJWithArray()
Changes you can make for main and version 3.18 so that is not portable to previous versions of PETSc. This will remove all deprecation warnings when you build. In addition to the changes above
Change
PetscOptionsHead()
andPetscOptionsTail()
toPetscOptionsHeadBegin()
andPetscOptionsHeadEnd()
Change
MatPreallocateInitialize()
andMatPreallocateFinalize()
toMatPreallocateBegin()
andMatPreallocateEnd()
Change uses of MatGetOption() with MAT_SYMMETRIC, MAT_STRUCTURALLY_SYMMETRIC, MAT_HERMITIAN, MAT_SPD to calls to MatIsSymmetric(), MatIsSymmetricKnown() etc.
Whenever you call MatSetOption() with one of the above options and it is intended to stay with the matrix through calls to MatSetValues() etc add a call to MatSetOption() with MAT_SYMMETRY_ETERNAL etc
General:
Add native PETSc/HIP backend for AMD GPUs
Add
PETSC_ERR_RETURN
to signal when an error handler returns 0 inPetscError()
Change behavior of
SETERRQ()
whenPetscError()
returns 0 via user-set error handler. In such casesSETERRQ()
now returnsPETSC_ERR_RETURN
(a nonzero value) instead. Previously the value (0) would be propagated as-is. Note that while returning 0 from error handlers inPetscError()
is supported, doing so is discouragedChange
PetscOptionsBegin()
,PetscOptionsEnd()
, andPetscObjectOptionsBegin()
to not return an error codeChange
PetscOptionsHead()
,PetscOptionsTail()
, toPetscOptionsHeadBegin()
andPetscOptionsHeadEnd()
and to not return an error codeEnable
MPI_Datatype
type-checking to ensure that the type of the pointer passed to communication routines (e.g.PetscSFBcastBegin()
) matches the correspondingMPI_Datatype
argument. Compilers supporting this feature will emit a warning in case of mismatch. These may be disabled by definingPETSC_SKIP_ATTRIBUTE_MPI_TYPE_TAG
prior to all PETSc header-file inclusionsAdd
PETSC_ATTRIBUTE_FORMAT()
to enable compile-timeprintf()
-style format specifier checking and apply it any PETSc functions taking a format stringDeprecate the use of
%D
for printingPetscInt
in favor of%" PetscInt_FMT "
. Compilers may now emit warnings when using%D
as a result of applyingPETSC_ATTRIBUTE_FORMAT
. Users that need to support older versions of PETSc may do one of two things:Recommended Insert the following code block after all PETSc header-file inclusions
#if !defined(PetscInt_FMT) # if defined(PETSC_USE_64BIT_INDICES) # if !defined(PetscInt64_FMT) # if defined(PETSC_HAVE_STDINT_H) && defined(PETSC_HAVE_INTTYPES_H) && defined(PETSC_HAVE_MPI_INT64_T) # include <inttypes.h> # define PetscInt64_FMT PRId64 # elif (PETSC_SIZEOF_LONG_LONG == 8) # define PetscInt64_FMT "lld" # elif defined(PETSC_HAVE___INT64) # define PetscInt64_FMT "ld" # else # error "cannot determine PetscInt64 type" # endif # endif # define PetscInt_FMT PetscInt64_FMT # else # define PetscInt_FMT "d" # endif #endif
This will ensure that the appropriate format specifiers are defined regardless of PETSc version.
Not Recommended Compilers warnings can be permanently suppressed by defining
PETSC_SKIP_ATTRIBUTE_FORMAT
prior to all PETSc header-file inclusions
chkerrconvert.py
(${PETSC_DIR}/share/petsc/chkerrconvert.py
) now also handles possible spaces between the semi-colon andCHKERR
construct when replacing.
Configure/Build:
Remove python2 support, python-3.4+ is now required
Sys:
Change calling sequence of
PetscObjectProcessOptionsHandler()
to flip the role of the first two argumentsChange
-log_view
to no longer print out the amount of memory associated with different types of objects. That data was often incorrectChange
PetscCall()
from Fortran so thatcall PetscFunction(args,ierr);CHKERRQ(ierr);
can be replaced withPetscCall(PetscFunction(args,ierr))
Add
PetscCallA()
from Fortran so thatcall PetscFunction(args,ierr);CHKERRA(ierr);
can be replaced withPetscCallA(PetscFunction(args,ierr))
Add
PetscCallMPI()
andPetscCallMPIA()
that may be used to call MPI functions from FortranChange the
PetscCheck()
andPetscAssert()
macros to behave like function calls by wrapping indo { } while (0)
. Previously these macros expanded toif (...) SETERRQ(...)
, which meant they could be chained with subsequent conditionalsChange
PetscStackCallStandard()
toPetscCallExternal()
Change
PetscStackCall()
toPetscStackCallExternalVoid()
Change
PetscStackCallXXX()
toPetscCallXXX()
Add
PetscCallBack()' for calling all PETSc callbacks (usually to user code) to replace the use of ``PetscStackPush()
andPetscStackPop
Add
PetscTryTypeMethod()
andPetscUseTypeMethod()
to replace direct calls of the form(\*obj->ops->op)(obj,...)
Add
PetscMemTypeToString()
to convertPetscMemType
to stringAdd
PetscOffloadMaskToString()
to (shockingly) convertPetscOffloadMask
to stringAdd
PetscOffloadMaskToMemType()
Split off CUDA and HIP specific headers from
petscdevice.h
intopetscdevice_cuda.h
andpetscdevice_hip.h
Add
petscdevice_cupm.h
Allow
PetscDevice
andPetscDeviceContext
API to be callable from C via stub macrosReplace
PETSC_DEVICE_INVALID
withPETSC_DEVICE_HOST
Make
PETSC_DEVICE_DEFAULT()
a functionMake
PetscDeviceContext
into aPetscObject
Add
PetscDeviceContextGetDeviceType()
convenience functionChange
PetscDeviceContextSetFromOptions()
to no longer accept the options prefix (PetscDeviceContext
now has one as aPetscObject
)Add
PetscDeviceContextView()
Add
PetscDeviceMalloc()
Add
PetscDeviceCalloc()
Add
PetscDeviceFree()
Add
PetscDeviceMemcpy()
Add
PetscDeviceArrayCopy()
Add
PetscDeviceMemset()
Add
PetscDeviceArrayZero()
Deprecate
PetscLogObjectParent()
Deprecate
PetscLogObjectMemory()
Deprecate
PetscNewLog()
, users should just usePetscNew()
insteadAdd
PetscHasBuiltin()
to detect whether a particular builtin function is supported by the compilerAdd
PetscAssume()
to indicate an invariant condition to the compilerAdd
PetscSortedInt64()
,PetscSortInt64()
andPetscSortCount()
for sorting and checking arrays of these typesAdd
PetscHMapObjCreate()
and all associated hash map routines for holding PETSc objectsAdd
PetscObjectDelayedDestroy()
,PetscGarbageKeySortedIntersect()
,PetscGarbageCleanup()
andPetscGarbageView()
for memory cleanup operations in managed languagesRemove unused preprocessor variables
PETSC_Alignx
,PETSC_const
, andPETSC_HAVE_GETARG
Event Logging:
Add NVIDIA NVTX sections to Default
event logging. This tags code
sections, like stages, with nvtxRangePushA(char name[]) and
nvtxRangePop(), which can be visualized after the run with the NVIDIA Nsight GUI tool. To
generate a data file, run code with nsys profile -f true -o file-name
exec-name
.
PetscViewer:
Change
PetscViewerHDF5GetGroup()
to accept optional path relative to the pushed group and always return absolute path (newly allocated)Change
PetscViewerHDF5OpenGroup()
to accept optional path relative to the pushed group
PetscDraw:
Add
PetscDrawSPGetDimension()
Change
PetscDrawCollectiveBegin()
andPetscDrawCollectiveEnd()
to not return an error code. Users can remove the error code checking for these functions and it will work correctly for all versions of PETSc
AO:
IS:
Add
ISShift()
VecScatter / PetscSF:
Add
PetscSFGetGraphLayout()
PF:
Vec:
Add
VecSetPreallocationCOO()
,VecSetValuesCOO()
andVecSetPreallocationCOOLocal()
to support vector assembly with coordinatesAdd
VecStrideSum()
andVecStrideSumAll()
for summing subvectors of strided vectorsAdd
VecCreateLocalVector()
to be used for calls involvingVec{Get|Restore}LocalVector()
PetscSection:
PetscPartitioner:
Mat:
Change
MatPreallocateInitialize()
andMatPreallocateFinalize()
toMatPreallocateBegin()
andMatPreallocateEnd()
and to not return an error codeChange
MatDenseGetSubMatrix()
to be able to retrieve only selected contiguous rows instead of all rowsAdd
MatSetOptionsPrefixFactor()
andMatAppendOptionsPrefixFactor()
to allow controlling the options prefix used by factors created from this matrixChange
MatSetOptionsPrefix()
to no longer affect the options prefix used by factors created from this matrixChange matrix factor options called from within KSP/PC to always inherit the options prefix from the KSP/PC, not the options prefix in the originating matrix
Add
MatIsStructurallySymmetricKnown()
andMatIsSPDKnown()
Change
MatGetOption()
to no longer produce results forMAT_STRUCTURALLY_SYMMETRIC
,MAT_SYMMETRIC
,MAT_SPD
, andMAT_HERMITIAN
Add
MatCreateGraph()
to create a scalar matrix for use in graph algorithmsAdd an option -mat_factor_bind_factorization <host, device> to control where to do matrix factorization. Currently only supported with SEQAIJCUSPARSE matrices.
Add
MatUpdateMPIAIJWithArray()
and deprecateMatUpdateMPIAIJWithArrays()
Change the coordinate array parameters in
MatSetPreallocationCOO
from const to non-constAdd enforcement of the previously unenforced rule that
MAT_REUSE_MATRIX
withMatTranspose()
can only be used after a call toMatTranspose()
withMAT_INITIAL_MATRIX
. AddMatTransposeSetPrecursor()
to allow usingMAT_REUSE_MATRIX
withMatTranspose()
without the initial call toMatTranspose()
.Add
MatTransposeSymbolic()
Add
MatShellSetContextDestroy()
and add internal refrence counting for user definedMatShell
context dataAdd
MatShellSetContextDestroy()
and add internal reference counting for user definedMatShell
context dataChange
MATTRANPOSEMAT
toMATTRANPOSEVIRTUAL
MatCoarsen:
Add
MISK
coarsening type. Distance-k maximal independent set (MIS) C-F coarsening with a greedy, MIS based aggregation algorithm
PC:
Add PC type of mpi which can be used in conjunction with -mpi_linear_solver_server to use MPI parallelism to solve a system created on a single MPI rank
Add
PCHYPREAMSSetInteriorNodes()
to set interior nodes for HYPRE AMSAdd
PCAMGX
, a PC interface for NVIDIA’s AMGx AMG solverRemove
PCGAMGSetSymGraph()
and-pc_gamg_sym_graph
. The user should now indicate symmetry and structural symmetry usingMatSetOption()
and GAMG will symmetrize the graph if a symmetric options is not setChange
-pc_gamg_reuse_interpolation
default from false to true.
KSP:
Deprecate
KSPHPDDMGetDeflationSpace()
(resp.KSPHPDDMSetDeflationSpace()
) in favor ofKSPHPDDMGetDeflationMat()
(resp.KSPHPDDMSetDeflationMat()
)Add
KSPNONE
as alias forKSPPREONLY
SNES:
Add
DMDASNESSetFunctionLocalVec()
,DMDASNESSetJacobianLocalVec()
andDMDASNESSetObjectiveLocalVec()
, and associate typesDMDASNESFunctionVec
,DMDASNESJacobianVec
andDMDASNESObjectiveVec
, which accept Vec parameters instead of void pointers in contrast to versions without the Vec suffixAdd
SNESLINESEARCHNONE
as alias forSNESLINESEARCHBASIC
Add
DMSNESSetFunctionContextDestroy()
andDMSNESSetJacobianContextDestroy()
and usePetscContainter
for user context to facilitate automatic destruction of user set context
SNESLineSearch:
TS:
Add
TSSetTimeSpan()
,TSGetTimeSpan()
andTSGetTimeSpanSolutions()
to support time spanAdd
DMTSGetIFunctionLocal()
,DMTSGetIJacobianLocal()
, andDMTSGetRHSFunctionLocal()
Add
DMTSSetIFunctionContextDestroy()
,DMTSSetIJacobianContextDestroy()
,DMTSSetRHSFunctionContextDestroy()
,DMTSSetRHSJacobianContextDestroy()
,DMTSSetI2FunctionContextDestroy()
, andDMTSSetI2JacobianContextDestroy()
and usePetscContainter
for user context to facilitate automatic destruction of user set contextMake public
SNESVIComputeMeritFunction()
andSNESVIComputeFunction()
TAO:
Rename the command line option
-tao_nm_lamda
to-tao_nm_lambda
DM/DA:
Add
DMDAMapMatStencilToGlobal()
to map MatStencils to global indicesAdd
DMGetCellCoordinateDM()
,DMSetCellCoordinateDM()
,DMGetCellCoordinateSection()
,DMSetCellCoordinateSection()
,DMGetCellCoordinates()
,DMSetCellCoordinates()
,DMGetCellCoordinatesLocalSetup()
,DMGetCellCoordinatesLocal()
,DMGetCellCoordinatesLocalNoncollective()
,DMSetCellCoordinatesLocal()
Add
DMFieldCreateDSWithDG()
to allow multiple representations of a given fieldAdd
DMProjectFieldLabel()
Make public
DMSetVI()
andDMDestroyVI()
Change
DMCountNonCyclicReferences()
toDMCountNonCyclicReferences_Internal()
Add
DMCountNonCyclicReferences()
as a more generic wrapper forDMCountNonCyclicReferences_Internal()
DMSwarm:
Add
DMSwarmGetCoordinateFunction()
,DMSwarmSetCoordinateFunction()
,DMSwarmGetVelocityFunction()
,DMSwarmSetVelocityFunction()
to allow flexible layout of particles
DMPlex:
Add
DMLabelPropagateBegin()
,DMLabelPropagatePush()
, andDMLabelPropagateEnd()
Add
DMPlexPointQueue
and APIAdd label value argument to
DMPlexLabelCohesiveComplete()
andDMPlexCreateHybridMesh()
Change
DMPlexCheckPointSF()
to take optionalPetscSF
parameterAdd
DMPlexCheck()
Add
DMPlexMetricDeterminantCreate()
for creating determinant fields for Riemannian metrics- Change
DMPlexMetricEnforceSPD()
: pass determinant Vec, rather than its address
pass output metric, rather than its address
- Change
- Change
DMPlexMetricNormalize()
: pass output metric, rather than its address
pass determinant Vec, rather than its address
- Change
Change
DMPlexMetricAverage()
,DMPlexMetricAverage2()
andDMPlexMetricAverage3()
to pass output metric, rather than its addressChange
DMPlexMetricIntersection()
,DMPlexMetricIntersection2()
andDMPlexMetricIntersection3()
to pass output metric, rather than its address- Add capability to specify whether the DMPlex should be reordered by default:
add
DMPlexReorderGetDefault()
andDMPlexReorderSetDefault()
to get and set this flag
Add
DMPlexCreateOverlapLabelFromLabels()
for more customized overlapAdd
DMPlexSetOverlap()
to promote an internal interfaceAdd
DMGetCellCoordinateDM()
,DMSetCellCoordinateDM()
,DMGetCellCoordinateSection()
,DMSetCellCoordinateSection()
,DMGetCellCoordinates()
,DMSetCellCoordinates()
,DMGetCellCoordinatesLocalSetUp()
,DMGetCellCoordinatesLocal()
,DMGetCellCoordinatesLocalNoncollective()
, andDMSetCellCoordinatesLocal()
to provide an independent discontinuous representation of coordinatesChange
DMGetPeriodicity()
andDMSetPeriodicity()
to get rid of the flag and boundary type. Since we have an independent representation, we can tell if periodicity was imposed, and boundary types were never used, so they can be inferred from the given L. We also add Lstart to allow tori that do not start at 0.Add
DMPlexGetCellCoordinates()
andDMPlexRestoreCellCoordinates()
for clean interface for periodicityAdd
DMPlexDistributionSetName()
andDMPlexDistributionGetName()
to set/get the name of the specific parallel distribution of the DMPlex
FE/FV:
Add
PetscFECreateFromSpaces()
to build similar space from pieces
DMNetwork:
Add
DMNetworkFinalizeComponents()
to setup the internal data structures for components on a network. Previously this could only be done by calling DMSetUp
DMStag:
DT:
Add probability distributions
PetscPDFGaussian3D()
,PetscPDFSampleGaussian3D()
,PetscPDFConstant2D()
,PetscCDFConstant2D()
,PetscPDFSampleConstant2D()
,PetscPDFConstant3D()
,PetscCDFConstant3D()
,PetscPDFSampleConstant3D()
Fortran: