Changes: Development#
General:
Change behavior of
-options_leftwhen set totrue: it no longer triggers a call toPetscOptionsView()Change \(PETSC_DIR/lib/petsc/bin/petscfreesharedmemory to \)PETSC_DIR/lib/petsc/bin/petscfreesharedmemory.sh
Configure/Build:
Make
SYCLadevicePackage, i.e., builds--with-syclnow havePETSC_HAVE_DEVICEdefinedAdd the option
--with-devicelanguageto compilePetscDevicecode using either a C or C++ compilerAdd
Caliper, an instrumentation and performance profiling library that can be used to profileHypre.Add typing stubs for the Python extension module
petsc4py.PETSc.Remove
--with-mumps-serialoption, rely on--with-mpi=0
Sys:
Add
PetscCallHYPRE()to check HYPRE error codes and print error messages on failureAdd
PetscBTCountSet()to count set bits inPetscBTAdd the option
-hypre_umpire_device_pool_size <n>to set the Umpire device memory pool size (in MiB), which is used by HYPRE and 4 Gib by defaultChange
PetscStackCallExternalVoid()toPetscCallExternalVoid()
Event Logging:
Add two approaches for GPU energy monitoring:
-log_view_gpu_energyand-log_view_gpu_energy_meterAdd API
PetscLogGpuEnergy(),PetscLogGpuEnergyMeter(),PetscLogGpuEnergyMeterBegin()andPetscLogGpuEnergyMeterEnd()for GPU energy monitoringRemove
TAO_ObjectiveEval,TAO_GradientEval,TAO_ObjGradEval,TAO_HessianEvallog events; objective, gradient, objective-and-gradient, and Hessian evaluations are now logged asTAOTERM_ObjectiveEval,TAOTERM_GradientEval,TAOTERM_ObjGradEval,TAOTERM_HessianEvalunderTAOTERM_CLASSID. These log events reflect the actual user callback invoked, not theTaoCompute*()function called by the solver; for example, callingTaoComputeGradient()when only an objective-and-gradient callback is provided logsTAOTERM_ObjGradEvalAdd
TAO_ResidualEvallog event forTaoComputeResidual(); previouslyTaoComputeResidual()reusedTAO_ObjectiveEval
PetscViewer:
Change the final argument of
PetscViewerGLVisSetFields()toPetscCtxDestroyFn *. This means the destroy function must dereference the argument before operating on it
PetscDraw:
AO:
IS:
VecScatter / PetscSF:
PF:
Vec:
Add
VecNestGetSubVecsRead()andVecNestRestoreSubVecsRead()for read-only access to subvectorsAdd
VecPointwiseSign()andVecSignMode
PetscSection:
Add
PetscSectionMigrateData(), akin toDMPlexDistributeData()
PetscPartitioner:
Mat:
Add
MatCreateDenseWithMemType()andMatDenseReplaceArrayWithMemType()Change the
destroy()function argument ofMatShellSetMatProductOperation()to typePetscCtxDestroyFn *. This means the destroy function must dereference the argument before operating on itRemove
MatMissingDiagonal(). Developers should useMatGetDiagonalMarkers_SeqXXX()when the functionality is neededChange
MatSetOption(A, MAT_HERMITIAN, PETSC_TRUE)forMatSBAIJto no longer automatically set the optionMAT_SYMMETRICtoPETSC_FALSE. It is now the duty of the user to callMatSetOption(A, MAT_SYMMETRIC, PETSC_FALSE)if aMatSBAIJis Hermitian but not symmetricDeprecate
-matmatmult_Bbnin favor of-matproduct_batch_sizeAdd
-mat_vec_typeoption forMatSetFromOptions()
MatCoarsen:
PC:
Add multi-precision support for MUMPS. One could use
-pc_precision <single, double>to set the precision to be used by MUMPS, which can be different fromPetscScalar’s precisionAdd support for MUMPS out-of-core facility with the option
-mat_mumps_ooc_tmpdir <dir>and new functionsMatMumpsSetOocTmpDir(),MatMumpsGetOocTmpDir()Add
PCPatchSetComputeOperatorExteriorFacets()andPCPatchSetComputeFunctionExteriorFacets()to support exterior (boundary) facet integral callbacks in the patch preconditioner
KSP:
Change
KSPSetDMActive()to take aKSPDMActiveargumentRemove
KSPHPDDMPrecisionin favor ofPetscPrecisionDeprecate
KSPPIPEGCRSetModifyPC(),KSPGCRSetModifyPC(), andKSPFGMRESSetModifyPC()in favor ofKSPFlexibleSetModifyPC()Deprecate
KSPFGMRESModifyPCNoChange()andKSPFGMRESModifyPCKSP()in favor ofKSPFlexibleModifyPCNoChange()andKSPFlexibleModifyPCKSP()
SNES:
Change the
destroy()function argument ofSNESSetConvergenceTest()to typePetscCtxDestroyFn *. This means the destroy function must dereference the argument before operating on itChange
SNES_DIVERGED_FNORM_NANtoSNES_DIVERGED_FUNCTION_NANORINFAdd developer functions
SNESCheckFunctionDomainError(),SNESLineSearchCheckFunctionDomainError(),SNESCheckObjectiveDomainError(),SNESLineSearchCheckObjectiveDomainError(),SNESCheckJacobianDomainError(), andSNESLineSearchCheckJacobianDomainError()Add
SNESNewtonALSetDiagonalScalingto allow for per-DoF scaling of solution vector when computing arc length
SNESLineSearch:
TS:
Add
TSPseudoComputeFunction()to get nonlinear residual while avoiding recalculation if possibleRemove unused
TSPseudoVerifyTimeStepDefault()Remove
TSPseudoComputeTimeStep()andTSPseudoVerifyTimeStep()Change the
destroy()function argument ofTSTrajectorySetTransform()to typePetscCtxDestroyFn *. This means the destroy function must dereference the argument before operating on itCorrect option
-ts_max_rejectto-ts_max_step_rejectionsCorrect option
-ts_dtto-ts_time_stepChange
TSAdaptCheckStage()to call function set byTSAdaptSetCheckStage()before other checksFix
-ts_ssp_nstagesto-ts_ssp_num_stages
TAO:
Add
TaoTermobject to allow easily constructing and using objective functions, and their derivatives that are the sum of two or more terms. This will allow the easy implementation of Tao solvers that utilize the sum structureAdd
TaoGetTerm()andTaoAddTerm()for manipulating the objective, gradient, and Hessian evaluation of aTaousingTaoTermAdd
TaoGetHessianMatrices()to get the Hessian and preconditioner matrices from aTaoFix
TAOBRGNsuch thatTAOBRGNsubsolver properly appendsTAOBRGN’s prefixChange
TaoComputeResidual()to increment a new residual evaluation counter instead of the objective function evaluation counterChange
-tao_viewto report residual evaluations separately and to include matrix-free finite-difference gradient evaluations in the gradient evaluation count
TaoTerm:
Add
TAOTERMCALLBACKSimplementation ofTaoTermconstructed from the function callbacks passed to aTaoobjectAdd
TAOTERMSHELLimplementation ofTaoTermfor user-defined objective routinesAdd
TAOTERMSUMimplementation ofTaoTermfor scaled, mapped sums of termsAdd
TAOTERMHALFL2SQUAREDimplementation ofTaoTermfor a squared-norm penalty functionAdd
TAOTERML1implementation ofTaoTermfor a 1-norm penalty functionAdd
TAOTERMQUADRATICimplementation ofTaoTermfor a quadratic penalty functionAdd finite difference utilities:
TaoTermComputeGradientFD(),TaoTermComputeHessianFD(),TaoTermCreateHessianMFFD(), and set/get functionsTaoTermComputeGradientSetUseFD()/TaoTermComputeGradientGetUseFD(),TaoTermComputeHessianSetUseFD()/TaoTermComputeHessianGetUseFD()
PetscRegressor:
PetscDA:
Add data assimilation object
PetscDAwith two ensemble-based implementationsPETSCDAETKFandPETSCDALETKFand three tutorials: Lorenz-96, traveling wave, and dam breakMove localization
PetscDALETKFGetLocalizationMatrix()utility out ofDMPLEXand intoPETSCDALETKF
DM:
Change the final argument of
DMShellSetDestroyContext()toPetscCtxDestroyFn *. This means the destroy function must dereference the argument before operating on itAdd
DMLabelGetValueISGlobal()to get globally consistentISof values in aDMLabel
DMSwarm:
DMPlex:
Add an extra communicator argument to
DMPlexFilter()to allow extracting local meshesChange
verticesAdjSavedparameter inDMPlexCreateFromCell*Parallel*()functions to be allocated by function rather than by userAdd
DMPlexCreateColoring()
FE/FV:
DMNetwork:
DMStag:
DT:
Fortran:
Replace
./configureoption--with-mpi-f90module-visibilitywith--with-mpi-ftn-module=<mpi or mpi_f08>Add
PETSC_INT_KINDandPETSC_MPIINT_KINDFortran code should now use
MPIU_Comminstead ofMPI_Comm, and similarly for other MPI types, see section “Fortran and MPI” in the users guideFortran interface definitions are now automatically generated for all functions that take context variable arguments, represented in the C source code with a type of
PetscCtx, allowing the use of any Fortran derived type (or PETSc object) as the contextFor all PETSc functions
XXXGetYYY()that return a context variable as an argument, represented in the C source code with an argument type ofPetscCtxRt, a macro is generated used withInterface_XXXGetYYY(AppCtx)which tells the Fortran compiler that a pointer to that derived typetype(AppCtx)is returned from the Fortran version ofXXXGetYYY(). See src/snes/tutorials/ex5f90.F90`