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-dialectargument 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++14means you want-std=gnu++14, no more, no lessFix for requesting no C++ dialect flag via
--with-cxx-dialect=0. Previouslyconfigurewould bail out immediately without running the tests and therefore wouldn’t set any of the capability defines.configurenow 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_PATCHso as to not have confusion with patch releases where the subminor version changesChange
PETSC_HAVE_MKLtoPETSC_HAVE_MKL_LIBSAdd
PETSC_HAVE_MKL_INCLUDESEnable HYPRE GPU for 64bit indices build (using HYPRE’s mixed-int configuration)
Reuse PETSc-installed hwloc when installing Open MPI
Sys:
Add
MPI_Comm_get_name()andMPI_Comm_set_name()to MPIUNIRemove
petsccublas.handpetschipblas.hRemove
-petsc_use_default_null_streamand-[cuda|hip]_synchronizeoptionsRemove
PetscCUDASynchronizeandPetscHIPSynchronize. Their operation is now managed byPetscDeviceContextvia itsPetscStreamTypeattributeRemove
PetscCUDAInitialize(),PetscCUDAInitializeCheck(),PetscHIPInitialize(), andPetscHIPInitializeCheck(). Their function is now handled byPetscDeviceInitialize()andPetscDeviceInitialized()Remove
PetscCUBLASInitializeHandle(),PetscCUSOLVERDnInitializeHandle(),PetscHIPBLASInitializeHandle(), andPetscHIPSOLVERInitializeHandle(). Their function is now handled implicitly byPetscDeviceContextRemove
petsc_gputimer_beginandpetsc_gputimer_beginAdd
-device_enable,-device_selectand-device_viewstartup-options to control coarse-grained device initialization strategyReplace
-[cuda|hip]_devicewith split options-device_enable_[cuda|hip]and-device_select_[cuda|hip]to enable fine-grained control of device selection and initialization strategyReplace
-[cuda|hip]_viewwith-device_view_[cuda|hip]Add
PetscDeviceInitTypeto 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 aPetscDevicefor a specific deviceAdd
PetscDeviceView()Move
PetscInt64_FMTandMPIU_INT64definitions topetscsystypes.hAdd
PetscBLASInt_FMT,PETSC_MPI_COMM_FMT, andPETSC_MPI_WIN_FMTformat specifiersAdd
petscmacros.hheader 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_NODISCARDAdd
PetscSizeTas a language-agnostic equivalent ofsize_tfrom<stddef.h>Add
PetscCountas a signed datatype for counts, equivalent toptrdiff_tfrom<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,inlineis a standard keyword since C99 and C++11Deprecate
PETSC_STATIC_INLINE, as bothstaticandinlineare standard keywords since C99 and C++11Remove
PETSC_C_RESTRICT,restrictis 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.PetscDeviceinitialization for CUDA and HIP will now respectCUDA_VISIBILE_DEVICESandHIP_VISIBLE_DEVICESenvironment variables respectivelyAdd
PETSC_ATTRIBUTE_COLDto 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
CHKERRvariants listed above in C/C++ sources. New code should prefer thePetscCallvariants though no compiler diagnostics will be emitted if the old versions are used. One may use${PETSC_DIR}/share/petsc/chkerrconvert.pyto perform the conversions automatically, though users should note that this script is considered “beta” software. It was used to facilitate theCHKERRchanges 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_DECIDEAdd
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, removeconstfromilocalandiremoteargumentsAdd
PetscSFConcatenate()
PF:
Vec:
Change
VecTaggerComputeBoxes()andVecTaggerComputeIS()to return a boolean whose value is true if the list was createdAdd
-vec_bind_belowoption for specifying size threshold below which GPU is not used forVecoperationsAdd
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_belowoption for specifying size threshold below which GPU is not used forMatoperationsAdd
MatSetBindingPropagates()Add
MatGetBindingPropagates()Add
MatSeqAIJGetArrayWrite()andMatSeqAIJRestoreArrayWrite()to get write-access to the value array ofMatSeqAIJon 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
MatStructuresenumeration to avoid spaces and match capitalization of other enumerationsChange size argument of
MatSetPreallocationCOO()toPetscCountAdd
MATORDERINGMETISNDuse METIS for nested dissection ordering ofMatSeqAIJ, with optionsnseps,niter,ufactorandpfactorunder the common prefix-mat_ordering_metisnd_Change options
-matproduct_<product_type>_viato-mat_product_algorithmAdd
-mat_superlu_dist_3dand-mat_superlu_dist_d <n>to support using SuperLU_DIST’s version 7.2 3d decomposition algorithmsMATISnow 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
PCBJKOKKOSa new, experimental batch Kokkos solver-pc_type bjkokkos -pc_bjkokkos_ksp_type [tfqmr|bicg] -pc_bjkokkos_pc_type jacobi -ksp_type preonlyAdd -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
PCGAMGdefault to usePCJACOBIsmoothing instead ofPCSOR. 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
PCGAMGeigenvalue estimation to useKSPCGwhenMAT_SPDhas been set (seeMatSetOption()) andKSPCRwhenMAT_SYMMETRICorMAT_HERMITIANhas 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
PCGAMGto usePCGAMGSetUseSAEstEig()by default when the smoother uses Jacobi preconditioning.
KSP:
Outer most
KSPSolve()will error ifKSP_DIVERGED_ITSandKSPSetErrorIfNotConverged()is usedAdd
KSPQMRCGSto 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_denseto use a dense linear solver (serial only) within CVODE, instead of the default iterative solveChange timestepper type
TSDISCGRADto 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
TSRemoveTrajectoryto 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()forDMLabelcomparisonAdd
DMCompareLabels()comparingDMLabels of twoDMsDMCopyLabels()now takes DMCopyLabelsMode argument determining duplicity handlingAdd
-dm_bind_belowoption for specifying size threshold below which GPU is not used forVecandMatobjects 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=NULLrecovers 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_matto-dm_plex_csr_algwhich takes a DMPlexCSRAlgorithm name- Add public API for metric-based mesh adaptation:
Move
DMPlexMetricCtxfrom public to private and give it toDMPlexAdd
DMPlexMetricSetFromOptions()to assign values toDMPlexMetricCtxAdd
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
DMPlexMetricCtxso 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
DMAdaptorso that its-adaptor_refinement_h_min/h_max/a_max/pcommand 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 aPetscSFas argumentChange
DMPlexLabelsLoad()to take thePetscSFargument and load in parallelChange
DMPlexCreateFromFile()to take the mesh name as argumentChange
DMAdaptMetricso that it takes an additional argument for cell tagsChange
DMTransformAdaptLabelso that it takes an additional argument for cell tagsChange
DMGenerateRegisterso that it registers routines that take an additional argument for cell tagsChange
DMPlexFindVertices()to takeVecandISarguments instead of arraysAdd
DMPlexTSComputeRHSFunctionFEM()to support explicit timesteppingNewly created
DMPlexwill be distributed by default; this previously required-dm_distributeor explicit calls toDMPlexDistribute()Add
DMPlexDistributeGetDefault()andDMPlexDistributeSetDefault()to determine and set the default forDMPlexdistributionAdd meshing of the Schwarz-P and Gyroid triply periodic minimal surface (see
DMPlexCreateTPSMesh()). These meshes can be automatically generated using-dm_plex_shape schwarz_por-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
PetscSpacePolynomialTypeenum and associated array of stringsPetscSpacePolynomialTypes: other polynomial spaces are now handled by other implementations ofPetscSpaceAdd
PETSCSPACEPTRIMMEDthat 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