Changes: Development#

Changes you should make for main and version 3.18 so that it is portable to previous versions of PETSc

Changes you can make for main and version 3.18 so that is not portable to previous versions of PETSc. This will remove all deprecation warnings when you build. In addition to the changes above

General:

  • Change PetscOptionsBegin(), PetscOptionsEnd(), and PetscObjectOptionsBegin() to not return an error code

  • Change PetscOptionsHead(), PetscOptionsTail(), to PetscOptionsHeadBegin() and PetscOptionsHeadEnd() and to not return an error code

  • Add PETSC_ATTRIBUTE_FORMAT() to enable compile-time printf()-style format specifier checking and apply it any PETSc functions taking a format string

  • Deprecate the use of %D for printing PetscInt in favor of %" PetscInt_FMT ". Compilers may now emit warnings when using %D as a result of applying PETSC_ATTRIBUTE_FORMAT. Users that need to support older versions of PETSc may do one of two things:

    1. Recommended Insert the following code block after all PETSc header-file inclusions

      #if !defined(PetscInt_FMT)
      #  if defined(PETSC_USE_64BIT_INDICES)
      #    if !defined(PetscInt64_FMT)
      #      if defined(PETSC_HAVE_STDINT_H) && defined(PETSC_HAVE_INTTYPES_H) && defined(PETSC_HAVE_MPI_INT64_T)
      #        include <inttypes.h>
      #        define PetscInt64_FMT PRId64
      #      elif (PETSC_SIZEOF_LONG_LONG == 8)
      #        define PetscInt64_FMT "lld"
      #      elif defined(PETSC_HAVE___INT64)
      #        define PetscInt64_FMT "ld"
      #      else
      #        error "cannot determine PetscInt64 type"
      #      endif
      #    endif
      #    define PetscInt_FMT PetscInt64_FMT
      #  else
      #    define PetscInt_FMT "d"
      #  endif
      #endif
      

      This will ensure that the appropriate format specifiers are defined regardless of PETSc version.

    2. Not Recommended Compilers warnings can be permanently suppressed by defining PETSC_SKIP_ATTRIBUTE_FORMAT prior to all PETSc header-file inclusions

Configure/Build:

  • Remove python2 support, python-3.4+ is now required

Sys:

  • Change PetscCall() from Fortran so that call PetscFunction(args,ierr);CHKERRQ(ierr); can be replaced with PetscCall(PetscFunction(args,ierr))

  • Add PetscCallA() from Fortran so that call PetscFunction(args,ierr);CHKERRA(ierr); can be replaced with PetscCallA(PetscFunction(args,ierr))

  • Add PetscCallMPI() and PetscCallMPIA() that may be used to call MPI functions from Fortran

  • Change the PetscCheck() and PetscAssert() macros to behave like function calls by wrapping in do { } while (0). Previously these macros expanded to if (...) SETERRQ(...), which meant they could be chained with subsequent conditionals.

PetscViewer:

PetscDraw:

AO:

IS:

VecScatter / PetscSF:

PF:

Vec:

PetscSection:

PetscPartitioner:

Mat:

  • Change MatPreallocateInitialize() and MatPreallocateFinalize() to MatPreallocateBegin() and MatPreallocateEnd() and to not return an error code

  • Change MatDenseGetSubMatrix() to be able to retrieve only selected contiguous rows instead of all rows

  • Add MatSetOptionsPrefixFactor() and MatAppendOptionsPrefixFactor() to allow controlling the options prefix used by factors created from this matrix

  • Change MatSetOptionsPrefix() to no longer affect the options prefix used by factors created from this matrix

  • Change matrix factor options called from within KSP/PC to always inherit the options prefix from the KSP/PC, not the options prefix in the originating matrix

  • Add MatCreateGraph() to create a scalar matrix for use in graph algorithms

  • Add MatFilter() to remove values with an absolute value equal to or below a give threshold

MatCoarsen: - Add MISK coarsening type. Distance-k maximal independent set (MIS) C-F coarsening with a greedy, MIS based aggregation algorithm.

PC:

KSP:

SNES:

SNESLineSearch:

TS:

TAO:

DM/DA:

DMSwarm:

DMPlex:

FE/FV:

DMNetwork:

DMStag:

DT:

Fortran: