Changes: Development#
General#
Increase the minimum required CUDA Toolkit version to 11.4
Change the policy so that documentation changes/fixes/additions are added to the
mainbranch, not thereleasebranchChange
petscdiffto treat<in expected output as text that must match instead of suppressing differences from numerical outputChange the
make branch-reviewrule to[PETSC_LLM_CLI=command] [PETSC_LLM_MODEL=modelname] make branch-review. Add support for Gemini, Codex, OpenCode, and other LLM CLIs. Replace the use ofCLAUDE_OPTSwithPETSC_LLM_CLI_OPTSandPETSC_LLM_MODELAdd a CodeGraph skill and repository guidance so LLM coding tools automatically use an existing local PETSc CodeGraph index when navigating or reviewing source
Add
commandprefixas initial arguments toPetscOptionsDeprecatedNoObject()
Configure/Build#
Increase the minimum required Python version for
./configureto 3.6Add
providesDocsanddocsDirspackage attributes so that an external package’s sources can be cloned and scanned to generate PETSc manual pages when the documentation is builtAdd interface to LIBXSMM
Sys#
Add
PetscGetConfiguration()Deprecate
PETSC_MPI_THREAD_REQUIREDAdd support for running PETSc applications as MCP servers that can be accessed by LLMs
Add
PetscRandomAppendOptionsPrefix()andPetscRandomGetOptionsPrefix()Add
PetscCallLAPACKInfo()for calling LAPACK routines with aninfoargument where the caller requires aninfovalue of 0 for the program to continueAdd
PetscIntCSRView()to inspect CSR graph
Event Logging#
Change
-logand-log_allto only take optional filename arguments. They no longer take optional boolean argument
PetscViewer#
Add support for writing CGNS descriptors on the base node:
PetscViewerCGNSGetDescriptors(),PetscViewerCGNSRestoreDescriptors(),PetscViewerCGNSSetDescriptor()Add
PetscViewerVTKWriteFnas the typedef prototype for thewrite()function passed toPetscViewerVTKAddField(). This addition requires no changes to user source code
PetscDraw#
AO#
IS#
Add
PetscLayoutGetComm()to obtain the MPI communicator of aPetscLayout
VecScatter / PetscSF#
PF#
Vec#
Add
VecCreateSeqWithArrayAndMemType()andVecCreateMPIWithArrayAndMemType()to create array-style standard, CUDA, or HIP vectors from memory of a specifiedPetscMemTypeAdd
VecSetStdBasis()API to set a vector to the i-th standard basis vectorChange the behavior of
VecPointwiseDivide()implementing w = x / y: if a particulary[i]is zero andx[i]is also zero,w[i]is set to one (before it was set to zero).Deprecate
-vec_view_stashin favor of-vec_stash_view
PetscSection#
PetscPartitioner#
Mat#
Add
MATPRODUCT_PtAPsupport forMATDIAGONALandMATCONSTANTDIAGONALAdd
MATPRODUCT_ABsupport forMATDIAGONALandMATCONSTANTDIAGONALwith any matrix typeAdd
MatSeqAIJGetKokkosView(),MatSeqAIJRestoreKokkosView(),MatSeqAIJGetKokkosViewWrite()andMatSeqAIJRestoreKokkosViewWrite()to the public APIChange
MatSeqAIJCUSPARSEGetIJ(),MatSeqAIJCUSPARSERestoreIJ(),MatSeqAIJHIPSPARSEGetIJ()andMatSeqAIJHIPSPARSERestoreIJ()to returnPetscIntindices instead ofintAdd
MatNormApproximate()to compute matrix norms approximatelyAdd
MatGetMultPetscSF()to access thePetscSFused to communicate off-process vector entries inMatMult()forMATMPIAIJ,MATMPIBAIJ,MATMPISBAIJ,MATMPIDENSE, andMATMPISELLChange
MATSEQSBAIJbehavior inMatPermute()andMatDiagonalScale()to useMATSEQBAIJwhen the result is not necessarily symmetricChange
MatGetValues()to respect the row or column orientation set withMatSetOption(mat, MAT_ROW_ORIENTED, ...). This will break current code that callsMatSetOption(mat, MAT_ROW_ORIENTED, PETSC_FALSE)and usesMatGetValues()Add new
MatTypeMATSEQBAIJLIBXSMMandMATMPIBAIJLIBXSMMAdd support for
MatSetInf()withMATSEQDENSEandMATMPIDENSE; noMatTypeimplemented it beforeAdd device SpMM support for
MATPRODUCT_ABandMATPRODUCT_AtBwith aMATAIJKOKKOSmatrix and dense matrices; previously these products loopedMatMult()over the columns of the dense matrixChange
MatCreateMAIJ()to convert its result toMATAIJKOKKOSwhen the input matrix has that type, as is already done forMATAIJCUSPARSE; theMATMAIJkernels read the host arrays of the input matrix directly and so miss values last updated on deviceChange
MatDiagonalScale()forMATSEQDENSECUDAandMATSEQDENSEHIPto check the memory type of the scalingVecinstead of itsVecType, so device-resident vectors such asVECKOKKOSare consumed directly on the GPU instead of being copied through the hostAdd
MatDenseUpdateColumnLayout()to change the layout of input vectors of the matrix vector productChange
MatGetState()to return aMatStateand addMatStateCompare(),MatStateCompareUpdate(), andMatStateInvalidate()Fix
MatNorm()forMATMPIDENSEto respect the leading dimension of the local matrix, which was previously ignored in parallel forNORM_1andNORM_FROBENIUSand gave wrong results, for example on matrices obtained withMatDenseGetSubMatrix()Add device implementations of
MatNorm()withNORM_1,NORM_FROBENIUS, andNORM_INFINITYforMATDENSECUDAandMATDENSEHIP; previously all norms copied the matrix to the hostChange
MatNorm()forMATMPIDENSEto computeNORM_FROBENIUSandNORM_INFINITYvia the local matrix norm, soMATMPIDENSECUDAandMATMPIDENSEHIPno longer copy to the host for those norms
MatCoarsen#
PC#
Add
PCGAMGSetProlongatorFilter()andPCGAMGGetProlongatorFilter()to set/get the threshold for filtering the prolongator inPCGAMG. The threshold is relative, applies to whole fine-node/coarse-node coupling blocks while preserving the near-null space, and must be in [0,1)Add
PCGAMGSetProlongatorFilterScale()andPCGAMGGetProlongatorFilterScale()to set/get the per-level scaling of the prolongator filter threshold inPCGAMG; the scale must be in [0,1]PCGAMGSetThresholdScale()now requires its argument to be in [0,1]PCGAMGSetThreshold()now requires each threshold value to be less than 1; negative values still mean keeping even zero entries in the graph. It is also nowLogically Collective(checked in debug builds), matchingPCGAMGSetThresholdScale()Add
PC_HPDDM_COARSE_CORRECTION_DEFLATED_REVERSEDfor applying the coarse correction after the fine correction inPCHPDDMAdd
PCAIRandPCPFLAREINVmanual pages, generated from the PFLARE sources when the documentation is builtFix
PCMGto honorPCSetUseAmat(pc, PETSC_FALSE)at all levelsAdd
PCMatApplyRichardson(),PCMatApplyRichardsonExists(), andPCShellSetMatApplyRichardson(), the block analogs ofPCApplyRichardson(),PCApplyRichardsonExists(), andPCShellSetApplyRichardson()Add the missing Fortran binding for
PCShellSetMatApply()Remove
PCSetDiagonalScale(),PCGetDiagonalScale(),PCDiagonalScaleLeft(), andPCDiagonalScaleRight()
KSP#
Fix for
KSPpre- and post-solve callbacks, that can now be used together with Eisenstat and Walker trick forSNESAdd
KSPPreSolve()andKSPPostSolve()to run the registeredKSPpre/post solve callbacksChange
KSPSolve()to run theKSPSetPreSolve()callback afterKSPSetUp()andKSPSetUpOnBlocks()instead of beforeAdd
KSPIDR— IDR(s) Induced Dimension Reduction Krylov solver (biorthogonal variant)Add
KSPIDRSetS(),KSPIDRGetS(),KSPIDRSetRandom(),KSPIDRGetRandom(),KSPIDRSetCosine(), andKSPIDRGetCosine()Deprecate
KSPMonitorResidualShort()and-ksp_monitor_short, remove thepreconditioned_residual_shortmonitor registry nameRemove
-ksp_plot_eigenvalues,-ksp_plot_eigenvalues_explicitly,-ksp_plot_eigencontoursthat have been deprecated since version 3.9Remove
KSPSetDiagonalScale(),KSPGetDiagonalScale(),KSPSetDiagonalScaleFix(), andKSPGetDiagonalScaleFix(), along with the-ksp_diagonal_scale,-ksp_diagonal_scale_fix, and-ksp_view_diagonal_scaleoptionsRemove
KSPAGMRES(Wakam and Erhel, 2011), which was never registered as a usableKSPTypeAdd native support for
KSPMatSolve()andKSPMatSolveTranspose()withKSPRICHARDSON, which iterates on batches of or the entire block of right-hand sides instead of solving them one at a timeAdd delegation of the
KSPRICHARDSONblock iteration toPCMatApplyRichardson()when thePCprovides it, falling back toPCApplyRichardson()on one right-hand side at a time so that the result matchesKSPSolve()Change
KSPConvergedDefault()to base the relative tolerance on the Frobenius norm of the batch of (preconditioned) right-hand sides during aKSPMatSolve()with a nonzero initial guess, matchingKSPSolve()Change
KSPMatSolve()andKSPMatSolveTranspose()to reset the residual history at the start of each solve, and of each batch when-ksp_matsolve_batch_sizeis used, asKSPSolve()does, unlessKSPSetResidualHistory()was called withresetset toPETSC_FALSEChange
KSPRichardsonSetSelfScale()to trigger aKSPSetUp()re-run when the flag changes, fixing an out-of-bounds work vector access when it was set afterKSPSetUp()GMRES orthogonalization routines have been promoted to the main
KSPlevel, and GMRES has been dropped from the name. The new names areKSPOrthogonalizationSet(),KSPOrthogonalizationGet(),KSPOrthogonalizationModifiedGramSchmidt(),KSPOrthogonalizationClassicalGramSchmidt(),KSPOrthogonalizationSetCGSRefinementType(),KSPOrthogonalizationGetCGSRefinementType(). Note that the signature of orthogonalization functions has changed, seeKSPOrthogonalizationFn. The related enumeration is nowKSP_ORTHOGONALIZATION_CGS_REFINE_*and command-line options are now-ksp_orthogonalization (cgs|mgs)and-ksp_orthogonalization_cgs_refinement_type (refine_never|refine_ifneeded|refine_always)
SNES#
Change
SNESSetUp()to not overwrite the NPC application context if one has previously been set on the NPCChange
SNESComputeJacobian()to call the user-provided Jacobian function when a left NPC is active and the solver is notSNESASPINAdd support for nonlinear preconditioners with a
DMdifferent from the parentSNESDM. CallingSNESSetNPC()will no longer enforce default parameters on the NPCChange
-snes_mfto respect an explicitly setPCtype instead of silently overriding it withPCNONE; an explicitly requestedPCthat requires an assembled matrix now errorsDeprecate
SNESMonitorDefaultShort()and-snes_monitor_shortAdd
SNESFASSetUseCoarseCorrectionLineSearch()and-snes_fas_use_coarse_correction_linesearchto implement the algorithm in [Nas00].Change default linesearch for
SNESFASwithSNESFASTypeofSNES_FAS_ADDITIVEtoSNESLINESEARCHSECANT
SNESLineSearch#
Deprecate
SNESLINESEARCHBASICin favor ofSNESLINESEARCHNONE
TS#
Add
DMTSSetIFunctionPre()Expose
TSDiscGradGetX0AndXdot()andTSDiscGradRestoreX0AndXdot()Add
TSIsImplicit()that indicates if theTSTypeis implicit and usesSNESorKSP
TAO#
Deprecate
TaoMonitorDefaultShort(),-tao_monitor_short, and-tao_monitor_short_intervalChange the deprecated
TaoSMonitor()and-tao_smonitorto use the full-precision default monitorAdd
TaoGetConvergedReasonString()to retrieve a human readable string describing theTaoConvergedReason
TaoTerm#
PetscRegressor#
PetscDA#
Add the
PetscDALETKFLocalizationTypeenum (PETSCDA_LETKF_LOC_NONE,PETSCDA_LETKF_LOC_GASPARI_COHN,PETSCDA_LETKF_LOC_GAUSSIAN,PETSCDA_LETKF_LOC_BOXCAR) selecting the LETKF localization kernelAdd
PetscDALETKFSetLocalizationType(),PetscDALETKFGetLocalizationType(),PetscDALETKFSetLocalizationRadius(),PetscDALETKFGetLocalizationRadius(), andPetscDALETKFSetLocalizationCoordinates(); the localization matrix is built lazily from these distance-based kernel parametersAdd
PetscDALETKFResetLocalization()to drop the cached localization matrix so the next analysis rebuilds it from the current kernel parametersRemove
PETSCDAETKF; usePETSCDALETKFwithPetscDALETKFSetLocalizationType(da, PETSCDA_LETKF_LOC_NONE)for identical behaviorRemove
PetscDAEnsembleSetSqrtType(),PetscDAEnsembleGetSqrtType(), thePetscDASqrtTypeenum (PETSCDA_SQRT_CHOLESKY,PETSCDA_SQRT_EIGEN), and the-petscda_ensemble_sqrt_typeoption; the symmetric-eigendecomposition square root is now the only pathRemove
PetscDALETKFSetLocalization(); use the distance-based APIPetscDALETKFSetLocalizationType(),PetscDALETKFSetLocalizationRadius(), andPetscDALETKFSetLocalizationCoordinates()insteadRemove
PetscDALETKFSetObsPerVertex()andPetscDALETKFGetObsPerVertex(); per-vertex observation counts are now derived from the distance-based localization kernelRemove
PetscDALETKFGetLocalizationMatrix(); the localization matrix is an internal cached object built lazily on the first analysis. Callers that previously supplied this matrix should switch toPetscDALETKFSetLocalizationCoordinates()and let the implementation build the matrix from the chosen kernelChange the LETKF distance-based periodicity convention: per-axis periodicity is now activated by
bd[d] > 0.0(the period), and negativebd[d]now raisesPETSC_ERR_ARG_OUTOFRANGE; previously any non-zerobd[d](including negative values) enabled periodicityAdd
PetscDAEnsembleForecastFntypedef for thePetscDAEnsembleForecast()model callbackChange the
PetscDAEnsembleForecast()model callback signature from(Vec, Vec, PetscCtx)to(Mat, PetscCtx); the model now receives the entire ensemble matrix and advances all members in place. Existing per-member callbacks should iterate over the columns withMatDenseGetColumnVec()/MatDenseRestoreColumnVec()(seeShallowWaterStep2D()insrc/ml/da/tutorials/ex4.c)Change
-petscda_viewto fire at the tail of everyPetscDAEnsembleAnalysis()call (mirroringKSPSolve()/SNESSolve()), so it now emits once per analysis cycle rather than once per run; code that wants a single end-of-run snapshot should callPetscDAView()explicitly after the assimilation loop
DM#
Change
DMLabelPropagatePush()to take a reduce operatorAdd
DMKSPSetCreateOperators()to let theDMprovide a pair of application specificMatobjects to innerKSPsolvers.Fix
DMGetLocalToGlobalMapping()for a local section carrying a chart permutation (seeDMReorderSectionSetDefault()); the map is now indexed by the local section offsets. The local section must now be set up withPetscSectionSetUp()before the mapping is built, otherwise an error is raisedFix
DMSetLocalSection()andDMSetGlobalSection()to invalidate a previously built section-derived local-to-global mapping, which was computed from the old sections; a mapping built by theDMimplementation itself, such as byDMDAinDMSetUp(), is kept.DMFORESTwithp4estshares its sections into its cachedDMPLEXwithout going through those setters, and now invalidates the mapping there as well
DMSwarm#
Add
DMSwarmProjectFields()andDMSwarmProjectGradientFields()Add
DMSwarmSortclassAdd
DMSwarmSortDestroy()andDMSwarmSortView()Allow
DMSwarmCellDMSetSort()to take inNULLand clear the sortAdd
DMSwarmPreallocateMassMatrix()andDMSwarmFillMassMatrix()
DMPlex#
Add
DMPlexDrawCell()Add
DMPlexLabelCompleteStar()Add an extra communicator argument to
DMPlexFilter()to allow extracting local meshesAdd
DMPlexCopyFlags()Add
DMPlexCheckLabel()andDMPlexReconcileLabel()Change CGNS viewer to use multi-component read/write interface for better performance
Add
DMPlexLabelCohesiveCheck()Change
DMPlexLabelCohesiveComplete()to remove split argumentAdd
DM_SHAPE_DIIIDAdd
DMPlexTriangleSetAngleBound(),DMPlexTriangleGetAngleBound(),DMPlexTetgenSetRadiusEdgeBound(),DMPlexTetgenGetRadiusEdgeBound(),DMPlexTetgenSetDihedralBound(),DMPlexTetgenGetDihedralBound()
FE/FV#
DMNetwork#
DMStag#
DT#
Add
PetscWeakFormGetKeys()