Changes: 3.17#
General:
PETSc now requires a C99 compliant C compiler in all cases. Previously C99 was only required when building PETSc, but this now extends to public interfaces and header-files
PETSc now requires a C++11 compliant C++ compiler. Note this requirement is only enforced if C++ is used; it is acceptable to have a compiler that does not support C++11 if you only ever build C source
PETSc now requires at least Microsoft Visual Studio 2015 when using the Microsoft Visual C/C++ Compiler
Change
MPIU_Allreduce()
to always returns a PETSc error code that should be checked withCHKERRQ(ierr)
orPetscCall()
Configure/Build:
Change minimum value of
--with-cxx-dialect
argument from “03” to “11”C++ dialect will now also be inferred from compiler flags, although users will be warned that they should let PETSc auto-detect the flag when setting the dialect this way
Change C++ dialect flag option to be consistent with compiler flags;
--with-cxx-dialect=gnu++14
means you want-std=gnu++14
, no more, no lessFix for requesting no C++ dialect flag via
--with-cxx-dialect=0
. Previouslyconfigure
would bail out immediately without running the tests and therefore wouldn’t set any of the capability defines.configure
now runs all tests, just doesn’t add the flag in the endFix a number of corner-cases when handling C++ dialect detection
Remove deprecated
PETSC_VERSION_PATCH
so as to not have confusion with patch releases where the subminor version changesChange
PETSC_HAVE_MKL
toPETSC_HAVE_MKL_LIBS
Add
PETSC_HAVE_MKL_INCLUDES
Enable HYPRE GPU for 64bit indices build (using HYPRE’s mixed-int configuration)
Reuse PETSc-installed hwloc when installing OpenMPI
Sys:
Add
MPI_Comm_get_name()
andMPI_Comm_set_name()
to MPIUNIRemove
petsccublas.h
andpetschipblas.h
Remove
-petsc_use_default_null_stream
and-[cuda|hip]_synchronize
optionsRemove
PetscCUDASynchronize
andPetscHIPSynchronize
. Their operation is now managed byPetscDeviceContext
via itsPetscStreamType
attributeRemove
PetscCUDAInitialize()
,PetscCUDAInitializeCheck()
,PetscHIPInitialize()
, andPetscHIPInitializeCheck()
. Their function is now handled byPetscDeviceInitialize()
andPetscDeviceInitialized()
Remove
PetscCUBLASInitializeHandle()
,PetscCUSOLVERDnInitializeHandle()
,PetscHIPBLASInitializeHandle()
, andPetscHIPSOLVERInitializeHandle()
. Their function is now handled implicitly byPetscDeviceContext
Remove
petsc_gputimer_begin
andpetsc_gputimer_begin
Add
-device_enable
,-device_select
and-device_view
startup-options to control coarse-grained device initialization strategyReplace
-[cuda|hip]_device
with split options-device_enable_[cuda|hip]
and-device_select_[cuda|hip]
to enable fine-grained control of device selection and initialization strategyReplace
-[cuda|hip]_view
with-device_view_[cuda|hip]
Add
PetscDeviceInitType
to enumerate PETSc device initialization strategiesAdd
PetscDeviceInitialize()
to eagerly initialize aPetscDeviceType
, andPetscDeviceInitialized()
to query the corresponding initialization stateChange
PetscDeviceCreate()
to also accept aPetscInt devid
, to create aPetscDevice
for a specific deviceAdd
PetscDeviceView()
Move
PetscInt64_FMT
andMPIU_INT64
definitions topetscsystypes.h
Add
PetscBLASInt_FMT
,PETSC_MPI_COMM_FMT
, andPETSC_MPI_WIN_FMT
format specifiersAdd
petscmacros.h
header to house common PETSc preprocessor macrosAdd
PetscUnreachable()
to indicate unreachable code section to compilerAdd
PetscHasAttribute()
macro to query for existence of an__attribute__
specifierAdd
PetscCommGetComm()
andPetscCommRestoreComm()
to allow reuse of MPI communicator with external packages, as some MPI implementations have brokenMPI_Comm_free()
Add
PetscExpand()
,PetscConcat()
,PetscCompl()
, andPetscExpandToNothing()
Add
PETSC_CONSTEXPR_14
,PETSC_NULLPTR
, andPETSC_NODISCARD
Add
PetscSizeT
as a language-agnostic equivalent ofsize_t
from<stddef.h>
Add
PetscCount
as a signed datatype for counts, equivalent toptrdiff_t
from<stddef.h>
.Add
PetscCountCast
,PetscSortIntWithCountArray()
, andPetscSortIntWithIntCountArrayPair()
Deprecate
SETERRQ1()
-SETERRQ9()
in favor ofSETERRQ()
which is now variadicDeprecate
PetscInfo1()
-PetscInfo9()
in favor ofPetscInfo()
which is now variadicDeprecate
PETSC_INLINE
,inline
is a standard keyword since C99 and C++11Deprecate
PETSC_STATIC_INLINE
, as bothstatic
andinline
are standard keywords since C99 and C++11Remove
PETSC_C_RESTRICT
,restrict
is a standard keyword since C99Change
SETERRMPI()
to be variadicChange
SETERRABORT()
to be variadicAdd
PetscCheck()
andPetscAssert()
for checking a boolean condition is true. The former is always enabled, while the latter is enabled only in debug builds.PetscDevice
initialization for CUDA and HIP will now respectCUDA_VISIBILE_DEVICES
andHIP_VISIBLE_DEVICES
environment variables respectivelyAdd
PETSC_ATTRIBUTE_COLD
to inform compilers that a function is unlikely to be calledAdd
PetscCall()
,PetscCallVoid()
,PetscCallMPI()
,PetscCallAbort()
,PetscCallContinue()
,PetscCallThrow()
, andPetscCallCXX()
. These supersedeCHKERRQ()
,CHKERRV()
,CHKERRMPI()
,CHKERRABORT()
,CHKERRCONTINUE()
,CHKERRXX()
, andCHKERRCXX()
respectivelyAdd
PetscCallCUDA()
,PetscCallCUBLAS()
,PetscCallCUSPARSE()
,PetscCallCUSOLVER()
,PetscCallCUFFT()
, andPetscCallCURAND()
. These supersedeCHKERRCUDA()
,CHKERRCUBLAS()
,CHKERRCUSPARSE()
,CHKERRCUSOLVER()
,CHKERRCUFFT()
, andCHKERRCURAND()
respectivelyAdd
PetscCallHIP()
,PetscCallHIPBLAS()
, andPetscCallHIPSOLVER()
. These supersedeCHKERRHIP()
,CHKERRHIPBLAS()
, andCHKERRHIPSOLVER()
respectivelyAdd
PetscCallCEED()
which supersedesCHKERRQ_CEED()
Soft-deprecate
CHKERR
variants listed above in C/C++ sources. New code should prefer thePetscCall
variants though no compiler diagnostics will be emitted if the old versions are used. One may use${PETSC_DIR}/share/petsc/chkerrconvert.py
to perform the conversions automatically, though users should note that this script is considered “beta” software. It was used to facilitate theCHKERR
changes during development and is being exposed to users in order to smooth the transition – while every reasonable effort was made to ensure correctness, we provide no guarantee of it.
PetscViewer:
Add
PetscViewerHDF5SetDefaultTimestepping()
andPetscViewerHDF5SetDefaultTimestepping()
to deal with HDF5 files missing the timestepping attribute
PetscDraw:
Add
PetscDrawSPAddPointColorized()
to change scatter point color based on third input value
AO:
IS:
ISLocalToGlobalMappingCreateSF()
: allow passingstart = PETSC_DECIDE
Add
ISSetLayout()
VecScatter / PetscSF:
Add MPI-4.0 large count support. With an MPI-4.0 compliant MPI implementation and 64-bit indices, one can now pass over 2 billion elements in a single message in either VecScatter or PetscSF
Add
PetscSFFetchAndOpWithMemTypeBegin()
, which is similar toPetscSFFetchAndOpBegin()
, but with explicit memory typesChange
PetscSFSetGraph()
andPetscSFSetGraphLayout()
to sort leaves, removeconst
fromilocal
andiremote
argumentsAdd
PetscSFConcatenate()
PF:
Vec:
Change
VecTaggerComputeBoxes()
andVecTaggerComputeIS()
to return a boolean whose value is true if the list was createdAdd
-vec_bind_below
option for specifying size threshold below which GPU is not used forVec
operationsAdd
VecSetBindingPropagates()
Add
VecGetBindingPropagates()
For CUDA and ViennaCL and HIP GPU vectors,
VecCreate()
no longer allocates the array on CPU eagerly, it is only allocated if it is neededVecGetArrayAndMemType()
andVecGetArrayReadAndMemType()
now always return a device pointer (copying the data to the device if needed) for the standard CUDA, HIP, and CUDA/HIP Kokkos vectors. Previously, they did so only when the device had the latest dataAdd
VecGetArrayWriteAndMemType()
andVecRestoreArrayWriteAndMemType()
, which are similar to theVecGetArrayReadAndMemType()
family, but only write to the vector on device
PetscPartitioner:
Mat:
Add
-mat_bind_below
option for specifying size threshold below which GPU is not used forMat
operationsAdd
MatSetBindingPropagates()
Add
MatGetBindingPropagates()
Add
MatSeqAIJGetArrayWrite()
andMatSeqAIJRestoreArrayWrite()
to get write-access to the value array ofMatSeqAIJ
on CPUAdd
MatCUSPARSESetUseCPUSolve()
Use CPU solve with cuSparse for LU factorization that are on the CPU.Change
MatCreateIS()
behavior when NULL is passed for the mappings. Now a NULL map implies matching local and global spacesAdd support of
MatSetValuesCOO()
andMatSetPreallocationCOO()
for matrix type AIJKOKKOS. Additionally, for AIJKOKKOS, they support negative indices and remote entriesAdd
MatMultHermitianTransposeEqual()
andMatMultHermitianTransposeAddEqual()
Add
MatSetPreallocationCOOLocal()
to set preallocation for matrices using a coordinate format of the entries with local indicesChange
MatStructures
enumeration to avoid spaces and match capitalization of other enumerationsChange size argument of
MatSetPreallocationCOO()
toPetscCount
Add
MATORDERINGMETISND
use METIS for nested dissection ordering ofMatSeqAIJ
, with optionsnseps
,niter
,ufactor
andpfactor
under the common prefix-mat_ordering_metisnd_
Change options
-matproduct_<product_type>_via
to-mat_product_algorithm
Add
-mat_superlu_dist_3d
and-mat_superlu_dist_d <n>
to support using SuperLU_DIST’s version 7.2 3d decomposition algorithmsMATIS
now supports negative and repeated indices in the local-to-global map and the COO assembly routines. This allows for better integration with libceedAdd
MatISGetLocalToGlobalMapping()
to retrieve the logical map for assembled subdomain problem
PC:
Add MG option
-pc_mg_galerkin_mat_product_algorithm [cusparse|hypre]
andPCMGGalerkinSetMatProductAlgorithm()
to use cuSparse or hypre’s SpGEMM for Galerkin products in hypreAdd PC type
PCBJKOKKOS
a new, experimental batch Kokkos solver-pc_type bjkokkos -pc_bjkokkos_ksp_type [tfqmr|bicg] -pc_bjkokkos_pc_type jacobi -ksp_type preonly
Add -pc_svd_monitor ::all option to print all the singular values instead of a maximum of ten
PCMG:
Add
PCMGGetGridComplexity()
to get operator and grid complexity of MG hierarchyChange
PCGAMG
default to usePCJACOBI
smoothing instead of PCSOR. This also allows the default configuration to use GPUs effectively, and to deliver equivalent convergence. For the old default, use-mg_levels_pc_type sor
.Change
PCGAMG
eigenvalue estimation to useKSPCG
whenMAT_SPD
has been set (seeMatSetOption()
) andKSPCR
whenMAT_SYMMETRIC
orMAT_HERMITIAN
has been set. These are usually somewhat more accurate and reliable than the previous default ofKSPGMRES
, and in tune withKSPCHEBYSHEV
. Note that Chebyshev will generally not be a suitable smoother for indefinite matrices.Change
PCGAMG
to usePCGAMGSetUseSAEstEig()
by default when the smoother uses Jacobi preconditioning.
KSP:
Outer most
KSPSolve()
will error if KSP_DIVERGED_ITS and`KSPSetErrorIfNotConverged()
is usedAdd
KSPQMRCGS
to support qmrcgstab with right preconditioningAdd
KSPGuessSetTolerance()
Add a new model option to
KSPGuessFischerSetModel()
SNES:
Add
SNESNewtonTRDCGetRhoFlag()
,SNESNewtonTRDCSetPreCheck()
,SNESNewtonTRDCGetPreCheck()
,SNESNewtonTRDCSetPostCheck()
,SNESNewtonTRDCGetPostCheck()
SNESLineSearch:
TS:
Add
TSSundialsSetUseDense()
and options database option-ts_sundials_use_dense
to use a dense linear solver (serial only) within CVODE, instead of the default iterative solveChange timestepper type
TSDISCGRAD
to include additional conservation terms based on formulation from [Gonzalez 1996] for Hamiltonian systems: - AddTSDiscGradIsGonzalez()
to check flag for whether to use additional conservative terms in discrete gradient formulation - AddTSDiscGradUseGonzalez()
to set discrete gradient formulation with or without additional conservative terms. Without flag, the discrete gradients timestepper is just backwards eulerAdd
TSRemoveTrajectory
to destroy and remove the internal TSTrajectory object from TSChange
TSMonitorSPSwarmSolution()
to have correct axes labels and bounds
Tao:
Add
TaoGetGradient()
,TaoGetObjectiveAndGradient()
andTaoGetHessian()
Deprecate
TaoSetInitialVector()
in favor ofTaoSetSolution()
Deprecate
TaoGetSolutionVector()
in favor ofTaoGetSolution()
Deprecate
TaoGetGradientVector()
in favor ofTaoGetGradient()
Deprecate
TaoSetObjectiveRoutine()
in favor ofTaoSetObjective()
Deprecate
TaoSetGradientRoutine()
in favor ofTaoSetGradient()
Deprecate
TaoSetObjectiveAndGradientRoutine()
in favor ofTaoSetObjectiveAndGradient()
Deprecate
TaoSetHessianRoutine()
in favor ofTaoSetHessian()
Change
TaoGetObjective()
. UseTaoGetSolutionStatus(tao,NULL,&fct,NULL,NULL,NULL,NULL)
instead
DM/DA:
Add
DMLabelGetNonEmptyStratumValuesIS()
, similar toDMLabelGetValueIS()
but counts only nonempty strataAdd
DMLabelCompare()
forDMLabel
comparisonAdd
DMCompareLabels()
comparingDMLabel
s of twoDM
sDMCopyLabels()
now takes DMCopyLabelsMode argument determining duplicity handlingAdd
-dm_bind_below
option for specifying size threshold below which GPU is not used forVec
andMat
objects associated with a DMAdd
DMCreateMassMatrixLumped()
to support explicit timestepping, also addDMTSCreateRHSMassMatrix()
,DMTSCreateRHSMassMatrixLumped()
, andDMTSDestroyRHSMassMatrix()
Promote
DMGetFirstLabelEntry()
to public API and renameAdd bias vector argument to
DMGetDefaultConstraints()
andDMSetDefaultConstraints()
. Passingbias=NULL
recovers prior behavior.Change
DMGetAuxiliaryVec()
,DMSetAuxiliaryVec()
, andDMGetAuxiliaryLabels()
to take an equation part number
DMSwarm:
Add
DMSwarmGetNumSpecies()
andDMSwarmSetNumSpecies()
to support PICAdd
DMSwarmComputeLocalSize()
,DMSwarmComputeLocalSizeFromOptions()
,DMSwarmInitializeCoordinates()
,DMSwarmInitializeVelocities()
,DMSwarmInitializeVelocitiesFromOptions()
to assist initialization of PIC methods
DMPlex:
Add
DMExtrude()
which now the default extrusionChange
DMPlexExtrude()
to use DMPlexTransform underneathAdd
DMPlexTransformExtrudeSetNormalFunction()
to allow computed normalsAdd
DMGetNaturalSF()
andDMSetNaturalSF()
Change
-dm_plex_csr_via_mat
to-dm_plex_csr_alg
which takes a DMPlexCSRAlgorithm name- Add public API for metric-based mesh adaptation:
Move
DMPlexMetricCtx
from public to private and give it toDMPlex
Add
DMPlexMetricSetFromOptions()
to assign values toDMPlexMetricCtx
Add
DMPlexMetricSetIsotropic()
for declaring whether a metric is isotropicAdd
DMPlexMetricIsIsotropic()
for determining whether a metric is isotropicAdd
DMPlexMetricSetUniform()
for declaring whether a metric is uniformAdd
DMPlexMetricIsUniform()
for determining whether a metric is uniformAdd
DMPlexMetricSetRestrictAnisotropyFirst()
for declaring whether anisotropy should be restricted before normalizationAdd
DMPlexMetricRestrictAnisotropyFirst()
for determining whether anisotropy should be restricted before normalizationAdd
DMPlexMetricSetMinimumMagnitude()
for specifying the minimum tolerated metric magnitudeAdd
DMPlexMetricGetMinimumMagnitude()
for retrieving the minimum tolerated metric magnitudeAdd
DMPlexMetricSetMaximumMagnitude()
for specifying the maximum tolerated metric magnitudeAdd
DMPlexMetricGetMaximumMagnitude()
for retrieving the maximum tolerated metric magnitudeAdd
DMPlexMetricSetMaximumAnisotropy()
for specifying the maximum tolerated metric anisostropyAdd
DMPlexMetricGetMaximumAnisotropy()
for retrieving the maximum tolerated metric anisotropyAdd
DMPlexMetricSetTargetComplexity()
for specifying the target metric complexityAdd
DMPlexMetricGetTargetComplexity()
for retrieving the target metric complexityAdd
DMPlexMetricSetNormalizationOrder()
for specifying the order of L-p normalizationAdd
DMPlexMetricGetNormalizationOrder()
for retrieving the order of L-p normalizationChange
DMPlexMetricCtx
so that it is only instantiated when one of the above routines are called- Change
DMPlexMetricEnforceSPD()
to have more arguments: control whether anisotropy is restricted
output the modified metric, rather than modifying the input
output the determinant
- Change
Change
DMPlexMetricNormalize()
to have another argument, for controlling whether anisotropy is restricted
Change
DMAdaptor
so that its-adaptor_refinement_h_min/h_max/a_max/p
command line arguments become-dm_plex_metric_h_min/h_max/a_max/p
- Add 2D and 3D mesh adaptation interface to Mmg and 3D mesh adaptation interface to ParMmg. Mmg/ParMmg specific changes:
Change
DMPlexBuildFromCellListParallel()
to have another argument, for the connectivityChange
DMPlexCreateFromCellListParallelPetsc()
to have another argument, for the connectivityAdd
DMPlexMetricSetVerbosity()
for setting the verbosity of the metric-based mesh adaptation packageAdd
DMPlexMetricGetVerbosity()
for getting the verbosity of the metric-based mesh adaptation packageAdd
DMPlexMetricSetNoInsertion()
to turn off node insertion and deletion for (Par)MmgAdd
DMPlexMetricNoInsertion()
to determine whether node insertion and deletion are turned off for (Par)MmgAdd
DMPlexMetricSetNoSwapping()
to turn off facet swapping for (Par)MmgAdd
DMPlexMetricNoSwapping()
to determine whether facet swapping is turned off for (Par)MmgAdd
DMPlexMetricSetNoMovement()
to turn off node movement for (Par)MmgAdd
DMPlexMetricNoMovement()
to determine whether node movement is turned off for (Par)MmgAdd
DMPlexMetricSetNoSurf()
to turn off surface modification for (Par)MmgAdd
DMPlexMetricNoSurf()
to determine whether surface modification is turned off for (Par)MmgAdd
DMPlexMetricSetGradationFactor()
to set the metric gradation factorAdd
DMPlexMetricGetGradationFactor()
to get the metric gradation factorAdd
DMPlexMetricSetHausdorffNumber()
to set the metric Hausdorff numberAdd
DMPlexMetricGetHausdorffNumber()
to get the metric Hausdorff numberAdd
DMPlexMetricSetNumIterations()
to set the number of ParMmg adaptation iterationsAdd
DMPlexMetricGetNumIterations()
to get the number of ParMmg adaptation iterations
Change
DMPlexCoordinatesLoad()
to take aPetscSF
as argumentChange
DMPlexLabelsLoad()
to take thePetscSF
argument and load in parallelChange
DMPlexCreateFromFile()
to take the mesh name as argumentChange
DMAdaptMetric
so that it takes an additional argument for cell tagsChange
DMTransformAdaptLabel
so that it takes an additional argument for cell tagsChange
DMGenerateRegister
so that it registers routines that take an additional argument for cell tagsChange
DMPlexFindVertices()
to takeVec
andIS
arguments instead of arraysAdd
DMPlexTSComputeRHSFunctionFEM()
to support explicit timesteppingNewly created
DMPlex
will be distributed by default; this previously required-dm_distribute
or explicit calls toDMPlexDistribute()
Add
DMPlexDistributeGetDefault()
andDMPlexDistributeSetDefault()
to determine and set the default forDMPlex
distributionAdd meshing of the Schwarz-P and Gyroid triply periodic minimal surface (see
DMPlexCreateTPSMesh()
). These meshes can be automatically generated using-dm_plex_shape schwarz_p
or-dm_plex_shape gyroid
, with optional levels of refinement and extrusion to 3D solids with prescribed thickness.Add
DMCreateFEDefault()
as a convenience method for creating the right element on a meshRemove deprecated
DMPlexCreateFromCellList()
andDMPlexCreateFromCellListParallel()
Add
DMSetMatrixPreallocateSkip()
to save initialization time whenMatSetPreallocationCOO()
will be used.Improve loading performance related to coordinate projection in common cases.
Add
DMPlexGetOrdering1D()
for 1D Plex problemsAdd
DMPlexComputeClementInterpolant()
averaging operator
DMPlexLandau:
Add
DMPlexLandauCreateVelocitySpace()
Create DMComposite of DMPlex for Landau collision operatorAdd
DMPlexLandauDestroyVelocitySpace()
Destroy DMComposite of DMPlex for Landau collision operatorAdd
DMPlexLandauIFunction()
Landau collision operatorAdd
DMPlexLandauIJacobian()
Landau collision operator
FE/FV:
Deprecate
PetscSpacePolynomialGetSymmetric()
andPetscSpacePolynomialSetSymmetric()
: symmetric polynomials were never supported and support is no longer plannedRemove
PetscSpacePolynomialType
enum and associated array of stringsPetscSpacePolynomialTypes
: other polynomial spaces are now handled by other implementations ofPetscSpace
Add
PETSCSPACEPTRIMMED
that implements trimmed polynomial spaces (also known as the spaces in Nedelec face / edge elements of the first kind)Replace
PetscDSGet/SetHybrid()
withPetscDSGet/SetCohesive()
Add
PetscDSIsCohesive()
,PetscDSGetNumCohesive()
, andPetscDSGetFieldOffsetCohesive()
Add argument to
PetscFEIntegrateHybridJacobian()
to indicate the face for the integrationAdd
PetscFECreateByCell()
andPetscFECreateLagrangeByCell()
to create FE spaces on specific cell typesReplace
PetscDualSpaceCreateReferenceCell()
withDMPlexCreateReferenceCell()
Add
PetscDualSpaceEqual()
andPetscQuadratureEqual()
DMNetwork:
DMNetworkAddComponent()
now requires a valid component key for each call
DMStag:
DT:
Add
PetscDTPTrimmedEvalJet()
to evaluate a stable basis for trimmed polynomials, andPetscDTPTrimmedSize()
for the size of that spaceAdd
PetscDSGetRHSResidual()
andPetscDSSetRHSResidual()
to support explicit timesteppingAdd
PetscDTTensorQuadratureCreate()
to combine different quadratures, such as on a prismAdd
PetscProbComputeKSStatistic()
to apply the Kolmogorov-Smirnov testAdd probability distributions
PetscPDFMaxwellBoltzmann1D()
,PetscCDFMaxwellBoltzmann1D()
,PetscPDFMaxwellBoltzmann2D()
,PetscCDFMaxwellBoltzmann2D()
,PetscPDFMaxwellBoltzmann3D()
,PetscCDFMaxwellBoltzmann3D()
,PetscPDFGaussian1D()
,PetscCDFGaussian1D()
,PetscPDFSampleGaussian1D()
,PetscPDFGaussian2D()
,PetscPDFSampleGaussian2D()
,PetscPDFConstant1D()
,PetscCDFConstant1D()
Fortran:
Logging:
Add
PetscLogIsActive()
to determine if logging is in progress or not