From c54ef3653a7d75a9994a392fdd8de4a62a9a1db2 Mon Sep 17 00:00:00 2001 From: Barry Smith Date: Fri, 15 Nov 2024 10:55:50 -0500 Subject: [PATCH 1/9] Fix the VecNorm cached value sanity check for debug mode, it fails for a norm of NaN. Reported-by: Sebastien Gilles --- src/vec/vec/interface/rvector.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vec/vec/interface/rvector.c b/src/vec/vec/interface/rvector.c index 3c4705f2358..44c1624d4e6 100644 --- a/src/vec/vec/interface/rvector.c +++ b/src/vec/vec/interface/rvector.c @@ -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); From 2b89ae0dc3f09803c5c6f85ceb64ff0f45faa796 Mon Sep 17 00:00:00 2001 From: Satish Balay Date: Thu, 21 Nov 2024 16:44:49 -0600 Subject: [PATCH 2/9] website: redirect /manualpages to release/manualpages --- doc/public/_redirects | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/public/_redirects b/doc/public/_redirects index fe4e6ae8b87..a5090fa948f 100644 --- a/doc/public/_redirects +++ b/doc/public/_redirects @@ -5,3 +5,4 @@ /release/docs/* /release/:splat 301 /main/docs/* /main/:splat 301 /community/* /release/community/:splat 301 +/manualpages/* /release/manualpages/:splat 301 From 861cd84cee97f3ce64c6649e87f48a47fd4d768f Mon Sep 17 00:00:00 2001 From: Stefano Zampini Date: Mon, 25 Nov 2024 15:00:33 +0300 Subject: [PATCH 3/9] VecGetLocalToGlobalMapping_MPI_VecGhost: return Null if ghostis is not present --- src/vec/vec/impls/mpi/pbvec.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/vec/vec/impls/mpi/pbvec.c b/src/vec/vec/impls/mpi/pbvec.c index 4f8527826de..25d01893a5d 100644 --- a/src/vec/vec/impls/mpi/pbvec.c +++ b/src/vec/vec/impls/mpi/pbvec.c @@ -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)); From d9186caad6ef38fc85935f205e1c6ce0fee580c6 Mon Sep 17 00:00:00 2001 From: Satish Balay Date: Wed, 27 Nov 2024 11:43:56 -0600 Subject: [PATCH 4/9] generateCPreprocessorGuesses: fix docstring --- config/BuildSystem/config/setCompilers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/BuildSystem/config/setCompilers.py b/config/BuildSystem/config/setCompilers.py index 86a7a29ade8..5d2fbe98f63 100644 --- a/config/BuildSystem/config/setCompilers.py +++ b/config/BuildSystem/config/setCompilers.py @@ -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: From d2c1f4df4af667648d92e676e3691691cec232c8 Mon Sep 17 00:00:00 2001 From: Pierre Jolivet Date: Thu, 28 Nov 2024 14:04:05 +0100 Subject: [PATCH 5/9] configure: add new Intel MPI wrappers --- config/BuildSystem/config/compilerOptions.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/config/BuildSystem/config/compilerOptions.py b/config/BuildSystem/config/compilerOptions.py index d8bc088a3c8..8d717901b5c 100644 --- a/config/BuildSystem/config/compilerOptions.py +++ b/config/BuildSystem/config/compilerOptions.py @@ -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('"','\\"')) @@ -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')) @@ -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')) From c5eb363024cab0ae54dfc5819504c2ca8b645b36 Mon Sep 17 00:00:00 2001 From: Pierre Jolivet Date: Thu, 28 Nov 2024 09:18:20 +0100 Subject: [PATCH 6/9] configure: error out if using --with-petsc4py and Python < 3.7 --- config/BuildSystem/config/packages/petsc4py.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/config/BuildSystem/config/packages/petsc4py.py b/config/BuildSystem/config/packages/petsc4py.py index 8831db1e5b5..5df2c8ddd42 100644 --- a/config/BuildSystem/config/packages/petsc4py.py +++ b/config/BuildSystem/config/packages/petsc4py.py @@ -123,7 +123,9 @@ 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') @@ -131,7 +133,7 @@ def configureLibrary(self): 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() From 279b6799eee79dfb70b33177e1474eed304ab281 Mon Sep 17 00:00:00 2001 From: Pierre Jolivet Date: Sat, 23 Nov 2024 08:32:27 +0100 Subject: [PATCH 7/9] ksp_ksp_tutorials-ex1: fix -n 1 case --- src/ksp/ksp/tutorials/ex1.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/ksp/ksp/tutorials/ex1.c b/src/ksp/ksp/tutorials/ex1.c index 1df1f2a2c6c..808f7b56acf 100644 --- a/src/ksp/ksp/tutorials/ex1.c +++ b/src/ksp/ksp/tutorials/ex1.c @@ -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)); From ba20e95a66689727ff2fd0520cba4e10aa89e6da Mon Sep 17 00:00:00 2001 From: Pierre Jolivet Date: Sat, 23 Nov 2024 08:34:06 +0100 Subject: [PATCH 8/9] configure: disable ParMmg for 64-bit integers --- config/BuildSystem/config/packages/parmmg.py | 1 + 1 file changed, 1 insertion(+) diff --git a/config/BuildSystem/config/packages/parmmg.py b/config/BuildSystem/config/packages/parmmg.py index aad6c8328e5..12583ee2744 100644 --- a/config/BuildSystem/config/packages/parmmg.py +++ b/config/BuildSystem/config/packages/parmmg.py @@ -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): From 2a89477b25f3695626c03c30fbd331171623fac3 Mon Sep 17 00:00:00 2001 From: Satish Balay Date: Thu, 28 Nov 2024 23:26:47 -0600 Subject: [PATCH 9/9] Increase patchlevel to 3.22.2 --- doc/install/download.rst | 6 +++--- include/petscversion.h | 2 +- src/binding/petsc4py/src/petsc4py/__init__.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/install/download.rst b/doc/install/download.rst index 40c8839eae6..2dd6c8c920e 100644 --- a/doc/install/download.rst +++ b/doc/install/download.rst @@ -31,16 +31,16 @@ Alternative: Obtain Release Version with Tarball Tarball which contains only the source. Documentation available `online `__. -- `petsc-3.22.1.tar.gz `__ +- `petsc-3.22.2.tar.gz `__ Tarball which includes all documentation, recommended for offline use. -- `petsc-with-docs-3.22.1.tar.gz `__ +- `petsc-with-docs-3.22.2.tar.gz `__ Tarball to enable a separate installation of petsc4py. -- `petsc4py-3.22.1.tar.gz `__ +- `petsc4py-3.22.2.tar.gz `__ To extract the sources use: diff --git a/include/petscversion.h b/include/petscversion.h index a3297273a3d..d3314037d1b 100644 --- a/include/petscversion.h +++ b/include/petscversion.h @@ -5,7 +5,7 @@ #define PETSC_VERSION_RELEASE 1 #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" diff --git a/src/binding/petsc4py/src/petsc4py/__init__.py b/src/binding/petsc4py/src/petsc4py/__init__.py index a09febeb05f..55cddfd95d3 100644 --- a/src/binding/petsc4py/src/petsc4py/__init__.py +++ b/src/binding/petsc4py/src/petsc4py/__init__.py @@ -16,7 +16,7 @@ """ __author__ = 'Lisandro Dalcin' -__version__ = '3.22.1' +__version__ = '3.22.2' __credits__ = 'PETSc Team '