Skip to content

Commit

Permalink
Merge tag 'v3.22.2' into connorjward/merge-upstream
Browse files Browse the repository at this point in the history
PETSc 3.22.2
  • Loading branch information
connorjward committed Nov 29, 2024
2 parents 9c76db9 + 2a89477 commit 742dc75
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 22 deletions.
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
1 change: 1 addition & 0 deletions config/BuildSystem/config/packages/parmmg.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,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
6 changes: 3 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
1 change: 1 addition & 0 deletions doc/public/_redirects
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
/release/docs/* /release/:splat 301
/main/docs/* /main/:splat 301
/community/* /release/community/:splat 301
/manualpages/* /release/manualpages/:splat 301
2 changes: 1 addition & 1 deletion include/petscversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#define PETSC_VERSION_RELEASE 0
#define PETSC_VERSION_MAJOR 3
#define PETSC_VERSION_MINOR 22
#define PETSC_VERSION_SUBMINOR 1
#define PETSC_VERSION_SUBMINOR 2
#define PETSC_RELEASE_DATE "Sep 28, 2024"
#define PETSC_VERSION_DATE "unknown"

Expand Down
2 changes: 1 addition & 1 deletion src/binding/petsc4py/src/petsc4py/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"""

__author__ = 'Lisandro Dalcin'
__version__ = '3.22.1'
__version__ = '3.22.2'
__credits__ = 'PETSc Team <[email protected]>'


Expand Down
12 changes: 7 additions & 5 deletions src/ksp/ksp/tutorials/ex1.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,18 @@ int main(int argc, char **args)
col[2] = i + 1;
PetscCall(MatSetValues(A, 1, &i, 3, col, value, INSERT_VALUES));
}
i = n - 1;
col[0] = n - 2;
col[1] = n - 1;
PetscCall(MatSetValues(A, 1, &i, 2, col, value, INSERT_VALUES));
if (n > 1) {
i = n - 1;
col[0] = n - 2;
col[1] = n - 1;
PetscCall(MatSetValues(A, 1, &i, 2, col, value, INSERT_VALUES));
}
i = 0;
col[0] = 0;
col[1] = 1;
value[0] = 2.0;
value[1] = -1.0;
PetscCall(MatSetValues(A, 1, &i, 2, col, value, INSERT_VALUES));
PetscCall(MatSetValues(A, 1, &i, n > 1 ? 2 : 1, col, value, INSERT_VALUES));
PetscCall(MatAssemblyBegin(A, MAT_FINAL_ASSEMBLY));
PetscCall(MatAssemblyEnd(A, MAT_FINAL_ASSEMBLY));

Expand Down
7 changes: 3 additions & 4 deletions src/vec/vec/impls/mpi/pbvec.c
Original file line number Diff line number Diff line change
Expand Up @@ -425,11 +425,10 @@ static PetscErrorCode VecGetLocalToGlobalMapping_MPI_VecGhost(Vec X, ISLocalToGl
const PetscInt *ghostidx;

PetscFunctionBegin;
if (X->map->mapping) {
*ltg = X->map->mapping;
PetscFunctionReturn(PETSC_SUCCESS);
}
*ltg = X->map->mapping;
if (X->map->mapping) PetscFunctionReturn(PETSC_SUCCESS);
PetscCall(VecGhostGetGhostIS(X, &ghostis));
if (!ghostis) PetscFunctionReturn(PETSC_SUCCESS);
PetscCall(ISGetLocalSize(ghostis, &nghost));
PetscCall(VecGetLocalSize(X, &n));
PetscCall(ISGetIndices(ghostis, &ghostidx));
Expand Down
2 changes: 1 addition & 1 deletion src/vec/vec/interface/rvector.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ PetscErrorCode VecNorm(Vec x, NormType type, PetscReal *val)
b1[0] = -(*val);
b1[1] = *val;
PetscCallMPI(MPIU_Allreduce(b1, b2, 2, MPIU_REAL, MPIU_MAX, PetscObjectComm((PetscObject)x)));
PetscCheck(-b2[0] == b2[1], PETSC_COMM_SELF, PETSC_ERR_ARG_WRONGSTATE, "Difference in cached %s norms: local %g", NormTypes[type], (double)*val);
PetscCheck((PetscIsNanReal(b2[0]) && PetscIsNanReal(b2[1])) || (-b2[0] == b2[1]), PETSC_COMM_SELF, PETSC_ERR_ARG_WRONGSTATE, "Difference in cached %s norms: local %g", NormTypes[type], (double)*val);
}
}
if (flg) PetscFunctionReturn(PETSC_SUCCESS);
Expand Down

0 comments on commit 742dc75

Please sign in to comment.