Skip to content

Commit

Permalink
Merge pull request #24 from firedrakeproject/connorjward/merge-upstream
Browse files Browse the repository at this point in the history
Merge upstream
  • Loading branch information
connorjward authored Dec 4, 2024
2 parents ebc0e51 + 191d542 commit 4354988
Show file tree
Hide file tree
Showing 47 changed files with 466 additions and 184 deletions.
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

0 comments on commit 4354988

Please sign in to comment.