Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge upstream #24

Merged
merged 71 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
610dbfc
Fix a typo
jczhang07 Oct 29, 2024
960603d
Merge branch 'jczhang/2024-10-29/fix-a-typo' into 'release'
balay Oct 29, 2024
a2df2f3
restore version range checks for MPICH, OpenMPI: accept versions [x.y…
minrk Oct 3, 2024
077598d
kokkos vpbjacobi: Handle MPIAIJ matrices
jrwrigh Oct 30, 2024
e889910
Merge branch 'jrwrigh/vpbjacobi_get_vblock' into 'release'
balay Oct 30, 2024
09c4504
Merge branch 'again-mpi-check' into 'release'
balay Oct 31, 2024
927f437
Minor housekeeping
prj- Oct 31, 2024
6c877b2
Merge branch 'jolivet/minor-housekeeping' into 'release'
balay Oct 31, 2024
c9e802c
resolve install_name_tool on $PATH (check otool similarly)
minrk Oct 31, 2024
793d7be
Update executeShellCommand() usage
balay Oct 31, 2024
3ff19dd
Add webpage for 2025 meeting with appropriate links
BarrySmith Oct 31, 2024
c2ae0b1
Merge branch 'barry/2024-10-26/add-meeting-2025-page/release' into 'r…
balay Oct 31, 2024
e4bac72
Vec: simplify veckok cpu/gpu logging, in addition to adding missing ones
jczhang07 Nov 1, 2024
408815c
Merge branch 'install_name_path' into 'release'
balay Nov 1, 2024
f61a250
tests: switch '-V' option (to '-v') in src/ts/events/tests/ex3.c - th…
balay Nov 1, 2024
85c72f1
Fix the broken check that AVX512 is available in configure.
BarrySmith Nov 1, 2024
fb8b7a6
add rule make getversion to PETSc so users make (or cmake) can check …
BarrySmith Oct 31, 2024
4481f81
Merge branch 'jczhang/2024-10-31/fix-veckok-logging' into 'release'
balay Nov 5, 2024
e125b91
Merge branch 'balay/fix-alltests' into 'release'
balay Nov 5, 2024
a041184
petsc4py: add preallocateWithMatPreallocator binding
connorjward Jan 11, 2024
aab16b0
Merge branch 'connorjward/add-prealloc-binding' into 'release'
balay Nov 6, 2024
d85a10a
installation: clarify CUDA compatible Nvidia driver on Linux
balay Nov 6, 2024
5fba8a7
Merge branch 'balay/clarify-nvidia-driver' into 'release'
balay Nov 6, 2024
7af56e5
petsc4py: disable PetscDevice tests when cxx==0
stefanozampini Nov 4, 2024
be928c2
petsc4py: clarify docs for Object.setFromOptions
stefanozampini Nov 6, 2024
ce65f7b
Merge branch 'stefanozampini/remove-objectsetfromoptions-petsc4py' in…
balay Nov 6, 2024
2149b0e
petsc4py: fix creation of source distribution
stefanozampini Nov 7, 2024
855b130
Add information about student travel support to PETSc 2025 meeting
BarrySmith Nov 8, 2024
d716c74
Merge branch 'barry/2024-11-01/fix-avx512-check/release' into 'release'
balay Nov 8, 2024
431be1d
Merge branch 'barry/2024-10-31/add-make-getversion/release' into 'rel…
balay Nov 8, 2024
065e2b1
docs: fix build error
balay Nov 8, 2024
1494c3b
docs: Update petscversion instructions
balay Nov 9, 2024
8a3ced8
Merge branch 'balay/fix-doc' into 'release'
balay Nov 9, 2024
2c094c9
Merge branch 'barry/2024-11-08/add-support-2025-meeting/release' into…
balay Nov 9, 2024
cecda66
Add a link to the PETSc 2025 meeting discord channel to petsc.org
BarrySmith Nov 9, 2024
8fa65e1
website: add redirect from https://petsc.org/community/meetings/2025 …
balay Nov 9, 2024
80d1c2c
Merge branch 'stefanozampini/fix-petsc4py-sdist' into 'release'
balay Nov 11, 2024
0902bb4
pip-petsc: bdist_wheel is now part of setuptools v71
dalcinl Nov 11, 2024
92e05de
Merge branch 'dalcinl/setuptools-bdist_wheel' into 'release'
balay Nov 11, 2024
52e36f9
`static inline` functions in headers do not need `PETSC_UNUSED`
dalcinl Nov 13, 2024
804cf99
Merge branch 'dalcinl/fix-static-inline-unused/release' into 'release'
balay Nov 14, 2024
dec611a
Fix bug in dmnetwork example and add error checking for bug
BarrySmith Nov 14, 2024
a43f987
Merge branch 'barry/2024-11-13/fix-dmnetwork-alignment/release' into …
balay Nov 14, 2024
c54ef36
Fix the VecNorm cached value sanity check for debug mode, it fails fo…
BarrySmith Nov 15, 2024
85aa6ec
Change the functionality of VecPow to be as expected.
BarrySmith Nov 15, 2024
a899ed5
Merge branch 'barry/2024-11-09/add-discord-channel-petsc-2025/release…
balay Nov 18, 2024
50dba35
Merge branch 'barry/2024-11-15/fix-vecpow/release' into 'release'
balay Nov 19, 2024
abf72cf
install: fix ranlib usage wrt self.executeShellCommand() as it can be…
balay Nov 19, 2024
b63c620
fix(cgns): Fix GetSolutionTime
jrwrigh Nov 12, 2024
7996179
Add news item to petsc.org with BlueSky link
BarrySmith Nov 20, 2024
3cc7c93
Fix manual page for SNESSetDivergenceTolerance() by elimiting mention…
BarrySmith Nov 20, 2024
e8adae0
Merge branch 'jrwrigh/fix_cgns_solution_time' into 'release'
balay Nov 20, 2024
fef7638
Merge branch 'balay/fix-install-ranlib' into 'release'
balay Nov 20, 2024
4a32847
Merge branch 'barry/2024-11-19/add-news-bluesky/release' into 'release'
balay Nov 20, 2024
ef1a300
Merge branch 'barry/2024-11-20/fix-man-page-snessetdivergencetoleranc…
balay Nov 20, 2024
fe5502e
Vec+Python: Fix reference counting in getDM()
knepley Nov 7, 2024
d1b209f
Merge branch 'knepley/fix-python-vecgetdm' into 'release'
balay Nov 21, 2024
9988c8b
Merge branch 'barry/2024-11-15/fix-vecnorm-cache-check/release' into …
balay Nov 21, 2024
2b89ae0
website: redirect /manualpages to release/manualpages
balay Nov 21, 2024
586afc9
Merge branch 'balay/website-release-redirect' into 'release'
balay Nov 22, 2024
861cd84
VecGetLocalToGlobalMapping_MPI_VecGhost: return Null if ghostis is no…
stefanozampini Nov 25, 2024
68c4918
Merge branch 'stefanozampini/fix-ghost-l2g' into 'release'
balay Nov 25, 2024
d9186ca
generateCPreprocessorGuesses: fix docstring
balay Nov 27, 2024
d2c1f4d
configure: add new Intel MPI wrappers
prj- Nov 28, 2024
c5eb363
configure: error out if using --with-petsc4py and Python < 3.7
prj- Nov 28, 2024
279b679
ksp_ksp_tutorials-ex1: fix -n 1 case
prj- Nov 23, 2024
ba20e95
configure: disable ParMmg for 64-bit integers
prj- Nov 23, 2024
9305689
Merge branch 'jolivet/fix-mpi-wrappers' into 'release'
balay Nov 28, 2024
3d8800a
Merge branch 'balay/fix-generateCPreprocessorGuesses-docstring' into …
balay Nov 29, 2024
2a89477
Increase patchlevel to 3.22.2
balay Nov 29, 2024
191d542
Merge tag 'v3.22.2' into connorjward/merge-upstream
connorjward Dec 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions config/BuildSystem/config/compilerFlags.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,10 @@ def outputCompilerMacros(self):
if out.find('__AVX2__') > -1 and out.find('__FMA__') > -1:
self.text = self.text + 'Intel instruction sets utilizable by compiler:\n'
self.text = self.text + ' AVX2\n'
if out.find('__AVX512__') > -1:
self.text = self.text + ' AVX512\n'
if out.find('__AVX512') > -1:
self.text = self.text + ' AVX512: '
self.text = self.text + ' '.join([i for i in out.split('__') if i.startswith('AVX512')])
self.text = self.text + '\n'
except:
pass
for filename in [self.compilerDefines, self.compilerFixes, self.compilerSource, self.compilerObj]:
Expand All @@ -176,15 +178,14 @@ def checkIntelHardwareSupport(self):
try:
(out, err, ret) = Configure.executeShellCommand('lscpu', log = self.log)
except:
try:
(out, err, ret) = Configure.executeShellCommand('sysctl -a', log = self.log)
if out.find('hw.optional.avx2_0: 1') > -1 and out.find('hw.optional.fma: 1') > -1:
self.text = self.text + 'Intel instruction sets found on CPU:\n'
self.text = self.text + ' AVX2\n'
if out.find('hw.optional.avx512f: 1') > -1:
self.text = self.text + ' AVX512\n'
except:
pass
out = ''
if out.find(' avx2 ') > -1 and out.find(' fma ') > -1:
self.text = self.text + 'Intel instruction sets found on CPU:\n'
self.text = self.text + ' AVX2\n'
if out.find(' avx512') > -1:
self.text = self.text + ' AVX512: '
self.text = self.text + ' '.join([i for i in out.split(' ') if i.startswith('avx512')])
self.text = self.text + '\n'
return

def configure(self):
Expand Down
7 changes: 3 additions & 4 deletions config/BuildSystem/config/compilerOptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def getCFlags(self, compiler, bopt, language):
import config.setCompilers

if language == 'C':
if [s for s in ['mpicc','mpiicc'] if os.path.basename(compiler).find(s)>=0]:
if [s for s in ['mpicc','mpiicc','mpiicx'] if os.path.basename(compiler).find(s)>=0]:
try:
output = self.executeShellCommand(compiler + ' -show', log = self.log)[0]
self.framework.addMakeMacro('MPICC_SHOW',output.strip().replace('\n','\\\\n').replace('"','\\"'))
Expand Down Expand Up @@ -126,7 +126,7 @@ def getCFlags(self, compiler, bopt, language):
def getCxxFlags(self, compiler, bopt, language):
import config.setCompilers

if [s for s in ['mpiCC','mpic++','mpicxx','mpiicxx','mpiicpc'] if os.path.basename(compiler).find(s)>=0]:
if [s for s in ['mpiCC','mpic++','mpicxx','mpiicxx','mpiicpc','mpiicpx'] if os.path.basename(compiler).find(s)>=0]:
try:
output = self.executeShellCommand(compiler+' -show', log = self.log)[0]
self.framework.addMakeMacro('MPICXX_SHOW',output.strip().replace('\n','\\\\n'))
Expand Down Expand Up @@ -240,8 +240,7 @@ def getCxxFlags(self, compiler, bopt, language):
return flags

def getFortranFlags(self, compiler, bopt):

if [s for s in ['mpif77','mpif90','mpifort','mpiifort'] if os.path.basename(compiler).find(s)>=0]:
if [s for s in ['mpif77','mpif90','mpifort','mpiifort','mpiifx'] if os.path.basename(compiler).find(s)>=0]:
try:
output = self.executeShellCommand(compiler+' -show', log = self.log)[0]
self.framework.addMakeMacro('MPIFC_SHOW',output.strip().replace('\n','\\\\n'))
Expand Down
2 changes: 1 addition & 1 deletion config/BuildSystem/config/packages/hpddm.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Configure(config.package.Package):
def __init__(self,framework):
config.package.Package.__init__(self,framework)
self.version = '2.3.1'
self.gitcommit = 'v'+self.version # main sep-25-2024
self.gitcommit = '1813156fce13718da3ced5aeb2ebbb736a2227bd' # main oct-26-2024
self.download = ['git://https://github.com/hpddm/hpddm','https://github.com/hpddm/hpddm/archive/'+self.gitcommit+'.tar.gz']
self.minversion = '2.2.1'
self.versionname = 'HPDDM_VERSION'
Expand Down
1 change: 1 addition & 0 deletions config/BuildSystem/config/packages/parmmg.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ def __init__(self, framework):
self.liblist = [['libparmmg.a']]
self.functions = ['PMMG_Free_all_var']
self.precisions = ['double']
self.requires32bitint = 1
return

def setupDependencies(self, framework):
Expand Down
6 changes: 4 additions & 2 deletions config/BuildSystem/config/packages/petsc4py.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,17 @@ def Install(self):
def configureLibrary(self):
import sys
if not self.sharedLibraries.useShared and not self.setCompilers.isCygwin(self.log):
raise RuntimeError('petsc4py requires PETSc be built with shared libraries; rerun with --with-shared-libraries')
raise RuntimeError('petsc4py requires PETSc be built with shared libraries; rerun with --with-shared-libraries')
if sys.version_info < (3, 7):
raise RuntimeError('petsc4py requires Python 3.7 at least')
chkpkgs = ['numpy']
if sys.version_info >= (3, 12):
chkpkgs.append('setuptools')
npkgs = []
for pkg in chkpkgs:
if not getattr(self.python,pkg): npkgs.append(pkg)
if npkgs:
raise RuntimeError('PETSc4py requires Python with "%s" module(s) installed!\n'
raise RuntimeError('petsc4py requires Python with "%s" module(s) installed!\n'
'Please install using package managers - for ex: "apt" or "dnf" (on linux),\n'
'or with "pip" using: %s -m pip install %s' % (" ".join(npkgs), self.python.pyexe, " ".join(npkgs)))
self.getInstallDir()
Expand Down
2 changes: 1 addition & 1 deletion config/BuildSystem/config/setCompilers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1491,7 +1491,7 @@ def checkCCompiler(self):
return

def generateCPreprocessorGuesses(self):
'''Determines the C preprocessor from CPP, then --with-cpp, then the C compiler'''
'''Determines the C preprocessor from --with-cpp, then CPP, then the C compiler'''
if 'with-cpp' in self.argDB:
yield self.argDB['with-cpp']
elif 'CPP' in self.argDB:
Expand Down
9 changes: 5 additions & 4 deletions config/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -508,12 +508,13 @@ def copyLib(self, src, dst):
return
shutil.copy2(src, dst)
if self.setCompilers.getCompiler().find('win32fe') < 0 and os.path.splitext(dst)[1] == '.'+self.arLibSuffix:
self.executeShellCommand(self.ranlib+' '+dst)
if os.path.splitext(dst)[1] == '.dylib' and os.path.isfile('/usr/bin/install_name_tool'):
[output,err,flg] = self.executeShellCommand("otool -D "+src)
import shlex
self.executeShellCommand(shlex.split(self.ranlib) + [dst])
if os.path.splitext(dst)[1] == '.dylib' and shutil.which('otool') and shutil.which('install_name_tool'):
[output,err,flg] = self.executeShellCommand(['otool', '-D', src])
oldname = output[output.find("\n")+1:]
installName = oldname.replace(os.path.realpath(self.archDir), self.installDir)
self.executeShellCommand('/usr/bin/install_name_tool -id ' + installName + ' ' + dst)
self.executeShellCommand(['install_name_tool', '-id', installName, dst])
# preserve the original timestamps - so that the .a vs .so time order is preserved
shutil.copystat(src,dst)
return
Expand Down
2 changes: 2 additions & 0 deletions doc/community/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
Community
*********

`Follow PETSc on BlueSky <https://bsky.app/profile/petsc.bsky.social>`__.

PETSc is associated with `NumFOCUS <http://numfocus.org>`__, a 501(c)(3) nonprofit supporting open code and reproducible science, through which you can help support PETSc.

.. image:: /images/community/numfocus.png
Expand Down
8 changes: 5 additions & 3 deletions doc/community/meetings/2024/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,23 @@ Cologne, Germany; May 23-24, 2024
:alt: PETSc User Meeting 2024 group photo

Scientific committee:

- Dr. Pierre Jolivet Sorbonne Université, CNRS

- Prof. Dr. Axel Klawonn University of Cologne
- Prof. Dr. Axel Klawonn University of Cologne

- Prof. Dr. Matthew Knepley University at Buffalo
- Prof. Dr. Matthew Knepley University at Buffalo

- Dr. Martin Lanser University of Cologne

- Prof. Dr. Oliver Rheinbach TU Bergakademie Freiberg
- Prof. Dr. Oliver Rheinbach TU Bergakademie Freiberg

- Dr. Janine Weber University of Cologne

- Dr. Stefano Zampini King Abdullah University of Science and Technology

Local Organizing Committee

- Prof. Dr. Axel Klawonn

- Dr. Jascha Knepper
Expand Down
44 changes: 44 additions & 0 deletions doc/community/meetings/2025/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
:orphan:

.. _2025_meeting:


2025 PETSc Annual Users Meeting and Tutorial
********************************************

May 20-21, 2025, University of Buffalo, New York, USA


Meeting times
-------------
* Monday, May 19 - Tutorial
* Tuesday, May 20 - Meeting
* Wednesday, May 21 - Meeting


Registration
------------
Please `register <https://ti.to/nf-projects/petsc-annual-meeting>`__ to save your seat.
Fee: $100, for breaks and lunches; free for students.

Submit a presentation
---------------------
`Submit an abstract <https://docs.google.com/forms/d/126KwzajoQvcqU_q7btNsYxFqbe7rJ_vASC-tejZfXDQ>`__ to be included in the schedule.
We welcome talks from all perspectives, including

* contributions to PETSc
* use of PETSc in applications or libraries
* development of libraries and packages `called from PETSc <https://petsc.org/release/install/external_software/>`__
* just curious about using PETSc in applications

Student Travel Support
----------------------

We have funding to provide travel support for students attending the meeting without their own funding. To apply, check the
"Student Funding Support" ticket while registering for the meeting. Early registration will increase your chance of obtaining travel support.

Questions and Meeting Discussion
--------------------------------

For questions about the meeting contact [email protected].
Join the discussion about the meeting on the `2025 PETSc Annual Users Meeting Discord channel <https://discord.com/channels/1119324534303109172/1298348560600924200>`__,
4 changes: 2 additions & 2 deletions doc/community/meetings/meeting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ simulations by scientists and engineers.
Upcoming Meetings
=================

- The PETSc Annual User Meeting (PAUM) 2025 will take place in Buffalo, New York, USA on May 19-21, 2025.
- `Submit a presentation or poster <https://docs.google.com/forms/d/126KwzajoQvcqU_q7btNsYxFqbe7rJ_vASC-tejZfXDQ>`__
- The :any:`2025 PETSc annual user meeting<2025_meeting>` will take place May 20-21, 2025 in Buffalo, New York, USA, with
tutorials on May 19th.

Previous Meetings
=================
Expand Down
8 changes: 8 additions & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ Immediately jump in and run PETSc code :any:`handson`.

PETSc is developed as :ref:`open-source <doc_license>`, :any:`requests <doc_creepycrawly>` and :any:`contributions <ch_contributing>` are welcome.

.. admonition:: News:

PETSc is now on `BlueSky <https://bsky.app/profile/petsc.bsky.social>`__.

.. admonition:: News:

The :any:`2025 PETSc Annual User Meeting<2025_meeting>` will take place May 20-21, 2025 in Buffalo, New York, USA, with tutorials on May 19th.

.. admonition:: News: Mrs Hong Zhang, who has been a PETSc developer for twenty-five years and mentored many students and future PETSc developers, has retired.

.. image:: /images/community/HongZhangDinner.jpg
Expand Down
9 changes: 6 additions & 3 deletions doc/install/download.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ Alternative: Obtain Release Version with Tarball

Tarball which contains only the source. Documentation available `online <https://petsc.org/release>`__.

- `petsc-3.22.1.tar.gz <https://web.cels.anl.gov/projects/petsc/download/release-snapshots/petsc-3.22.1.tar.gz>`__
- `petsc-3.22.2.tar.gz <https://web.cels.anl.gov/projects/petsc/download/release-snapshots/petsc-3.22.2.tar.gz>`__

Tarball which includes all documentation, recommended for offline use.

- `petsc-with-docs-3.22.1.tar.gz <https://web.cels.anl.gov/projects/petsc/download/release-snapshots/petsc-with-docs-3.22.1.tar.gz>`__
- `petsc-with-docs-3.22.2.tar.gz <https://web.cels.anl.gov/projects/petsc/download/release-snapshots/petsc-with-docs-3.22.2.tar.gz>`__


Tarball to enable a separate installation of petsc4py.

- `petsc4py-3.22.1.tar.gz <https://web.cels.anl.gov/projects/petsc/download/release-snapshots/petsc4py-3.22.1.tar.gz>`__
- `petsc4py-3.22.2.tar.gz <https://web.cels.anl.gov/projects/petsc/download/release-snapshots/petsc4py-3.22.2.tar.gz>`__

To extract the sources use:

Expand Down Expand Up @@ -117,6 +117,9 @@ PETSc does not follow **Semantic Versioning**, :cite:`semver-webpage`, rather i
- MINOR version, with new functionality and likely small API changes; most changes are backward compatible with deprecation. On a 6 month cycle.
- PATCH version, with bug fixes - and minor functionality updates preserving the current API. On a monthly cycle.

PETSc provides tools to allow you to stipulate what versions of PETSc it works with at configure time, compile time, or runtime of your package, see
:any:`ch_versionchecking`.

.. rubric:: References

.. bibliography:: /petsc.bib
Expand Down
7 changes: 4 additions & 3 deletions doc/install/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -682,8 +682,8 @@ Note that using OpenMP within MPI code must be done carefully to prevent too man
An NVIDIA GPU is **required** to use `CUDA`_-accelerated code. Check that your machine
has a `CUDA`_ enabled GPU by consulting https://developer.nvidia.com/cuda-gpus.

On Linux - make sure you have compatible `NVIDIA driver
<https://developer.nvidia.com/cuda-downloads>`__ installed.
On Linux - verify [#]_ that CUDA compatible `NVIDIA driver
<https://www.nvidia.com/en-us/drivers>`__ is installed.

On Microsoft Windows - Use either `Cygwin`_ or `WSL`_ the latter of which is entirely untested right
now. If you have experience with `WSL`_ and/or have successfully built PETSc on Microsoft Windows
Expand All @@ -695,7 +695,7 @@ In most cases you need only pass the configure option ``--with-cuda``; check

CUDA build of PETSc currently works on Mac OS X, Linux, Microsoft Windows with `Cygwin`_.

Examples that use CUDA have the suffix .cu; see ``$PETSC_DIR/src/snes/tutorials/ex47.cu``
Examples that use CUDA have the suffix .cu; see ``$PETSC_DIR/src/snes/tutorials/ex47cu.cu``

.. _doc_config_accel_kokkos:

Expand Down Expand Up @@ -790,3 +790,4 @@ systems. Also note the configuration examples in ``config/examples``.
.. [#] The two packages provide slightly different (though largely overlapping) functionality which can only be fully used if both packages are installed.
.. [#] Apple provides customized ``clang`` and ``clang++`` for its system. To use the unmodified LLVM project ``clang`` and ``clang++``
install them with brew.
.. [#] To verify CUDA compatible Nvidia driver on Linux - run the utility ``nvidia-smi`` - it should provide the version of the Nvidia driver currently installed, and the maximum CUDA version it supports.
1 change: 1 addition & 0 deletions doc/manual/additional.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Additional Information
:maxdepth: 2

fortran
versionchecking
matlab
profiling
performance
Expand Down
72 changes: 72 additions & 0 deletions doc/manual/versionchecking.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
.. _ch_versionchecking:

Checking the PETSc version
--------------------------
The PETSc version
is defined in ``$PETSC_DIR/include/petscversion.h`` with the three macros
``PETSC_VERSION_MAJOR``, ``PETSC_VERSION_MINOR``, and ``PETSC_VERSION_SUBMINOR``.

The shell commands ``make getversion`` or ``$PETSC_DIR/lib/petsc/bin/petscversion`` prints out the PETSc version.
The command

.. code-block:: console

$ $PETSC_DIR/lib/petsc/bin/petscversion <eq,gt,lt,ge,le> major.minor<.subminor>

allows one to add tests to make files, CMake files, configure scripts etc, to ensure the PETSc version is compatible with your applications. For example,

.. code-block:: console

$ $PETSC_DIR/lib/petsc/bin/petscversion eq 3.22

returns 1 if the PETSc version is 3.22 (any subminor version is allowed). While

.. code-block:: console

$ $PETSC_DIR/lib/petsc/bin/petscversion ge 3.21

returns 1 if the PETSc version is 3.21 or higher.


Though we try to avoid making changes to the PETSc API, they are inevitable; thus we
provide tools to help manage one's application to be robust to such changes.

During configure/make time
~~~~~~~~~~~~~~~~~~~~~~~~~~

The command

.. code-block:: console

$ $PETSC_DIR/lib/petsc/bin/petscversion eq xxx.yyy[.zzz]

prints out 1 if the PETSc version matches ``xxx.yyy[.zzz]`` and 0 otherwise. The command works in a similar
way for ``lt``, ``le``, ``gt``, and ``ge``. This allows your application configure script, or ``makefile`` or ``CMake`` file
to check if the PETSc version is compatible with application even before beginning to compile your code.


During compile time
~~~~~~~~~~~~~~~~~~~

The CPP macros

- ``PETSC_VERSION_EQ(MAJOR,MINOR,SUBMINOR)``
- ``PETSC_VERSION_LT(MAJOR,MINOR,SUBMINOR)``
- ``PETSC_VERSION_LE(MAJOR,MINOR,SUBMINOR)``
- ``PETSC_VERSION_GT(MAJOR,MINOR,SUBMINOR)``
- ``PETSC_VERSION_GE(MAJOR,MINOR,SUBMINOR)``

may be used in the source code to choose different code paths or error out depending on the PETSc version.

At Runtime
~~~~~~~~~~


The command

.. code-block:: C

char version(lengthofversion);
PetscErrorCode PetscGetVersion(char version[], size_t lengthofversion)

gives access to the version at runtime.
2 changes: 2 additions & 0 deletions doc/public/_redirects
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
/main/download /main/install/download 302
/release/docs/* /release/:splat 301
/main/docs/* /main/:splat 301
/community/* /release/community/:splat 301
/manualpages/* /release/manualpages/:splat 301
1 change: 1 addition & 0 deletions gmakefile.test
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,7 @@ help-nontest:
-@echo " libs - build (update) the PETSc and related libraries"
-@echo " check - run a basic check that the libraries are built correctly and can be used"
-@echo " "
-@echo " getversion - print the PETSc version, or $PETSC_DIR/lib/petsc/bin/petscversion"
-@echo " getmpiexec - print the mpiexec to use to run PETSc programs"
-@echo " getlinklibs - print the libraries that a PETSc application must link against"
-@echo " getincludedirs - print the include directories that a PETSc application must be compiled against"
Expand Down
5 changes: 3 additions & 2 deletions include/petsc/private/viewercgnsimpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ typedef struct {
PetscInt batch_size;

// Solution reading information
PetscInt solution_index; // User set solution index
int solution_file_index; // CGNS file solution index for direct access
PetscInt solution_index; // User set solution index
int solution_file_index; // CGNS file solution index for direct access
int solution_file_pointer_index; // CGNS file solution index for FlowSolutionPointers (and other related arrays), index by 1
char *solution_name;
} PetscViewer_CGNS;

Expand Down
Loading