Changes: 3.19#
General:
Add perfstubs package, see Users Manual: Profiling: Using TAU for more information on usage
Configure/Build:
Remove unused preprocessor variables
PETSC_HAVE_VPRINTF_CHAR
,PETSC_HAVE_VFPRINTF_CHAR
,PETSC_STAT_MACROS_BROKEN
,PETSC_HAVE_FORTRAN_GETARG
,PETSC_uid_t
,PETSC_gid_t
,PETSC_HAVE_PTHREAD_BARRIER_T
,PETSC_HAVE_SCHED_CPU_SET_T
,PETSC_HAVE_SYS_SYSCTL_H
,PETSC_HAVE_SYS_SYSINFO_H
,PETSC_HAVE_SYSINFO_3ARG
,PETSC_SIZEOF_SHORT
, andPETSC_SIZEOF_ENUM
Deprecate
--with-gcov
configure option in favor of--with-coverage
Add
--with-coverage-exec
configure option to specify the coverage-collection tool to be used e.g.gcov
or/path/to/llvm-cov-15
Add
--with-strict-petscerrorcode
configure option to enable compile-time checking for correct usage ofPetscErrorCode
, see belowAdd support for C++20
Add support for CUDA-12
Improved C++ dialect handling for non-conformal cases. In general
configure
will fail faster and with a more informative error message when the C++ compiler does not comply with restraints
Sys:
Change
PetscOptionsMonitorDefault()
to also take in the option source, andPetscOptionsMonitorSet()
to take the new monitor functionDeprecate
PetscTable
and related functions. Previous users ofPetscTable
are encouraged to use the more performantPetscHMapI
instead, though they should note that this requires additional steps and limitations:#include <petscctable.h>
must be swapped for#include <petsc/private/hashmapi.h>
. This of course requires that you have access to the private PETSc headers.While most of the old
PetscTable
routines have direct analogues inPetscHMapI
,PetscAddCount()
does not. All uses of this routine should be replaced with the following snippet:// PetscHMapI hash_table; // PetscInt key; PetscHashIter it; PetscBool missing; PetscCall(PetscHMapIPut(hash_table, key, &it, &missing)); if (missing) { PetscInt size; PetscCall(PetscHMapIGetSize(hash_table, &size)); PetscCall(PetscHMapIIterSet(hash_table, it, size)); }
Furthermore, users should note that
PetscHMapI
is based on – and directly#include
s –${PETSC_DIR}/include/petsc/private/khash/khash.h
. This file contains external source code that is licensed under the MIT license, which is separate from the PETSc license.Remove undocumented
PETSC_MPI_WIN_FMT
andPETSC_MPI_COMM_FMT
. Users should cast bothMPI_Comm
andMPI_Win
toPETSC_INTPTR_T
and use thePETSC_INTPTR_T_FMT
format specifier instead:MPI_Comm comm; MPI_Win win; // old PetscCall(PetscPrintf(..., "MPI Comm %" PETSC_MPI_COMM_FMT, comm)); PetscCall(PetscPrintf(..., "MPI Window %" PETSC_MPI_WIN_FMT, win)); // new PetscCall(PetscPrintf(..., "MPI Comm %" PETSC_INTPTR_T_FMT, (PETSC_INTPTR_T)comm)); PetscCall(PetscPrintf(..., "MPI Window %" PETSC_INTPTR_T_FMT, (PETSC_INTPTR_T)win));
Deprecate
PETSC_NULL
in favor ofPETSC_NULLPTR
as it does the right thing in both C and C++Significantly improve lookup and deletion performance of
PetscFunctionList
. This also improves performance ofPetscObjectComposeFunction()
andPetscObjectQueryFunction()
.Optionally define
PetscErrorCode
as anenum
, and tag it asPETSC_NODISCARD
. This feature may be enabled by configuring PETSc with--with-strict-petscerrorcode
configure option. This feature allows catching the following logical errors at compile-time:Not properly checking the return-code of PETSc calls via
PetscCall()
. PETSc is left in an inconsistent state when errors are detected and cannot generally recover from them, so is not supported.Using the wrong
PetscCall()
variant, for example usingPetscCall()
on MPI functions (instead ofPetscCallMPI()
).Returning
PetscErrorCode
frommain()
instead ofint
.
Users should note that this comes with the following additional changes:
Add
PETSC_SUCCESS
to indicate success, always guaranteed to equal0
.PetscFunctionReturn(0)
should be changed toPetscFunctionReturn(PETSC_SUCCESS)
. While the original0
-form will continue to work in C, it is required for C++.Any user-defined macros using boolean short-circuiting to chain multiple calls in the same line, which logically return a
PetscErrorCode
, should now explicitly cast the “result” of the macro withPetscErrorCode
:// Both foo() and bar() defined as returning PetscErrorCode extern PetscErrorCode foo(int); extern PetscErrorCode bar(int); // The following macros logically "return" a PetscErrorCode, i.e. can // be used: // // PetscCall(MY_USER_MACRO(a, b)); // // but use boolean short-circuiting to chain the calls together. bar() // only executes if foo() returns PETSC_SUCCESS // old #define MY_USER_MACRO(a, b) (foo(a) || bar(b)) // new #define MY_BETTER_USER_MACRO(a, b) ((PetscErrorCode)(foo(a) || bar(b)))
While currently opt-in, this feature will be enabled by default in a future release. Users are highly encourage to enable it and fix any discrepancies before that point. Note that
PETSC_SUCCESS
is defined whether or not the feature is enabled, so users may incrementally update.Add
PetscFFlush()
Soft-deprecate
PetscStrcpy()
andPetscStrcat()
. No diagnostics will be emitted if these routines are used, but users are highly encouraged to switch to the more secure (and possibly performant)PetscStrncpy()
andPetscStrlcat()
Add
PETSC_REAL_MIN
for smallest normalized floating point numberAdd
PETSC_ATTRIBUTE_MAY_ALIAS
to inform compilers that a type is not subjected to type-based alias analysis
Event Logging:
PetscViewer:
The VTK viewers (
.vts
,.vtr
, and.vtu
) now useheader_type="UInt64"
to enable writing large binary appended blocks
PetscDraw:
Add
PetscDrawSetVisible()
to set if the drawing surface (the ‘window’) is visible on its display
AO:
IS:
Change
ISDuplicate()
to preserve the block size of the input in the outputDeprecate
ISCompressIndicesSorted()
VecScatter / PetscSF:
Add experimental support in PetscSF for MPICH MPIX_Stream (with MPICH-4.2.0 and higher). One can enable it via
-sf_use_stream_aware_mpi
Add an alias option
-sf_use_gpu_aware_mpi
to-use_gpu_aware_mpi
Remove
SCATTER_LOCAL
from the enum type since it is not a public valueChange
PetscSFConcatenate()
to acceptPetscSFConcatenateRootMode
parameter; add option to concatenate root spaces globallyAdd
PetscSFSetGraphFromCoordinates()
to construct a graph from fuzzy matching of coordinates; such as occurs for projections between different dimensions or for overlapping meshes
PF:
Vec:
Document
VecOperation
Add
VECOP_SET
Significantly improve performance of
VecMDot()
,VecMAXPY()
andVecDotNorm2()
for CUDA and HIP vector types. These routines should be between 2x and 4x faster.Enforce the rule that
VecAssemblyBegin()
andVecAssemblyEnd()
must be called on even sequential vectors after calls toVecSetValues()
. This also applies to assignment of vector entries in petsc4py
PetscSection:
PetscPartitioner:
Mat:
MatSetValues()
and friends will now provide reasonable performance when no preallocation information is providedAdd
MatEliminateZeros()
Improve efficiency of
MatConvert()
fromMATNORMAL
toMATHYPRE
Add
MatDenseGetArrayAndMemType()
,MatDenseRestoreArrayAndMemType()
,MatDenseGetArrayReadAndMemType()
,MatDenseRestoreArrayReadAndMemType()
,MatDenseGetArrayWriteAndMemType()
andMatDenseRestoreArrayWriteAndMemType()
to return the array and memory type of a dense matrixDeprecate all MatPreallocate* routines. These are no longer needed since non-preallocated matrices will now be as fast as using them
Significantly improve performance of
MatScale()
andMatAXPY()
forMATDENSECUDA
andMATDENSEHIP
in the case where the leading dimension is greater than the number of columns/rows. This situation arises when using e.g. sub-matrices. These routines should be between 3x and 4x faster
MatCoarsen:
PC:
Add
PCHPDDMSetSTShareSubKSP()
KSP:
Add
KSPMonitorDynamicToleranceCreate()
andKSPMonitorDynamicToleranceSetCoefficient()
Change
-sub_ksp_dynamic_tolerance_param
to-sub_ksp_dynamic_tolerance
Add support for
MATAIJCUSPARSE
andVECCUDA
toKSPHPDDM
Deprecate
KSP_CONVERGED_CG_NEG_CURVE
in favor ofKSP_CONVERGED_NEG_CURVE
Deprecate
KSP_CONVERGED_CG_CONSTRAINED
in favor ofKSP_CONVERGED_STEP_LENGTH
Add fourth kind Chebyshev polynomials; see
KSPChebyshevKind
andKSPChebyshevSetKind()
Add
KSPSetConvergedNegativeCurvature()
to declare convergence if negative curvature is detected by the Krylov solverAdd MINRES-QLP, available via
KSPMINRESSetUseQLP()
or the command line-ksp_minres_qlp
Replace old MINRES implementation
Add
KSPMatSolveTranspose()
SNES:
Add
SNESPruneJacobianColor()
to improve the MFFD coloringAdd
SNESVIGetVariableBounds()
to access variable bounds of aSNESVI
SNESLineSearch:
TS:
Add
TSPruneIJacobianColor()
to improve the MFFD coloringAdd argument to
TSMonitorSPCtxCreate()
to enable multispecies plotsAdd
TSMonitorHGCtxCreate()
,TSMonitorHGCtxDestroy()
,TSMonitorHGSwarmSolution()
to support histogram plots of particle swarmsAdd support for first-order adjoint calculation for
TSARKIMEX
TAO:
DM/DA:
Add
DMLabelGetType()
,DMLabelSetType()
,DMLabelSetUp()
,DMLabelRegister()
,DMLabelRegisterAll()
,DMLabelRegisterDestroy()
Add
DMLabelEphemeralGetLabel()
,DMLabelEphemeralSetLabel()
,DMLabelEphemeralGetTransform()
,DMLabelEphemeralSetTransform()
Now
DMGetCellDS()
,DMGetRegionDS()
,DMSetRegionDS()
,DMGetRegionNumDS()
,DMSetRegionNumDS()
can also set and return an input DS
DMSwarm:
Add
DMSwarmGetMigrateType()
andDMSwarmSetMigrateType()
DMPlex:
Add
DMPlexGetOrientedCone()
andDMPlexRestoreOrientedCone()
to return both cone and orientation togetherAdd
DMPlexTransformGetChart()
,DMPlexTransformGetCellType()
,DMPlexTransformGetDepth()
,DMPlexTransformGetDepthStratum()
,DMPlexTransformGetConeSize()
to enable ephemeral meshesRemove
DMPlexAddConeSize()
Add
DMPlexCreateEphemeral()
Both
DMView()
andDMLoad()
now support parallel I/O with a new HDF5 format (see the manual for details)Remove
DMPlexComputeGeometryFEM()
since it was brokenChange
DMPlexMarkBoundaryFaces()
to avoid marking faces on the parallel boundary. To get the prior behavior, you can temporarily remove thePointSF
from theDM
Add
-dm_localize_height
to localize edges and facesAdd
DMPlexCreateHypercubicMesh()
to create hypercubic meshes needed for QCDAdd
-dm_plex_shape zbox
option toDMSetFromOptions()
to generated born-parallel meshes in Z-ordering (a space-filling curve). This may be used as-is with-petscpartitioner_type simple
or redistributed using-petscpartitioner_type parmetis
(orptscotch
, etc.), which is more scalable than creating a serial mesh to partition and distribute.Add
DMPlexSetIsoperiodicFaceSF()
to wrap a non-periodic mesh into periodic while preserving the local point representation for both donor and image sheet. This is supported withzbox
above, and allows single-element periodicity.Now
DMPlexGetCompressedClosure()
also takes the point orientation
FE/FV:
Add
DMPlexGetLocalOffsetsSupport()
for interaction with libCEED for FVNow
PetscFEIntegrateHybridResidual()
andPetscFEIntegrateHybridJacobian()
also take the input DS
DMNetwork:
Add DMNetworkGetNumVertices to retrieve the local and global number of vertices in DMNetwork
Add DMNetworkGetNumEdges to retrieve the local and global number of edges in DMNetwork
Add the ability to use
DMView()
on a DMNetwork with a PetscViewer with formatPETSC_VIEWER_ASCII_CSV
Add the ability to use
-dmnetwork_view draw
and-dmnetwork_view_distributed draw
to visualize a DMNetwork with an associated coordinate DM. This currently requires the configured Python environment to havematplotlib
andpandas
installed
DMStag:
DT:
Add
PetscQuadratureComputePermutations()
to compute the quadrature permutation corresponding to a k-cell orientation andPetscDSPermuteQuadPoint()
Add
PetscQuadratureGetCellType()
andPetscQuadratureSetCellType()
Add
PetscDSCopy()
Fortran:
Deprecate
ISGetIndices()
in favor ofISGetIndicesF90()
Deprecate
ISRestoreIndices()
in favor ofISRestoreIndicesF90()
Deprecate
ISLocalToGlobalMappingGetIndices()
in favor ofISLocalToGlobalMappingGetIndicesF90()
Deprecate
ISLocalToGlobalMappingRestoreIndices()
in favor ofISLocalToGlobalMappingRestoreIndicesF90()
Deprecate
VecGetArray()
in favor ofVecGetArrayF90()
Deprecate
VecRestoreArray()
in favor ofVecRestoreArrayF90()
Deprecate
VecGetArrayRead()
in favor ofVecGetArrayReadF90()
Deprecate
VecRestoreArrayRead()
in favor ofVecRestoreArrayReadF90()
Deprecate
VecDuplicateVecs()
in favor ofVecDuplicateVecsF90()
Deprecate
VecDestroyVecs()
in favor ofVecDestroyVecsF90()
Deprecate
DMDAVecGetArray()
in favor ofDMDAVecGetArrayF90()
Deprecate
DMDAVecRestoreArray()
in favor ofDMDAVecRestoreArrayF90()
Deprecate
DMDAVecGetArrayRead()
in favor ofDMDAVecGetArrayReadF90()
Deprecate
DMDAVecRestoreArrayRead()
in favor ofDMDAVecRestoreArrayReadF90()
Deprecate
DMDAVecGetArrayWrite()
in favor ofDMDAVecGetArrayWriteF90()
Deprecate
DMDAVecRestoreArrayWrite()
in favor ofDMDAVecRestoreArrayWriteF90()
Deprecate
MatGetRowIJ()
in favor ofMatGetRowIJF90()
Deprecate
MatRestoreRowIJ()
in favor ofMatRestoreRowIJF90()
Deprecate
MatSeqAIJGetArray()
in favor ofMatSeqAIJGetArrayF90()
Deprecate
MatSeqAIJRestoreArray()
in favor ofMatSeqAIJRestoreArrayF90()
Deprecate
MatMPIAIJGetSeqAIJ()
in favor ofMatMPIAIJGetSeqAIJF90()
Deprecate
MatDenseGetArray()
in favor ofMatDenseGetArrayF90()
Deprecate
MatDenseRestoreArray()
in favor ofMatDenseRestoreArrayF90()