From 0d0313da82d1eee1aa27e85c3a454c659f0f2238 Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Mon, 3 Apr 2023 09:41:00 +0200 Subject: [PATCH 001/112] slepc4py: fix setup.py after release, required by PyPI --- src/binding/slepc4py/setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/binding/slepc4py/setup.py b/src/binding/slepc4py/setup.py index b469abfc7..3dcfa1087 100755 --- a/src/binding/slepc4py/setup.py +++ b/src/binding/slepc4py/setup.py @@ -115,7 +115,7 @@ def long_description(): }) metadata_extra = { - 'long_description_content_type': 'text/rst', + 'long_description_content_type': 'text/x-rst', } # -------------------------------------------------------------------- @@ -196,7 +196,7 @@ def extensions(): def get_release(): suffix = os.path.join('src', 'binding', F('{pyname}')) if not topdir.endswith(os.path.join(os.path.sep, suffix)): - return False + return True release = 1 rootdir = os.path.abspath(os.path.join(topdir, *[os.path.pardir]*3)) version_h = os.path.join(rootdir, 'include', F('{name}version.h')) From 3258598ee0b54463ac4aa8152cca7202e79895b4 Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Mon, 3 Apr 2023 09:48:12 +0200 Subject: [PATCH 002/112] slepc4py: backport petsc4py fix --- src/binding/slepc4py/test/runtests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/binding/slepc4py/test/runtests.py b/src/binding/slepc4py/test/runtests.py index f767ca1d0..beb4a00ef 100644 --- a/src/binding/slepc4py/test/runtests.py +++ b/src/binding/slepc4py/test/runtests.py @@ -168,7 +168,7 @@ def writeln(message='', endl='\n'): writeln(getpackageinfo('numpy')) for entry in components: writeln(getlibraryinfo(entry)) - writeln(getpackageinfo('%s4py' % entry)) + writeln(getpackageinfo('%s4py' % entry.lower())) def load_tests(options, args): From a9bb34d39b821f5aa1d4d7e4005d487dda5de33a Mon Sep 17 00:00:00 2001 From: Pierre Jolivet Date: Tue, 4 Apr 2023 06:55:40 +0200 Subject: [PATCH 003/112] Fix petsc4py order of includes --- src/binding/slepc4py/conf/confpetsc.py | 6 +++--- src/binding/slepc4py/conf/confslepc.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/binding/slepc4py/conf/confpetsc.py b/src/binding/slepc4py/conf/confpetsc.py index 5801b146f..89c4e1247 100644 --- a/src/binding/slepc4py/conf/confpetsc.py +++ b/src/binding/slepc4py/conf/confpetsc.py @@ -284,13 +284,13 @@ def _get_petsc_config(self, petsc_dir, petsc_arch): confdict = makefile(StringIO(confstr)) return confdict - def _configure_ext(self, ext, dct, preppend=False): + def _configure_ext(self, ext, dct, append=False): extdict = ext.__dict__ for key, values in dct.items(): if key in extdict: for value in values: if value not in extdict[key]: - if preppend: + if not append: extdict[key].insert(0, value) else: extdict[key].append(value) @@ -316,7 +316,7 @@ def configure_extension(self, extension): petsc_ext_lib = split_quoted(self['PETSC_EXTERNAL_LIB_BASIC']) petsc_lib['extra_link_args'].extend(petsc_ext_lib) - self._configure_ext(extension, petsc_inc, preppend=True) + self._configure_ext(extension, petsc_inc, append=True) self._configure_ext(extension, petsc_lib) def configure_compiler(self, compiler): diff --git a/src/binding/slepc4py/conf/confslepc.py b/src/binding/slepc4py/conf/confslepc.py index 63b596ccf..55061c2bd 100644 --- a/src/binding/slepc4py/conf/confslepc.py +++ b/src/binding/slepc4py/conf/confslepc.py @@ -116,7 +116,7 @@ def configure_extension(self, extension): slepc_cfg['runtime_library_dirs'] = [ strip_prefix(SLEPC_DESTDIR, d) for d in SLEPC_LIB_DIR ] - self._configure_ext(extension, slepc_cfg, preppend=True) + self._configure_ext(extension, slepc_cfg, append=True) if self['BUILDSHAREDLIB'] == 'no': from petsc4py.lib import ImportPETSc PETSc = ImportPETSc(PETSC_ARCH) From 8fb22265097cbce5a6d4d8f36bd64bd308937ccd Mon Sep 17 00:00:00 2001 From: Pierre Jolivet Date: Fri, 7 Apr 2023 20:43:17 +0200 Subject: [PATCH 004/112] Bypass -Wzero-as-null-pointer-constant --- include/slepcsvd.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/slepcsvd.h b/include/slepcsvd.h index 5ed7d480a..54cb42b9d 100644 --- a/include/slepcsvd.h +++ b/include/slepcsvd.h @@ -142,14 +142,14 @@ SLEPC_EXTERN PetscErrorCode SVDGetProblemType(SVD,SVDProblemType*); SLEPC_EXTERN PetscErrorCode SVDIsGeneralized(SVD,PetscBool*); SLEPC_EXTERN PetscErrorCode SVDIsHyperbolic(SVD,PetscBool*); SLEPC_EXTERN PetscErrorCode SVDSetOperators(SVD,Mat,Mat); -PETSC_DEPRECATED_FUNCTION("Use SVDSetOperators()") static inline PetscErrorCode SVDSetOperator(SVD svd,Mat A) {return SVDSetOperators(svd,A,NULL);} +PETSC_DEPRECATED_FUNCTION("Use SVDSetOperators()") static inline PetscErrorCode SVDSetOperator(SVD svd,Mat A) {return SVDSetOperators(svd,A,PETSC_NULLPTR);} SLEPC_EXTERN PetscErrorCode SVDGetOperators(SVD,Mat*,Mat*); -PETSC_DEPRECATED_FUNCTION("Use SVDGetOperators()") static inline PetscErrorCode SVDGetOperator(SVD svd,Mat *A) {return SVDGetOperators(svd,A,NULL);} +PETSC_DEPRECATED_FUNCTION("Use SVDGetOperators()") static inline PetscErrorCode SVDGetOperator(SVD svd,Mat *A) {return SVDGetOperators(svd,A,PETSC_NULLPTR);} SLEPC_EXTERN PetscErrorCode SVDSetSignature(SVD,Vec); SLEPC_EXTERN PetscErrorCode SVDGetSignature(SVD,Vec*); SLEPC_EXTERN PetscErrorCode SVDSetInitialSpaces(SVD,PetscInt,Vec[],PetscInt,Vec[]); -PETSC_DEPRECATED_FUNCTION("Use SVDSetInitialSpaces()") static inline PetscErrorCode SVDSetInitialSpace(SVD svd,PetscInt nr,Vec *isr) {return SVDSetInitialSpaces(svd,nr,isr,0,NULL);} -PETSC_DEPRECATED_FUNCTION("Use SVDSetInitialSpaces()") static inline PetscErrorCode SVDSetInitialSpaceLeft(SVD svd,PetscInt nl,Vec *isl) {return SVDSetInitialSpaces(svd,0,NULL,nl,isl);} +PETSC_DEPRECATED_FUNCTION("Use SVDSetInitialSpaces()") static inline PetscErrorCode SVDSetInitialSpace(SVD svd,PetscInt nr,Vec *isr) {return SVDSetInitialSpaces(svd,nr,isr,0,PETSC_NULLPTR);} +PETSC_DEPRECATED_FUNCTION("Use SVDSetInitialSpaces()") static inline PetscErrorCode SVDSetInitialSpaceLeft(SVD svd,PetscInt nl,Vec *isl) {return SVDSetInitialSpaces(svd,0,PETSC_NULLPTR,nl,isl);} SLEPC_EXTERN PetscErrorCode SVDSetImplicitTranspose(SVD,PetscBool); SLEPC_EXTERN PetscErrorCode SVDGetImplicitTranspose(SVD,PetscBool*); SLEPC_EXTERN PetscErrorCode SVDSetDimensions(SVD,PetscInt,PetscInt,PetscInt); From ad6bf17baae34b6cd66327d4a280802c5c4a4c19 Mon Sep 17 00:00:00 2001 From: Pierre Jolivet Date: Wed, 12 Apr 2023 13:22:40 +0200 Subject: [PATCH 005/112] configure: new variable maxcxxdialect --- config/packages/hpddm.py | 4 ++-- config/packages/petsc.py | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/config/packages/hpddm.py b/config/packages/hpddm.py index b9903392f..0e736c4aa 100644 --- a/config/packages/hpddm.py +++ b/config/packages/hpddm.py @@ -28,8 +28,8 @@ def __init__(self,argdb,log): def Precondition(self,slepc,petsc): pkg = self.packagename.upper() - if not petsc.cxxdialectcxx11: - self.log.Exit(pkg+' requires C++11') + if petsc.maxcxxdialect == '': + self.log.Exit(pkg+' requires a functioning C++ compiler') if not petsc.buildsharedlib: self.log.Exit(pkg+' requires a shared library build') if 'slepc' in petsc.packages: diff --git a/config/packages/petsc.py b/config/packages/petsc.py index cc5aee43a..545f55844 100644 --- a/config/packages/petsc.py +++ b/config/packages/petsc.py @@ -139,7 +139,7 @@ def LoadConf(self): self.blaslapackint64 = False self.fortran = False self.language = 'c' - self.cxxdialectcxx11 = False + self.maxcxxdialect = '' self.packages = [] try: with open(petscconf_h) as f: @@ -165,14 +165,16 @@ def LoadConf(self): self.fortran = True elif len(l)==3 and l[0]=='#define' and l[1]=='PETSC_CLANGUAGE_CXX' and l[2]=='1': self.language = 'c++' - elif len(l)==3 and l[0]=='#define' and l[1]=='PETSC_HAVE_CXX_DIALECT_CXX11' and l[2]=='1': - self.cxxdialectcxx11 = True elif self.isinstall and len(l)==3 and l[0]=='#define' and l[1]=='PETSC_ARCH': self.arch = l[2].strip('"') else: for p in ['elemental','hpddm','mkl_libs','mkl_includes','mkl_pardiso','scalapack','slepc']: if len(l)==3 and l[0]=='#define' and l[1]=='PETSC_HAVE_'+p.upper() and l[2]=='1': self.packages.append(p) + for p in ['20','17','14','11']: + if len(l)==3 and l[0]=='#define' and l[1]=='PETSC_HAVE_CXX_DIALECT_CXX'+p and l[2]=='1' and (self.maxcxxdialect=='' or p>self.maxcxxdialect): + self.maxcxxdialect = p + break if 'mkl_libs' in self.packages and 'mkl_includes' in self.packages: self.packages.remove('mkl_libs') self.packages.remove('mkl_includes') From 4f5b570878bf741ab76635339c0fe3a5624eadc7 Mon Sep 17 00:00:00 2001 From: Pierre Jolivet Date: Thu, 20 Apr 2023 06:08:03 +0000 Subject: [PATCH 006/112] Build only a single PETSC_ARCH in slepc4pybuild --- config/packages/slepc4py.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/packages/slepc4py.py b/config/packages/slepc4py.py index 7ad5e2359..2f15f5d2d 100644 --- a/config/packages/slepc4py.py +++ b/config/packages/slepc4py.py @@ -73,7 +73,7 @@ def Process(self,slepcconf,slepcvars,slepcrules,slepc,petsc,archdir=''): rule = 'slepc4pybuild:\n' rule += '\t@echo "*** Building slepc4py ***"\n' rule += '\t@${RM} -f '+os.path.join(confdir,'slepc4py.errorflg')+'\n' - rule += '\t@cd '+builddir+' && \\\n' + rule += '\t@cd '+builddir+' && ${RM} -rf build && \\\n' rule += '\t %s ${PYTHON} setup.py build 2>&1 || \\\n' % envvars rule += '\t (echo "**************************ERROR*************************************" && \\\n' rule += '\t echo "Error building slepc4py." && \\\n' From 8d9523c63886604420958aa0b0be1ea152ec32ce Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Thu, 27 Apr 2023 10:16:11 +0200 Subject: [PATCH 007/112] Fix warnings with -DPETSC_SKIP_COMPLEX --- src/eps/tests/test21.c | 3 ++- src/sys/classes/fn/impls/exp/fnexp.c | 2 +- src/sys/classes/fn/impls/log/fnlog.c | 5 ----- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/eps/tests/test21.c b/src/eps/tests/test21.c index de1647e49..03846cc5a 100644 --- a/src/eps/tests/test21.c +++ b/src/eps/tests/test21.c @@ -98,7 +98,8 @@ int main(int argc,char **argv) PetscCall(PetscOptionsGetString(NULL,NULL,"-checkfile",filename,sizeof(filename),&checkfile)); if (checkfile) { #if defined(PETSC_HAVE_COMPLEX) - PetscComplex *eigs,eval; + PetscComplex *eigs,eval; + PetscCall(EPSGetConverged(eps,&nconv)); PetscCall(PetscMalloc1(nconv,&eigs)); PetscCall(PetscViewerBinaryOpen(PETSC_COMM_WORLD,filename,FILE_MODE_READ,&viewer)); diff --git a/src/sys/classes/fn/impls/exp/fnexp.c b/src/sys/classes/fn/impls/exp/fnexp.c index fedfbb65c..e65f1a39b 100644 --- a/src/sys/classes/fn/impls/exp/fnexp.c +++ b/src/sys/classes/fn/impls/exp/fnexp.c @@ -125,6 +125,7 @@ PetscErrorCode FNEvaluateFunctionMat_Exp_Pade(FN fn,Mat A,Mat B) PetscFunctionReturn(PETSC_SUCCESS); } +#if defined(PETSC_HAVE_COMPLEX) /* * Set scaling factor (s) and Pade degree (k,m) */ @@ -154,7 +155,6 @@ static PetscErrorCode sexpm_params(PetscReal nrm,PetscInt *s,PetscInt *k,PetscIn PetscFunctionReturn(PETSC_SUCCESS); } -#if defined(PETSC_HAVE_COMPLEX) /* * Partial fraction form coefficients. * If query, the function returns the size necessary to store the coefficients. diff --git a/src/sys/classes/fn/impls/log/fnlog.c b/src/sys/classes/fn/impls/log/fnlog.c index eb65cb6bf..18a1c612d 100644 --- a/src/sys/classes/fn/impls/log/fnlog.c +++ b/src/sys/classes/fn/impls/log/fnlog.c @@ -540,10 +540,6 @@ static PetscErrorCode recompute_diag_blocks_log(PetscBLASInt n,PetscScalar *L,Pe */ static PetscErrorCode FNLogmPade(FN fn,PetscBLASInt n,PetscScalar *T,PetscBLASInt ld,PetscBool firstonly) { -#if !defined(PETSC_HAVE_COMPLEX) - PetscFunctionBegin; - SETERRQ(PETSC_COMM_SELF,PETSC_ERR_SUP,"This function requires C99 or C++ complex support"); -#else PetscBLASInt k,sdim,lwork,info; PetscScalar *wr,*wi=NULL,*W,*Q,*Troot,*L,*work,one=1.0,zero=0.0,alpha; PetscInt i,j,s=0,m=0,*blockformat; @@ -606,7 +602,6 @@ static PetscErrorCode FNLogmPade(FN fn,PetscBLASInt n,PetscScalar *T,PetscBLASIn PetscCall(PetscFree(rwork)); #endif PetscFunctionReturn(PETSC_SUCCESS); -#endif } PetscErrorCode FNEvaluateFunctionMat_Log_Higham(FN fn,Mat A,Mat B) From f3519d29f775992c275651c3e437ae78c3cf0ca1 Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Fri, 28 Apr 2023 08:14:19 +0200 Subject: [PATCH 008/112] Sync with PETSc: update a string in -help output --- src/sys/tests/output/test2_1.out | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sys/tests/output/test2_1.out b/src/sys/tests/output/test2_1.out index 624d40b0c..e18bd6daa 100644 --- a/src/sys/tests/output/test2_1.out +++ b/src/sys/tests/output/test2_1.out @@ -67,7 +67,7 @@ Options for all PETSc programs: PetscDevice Options: -device_enable How (or whether) to initialize PetscDevices (choose one of) none lazy eager (PetscDeviceInitialize()) -default_device_type Set the PetscDeviceType returned by PETSC_DEVICE_DEFAULT() (choose one of) host cuda hip sycl (PetscDeviceSetDefaultDeviceType()) - -device_select : Which device to use. Pass PETSC_DECIDE to have PETSc decide or (given they exist) [0-128) for a specific device (PetscDeviceCreate()) + -device_select : Which device to use. Pass (-1) to have PETSc decide or (given they exist) [0-128) for a specific device (PetscDeviceCreate()) -device_view: Display device information and assignments (forces eager initialization) (PetscDeviceView()) ---------------------------------------- PetscDevice host Options: From e8b0038947b430ce32906296037f1ee187d80cf5 Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Fri, 28 Apr 2023 17:53:16 +0200 Subject: [PATCH 009/112] Sync with PETSc: reorganize makefiles to remove CFLAGS from enviromnent See https://gitlab.com/petsc/petsc/-/merge_requests/6387 --- config/install.py | 2 +- gmakefile | 49 ++++++++++++++++++++ lib/slepc/conf/slepc_rules.utils | 33 ++++++++++++++ makefile | 76 +++----------------------------- 4 files changed, 89 insertions(+), 71 deletions(-) create mode 100644 lib/slepc/conf/slepc_rules.utils diff --git a/config/install.py b/config/install.py index 4ec318eb8..541fe47aa 100755 --- a/config/install.py +++ b/config/install.py @@ -277,7 +277,7 @@ def fixConfFile(self, src): def fixConf(self): import shutil - for file in ['slepc_rules', 'slepc_rules.doc', 'slepc_variables', 'slepcrules', 'slepcvariables']: + for file in ['slepc_rules', 'slepc_rules.doc', 'slepc_rules.utils', 'slepc_variables', 'slepcrules', 'slepcvariables']: self.fixConfFile(os.path.join(self.destConfDir,file)) self.fixConfFile(os.path.join(self.destLibDir,'pkgconfig','slepc.pc')) self.fixConfFile(os.path.join(self.destIncludeDir,'slepcconf.h')) diff --git a/gmakefile b/gmakefile index 73907feb9..bb84e1094 100644 --- a/gmakefile +++ b/gmakefile @@ -254,4 +254,53 @@ allobj.d := $(srcs.o:%.o=%.d) # do-nothing build of PETSc (much worse for larger projects) $(allobj.d) : ; +gmakeinfo: + -@echo "==========================================" + -@echo Starting make run on `hostname` at `date +'%a, %d %b %Y %H:%M:%S %z'` + -@echo Machine characteristics: `uname -a` + -@echo "-----------------------------------------" + -@echo "Using SLEPc directory: ${SLEPC_DIR}" + -@echo "Using PETSc directory: ${PETSC_DIR}" + -@echo "Using PETSc arch: ${PETSC_ARCH}" + -@echo "-----------------------------------------" + -@grep "define SLEPC_VERSION" ${SLEPC_DIR}/include/slepcversion.h | ${SED} "s/........//" | head -n 7 + -@echo "-----------------------------------------" + -@echo "Using SLEPc configure options: ${SLEPC_CONFIGURE_OPTIONS}" + -@echo "Using SLEPc configuration flags:" + -@grep "\#define " ${SLEPCCONF_H} | tail -n +2 + -@echo "-----------------------------------------" + -@grep "define PETSC_VERSION" ${PETSC_DIR}/include/petscversion.h | ${SED} "s/........//" | head -n 7 + -@echo "-----------------------------------------" + -@echo "Using PETSc configure options: ${CONFIGURE_OPTIONS}" + -@echo "Using PETSc configuration flags:" + -@grep "\#define " ${PETSCCONF_H} | tail -n +2 + -@echo "-----------------------------------------" + -@echo "Using C/C++ include paths: ${SLEPC_CC_INCLUDES}" + -@echo "Using C compile: ${PETSC_CCOMPILE_SINGLE}" + -@if [ "${CXX}" != "" ]; then \ + echo "Using C++ compile: ${PETSC_CXXCOMPILE_SINGLE}";\ + fi + -@if [ "${FC}" != "" ]; then \ + echo "Using Fortran include/module paths: ${SLEPC_FC_INCLUDES}";\ + echo "Using Fortran compile: ${PETSC_FCOMPILE_SINGLE}";\ + fi + -@if [ "${CUDAC}" != "" ]; then \ + echo "Using CUDA compile: ${PETSC_CUCOMPILE_SINGLE}";\ + fi + -@echo "-----------------------------------------" + -@echo "Using C/C++ linker: ${PCC_LINKER}" + -@echo "Using C/C++ flags: ${PCC_LINKER_FLAGS}" + -@if [ "${FC}" != "" ]; then \ + echo "Using Fortran linker: ${FC_LINKER}";\ + echo "Using Fortran flags: ${FC_LINKER_FLAGS}";\ + fi + -@echo "-----------------------------------------" + -@echo "Using libraries: ${SLEPC_LIB}" + -@echo "------------------------------------------" + -@echo "Using mpiexec: ${MPIEXEC}" + -@echo "------------------------------------------" + -@echo "Using MAKE: ${MAKE}" + -@echo "Default MAKEFLAGS: MAKE_NP:${MAKE_NP} MAKE_LOAD:${MAKE_LOAD} MAKEFLAGS:${MAKEFLAGS}" + -@echo "==========================================" + -include $(allobj.d) diff --git a/lib/slepc/conf/slepc_rules.utils b/lib/slepc/conf/slepc_rules.utils new file mode 100644 index 000000000..ef8f1a096 --- /dev/null +++ b/lib/slepc/conf/slepc_rules.utils @@ -0,0 +1,33 @@ +# +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# SLEPc - Scalable Library for Eigenvalue Problem Computations +# Copyright (c) 2002-, Universitat Politecnica de Valencia, Spain +# +# This file is part of SLEPc. +# SLEPc is distributed under a 2-clause BSD license (see LICENSE). +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# + +include ${PETSC_DIR}/lib/petsc/conf/rules.utils + +getlinklibs_slepc: + -@echo ${SLEPC_LIB} + +getincludedirs_slepc: + -@echo ${SLEPC_CC_INCLUDES} + +vermin_slepc: + @vermin -vvv -t=3.4- ${VERMIN_OPTIONS} ${SLEPC_DIR}/config + +lint_slepc: + ${PYTHON3} ${SLEPC_DIR}/lib/slepc/bin/maint/slepcClangLinter.py $(LINTER_OPTIONS) + +help-lint_slepc: + @${PYTHON3} ${SLEPC_DIR}/lib/slepc/bin/maint/slepcClangLinter.py --help + -@echo "Basic usage:" + -@echo " make lint_slepc " + -@echo + -@echo "Options:" + -@echo " LINTER_OPTIONS=\"--linter_options ...\" See above for available options" + -@echo + diff --git a/makefile b/makefile index b79b45a6f..e6b44f472 100644 --- a/makefile +++ b/makefile @@ -27,14 +27,17 @@ DIRS = src include # Include the rest of makefiles include ./${PETSC_ARCH}/lib/slepc/conf/slepcvariables -include ${SLEPC_DIR}/lib/slepc/conf/slepc_common -include ${PETSC_DIR}/lib/petsc/conf/rules.utils +include ${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/conf/petscvariables +include ${SLEPC_DIR}/lib/slepc/conf/slepc_rules +include ${SLEPC_DIR}/lib/slepc/conf/slepc_rules.doc +include ${SLEPC_DIR}/lib/slepc/conf/slepc_rules.utils # This makefile doesn't really do any work. Sub-makes still benefit from parallelism. .NOTPARALLEL: OMAKE_SELF = $(OMAKE) -f makefile OMAKE_SELF_PRINTDIR = $(OMAKE_PRINTDIR) -f makefile +PETSCCONF_H = ${PETSC_DIR}/${PETSC_ARCH}/include/petscconf.h # ******** Rules for make all ************************************************************************** @@ -213,60 +216,8 @@ clean:: allclean #********* Rules for printing library properties useful for building applications ********************** -getlinklibs_slepc: - -@echo ${SLEPC_LIB} - -getincludedirs_slepc: - -@echo ${SLEPC_CC_INCLUDES} - info: - -@echo "==========================================" - -@echo Starting make run on `hostname` at `date +'%a, %d %b %Y %H:%M:%S %z'` - -@echo Machine characteristics: `uname -a` - -@echo "-----------------------------------------" - -@echo "Using SLEPc directory: ${SLEPC_DIR}" - -@echo "Using PETSc directory: ${PETSC_DIR}" - -@echo "Using PETSc arch: ${PETSC_ARCH}" - -@echo "-----------------------------------------" - -@grep "define SLEPC_VERSION" ${SLEPC_DIR}/include/slepcversion.h | ${SED} "s/........//" | head -n 7 - -@echo "-----------------------------------------" - -@echo "Using SLEPc configure options: ${SLEPC_CONFIGURE_OPTIONS}" - -@echo "Using SLEPc configuration flags:" - -@grep "\#define " ${SLEPCCONF_H} | tail -n +2 - -@echo "-----------------------------------------" - -@grep "define PETSC_VERSION" ${PETSC_DIR}/include/petscversion.h | ${SED} "s/........//" | head -n 7 - -@echo "-----------------------------------------" - -@echo "Using PETSc configure options: ${CONFIGURE_OPTIONS}" - -@echo "Using PETSc configuration flags:" - -@grep "\#define " ${PETSCCONF_H} | tail -n +2 - -@echo "-----------------------------------------" - -@echo "Using C/C++ include paths: ${SLEPC_CC_INCLUDES}" - -@echo "Using C compile: ${PETSC_CCOMPILE_SINGLE}" - -@if [ "${CXX}" != "" ]; then \ - echo "Using C++ compile: ${PETSC_CXXCOMPILE_SINGLE}";\ - fi - -@if [ "${FC}" != "" ]; then \ - echo "Using Fortran include/module paths: ${SLEPC_FC_INCLUDES}";\ - echo "Using Fortran compile: ${PETSC_FCOMPILE_SINGLE}";\ - fi - -@if [ "${CUDAC}" != "" ]; then \ - echo "Using CUDA compile: ${PETSC_CUCOMPILE_SINGLE}";\ - fi - -@echo "-----------------------------------------" - -@echo "Using C/C++ linker: ${PCC_LINKER}" - -@echo "Using C/C++ flags: ${PCC_LINKER_FLAGS}" - -@if [ "${FC}" != "" ]; then \ - echo "Using Fortran linker: ${FC_LINKER}";\ - echo "Using Fortran flags: ${FC_LINKER_FLAGS}";\ - fi - -@echo "-----------------------------------------" - -@echo "Using libraries: ${SLEPC_LIB}" - -@echo "------------------------------------------" - -@echo "Using mpiexec: ${MPIEXEC}" - -@echo "------------------------------------------" - -@echo "Using MAKE: ${MAKE}" - -@echo "Default MAKEFLAGS: MAKE_NP:${MAKE_NP} MAKE_LOAD:${MAKE_LOAD} MAKEFLAGS:${MAKEFLAGS}" - -@echo "==========================================" + -@${OMAKE} -f gmakefile gmakeinfo check_usermakefile: -@echo "Testing compile with user makefile" @@ -382,21 +333,6 @@ allcleanhtml: # ******** Rules for checking coding standards ********************************************************* -vermin_slepc: - @vermin -vvv -t=3.4- ${VERMIN_OPTIONS} ${SLEPC_DIR}/config - -lint_slepc: - ${PYTHON3} ${SLEPC_DIR}/lib/slepc/bin/maint/slepcClangLinter.py $(LINTER_OPTIONS) - -help-lint_slepc: - @${PYTHON3} ${SLEPC_DIR}/lib/slepc/bin/maint/slepcClangLinter.py --help - -@echo "Basic usage:" - -@echo " make lint_slepc " - -@echo - -@echo "Options:" - -@echo " LINTER_OPTIONS=\"--linter_options ...\" See above for available options" - -@echo - countfortranfunctions: -@for D in `find ${SLEPC_DIR}/src -name ftn-auto` \ `find ${SLEPC_DIR}/src -name ftn-custom`; do cd $$D; \ From 2d784b27f25becd782a07b34ec0fba3112824cb8 Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Sat, 29 Apr 2023 11:30:20 +0200 Subject: [PATCH 010/112] makefile: move get*_slepc rules to gmakefile because they need to include slepc_variables --- gmakefile | 6 ++++++ lib/slepc/conf/slepc_rules.utils | 6 ------ makefile | 6 ++++++ 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/gmakefile b/gmakefile index bb84e1094..8e264d368 100644 --- a/gmakefile +++ b/gmakefile @@ -254,6 +254,12 @@ allobj.d := $(srcs.o:%.o=%.d) # do-nothing build of PETSc (much worse for larger projects) $(allobj.d) : ; +gmakegetlinklibs_slepc: + -@echo ${SLEPC_LIB} + +gmakegetincludedirs_slepc: + -@echo ${SLEPC_CC_INCLUDES} + gmakeinfo: -@echo "==========================================" -@echo Starting make run on `hostname` at `date +'%a, %d %b %Y %H:%M:%S %z'` diff --git a/lib/slepc/conf/slepc_rules.utils b/lib/slepc/conf/slepc_rules.utils index ef8f1a096..72580b016 100644 --- a/lib/slepc/conf/slepc_rules.utils +++ b/lib/slepc/conf/slepc_rules.utils @@ -10,12 +10,6 @@ include ${PETSC_DIR}/lib/petsc/conf/rules.utils -getlinklibs_slepc: - -@echo ${SLEPC_LIB} - -getincludedirs_slepc: - -@echo ${SLEPC_CC_INCLUDES} - vermin_slepc: @vermin -vvv -t=3.4- ${VERMIN_OPTIONS} ${SLEPC_DIR}/config diff --git a/makefile b/makefile index e6b44f472..bff72d3bf 100644 --- a/makefile +++ b/makefile @@ -216,6 +216,12 @@ clean:: allclean #********* Rules for printing library properties useful for building applications ********************** +getlinklibs_slepc: + -@${OMAKE} -f gmakefile gmakegetlinklibs_slepc + +getincludedirs_slepc: + -@${OMAKE} -f gmakefile gmakegetincludedirs_slepc + info: -@${OMAKE} -f gmakefile gmakeinfo From 8b228f9f67779c18d37ee7e844613a90465479ad Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Sat, 29 Apr 2023 12:51:48 +0200 Subject: [PATCH 011/112] makefile: include petscvariables from slepcvariables --- config/packages/petsc.py | 8 ++++---- config/packages/slepc.py | 1 + makefile | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/config/packages/petsc.py b/config/packages/petsc.py index cc5aee43a..bcb036d23 100644 --- a/config/packages/petsc.py +++ b/config/packages/petsc.py @@ -99,17 +99,17 @@ def LoadConf(self): suggest = os.path.basename(self.arch) if not suggest: suggest = os.path.basename(self.arch[0:-1]) self.log.Exit('Variable PETSC_ARCH must not be a full path\nYou set PETSC_ARCH=%s, maybe you meant PETSC_ARCH=%s'% (self.arch,suggest)) - petscvariables = os.path.join(self.dir,self.arch,'lib','petsc','conf','petscvariables') + self.petscvariables = os.path.join(self.dir,self.arch,'lib','petsc','conf','petscvariables') petscconf_h = os.path.join(self.dir,self.arch,'include','petscconf.h') else: self.isinstall = True - petscvariables = os.path.join(self.dir,'lib','petsc','conf','petscvariables') + self.petscvariables = os.path.join(self.dir,'lib','petsc','conf','petscvariables') petscconf_h = os.path.join(self.dir,'include','petscconf.h') self.buildsharedlib = False self.bfort = 'nobfortinpetsc' try: - with open(petscvariables) as f: + with open(self.petscvariables) as f: for l in f.readlines(): r = l.split('=',1) if len(r)!=2: continue @@ -128,7 +128,7 @@ def LoadConf(self): if k in ['AR','AR_FLAGS','AR_LIB_SUFFIX','BFORT','BLASLAPACK_LIB','CC','CC_FLAGS','CC_LINKER_SLFLAG','CMAKE','CONFIGURE_OPTIONS','CPP','CXX','CXX_FLAGS','FC_FLAGS','MAKE','MAKE_NP','PREFIXDIR','RANLIB','SCALAPACK_LIB','SEDINPLACE','SL_LINKER_SUFFIX']: setattr(self,k.lower(),v) except: - self.log.Exit('Cannot process file ' + petscvariables) + self.log.Exit('Cannot process file ' + self.petscvariables) self.ind64 = False self.mpiuni = False diff --git a/config/packages/slepc.py b/config/packages/slepc.py index e9cf38f9f..f6f8e79d6 100644 --- a/config/packages/slepc.py +++ b/config/packages/slepc.py @@ -41,6 +41,7 @@ def ProcessArgs(self,argdb): self.prefixdir = os.path.realpath(os.path.normpath(self.prefixdir)) def Process(self,slepcconf,slepcvars,slepcrules,slepc,petsc,archdir=''): + slepcvars.write('include '+petsc.petscvariables+'\n') slepcvars.write('SLEPC_CONFIGURE_OPTIONS = '+' '.join(sys.argv[1:])+'\n') slepcvars.write('SLEPC_INSTALLDIR = '+slepc.prefixdir+'\n') if petsc.isinstall: diff --git a/makefile b/makefile index bff72d3bf..231ab93d6 100644 --- a/makefile +++ b/makefile @@ -27,7 +27,7 @@ DIRS = src include # Include the rest of makefiles include ./${PETSC_ARCH}/lib/slepc/conf/slepcvariables -include ${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/conf/petscvariables +include ./${PETSC_ARCH}/lib/slepc/conf/slepcvariables # include twice, required in prefix builds include ${SLEPC_DIR}/lib/slepc/conf/slepc_rules include ${SLEPC_DIR}/lib/slepc/conf/slepc_rules.doc include ${SLEPC_DIR}/lib/slepc/conf/slepc_rules.utils From 0c10ef96061f1011ce63998e7e9558fc2c5dda37 Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Fri, 28 Apr 2023 17:53:16 +0200 Subject: [PATCH 012/112] Sync with PETSc: reorganize makefiles to remove CFLAGS from enviromnent See https://gitlab.com/petsc/petsc/-/merge_requests/6387 --- config/install.py | 2 +- gmakefile | 49 ++++++++++++++++++++ lib/slepc/conf/slepc_rules.utils | 33 ++++++++++++++ makefile | 76 +++----------------------------- 4 files changed, 89 insertions(+), 71 deletions(-) create mode 100644 lib/slepc/conf/slepc_rules.utils diff --git a/config/install.py b/config/install.py index 4ec318eb8..541fe47aa 100755 --- a/config/install.py +++ b/config/install.py @@ -277,7 +277,7 @@ def fixConfFile(self, src): def fixConf(self): import shutil - for file in ['slepc_rules', 'slepc_rules.doc', 'slepc_variables', 'slepcrules', 'slepcvariables']: + for file in ['slepc_rules', 'slepc_rules.doc', 'slepc_rules.utils', 'slepc_variables', 'slepcrules', 'slepcvariables']: self.fixConfFile(os.path.join(self.destConfDir,file)) self.fixConfFile(os.path.join(self.destLibDir,'pkgconfig','slepc.pc')) self.fixConfFile(os.path.join(self.destIncludeDir,'slepcconf.h')) diff --git a/gmakefile b/gmakefile index 73907feb9..bb84e1094 100644 --- a/gmakefile +++ b/gmakefile @@ -254,4 +254,53 @@ allobj.d := $(srcs.o:%.o=%.d) # do-nothing build of PETSc (much worse for larger projects) $(allobj.d) : ; +gmakeinfo: + -@echo "==========================================" + -@echo Starting make run on `hostname` at `date +'%a, %d %b %Y %H:%M:%S %z'` + -@echo Machine characteristics: `uname -a` + -@echo "-----------------------------------------" + -@echo "Using SLEPc directory: ${SLEPC_DIR}" + -@echo "Using PETSc directory: ${PETSC_DIR}" + -@echo "Using PETSc arch: ${PETSC_ARCH}" + -@echo "-----------------------------------------" + -@grep "define SLEPC_VERSION" ${SLEPC_DIR}/include/slepcversion.h | ${SED} "s/........//" | head -n 7 + -@echo "-----------------------------------------" + -@echo "Using SLEPc configure options: ${SLEPC_CONFIGURE_OPTIONS}" + -@echo "Using SLEPc configuration flags:" + -@grep "\#define " ${SLEPCCONF_H} | tail -n +2 + -@echo "-----------------------------------------" + -@grep "define PETSC_VERSION" ${PETSC_DIR}/include/petscversion.h | ${SED} "s/........//" | head -n 7 + -@echo "-----------------------------------------" + -@echo "Using PETSc configure options: ${CONFIGURE_OPTIONS}" + -@echo "Using PETSc configuration flags:" + -@grep "\#define " ${PETSCCONF_H} | tail -n +2 + -@echo "-----------------------------------------" + -@echo "Using C/C++ include paths: ${SLEPC_CC_INCLUDES}" + -@echo "Using C compile: ${PETSC_CCOMPILE_SINGLE}" + -@if [ "${CXX}" != "" ]; then \ + echo "Using C++ compile: ${PETSC_CXXCOMPILE_SINGLE}";\ + fi + -@if [ "${FC}" != "" ]; then \ + echo "Using Fortran include/module paths: ${SLEPC_FC_INCLUDES}";\ + echo "Using Fortran compile: ${PETSC_FCOMPILE_SINGLE}";\ + fi + -@if [ "${CUDAC}" != "" ]; then \ + echo "Using CUDA compile: ${PETSC_CUCOMPILE_SINGLE}";\ + fi + -@echo "-----------------------------------------" + -@echo "Using C/C++ linker: ${PCC_LINKER}" + -@echo "Using C/C++ flags: ${PCC_LINKER_FLAGS}" + -@if [ "${FC}" != "" ]; then \ + echo "Using Fortran linker: ${FC_LINKER}";\ + echo "Using Fortran flags: ${FC_LINKER_FLAGS}";\ + fi + -@echo "-----------------------------------------" + -@echo "Using libraries: ${SLEPC_LIB}" + -@echo "------------------------------------------" + -@echo "Using mpiexec: ${MPIEXEC}" + -@echo "------------------------------------------" + -@echo "Using MAKE: ${MAKE}" + -@echo "Default MAKEFLAGS: MAKE_NP:${MAKE_NP} MAKE_LOAD:${MAKE_LOAD} MAKEFLAGS:${MAKEFLAGS}" + -@echo "==========================================" + -include $(allobj.d) diff --git a/lib/slepc/conf/slepc_rules.utils b/lib/slepc/conf/slepc_rules.utils new file mode 100644 index 000000000..ef8f1a096 --- /dev/null +++ b/lib/slepc/conf/slepc_rules.utils @@ -0,0 +1,33 @@ +# +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# SLEPc - Scalable Library for Eigenvalue Problem Computations +# Copyright (c) 2002-, Universitat Politecnica de Valencia, Spain +# +# This file is part of SLEPc. +# SLEPc is distributed under a 2-clause BSD license (see LICENSE). +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# + +include ${PETSC_DIR}/lib/petsc/conf/rules.utils + +getlinklibs_slepc: + -@echo ${SLEPC_LIB} + +getincludedirs_slepc: + -@echo ${SLEPC_CC_INCLUDES} + +vermin_slepc: + @vermin -vvv -t=3.4- ${VERMIN_OPTIONS} ${SLEPC_DIR}/config + +lint_slepc: + ${PYTHON3} ${SLEPC_DIR}/lib/slepc/bin/maint/slepcClangLinter.py $(LINTER_OPTIONS) + +help-lint_slepc: + @${PYTHON3} ${SLEPC_DIR}/lib/slepc/bin/maint/slepcClangLinter.py --help + -@echo "Basic usage:" + -@echo " make lint_slepc " + -@echo + -@echo "Options:" + -@echo " LINTER_OPTIONS=\"--linter_options ...\" See above for available options" + -@echo + diff --git a/makefile b/makefile index b79b45a6f..e6b44f472 100644 --- a/makefile +++ b/makefile @@ -27,14 +27,17 @@ DIRS = src include # Include the rest of makefiles include ./${PETSC_ARCH}/lib/slepc/conf/slepcvariables -include ${SLEPC_DIR}/lib/slepc/conf/slepc_common -include ${PETSC_DIR}/lib/petsc/conf/rules.utils +include ${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/conf/petscvariables +include ${SLEPC_DIR}/lib/slepc/conf/slepc_rules +include ${SLEPC_DIR}/lib/slepc/conf/slepc_rules.doc +include ${SLEPC_DIR}/lib/slepc/conf/slepc_rules.utils # This makefile doesn't really do any work. Sub-makes still benefit from parallelism. .NOTPARALLEL: OMAKE_SELF = $(OMAKE) -f makefile OMAKE_SELF_PRINTDIR = $(OMAKE_PRINTDIR) -f makefile +PETSCCONF_H = ${PETSC_DIR}/${PETSC_ARCH}/include/petscconf.h # ******** Rules for make all ************************************************************************** @@ -213,60 +216,8 @@ clean:: allclean #********* Rules for printing library properties useful for building applications ********************** -getlinklibs_slepc: - -@echo ${SLEPC_LIB} - -getincludedirs_slepc: - -@echo ${SLEPC_CC_INCLUDES} - info: - -@echo "==========================================" - -@echo Starting make run on `hostname` at `date +'%a, %d %b %Y %H:%M:%S %z'` - -@echo Machine characteristics: `uname -a` - -@echo "-----------------------------------------" - -@echo "Using SLEPc directory: ${SLEPC_DIR}" - -@echo "Using PETSc directory: ${PETSC_DIR}" - -@echo "Using PETSc arch: ${PETSC_ARCH}" - -@echo "-----------------------------------------" - -@grep "define SLEPC_VERSION" ${SLEPC_DIR}/include/slepcversion.h | ${SED} "s/........//" | head -n 7 - -@echo "-----------------------------------------" - -@echo "Using SLEPc configure options: ${SLEPC_CONFIGURE_OPTIONS}" - -@echo "Using SLEPc configuration flags:" - -@grep "\#define " ${SLEPCCONF_H} | tail -n +2 - -@echo "-----------------------------------------" - -@grep "define PETSC_VERSION" ${PETSC_DIR}/include/petscversion.h | ${SED} "s/........//" | head -n 7 - -@echo "-----------------------------------------" - -@echo "Using PETSc configure options: ${CONFIGURE_OPTIONS}" - -@echo "Using PETSc configuration flags:" - -@grep "\#define " ${PETSCCONF_H} | tail -n +2 - -@echo "-----------------------------------------" - -@echo "Using C/C++ include paths: ${SLEPC_CC_INCLUDES}" - -@echo "Using C compile: ${PETSC_CCOMPILE_SINGLE}" - -@if [ "${CXX}" != "" ]; then \ - echo "Using C++ compile: ${PETSC_CXXCOMPILE_SINGLE}";\ - fi - -@if [ "${FC}" != "" ]; then \ - echo "Using Fortran include/module paths: ${SLEPC_FC_INCLUDES}";\ - echo "Using Fortran compile: ${PETSC_FCOMPILE_SINGLE}";\ - fi - -@if [ "${CUDAC}" != "" ]; then \ - echo "Using CUDA compile: ${PETSC_CUCOMPILE_SINGLE}";\ - fi - -@echo "-----------------------------------------" - -@echo "Using C/C++ linker: ${PCC_LINKER}" - -@echo "Using C/C++ flags: ${PCC_LINKER_FLAGS}" - -@if [ "${FC}" != "" ]; then \ - echo "Using Fortran linker: ${FC_LINKER}";\ - echo "Using Fortran flags: ${FC_LINKER_FLAGS}";\ - fi - -@echo "-----------------------------------------" - -@echo "Using libraries: ${SLEPC_LIB}" - -@echo "------------------------------------------" - -@echo "Using mpiexec: ${MPIEXEC}" - -@echo "------------------------------------------" - -@echo "Using MAKE: ${MAKE}" - -@echo "Default MAKEFLAGS: MAKE_NP:${MAKE_NP} MAKE_LOAD:${MAKE_LOAD} MAKEFLAGS:${MAKEFLAGS}" - -@echo "==========================================" + -@${OMAKE} -f gmakefile gmakeinfo check_usermakefile: -@echo "Testing compile with user makefile" @@ -382,21 +333,6 @@ allcleanhtml: # ******** Rules for checking coding standards ********************************************************* -vermin_slepc: - @vermin -vvv -t=3.4- ${VERMIN_OPTIONS} ${SLEPC_DIR}/config - -lint_slepc: - ${PYTHON3} ${SLEPC_DIR}/lib/slepc/bin/maint/slepcClangLinter.py $(LINTER_OPTIONS) - -help-lint_slepc: - @${PYTHON3} ${SLEPC_DIR}/lib/slepc/bin/maint/slepcClangLinter.py --help - -@echo "Basic usage:" - -@echo " make lint_slepc " - -@echo - -@echo "Options:" - -@echo " LINTER_OPTIONS=\"--linter_options ...\" See above for available options" - -@echo - countfortranfunctions: -@for D in `find ${SLEPC_DIR}/src -name ftn-auto` \ `find ${SLEPC_DIR}/src -name ftn-custom`; do cd $$D; \ From c634b9a928a30bb97ba82d00c213b090937f1c93 Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Sat, 29 Apr 2023 11:30:20 +0200 Subject: [PATCH 013/112] makefile: move get*_slepc rules to gmakefile because they need to include slepc_variables --- gmakefile | 6 ++++++ lib/slepc/conf/slepc_rules.utils | 6 ------ makefile | 6 ++++++ 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/gmakefile b/gmakefile index bb84e1094..8e264d368 100644 --- a/gmakefile +++ b/gmakefile @@ -254,6 +254,12 @@ allobj.d := $(srcs.o:%.o=%.d) # do-nothing build of PETSc (much worse for larger projects) $(allobj.d) : ; +gmakegetlinklibs_slepc: + -@echo ${SLEPC_LIB} + +gmakegetincludedirs_slepc: + -@echo ${SLEPC_CC_INCLUDES} + gmakeinfo: -@echo "==========================================" -@echo Starting make run on `hostname` at `date +'%a, %d %b %Y %H:%M:%S %z'` diff --git a/lib/slepc/conf/slepc_rules.utils b/lib/slepc/conf/slepc_rules.utils index ef8f1a096..72580b016 100644 --- a/lib/slepc/conf/slepc_rules.utils +++ b/lib/slepc/conf/slepc_rules.utils @@ -10,12 +10,6 @@ include ${PETSC_DIR}/lib/petsc/conf/rules.utils -getlinklibs_slepc: - -@echo ${SLEPC_LIB} - -getincludedirs_slepc: - -@echo ${SLEPC_CC_INCLUDES} - vermin_slepc: @vermin -vvv -t=3.4- ${VERMIN_OPTIONS} ${SLEPC_DIR}/config diff --git a/makefile b/makefile index e6b44f472..bff72d3bf 100644 --- a/makefile +++ b/makefile @@ -216,6 +216,12 @@ clean:: allclean #********* Rules for printing library properties useful for building applications ********************** +getlinklibs_slepc: + -@${OMAKE} -f gmakefile gmakegetlinklibs_slepc + +getincludedirs_slepc: + -@${OMAKE} -f gmakefile gmakegetincludedirs_slepc + info: -@${OMAKE} -f gmakefile gmakeinfo From a84e85cfebff016346e326afeefffbe2418c7dba Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Sat, 29 Apr 2023 12:51:48 +0200 Subject: [PATCH 014/112] makefile: include petscvariables from slepcvariables --- config/packages/petsc.py | 8 ++++---- config/packages/slepc.py | 1 + makefile | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/config/packages/petsc.py b/config/packages/petsc.py index cc5aee43a..bcb036d23 100644 --- a/config/packages/petsc.py +++ b/config/packages/petsc.py @@ -99,17 +99,17 @@ def LoadConf(self): suggest = os.path.basename(self.arch) if not suggest: suggest = os.path.basename(self.arch[0:-1]) self.log.Exit('Variable PETSC_ARCH must not be a full path\nYou set PETSC_ARCH=%s, maybe you meant PETSC_ARCH=%s'% (self.arch,suggest)) - petscvariables = os.path.join(self.dir,self.arch,'lib','petsc','conf','petscvariables') + self.petscvariables = os.path.join(self.dir,self.arch,'lib','petsc','conf','petscvariables') petscconf_h = os.path.join(self.dir,self.arch,'include','petscconf.h') else: self.isinstall = True - petscvariables = os.path.join(self.dir,'lib','petsc','conf','petscvariables') + self.petscvariables = os.path.join(self.dir,'lib','petsc','conf','petscvariables') petscconf_h = os.path.join(self.dir,'include','petscconf.h') self.buildsharedlib = False self.bfort = 'nobfortinpetsc' try: - with open(petscvariables) as f: + with open(self.petscvariables) as f: for l in f.readlines(): r = l.split('=',1) if len(r)!=2: continue @@ -128,7 +128,7 @@ def LoadConf(self): if k in ['AR','AR_FLAGS','AR_LIB_SUFFIX','BFORT','BLASLAPACK_LIB','CC','CC_FLAGS','CC_LINKER_SLFLAG','CMAKE','CONFIGURE_OPTIONS','CPP','CXX','CXX_FLAGS','FC_FLAGS','MAKE','MAKE_NP','PREFIXDIR','RANLIB','SCALAPACK_LIB','SEDINPLACE','SL_LINKER_SUFFIX']: setattr(self,k.lower(),v) except: - self.log.Exit('Cannot process file ' + petscvariables) + self.log.Exit('Cannot process file ' + self.petscvariables) self.ind64 = False self.mpiuni = False diff --git a/config/packages/slepc.py b/config/packages/slepc.py index e9cf38f9f..f6f8e79d6 100644 --- a/config/packages/slepc.py +++ b/config/packages/slepc.py @@ -41,6 +41,7 @@ def ProcessArgs(self,argdb): self.prefixdir = os.path.realpath(os.path.normpath(self.prefixdir)) def Process(self,slepcconf,slepcvars,slepcrules,slepc,petsc,archdir=''): + slepcvars.write('include '+petsc.petscvariables+'\n') slepcvars.write('SLEPC_CONFIGURE_OPTIONS = '+' '.join(sys.argv[1:])+'\n') slepcvars.write('SLEPC_INSTALLDIR = '+slepc.prefixdir+'\n') if petsc.isinstall: diff --git a/makefile b/makefile index bff72d3bf..231ab93d6 100644 --- a/makefile +++ b/makefile @@ -27,7 +27,7 @@ DIRS = src include # Include the rest of makefiles include ./${PETSC_ARCH}/lib/slepc/conf/slepcvariables -include ${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/conf/petscvariables +include ./${PETSC_ARCH}/lib/slepc/conf/slepcvariables # include twice, required in prefix builds include ${SLEPC_DIR}/lib/slepc/conf/slepc_rules include ${SLEPC_DIR}/lib/slepc/conf/slepc_rules.doc include ${SLEPC_DIR}/lib/slepc/conf/slepc_rules.utils From c1382458f186da49a80567e8eb61c43f04847f93 Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Fri, 5 May 2023 18:59:06 +0200 Subject: [PATCH 015/112] make: fix error with gmakeinfo target --- gmakefile | 2 +- gmakefile.test | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gmakefile b/gmakefile index 8e264d368..fbcb3324a 100644 --- a/gmakefile +++ b/gmakefile @@ -61,7 +61,7 @@ $(generated) : $(slepcconf) $(slepcvariables) $(PETSCCONFIGDIR)/gmakegen.py $(PYTHON) $(PETSCCONFIGDIR)/gmakegen.py --petsc-arch=$(PETSC_ARCH_DIR) --pkg-dir=$(SLEPC_DIR) --pkg-name=slepc --pkg-pkgs=$(spkgs) --pkg-arch=$(PETSC_ARCH) # Skip including generated files (which triggers rebuilding them) when we're just going to clean anyway. -ifneq ($(filter-out clean check info,$(MAKECMDGOALS:clean%=clean)),) +ifneq ($(filter-out help clean check info gmakeinfo,$(MAKECMDGOALS:clean%=clean)),) include $(generated) endif diff --git a/gmakefile.test b/gmakefile.test index 1c39b3627..984bc196a 100644 --- a/gmakefile.test +++ b/gmakefile.test @@ -116,7 +116,7 @@ endif $(generatedtest) : $(slepcconf) $(slepcvariables) $(PETSCCONFIGDIR)/gmakegentest.py $(TESTDIR)/.DIR | $$(@D)/.DIR $(PYTHON) $(PETSCCONFIGDIR)/gmakegentest.py --petsc-dir=$(PETSC_DIR) --petsc-arch=$(PETSC_ARCH_DIR) --testdir=$(TESTDIR) --srcdir=$(TESTSRCDIR) --pkg-name=slepc --pkg-pkgs=$(spkgs) --pkg-arch=$(PETSC_ARCH) --pkg-dir=$(SLEPC_DIR) -ifneq ($(filter-out help clean check info slepc_libs all install install-lib checkbadSource checkbadFileChange allfortranstubs alletags get%,$(MAKECMDGOALS:clean%=clean)),) +ifneq ($(filter-out help clean check info gmakeinfo slepc_libs all install install-lib checkbadSource checkbadFileChange allfortranstubs alletags get%,$(MAKECMDGOALS:clean%=clean)),) include $(generatedtest) endif From 7b0af8b51ceef0d8802c356dd852e546faf24feb Mon Sep 17 00:00:00 2001 From: Pierre Jolivet Date: Mon, 8 May 2023 10:45:08 +0200 Subject: [PATCH 016/112] Fix -Wunused-parameter include/slepc/private/slepcimpl.h:57:104: warning: unused parameter 'eigi' [-Wunused-parameter] static inline PetscErrorCode SlepcPrintEigenvalueASCII(PetscViewer viewer,PetscScalar eigr,PetscScalar eigi) ^ include/slepc/private/slepcimpl.h:83:81: warning: unused parameter 'xi' [-Wunused-parameter] static inline PetscErrorCode SlepcViewEigenvector(PetscViewer viewer,Vec xr,Vec xi,const char *label,PetscInt index,PetscObject obj) ^ --- include/slepc/private/slepcimpl.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/slepc/private/slepcimpl.h b/include/slepc/private/slepcimpl.h index 175455896..cbc245cfd 100644 --- a/include/slepc/private/slepcimpl.h +++ b/include/slepc/private/slepcimpl.h @@ -62,6 +62,7 @@ static inline PetscErrorCode SlepcPrintEigenvalueASCII(PetscViewer viewer,PetscS #if defined(PETSC_USE_COMPLEX) re = PetscRealPart(eigr); im = PetscImaginaryPart(eigr); + (void)eigi; #else re = eigr; im = eigi; @@ -97,6 +98,8 @@ static inline PetscErrorCode SlepcViewEigenvector(PetscViewer viewer,Vec xr,Vec vname[count-1] = 'i'; PetscCall(PetscObjectSetName((PetscObject)xi,vname)); PetscCall(VecView(xi,viewer)); +#else + (void)xi; #endif PetscFunctionReturn(PETSC_SUCCESS); } From 2f5d15b7a39685ede9c9abcbdaa16bbaae5aa75e Mon Sep 17 00:00:00 2001 From: Pierre Jolivet Date: Tue, 9 May 2023 08:19:34 +0200 Subject: [PATCH 017/112] make check: avoid redundant line with PETSc --- makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/makefile b/makefile index 231ab93d6..585fad174 100644 --- a/makefile +++ b/makefile @@ -114,7 +114,7 @@ RUN_TEST = ${OMAKE_SELF} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} SLEPC_D check_install: check check: -@echo "Running check examples to verify correct installation" - -@echo "Using SLEPC_DIR=${SLEPC_DIR}, PETSC_DIR=${PETSC_DIR} and PETSC_ARCH=${PETSC_ARCH}" + -@echo "Using SLEPC_DIR=${SLEPC_DIR}, PETSC_DIR=${PETSC_DIR}, and PETSC_ARCH=${PETSC_ARCH}" @if [ "${PETSC_WITH_BATCH}" != "" ]; then \ echo "Running with batch filesystem, cannot run make check"; \ elif [ "${MPIEXEC}" = "/bin/false" ]; then \ @@ -145,7 +145,7 @@ check_build: cd src/eps/tests >/dev/null; ${RUN_TEST} testtest5_blopex; \ fi +@cd src/eps/tests >/dev/null; ${RUN_TEST} clean-legacy - -@echo "Completed test examples" + -@echo "Completed SLEPc test examples" # ******** Rules for make install ********************************************************************** @@ -227,7 +227,7 @@ info: check_usermakefile: -@echo "Testing compile with user makefile" - -@echo "Using SLEPC_DIR=${SLEPC_DIR}, PETSC_DIR=${PETSC_DIR} and PETSC_ARCH=${PETSC_ARCH}" + -@echo "Using SLEPC_DIR=${SLEPC_DIR}, PETSC_DIR=${PETSC_DIR}, and PETSC_ARCH=${PETSC_ARCH}" @cd src/eps/tutorials; ${RUN_TEST} clean-legacy @cd src/eps/tutorials; ${OMAKE} SLEPC_DIR=${SLEPC_DIR} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} -f ${SLEPC_DIR}/share/slepc/Makefile.user ex10 @grep -E "^#define PETSC_HAVE_FORTRAN 1" ${PETSCCONF_H} | tee .ftn.log > /dev/null; \ @@ -390,7 +390,7 @@ checkbadfortranstubs: # Compare ABI/API of two versions of PETSc library with the old one defined by PETSC_{DIR,ARCH}_ABI_OLD abitest: @if [ "x${SLEPC_DIR_ABI_OLD}" = "x" ] || [ "x${PETSC_ARCH_ABI_OLD}" = "x" ] || [ "x${PETSC_DIR_ABI_OLD}" = "x" ]; \ - then printf "You must set environment variables SLEPC_DIR_ABI_OLD, PETSC_ARCH_ABI_OLD and PETSC_DIR_ABI_OLD to run abitest\n"; \ + then printf "You must set environment variables SLEPC_DIR_ABI_OLD, PETSC_ARCH_ABI_OLD, and PETSC_DIR_ABI_OLD to run abitest\n"; \ exit 1; \ fi; -@echo "Comparing ABI/API of the following two SLEPc versions (you must have already configured and built them using GCC and with -g):" From c9f5bdd3069d1049680c99f66b4fdc64eadc6a39 Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Wed, 10 May 2023 06:19:40 +0000 Subject: [PATCH 018/112] Modify makefile includes to fix 'check' and other rules in case of prefix build --- makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makefile b/makefile index 231ab93d6..ed323d181 100644 --- a/makefile +++ b/makefile @@ -27,7 +27,7 @@ DIRS = src include # Include the rest of makefiles include ./${PETSC_ARCH}/lib/slepc/conf/slepcvariables -include ./${PETSC_ARCH}/lib/slepc/conf/slepcvariables # include twice, required in prefix builds +include ${SLEPC_DIR}/${PETSC_ARCH}/lib/slepc/conf/slepcvariables # required in prefix builds include ${SLEPC_DIR}/lib/slepc/conf/slepc_rules include ${SLEPC_DIR}/lib/slepc/conf/slepc_rules.doc include ${SLEPC_DIR}/lib/slepc/conf/slepc_rules.utils From 42e91f60af960843dac65bc2be681ac55da01901 Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Thu, 11 May 2023 08:32:40 +0200 Subject: [PATCH 019/112] Disable verbose messages from vermin --- lib/slepc/conf/slepc_rules.utils | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/slepc/conf/slepc_rules.utils b/lib/slepc/conf/slepc_rules.utils index 72580b016..cffb1771e 100644 --- a/lib/slepc/conf/slepc_rules.utils +++ b/lib/slepc/conf/slepc_rules.utils @@ -11,7 +11,7 @@ include ${PETSC_DIR}/lib/petsc/conf/rules.utils vermin_slepc: - @vermin -vvv -t=3.4- ${VERMIN_OPTIONS} ${SLEPC_DIR}/config + @vermin --violations -t=3.4- ${VERMIN_OPTIONS} ${SLEPC_DIR}/config lint_slepc: ${PYTHON3} ${SLEPC_DIR}/lib/slepc/bin/maint/slepcClangLinter.py $(LINTER_OPTIONS) From 3e003e428f8e0d01b122d4406a5d373b175ec18f Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Fri, 12 May 2023 09:08:57 +0200 Subject: [PATCH 020/112] Process one manual page located in ftn-custom --- .gitlab-ci.yml | 2 +- src/sys/ftn-custom/zslepc_startf.c | 1 - src/sys/makefile | 2 +- src/sys/slepcinit.c | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 104a848e2..df7f74f32 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -214,7 +214,7 @@ gnu-lint: - if [ ! -z ${INSTALL+x} ]; then make install; SLEPC_DIR=$INSTALL_DIR; fi - make CFLAGS="${MAKE_CFLAGS}" CXXFLAGS="${MAKE_CXXFLAGS}" FFLAGS="${MAKE_FFLAGS}" CUDAFLAGS="${MAKE_CUDAFLAGS}" check - if [ ! -z ${PKG_CONFIG+x} ]; then make check_usermakefile PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$PETSC_DIR/$PETSC_ARCH/lib/pkgconfig; fi - - if [ ! -z ${BUILD_DOCS+x} ]; then make alldoc LOC=$SLEPC_DIR; tar czf ${CI_JOB_NAME}-docs.tar.gz --exclude "*.out" --exclude "makefile*" --exclude "ftn-*" --exclude slepc4py docs include src; fi + - if [ ! -z ${BUILD_DOCS+x} ]; then make alldoc LOC=$SLEPC_DIR; tar czf ${CI_JOB_NAME}-docs.tar.gz --exclude "*.out" --exclude "makefile*" --exclude "ftn-auto*" --exclude slepc4py docs include src; fi - if [ ! -z ${BUILD_DOCS+x} ] && [ ! -z ${SLEPC4PY+x} ]; then make -C src/binding/slepc4py rst2html sphinx-html sphinx-pdf PYTHON=${PYTHON}; tar czf ${CI_JOB_NAME}-docs-py.tar.gz -C src/binding/slepc4py docs; fi - echo -e "section_end:`date +%s`:build_slepc\r\e[0K" - echo -e "section_start:`date +%s`:tests_slepc\r\e[0KSLEPc test suite" diff --git a/src/sys/ftn-custom/zslepc_startf.c b/src/sys/ftn-custom/zslepc_startf.c index 50d589e70..cce906fb9 100644 --- a/src/sys/ftn-custom/zslepc_startf.c +++ b/src/sys/ftn-custom/zslepc_startf.c @@ -34,7 +34,6 @@ SlepcInitialize() in the main (Fortran) program is sufficient. .seealso: SlepcInitialize() - @*/ PetscErrorCode SlepcInitializeFortran(void) diff --git a/src/sys/makefile b/src/sys/makefile index e576784ac..5515694ba 100644 --- a/src/sys/makefile +++ b/src/sys/makefile @@ -10,6 +10,6 @@ LIBBASE = libslepcsys MANSEC = sys -DIRS = f90-mod vec mat magma classes tests tutorials +DIRS = f90-mod vec mat magma classes tests tutorials ftn-custom include ${SLEPC_DIR}/lib/slepc/conf/slepc_common diff --git a/src/sys/slepcinit.c b/src/sys/slepcinit.c index 7d277dcef..e13f1ca49 100644 --- a/src/sys/slepcinit.c +++ b/src/sys/slepcinit.c @@ -250,7 +250,7 @@ PetscErrorCode SlepcCitationsInitialize(void) Level: beginner -.seealso: SlepcFinalize(), PetscInitialize() +.seealso: SlepcFinalize(), PetscInitialize(), SlepcInitializeFortran() @*/ PetscErrorCode SlepcInitialize(int *argc,char ***args,const char file[],const char help[]) { From 44faf072e2b9800b38a836e9e9339cf89aedee2f Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Mon, 15 May 2023 10:41:44 +0200 Subject: [PATCH 021/112] Increase patchlevel to 3.19.1 --- include/slepcversion.h | 2 +- src/binding/slepc4py/CHANGES.rst | 6 ++++++ src/binding/slepc4py/src/slepc4py/__init__.py | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/include/slepcversion.h b/include/slepcversion.h index 43a0b8c90..f161ee269 100644 --- a/include/slepcversion.h +++ b/include/slepcversion.h @@ -14,7 +14,7 @@ #define SLEPC_VERSION_RELEASE 1 #define SLEPC_VERSION_MAJOR 3 #define SLEPC_VERSION_MINOR 19 -#define SLEPC_VERSION_SUBMINOR 0 +#define SLEPC_VERSION_SUBMINOR 1 #define SLEPC_RELEASE_DATE "March 31, 2023" #define SLEPC_VERSION_DATE "unknown" diff --git a/src/binding/slepc4py/CHANGES.rst b/src/binding/slepc4py/CHANGES.rst index 8d9527e4e..41b9eef75 100644 --- a/src/binding/slepc4py/CHANGES.rst +++ b/src/binding/slepc4py/CHANGES.rst @@ -6,6 +6,12 @@ CHANGES: SLEPc for Python :Contact: dalcinl@gmail.com +Release 3.19.1 +============== + +- Update to SLEPc 3.19.1. + + Release 3.19.0 ============== diff --git a/src/binding/slepc4py/src/slepc4py/__init__.py b/src/binding/slepc4py/src/slepc4py/__init__.py index 5fb31a305..3025b26b7 100644 --- a/src/binding/slepc4py/src/slepc4py/__init__.py +++ b/src/binding/slepc4py/src/slepc4py/__init__.py @@ -21,7 +21,7 @@ """ __author__ = 'Lisandro Dalcin' -__version__ = '3.19.0' +__version__ = '3.19.1' __credits__ = 'SLEPc Team ' # ----------------------------------------------------------------------------- From b18b2632fbaaf8a31a69f33e9cd19658e39c0f4e Mon Sep 17 00:00:00 2001 From: Pierre Jolivet Date: Tue, 23 May 2023 07:42:57 +0200 Subject: [PATCH 022/112] Fix output file See also https://gitlab.com/petsc/petsc/-/merge_requests/6493 --- src/lme/tests/output/test1_3.out | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/lme/tests/output/test1_3.out b/src/lme/tests/output/test1_3.out index a4fa97caf..dc89f3eae 100644 --- a/src/lme/tests/output/test1_3.out +++ b/src/lme/tests/output/test1_3.out @@ -2,24 +2,24 @@ Lyapunov equation, N=100 (10x10 grid) -[0] MatSetUp_Seq_Hash(): Using hash-based MatSetValues() for MATSEQAIJ because no preallocation provided -[0] MatAssemblyEnd_SeqAIJ(): Matrix size: 100 X 100; storage space: 0 unneeded,460 used -[0] MatAssemblyEnd_SeqAIJ(): Number of mallocs during MatSetValues() is 0 -[0] MatAssemblyEnd_SeqAIJ(): Maximum nonzeros in any row is 5 -[0] MatCheckCompressedRow(): Found the ratio (num_zerorows 0)/(num_localrows 100) < 0.6. Do not use CompressedRow routines. -[0] MatSeqAIJCheckInode(): Found 100 nodes out of 100 rows. Not using Inode routines +[0] MatSetUp_Seq_Hash(): Using hash-based MatSetValues() for MATSEQAIJ because no preallocation provided +[0] MatAssemblyEnd_SeqAIJ(): Matrix size: 100 X 100; storage space: 0 unneeded,460 used +[0] MatAssemblyEnd_SeqAIJ(): Number of mallocs during MatSetValues() is 0 +[0] MatAssemblyEnd_SeqAIJ(): Maximum nonzeros in any row is 5 +[0] MatCheckCompressedRow(): Found the ratio (num_zerorows 0)/(num_localrows 100) < 0.6. Do not use CompressedRow routines. +[0] MatSeqAIJCheckInode(): Found 100 nodes out of 100 rows. Not using Inode routines Equation type set to 1 Equation type changed to 0 Solver being used: krylov Tolerance: -2., max iterations: 100 Subspace dimension: 21 Erroring out if convergence fails -[0] LMEDenseHessLyapunovChol(): Residual norm of dense Lyapunov equation = (removed) -[0] LMEDenseHessLyapunovChol(): Residual norm of dense Lyapunov equation = (removed) -[0] LMEDenseHessLyapunovChol(): Residual norm of dense Lyapunov equation = (removed) -[0] LMEDenseHessLyapunovChol(): Residual norm of dense Lyapunov equation = (removed) +[0] LMEDenseHessLyapunovChol(): Residual norm of dense Lyapunov equation = (removed) +[0] LMEDenseHessLyapunovChol(): Residual norm of dense Lyapunov equation = (removed) +[0] LMEDenseHessLyapunovChol(): Residual norm of dense Lyapunov equation = (removed) +[0] LMEDenseHessLyapunovChol(): Residual norm of dense Lyapunov equation = (removed) Error estimate reported by the solver: 2.948e-10 -[0] MatProductSetFromOptions_Private(): MatProductType AB for A seqaij, B seqdense +[0] MatProductSetFromOptions_Private(): MatProductType AB for A seqaij, B seqdense Computed residual norm: 4.03e-10 [0] SlepcFinalize(): SlepcFinalize() called From a85bba1864608a67c4d3f26ec8307aff52f546cd Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Sat, 27 May 2023 08:40:21 +0200 Subject: [PATCH 023/112] Fix output file once again --- src/sys/tests/output/test2_1.out | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/sys/tests/output/test2_1.out b/src/sys/tests/output/test2_1.out index e18bd6daa..b3fbde5da 100644 --- a/src/sys/tests/output/test2_1.out +++ b/src/sys/tests/output/test2_1.out @@ -65,17 +65,17 @@ Options for all PETSc programs: -petsc_sleep n: sleeps n seconds before running program ---------------------------------------- PetscDevice Options: - -device_enable How (or whether) to initialize PetscDevices (choose one of) none lazy eager (PetscDeviceInitialize()) - -default_device_type Set the PetscDeviceType returned by PETSC_DEVICE_DEFAULT() (choose one of) host cuda hip sycl (PetscDeviceSetDefaultDeviceType()) - -device_select : Which device to use. Pass (-1) to have PETSc decide or (given they exist) [0-128) for a specific device (PetscDeviceCreate()) - -device_view: Display device information and assignments (forces eager initialization) (PetscDeviceView()) + -device_enable: How (or whether) to initialize PetscDevices (choose one of) none lazy eager (PetscDeviceInitialize()) + -default_device_type: Set the PetscDeviceType returned by PETSC_DEVICE_DEFAULT() (choose one of) host cuda hip sycl (PetscDeviceSetDefaultDeviceType()) + -device_select: : Which device to use. Pass (-1) to have PETSc decide or (given they exist) [0-128) for a specific device (PetscDeviceCreate()) + -device_view: Display device information and assignments (forces eager initialization) (PetscDeviceView()) ---------------------------------------- PetscDevice host Options: - -device_view_host: Display device information and assignments (forces eager initialization) (PetscDeviceView()) + -device_view_host: Display device information and assignments (forces eager initialization) (PetscDeviceView()) ---------------------------------------- Root PetscDeviceContext Options: - -root_device_context_device_type Underlying PetscDevice (choose one of) host cuda hip sycl (PetscDeviceContextSetDevice) - -root_device_context_stream_type PetscDeviceContext PetscStreamType (choose one of) global_blocking default_blocking global_nonblocking (PetscDeviceContextSetStreamType) + -root_device_context_device_type: Underlying PetscDevice (choose one of) host cuda hip sycl (PetscDeviceContextSetDevice) + -root_device_context_stream_type: PetscDeviceContext PetscStreamType (choose one of) global_blocking default_blocking global_nonblocking (PetscDeviceContextSetStreamType) M = [ 1+0i 0.625+0i -0.125+0i -0.5+0i 1.25+0i -5.5+0i From db78867ebfde5892018ec9b9cc8d25a8b414f258 Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Sat, 3 Jun 2023 08:44:38 +0200 Subject: [PATCH 024/112] Fix -help message The default tarball does no longer contain docs/manual.html Also fix due to PETSc change https://gitlab.com/petsc/petsc/-/merge_requests/6514 --- src/sys/slepcinit.c | 2 +- src/sys/tests/output/test2_1.out | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sys/slepcinit.c b/src/sys/slepcinit.c index e13f1ca49..5bfc9daf7 100644 --- a/src/sys/slepcinit.c +++ b/src/sys/slepcinit.c @@ -88,7 +88,7 @@ static PetscErrorCode SlepcPrintVersion(MPI_Comm comm) PetscCall(SlepcGetVersion(version,256)); PetscCall((*PetscHelpPrintf)(comm,"%s\n",version)); PetscCall((*PetscHelpPrintf)(comm,SLEPC_AUTHOR_INFO)); - PetscCall((*PetscHelpPrintf)(comm,"See docs/manual.html for help.\n")); + PetscCall((*PetscHelpPrintf)(comm,"See https://slepc.upv.es/documentation/ for help.\n")); PetscCall((*PetscHelpPrintf)(comm,"SLEPc libraries linked from %s\n",SLEPC_LIB_DIR)); PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/sys/tests/output/test2_1.out b/src/sys/tests/output/test2_1.out index b3fbde5da..0d3009111 100644 --- a/src/sys/tests/output/test2_1.out +++ b/src/sys/tests/output/test2_1.out @@ -5,7 +5,7 @@ SLEPc version The SLEPc Team slepc-maint@upv.es https://slepc.upv.es -See docs/manual.html for help. +See https://slepc.upv.es/documentation/ for help. SLEPc libraries linked from PATH Petsc version The PETSc Team @@ -44,7 +44,7 @@ Options for all PETSc programs: -malloc_dump : dump list of unfreed memory at conclusion -malloc: use PETSc error checking malloc (deprecated, use -malloc_debug) -malloc no: don't use PETSc error checking malloc (deprecated, use -malloc_debug no) - -malloc_info: prints total memory usage + -malloc_info: prints total memory usage (deprecated, use -memory_view) -malloc_view : keeps log of all memory allocations, displays in PetscFinalize() -malloc_debug : enables or disables extended checking for memory corruption -options_view: dump list of options inputted From 137e65aa9c3abc39a63e71a682c94493354319ef Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Fri, 2 Jun 2023 20:20:06 +0200 Subject: [PATCH 025/112] SVD: Fix SVDConvergedReason to also have DIVERGED_SYMMETRY_LOST In HSVD cross and cyclic use an EPS with GHIEP problem type, that may diverge due to symmetry loss. So this must be carried over to SVD --- include/slepcsvd.h | 1 + .../slepc4py/src/slepc4py/SLEPc/SVD.pyx | 28 ++++++++++--------- .../slepc4py/src/slepc4py/SLEPc/slepcsvd.pxi | 1 + src/svd/interface/dlregissvd.c | 2 +- src/svd/interface/svdsolve.c | 3 +- 5 files changed, 20 insertions(+), 15 deletions(-) diff --git a/include/slepcsvd.h b/include/slepcsvd.h index 54cb42b9d..9ad7a2050 100644 --- a/include/slepcsvd.h +++ b/include/slepcsvd.h @@ -127,6 +127,7 @@ typedef enum {/* converged */ /* diverged */ SVD_DIVERGED_ITS = -1, SVD_DIVERGED_BREAKDOWN = -2, + SVD_DIVERGED_SYMMETRY_LOST = -3, SVD_CONVERGED_ITERATING = 0 } SVDConvergedReason; SLEPC_EXTERN const char *const*SVDConvergedReasons; diff --git a/src/binding/slepc4py/src/slepc4py/SLEPc/SVD.pyx b/src/binding/slepc4py/src/slepc4py/SLEPc/SVD.pyx index c819a84eb..caafb9d36 100644 --- a/src/binding/slepc4py/src/slepc4py/SLEPc/SVD.pyx +++ b/src/binding/slepc4py/src/slepc4py/SLEPc/SVD.pyx @@ -94,20 +94,22 @@ class SVDConvergedReason(object): """ SVD convergence reasons - - `CONVERGED_TOL`: All eigenpairs converged to requested tolerance. - - `CONVERGED_USER`: User-defined convergence criterion satisfied. - - `CONVERGED_MAXIT`: Maximum iterations completed in case MAXIT convergence criterion. - - `DIVERGED_ITS`: Maximum number of iterations exceeded. - - `DIVERGED_BREAKDOWN`: Solver failed due to breakdown. - - `CONVERGED_ITERATING`: Iteration not finished yet. + - `CONVERGED_TOL`: All eigenpairs converged to requested tolerance. + - `CONVERGED_USER`: User-defined convergence criterion satisfied. + - `CONVERGED_MAXIT`: Maximum iterations completed in case MAXIT convergence criterion. + - `DIVERGED_ITS`: Maximum number of iterations exceeded. + - `DIVERGED_BREAKDOWN`: Solver failed due to breakdown. + - `DIVERGED_SYMMETRY_LOST`: Underlying indefinite eigensolver was not able to keep symmetry. + - `CONVERGED_ITERATING`: Iteration not finished yet. """ - CONVERGED_TOL = SVD_CONVERGED_TOL - CONVERGED_USER = SVD_CONVERGED_USER - CONVERGED_MAXIT = SVD_CONVERGED_MAXIT - DIVERGED_ITS = SVD_DIVERGED_ITS - DIVERGED_BREAKDOWN = SVD_DIVERGED_BREAKDOWN - CONVERGED_ITERATING = SVD_CONVERGED_ITERATING - ITERATING = SVD_CONVERGED_ITERATING + CONVERGED_TOL = SVD_CONVERGED_TOL + CONVERGED_USER = SVD_CONVERGED_USER + CONVERGED_MAXIT = SVD_CONVERGED_MAXIT + DIVERGED_ITS = SVD_DIVERGED_ITS + DIVERGED_BREAKDOWN = SVD_DIVERGED_BREAKDOWN + DIVERGED_SYMMETRY_LOST = SVD_DIVERGED_SYMMETRY_LOST + CONVERGED_ITERATING = SVD_CONVERGED_ITERATING + ITERATING = SVD_CONVERGED_ITERATING class SVDTRLanczosGBidiag(object): """ diff --git a/src/binding/slepc4py/src/slepc4py/SLEPc/slepcsvd.pxi b/src/binding/slepc4py/src/slepc4py/SLEPc/slepcsvd.pxi index 6c183d622..6701c961a 100644 --- a/src/binding/slepc4py/src/slepc4py/SLEPc/slepcsvd.pxi +++ b/src/binding/slepc4py/src/slepc4py/SLEPc/slepcsvd.pxi @@ -43,6 +43,7 @@ cdef extern from * nogil: SVD_CONVERGED_MAXIT SVD_DIVERGED_ITS SVD_DIVERGED_BREAKDOWN + SVD_DIVERGED_SYMMETRY_LOST SVD_CONVERGED_ITERATING ctypedef PetscErrorCode (*SlepcSVDCtxDel)(void*) diff --git a/src/svd/interface/dlregissvd.c b/src/svd/interface/dlregissvd.c index 15e9783d5..294fc152b 100644 --- a/src/svd/interface/dlregissvd.c +++ b/src/svd/interface/dlregissvd.c @@ -17,7 +17,7 @@ const char *SVDErrorTypes[] = {"ABSOLUTE","RELATIVE","SVDErrorType","SVD_ERROR_" const char *SVDPRIMMEMethods[] = {"","HYBRID","NORMALEQUATIONS","AUGMENTED","SVDPRIMMEMethod","SVD_PRIMME_",NULL}; const char *SVDKSVDEigenMethods[] = {"","MRRR","DC","ELPA","SVDKSVDEigenMethod","SVD_KSVD_EIGEN_",NULL}; const char *SVDKSVDPolarMethods[] = {"","QDWH","ZOLOPD","SVDKSVDPolarMethod","SVD_KSVD_POLAR_",NULL}; -const char *const SVDConvergedReasons_Shifted[] = {"","","DIVERGED_BREAKDOWN","DIVERGED_ITS","CONVERGED_ITERATING","CONVERGED_TOL","CONVERGED_USER","CONVERGED_MAXIT","SVDConvergedReason","SVD_",NULL}; +const char *const SVDConvergedReasons_Shifted[] = {"","DIVERGED_SYMMETRY_LOST","DIVERGED_BREAKDOWN","DIVERGED_ITS","CONVERGED_ITERATING","CONVERGED_TOL","CONVERGED_USER","CONVERGED_MAXIT","SVDConvergedReason","SVD_",NULL}; const char *const*SVDConvergedReasons = SVDConvergedReasons_Shifted + 4; /*@C diff --git a/src/svd/interface/svdsolve.c b/src/svd/interface/svdsolve.c index 9f00cb836..ebaac3ebc 100644 --- a/src/svd/interface/svdsolve.c +++ b/src/svd/interface/svdsolve.c @@ -228,7 +228,8 @@ PetscErrorCode SVDGetIterationNumber(SVD svd,PetscInt *its) . SVD_CONVERGED_USER - converged due to a user-defined condition . SVD_CONVERGED_MAXIT - reached the maximum number of iterations with SVD_CONV_MAXIT criterion . SVD_DIVERGED_ITS - required more than max_it iterations to reach convergence -- SVD_DIVERGED_BREAKDOWN - generic breakdown in method +. SVD_DIVERGED_BREAKDOWN - generic breakdown in method +- SVD_DIVERGED_SYMMETRY_LOST - underlying indefinite eigensolver was not able to keep symmetry Can only be called after the call to SVDSolve() is complete. From 7396c17cfeaa9174a1a2f785af8c79950d2bc2df Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Tue, 13 Jun 2023 09:38:15 +0200 Subject: [PATCH 026/112] CI: slightly change one test to avoid non-convergence of BCGS The problem does not seem to be due to a change in PETSc, but probably due to messing with BLAS installation on one of the runners --- src/eps/tests/test9.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/eps/tests/test9.c b/src/eps/tests/test9.c index 6e3bb6320..b17e629ca 100644 --- a/src/eps/tests/test9.c +++ b/src/eps/tests/test9.c @@ -270,7 +270,7 @@ PetscErrorCode MyEigenSort(PetscScalar ar,PetscScalar ai,PetscScalar br,PetscSca args: -eps_ciss_moments 4 -eps_ciss_blocksize 5 -eps_ciss_refine_inner 1 -eps_ciss_refine_blocksize 2 test: suffix: 6_bcgs - args: -eps_ciss_realmats -eps_ciss_ksp_type bcgs -eps_ciss_pc_type sor -eps_ciss_integration_points 12 + args: -eps_ciss_realmats -eps_ciss_ksp_type bcgs -eps_ciss_pc_type ilu -eps_ciss_integration_points 8 test: suffix: 6_cheby_interval From 57e2af523f6092b92cba740c50a076ced9821ae1 Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Fri, 16 Jun 2023 07:43:08 +0200 Subject: [PATCH 027/112] CI: use -options_left 0 in one test --- src/eps/tutorials/ex2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/eps/tutorials/ex2.c b/src/eps/tutorials/ex2.c index df3b4abd7..4dd2a164d 100644 --- a/src/eps/tutorials/ex2.c +++ b/src/eps/tutorials/ex2.c @@ -149,7 +149,7 @@ int main(int argc,char **argv) requires: hpddm test: suffix: feast - args: -eps_type feast -eps_interval 1.1,1.25 -eps_ncv 64 + args: -eps_type feast -eps_interval 1.1,1.25 -eps_ncv 64 -options_left 0 requires: feast testset: From 7c98427760c388a6b4c9aeac459cf5935d0228be Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Tue, 20 Jun 2023 16:40:40 +0200 Subject: [PATCH 028/112] Fix typo in uncovered code --- include/slepcmagma.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/slepcmagma.h b/include/slepcmagma.h index e8c5b6743..e0b6ef06e 100644 --- a/include/slepcmagma.h +++ b/include/slepcmagma.h @@ -31,7 +31,7 @@ SLEPC_EXTERN PetscErrorCode SlepcMagmaInit(void); #if defined(PETSC_USE_COMPLEX) #if defined(PETSC_USE_REAL_SINGLE) -#define magma_xgeev(a,b,c,d,e,f,g,h,i,j,k,l.m.n) magma_cgeev((a),(b),(c),(magmaFloatComplex*)(d),(e),(magmaFloatComplex*)(f),(magmaFloatComplex*)(g),(h),(magmaFloatComplex*)(i),(j),(magmaFloatComplex*)(k),(l),(m),(n)) +#define magma_xgeev(a,b,c,d,e,f,g,h,i,j,k,l,m,n) magma_cgeev((a),(b),(c),(magmaFloatComplex*)(d),(e),(magmaFloatComplex*)(f),(magmaFloatComplex*)(g),(h),(magmaFloatComplex*)(i),(j),(magmaFloatComplex*)(k),(l),(m),(n)) #define magma_xgesv_gpu(a,b,c,d,e,f,g,h) magma_cgesv_gpu((a),(b),(magmaFloatComplex_ptr)(c),(d),(e),(magmaFloatComplex_ptr)(f),(g),(h)) #define magma_xgetrf_gpu(a,b,c,d,e,f) magma_cgetrf_gpu((a),(b),(magmaFloatComplex_ptr)(c),(d),(e),(f)) #define magma_xgetri_gpu(a,b,c,d,e,f,g) magma_cgetri_gpu((a),(magmaFloatComplex_ptr)(b),(c),(d),(magmaFloatComplex_ptr)(e),(f),(g)) From af755ff01b4e7be70fbd7e09e09b2aef69efcc67 Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Tue, 20 Jun 2023 18:06:06 +0200 Subject: [PATCH 029/112] Fix make check when --prefix points to a read-only file system --- src/eps/tests/makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/eps/tests/makefile b/src/eps/tests/makefile index be784460e..7edac7ea5 100644 --- a/src/eps/tests/makefile +++ b/src/eps/tests/makefile @@ -24,7 +24,7 @@ testtest5_blopex: test5.PETSc else \ echo "Possible error running BLOPEX src/eps/tests/test5 with 1 MPI process"; \ cat $${test}.tmp; \ - touch ${SLEPC_DIR}/check_error; \ + touch ../../../check_error; \ fi; \ ${RM} $${test}.tmp @@ -36,7 +36,7 @@ testtest7f: test7f.PETSc else \ echo "Possible error running Fortran src/eps/tests/test7f with 1 MPI process"; \ cat $${test}.tmp; \ - touch ${SLEPC_DIR}/check_error; \ + touch ../../../check_error; \ fi; \ ${RM} $${test}.tmp @@ -49,7 +49,7 @@ testtest10: test10.PETSc else \ echo "Possible error running C/C++ src/eps/tests/test10 with 1 MPI process"; \ cat $${test}.tmp; \ - touch ${SLEPC_DIR}/check_error; \ + touch ../../../check_error; \ fi; \ ${RM} $${test}.tmp @@ -62,7 +62,7 @@ testtest10_mpi: test10.PETSc else \ echo "Possible error running C/C++ src/eps/tests/test10 with 2 MPI process"; \ cat $${test}.tmp; \ - touch ${SLEPC_DIR}/check_error; \ + touch ../../../check_error; \ fi; \ ${RM} $${test}.tmp @@ -75,7 +75,7 @@ testtest10_cuda: test10.PETSc else \ echo "Possible error running C/C++ src/eps/tests/test10 with CUDA"; \ cat $${test}.tmp; \ - touch ${SLEPC_DIR}/check_error; \ + touch ../../../check_error; \ fi; \ ${RM} $${test}.tmp; From 1f1cd72a5299eb8bc60fea882d838782ddca9c80 Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Wed, 21 Jun 2023 17:19:01 +0200 Subject: [PATCH 030/112] Fix --download-elpa with NVIDIA compilers --- config/packages/elpa.py | 10 +++++++--- config/packages/petsc.py | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/config/packages/elpa.py b/config/packages/elpa.py index 721511536..8793a8632 100644 --- a/config/packages/elpa.py +++ b/config/packages/elpa.py @@ -101,11 +101,15 @@ def DownloadAndInstall(self,slepcconf,slepcvars,slepc,petsc,archdir,prefixdir): self.log.Exit('--download-elpa requires that the command autoreconf is available on your PATH') # Build package - confopt = ['--prefix='+prefixdir, '--libdir='+os.path.join(prefixdir,'lib'), 'CC="'+petsc.cc+'"', 'CFLAGS="'+petsc.getCFlags()+'"', 'F77="'+petsc.fc+'"', 'FFLAGS="'+petsc.getFFlags()+'"', 'FC="'+petsc.fc+'"', 'FCFLAGS="'+petsc.getFFlags()+'"', 'CXX="'+petsc.cxx+'"', 'CXXFLAGS="'+petsc.getCXXFlags()+'"', 'CPP="'+petsc.cpp+'"', 'LIBS="'+petsc.blaslapack_lib+'"', 'SCALAPACK_LDFLAGS="'+petsc.scalapack_lib+'"', '--disable-sse', '--disable-sse-assembly', '--disable-avx', '--disable-avx2', '--disable-avx512'] + confopt = ['--prefix='+prefixdir, '--libdir='+os.path.join(prefixdir,'lib'), 'CC="'+petsc.cc+'"', 'CFLAGS="'+petsc.getCFlags()+'"', 'F77="'+petsc.fc+'"', 'FFLAGS="'+petsc.getFFlags()+'"', 'FC="'+petsc.fc+'"', 'FCFLAGS="'+petsc.getFFlags()+'"', 'CXX="'+petsc.cxx+'"', 'CXXFLAGS="'+petsc.getCXXFlags()+'"', 'CPP="'+petsc.cpp+'"', 'SCALAPACK_LDFLAGS="'+petsc.scalapack_lib+'"', '--disable-sse', '--disable-sse-assembly', '--disable-avx', '--disable-avx2', '--disable-avx512'] + if petsc.fc_version.startswith('nvf'): + confopt.append('LIBS="'+petsc.blaslapack_lib+' -lnvf"') + else: + confopt.append('LIBS="'+petsc.blaslapack_lib+'"') if petsc.mpiuni or petsc.msmpi: - confopt = confopt + ['--with-mpi=no'] + confopt.append('--with-mpi=no') if petsc.precision == 'single': - confopt = confopt + ['--enable-single-precision'] + confopt.append('--enable-single-precision') (result,output) = self.RunCommand('cd '+builddir+'&& ./configure '+' '.join(confopt)+' '+self.buildflags+' && '+petsc.make+' -j'+petsc.make_np+' && '+petsc.make+' install') if result: self.log.Exit('Installation of ELPA failed') diff --git a/config/packages/petsc.py b/config/packages/petsc.py index bcb036d23..9215fc986 100644 --- a/config/packages/petsc.py +++ b/config/packages/petsc.py @@ -125,7 +125,7 @@ def LoadConf(self): elif k == 'BUILDSHAREDLIB' and v=='yes': self.buildsharedlib = True else: - if k in ['AR','AR_FLAGS','AR_LIB_SUFFIX','BFORT','BLASLAPACK_LIB','CC','CC_FLAGS','CC_LINKER_SLFLAG','CMAKE','CONFIGURE_OPTIONS','CPP','CXX','CXX_FLAGS','FC_FLAGS','MAKE','MAKE_NP','PREFIXDIR','RANLIB','SCALAPACK_LIB','SEDINPLACE','SL_LINKER_SUFFIX']: + if k in ['AR','AR_FLAGS','AR_LIB_SUFFIX','BFORT','BLASLAPACK_LIB','CC','CC_FLAGS','CC_LINKER_SLFLAG','CMAKE','CONFIGURE_OPTIONS','CPP','CXX','CXX_FLAGS','FC_FLAGS','FC_VERSION','MAKE','MAKE_NP','PREFIXDIR','RANLIB','SCALAPACK_LIB','SEDINPLACE','SL_LINKER_SUFFIX']: setattr(self,k.lower(),v) except: self.log.Exit('Cannot process file ' + self.petscvariables) From f80d975b1fb14d89d9897d0e265d401d644ef3b8 Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Wed, 21 Jun 2023 17:38:21 +0200 Subject: [PATCH 031/112] configure: prefer .append() when adding a single element to a list --- config/packages/arpack.py | 12 ++++++------ config/packages/evsl.py | 2 +- config/packages/ksvd.py | 6 +++--- config/packages/polar.py | 6 +++--- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/config/packages/arpack.py b/config/packages/arpack.py index 39c580cd8..b849cf077 100644 --- a/config/packages/arpack.py +++ b/config/packages/arpack.py @@ -91,15 +91,15 @@ def DownloadAndInstall(self,slepcconf,slepcvars,slepc,petsc,archdir,prefixdir): confopt = ['-DCMAKE_INSTALL_PREFIX='+prefixdir, '-DCMAKE_INSTALL_NAME_DIR:STRING="'+os.path.join(prefixdir,'lib')+'"', '-DCMAKE_INSTALL_LIBDIR:STRING="lib"', '-DCMAKE_C_COMPILER="'+petsc.cc+'"', '-DCMAKE_C_FLAGS:STRING="'+petsc.getCFlags()+'"', '-DCMAKE_Fortran_COMPILER="'+petsc.fc+'"', '-DCMAKE_Fortran_FLAGS:STRING="'+petsc.getFFlags()+'"', '-DBLAS_LIBRARIES="'+petsc.blaslapack_lib+'"'] if not petsc.mpiuni and not petsc.msmpi: confopt = confopt + ['-DMPI=ON', '-DMPI_C_COMPILER="'+petsc.cc+'"', '-DMPI_Fortran_COMPILER="'+petsc.fc+'"'] - confopt = confopt + ['-DCMAKE_BUILD_TYPE='+ ('Debug' if petsc.debug else 'Release')] + confopt.append('-DCMAKE_BUILD_TYPE='+('Debug' if petsc.debug else 'Release')) if petsc.buildsharedlib: confopt = confopt + ['-DBUILD_SHARED_LIBS=ON', '-DCMAKE_INSTALL_RPATH:PATH='+os.path.join(prefixdir,'lib')] else: - confopt = confopt + ['-DBUILD_SHARED_LIBS=OFF'] + confopt.append('-DBUILD_SHARED_LIBS=OFF') if petsc.ind64: - confopt = confopt + ['-DINTERFACE64=1'] + confopt.append('-DINTERFACE64=1') if 'MSYSTEM' in os.environ: - confopt = confopt + ['-G "MSYS Makefiles"'] + confopt.append('-G "MSYS Makefiles"') (result,output) = self.RunCommand('cd '+builddir+' && '+petsc.cmake+' '+' '.join(confopt)+' '+self.buildflags+' .. && '+petsc.make+' -j'+petsc.make_np+' && '+petsc.make+' install') else: # Build with autoreconf @@ -112,9 +112,9 @@ def DownloadAndInstall(self,slepcconf,slepcvars,slepc,petsc,archdir,prefixdir): if not petsc.mpiuni and not petsc.msmpi: confopt = confopt + ['--enable-mpi MPICC="'+petsc.cc+'"', 'MPIF77="'+petsc.fc+'"', 'MPIFC="'+petsc.fc+'"'] if not petsc.buildsharedlib: - confopt = confopt + ['--disable-shared'] + confopt.append('--disable-shared') if petsc.ind64: - confopt = confopt + ['INTERFACE64=1'] + confopt.append('INTERFACE64=1') (result,output) = self.RunCommand('cd '+builddir+'&& sh bootstrap && ./configure '+' '.join(confopt)+' && '+petsc.make+' -j'+petsc.make_np+' && '+petsc.make+' install') if result: diff --git a/config/packages/evsl.py b/config/packages/evsl.py index 181435b27..93c5dc28c 100644 --- a/config/packages/evsl.py +++ b/config/packages/evsl.py @@ -87,7 +87,7 @@ def DownloadAndInstall(self,slepcconf,slepcvars,slepc,petsc,archdir,prefixdir): if hasattr(petsc,'fc'): confopt = confopt + ['F77="'+petsc.fc+'"', 'FFLAGS="'+petsc.getFFlags()+'"', 'FC="'+petsc.fc+'"', 'FCFLAGS="'+petsc.getFFlags()+'"'] if petsc.buildsharedlib: - confopt = confopt + ['--enable-shared'] + confopt.append('--enable-shared') if 'mkl_pardiso' in petsc.packages and 'MKLROOT' in os.environ: confopt = confopt + ['--with-mkl-pardiso', '--with-intel-mkl'] (result,output) = self.RunCommand('cd '+builddir+'&& ./configure '+' '.join(confopt)+' '+self.buildflags+' && '+petsc.make+' && '+petsc.make+' install') diff --git a/config/packages/ksvd.py b/config/packages/ksvd.py index b65bd1bc2..cc5b7d89a 100644 --- a/config/packages/ksvd.py +++ b/config/packages/ksvd.py @@ -138,13 +138,13 @@ def DownloadAndInstall(self,slepcconf,slepcvars,slepc,petsc,archdir,prefixdir): # Build package builddir = slepc.CreateDir(builddir,'build') confopt = ['-DCMAKE_INSTALL_PREFIX='+prefixdir, '-DCMAKE_INSTALL_NAME_DIR:STRING="'+os.path.join(prefixdir,'lib')+'"', '-DCMAKE_C_COMPILER="'+petsc.cc+'"', '-DCMAKE_C_FLAGS:STRING="'+petsc.getCFlags()+'"', '-DELPA_INCDIR="'+os.path.join(incdir,'elpa-2022.11.001')+'"', '-DELPA_LIBDIR="'+libdir+'"', '-DPOLAR_DIR="'+prefixdir+'"', '-DBLAS_LIBRARIES="'+petsc.blaslapack_lib+'"'] - confopt = confopt + ['-DCMAKE_BUILD_TYPE='+ ('Debug' if petsc.debug else 'Release')] + confopt.append('-DCMAKE_BUILD_TYPE='+('Debug' if petsc.debug else 'Release')) if petsc.buildsharedlib: confopt = confopt + ['-DBUILD_SHARED_LIBS=ON', '-DCMAKE_INSTALL_RPATH:PATH='+os.path.join(prefixdir,'lib')] else: - confopt = confopt + ['-DBUILD_SHARED_LIBS=OFF'] + confopt.append('-DBUILD_SHARED_LIBS=OFF') if 'MSYSTEM' in os.environ: - confopt = confopt + ['-G "MSYS Makefiles"'] + confopt.append('-G "MSYS Makefiles"') (result,output) = self.RunCommand('cd '+builddir+' && '+petsc.cmake+' '+' '.join(confopt)+' '+self.buildflags+' .. && '+petsc.make+' -j'+petsc.make_np+' && '+petsc.make+' install') if result: self.log.Exit('Installation of KSVD failed') diff --git a/config/packages/polar.py b/config/packages/polar.py index 661d402aa..0cf818202 100644 --- a/config/packages/polar.py +++ b/config/packages/polar.py @@ -128,13 +128,13 @@ def DownloadAndInstall(self,slepcconf,slepcvars,slepc,petsc,archdir,prefixdir): # Build package builddir = slepc.CreateDir(builddir,'build') confopt = ['-DCMAKE_INSTALL_PREFIX='+prefixdir, '-DCMAKE_INSTALL_NAME_DIR:STRING="'+os.path.join(prefixdir,'lib')+'"', '-DCMAKE_C_COMPILER="'+petsc.cc+'"', '-DCMAKE_C_FLAGS:STRING="'+petsc.getCFlags()+'"'] - confopt = confopt + ['-DCMAKE_BUILD_TYPE='+ ('Debug' if petsc.debug else 'Release')] + confopt.append('-DCMAKE_BUILD_TYPE='+ ('Debug' if petsc.debug else 'Release')) if petsc.buildsharedlib: confopt = confopt + ['-DBUILD_SHARED_LIBS=ON', '-DCMAKE_INSTALL_RPATH:PATH='+os.path.join(prefixdir,'lib')] else: - confopt = confopt + ['-DBUILD_SHARED_LIBS=OFF'] + confopt.append('-DBUILD_SHARED_LIBS=OFF') if 'MSYSTEM' in os.environ: - confopt = confopt + ['-G "MSYS Makefiles"'] + confopt.append('-G "MSYS Makefiles"') (result,output) = self.RunCommand('cd '+builddir+' && '+petsc.cmake+' '+' '.join(confopt)+' '+self.buildflags+' .. && '+petsc.make+' -j'+petsc.make_np+' && '+petsc.make+' install') if result: self.log.Exit('Installation of POLAR failed') From eb50092a8d91fb184498766b015bcaa89c8cd425 Mon Sep 17 00:00:00 2001 From: Jacob Faibussowitsch Date: Fri, 23 Jun 2023 10:05:41 -0400 Subject: [PATCH 032/112] See https://gitlab.com/petsc/petsc/-/merge_requests/6554 --- src/eps/interface/epsopts.c | 14 +++++++------- src/lme/interface/lmeopts.c | 2 +- src/mfn/interface/mfnopts.c | 2 +- src/nep/interface/nepopts.c | 12 ++++++------ src/pep/interface/pepopts.c | 14 +++++++------- src/svd/interface/svdopts.c | 14 +++++++------- 6 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/eps/interface/epsopts.c b/src/eps/interface/epsopts.c index 0074b7f94..61ae31307 100644 --- a/src/eps/interface/epsopts.c +++ b/src/eps/interface/epsopts.c @@ -214,13 +214,13 @@ PetscErrorCode EPSSetFromOptions(EPS eps) PetscCall(EPSMonitorSetFromOptions(eps,"-eps_monitor_conv","convergence_history",NULL,PETSC_FALSE)); /* -----------------------------------------------------------------------*/ - PetscCall(PetscOptionsName("-eps_view","Print detailed information on solver used","EPSView",NULL)); - PetscCall(PetscOptionsName("-eps_view_vectors","View computed eigenvectors","EPSVectorsView",NULL)); - PetscCall(PetscOptionsName("-eps_view_values","View computed eigenvalues","EPSValuesView",NULL)); - PetscCall(PetscOptionsName("-eps_converged_reason","Print reason for convergence, and number of iterations","EPSConvergedReasonView",NULL)); - PetscCall(PetscOptionsName("-eps_error_absolute","Print absolute errors of each eigenpair","EPSErrorView",NULL)); - PetscCall(PetscOptionsName("-eps_error_relative","Print relative errors of each eigenpair","EPSErrorView",NULL)); - PetscCall(PetscOptionsName("-eps_error_backward","Print backward errors of each eigenpair","EPSErrorView",NULL)); + PetscCall(PetscOptionsName("-eps_view","Print detailed information on solver used","EPSView",&set)); + PetscCall(PetscOptionsName("-eps_view_vectors","View computed eigenvectors","EPSVectorsView",&set)); + PetscCall(PetscOptionsName("-eps_view_values","View computed eigenvalues","EPSValuesView",&set)); + PetscCall(PetscOptionsName("-eps_converged_reason","Print reason for convergence, and number of iterations","EPSConvergedReasonView",&set)); + PetscCall(PetscOptionsName("-eps_error_absolute","Print absolute errors of each eigenpair","EPSErrorView",&set)); + PetscCall(PetscOptionsName("-eps_error_relative","Print relative errors of each eigenpair","EPSErrorView",&set)); + PetscCall(PetscOptionsName("-eps_error_backward","Print backward errors of each eigenpair","EPSErrorView",&set)); PetscTryTypeMethod(eps,setfromoptions,PetscOptionsObject); PetscCall(PetscObjectProcessOptionsHandlers((PetscObject)eps,PetscOptionsObject)); diff --git a/src/lme/interface/lmeopts.c b/src/lme/interface/lmeopts.c index 214ba9bd3..29bc0d16e 100644 --- a/src/lme/interface/lmeopts.c +++ b/src/lme/interface/lmeopts.c @@ -128,7 +128,7 @@ PetscErrorCode LMESetFromOptions(LME lme) PetscCall(LMEMonitorSetFromOptions(lme,"-lme_monitor","error_estimate",NULL)); /* -----------------------------------------------------------------------*/ - PetscCall(PetscOptionsName("-lme_view","Print detailed information on solver used","LMEView",NULL)); + PetscCall(PetscOptionsName("-lme_view","Print detailed information on solver used","LMEView",&set)); PetscTryTypeMethod(lme,setfromoptions,PetscOptionsObject); PetscCall(PetscObjectProcessOptionsHandlers((PetscObject)lme,PetscOptionsObject)); diff --git a/src/mfn/interface/mfnopts.c b/src/mfn/interface/mfnopts.c index 7c516b265..1eb6f4687 100644 --- a/src/mfn/interface/mfnopts.c +++ b/src/mfn/interface/mfnopts.c @@ -115,7 +115,7 @@ PetscErrorCode MFNSetFromOptions(MFN mfn) PetscCall(MFNMonitorSetFromOptions(mfn,"-mfn_monitor","error_estimate",NULL)); /* -----------------------------------------------------------------------*/ - PetscCall(PetscOptionsName("-mfn_view","Print detailed information on solver used","MFNView",NULL)); + PetscCall(PetscOptionsName("-mfn_view","Print detailed information on solver used","MFNView",&set)); PetscTryTypeMethod(mfn,setfromoptions,PetscOptionsObject); PetscCall(PetscObjectProcessOptionsHandlers((PetscObject)mfn,PetscOptionsObject)); diff --git a/src/nep/interface/nepopts.c b/src/nep/interface/nepopts.c index f80060349..fbe8437f1 100644 --- a/src/nep/interface/nepopts.c +++ b/src/nep/interface/nepopts.c @@ -185,12 +185,12 @@ PetscErrorCode NEPSetFromOptions(NEP nep) PetscCall(NEPMonitorSetFromOptions(nep,"-nep_monitor_conv","convergence_history",NULL,PETSC_FALSE)); /* -----------------------------------------------------------------------*/ - PetscCall(PetscOptionsName("-nep_view","Print detailed information on solver used","NEPView",NULL)); - PetscCall(PetscOptionsName("-nep_view_vectors","View computed eigenvectors","NEPVectorsView",NULL)); - PetscCall(PetscOptionsName("-nep_view_values","View computed eigenvalues","NEPValuesView",NULL)); - PetscCall(PetscOptionsName("-nep_converged_reason","Print reason for convergence, and number of iterations","NEPConvergedReasonView",NULL)); - PetscCall(PetscOptionsName("-nep_error_absolute","Print absolute errors of each eigenpair","NEPErrorView",NULL)); - PetscCall(PetscOptionsName("-nep_error_relative","Print relative errors of each eigenpair","NEPErrorView",NULL)); + PetscCall(PetscOptionsName("-nep_view","Print detailed information on solver used","NEPView",&set)); + PetscCall(PetscOptionsName("-nep_view_vectors","View computed eigenvectors","NEPVectorsView",&set)); + PetscCall(PetscOptionsName("-nep_view_values","View computed eigenvalues","NEPValuesView",&set)); + PetscCall(PetscOptionsName("-nep_converged_reason","Print reason for convergence, and number of iterations","NEPConvergedReasonView",&set)); + PetscCall(PetscOptionsName("-nep_error_absolute","Print absolute errors of each eigenpair","NEPErrorView",&set)); + PetscCall(PetscOptionsName("-nep_error_relative","Print relative errors of each eigenpair","NEPErrorView",&set)); PetscTryTypeMethod(nep,setfromoptions,PetscOptionsObject); PetscCall(PetscObjectProcessOptionsHandlers((PetscObject)nep,PetscOptionsObject)); diff --git a/src/pep/interface/pepopts.c b/src/pep/interface/pepopts.c index c84514341..e89e136e0 100644 --- a/src/pep/interface/pepopts.c +++ b/src/pep/interface/pepopts.c @@ -210,13 +210,13 @@ PetscErrorCode PEPSetFromOptions(PEP pep) PetscCall(PEPMonitorSetFromOptions(pep,"-pep_monitor_conv","convergence_history",NULL,PETSC_FALSE)); /* -----------------------------------------------------------------------*/ - PetscCall(PetscOptionsName("-pep_view","Print detailed information on solver used","PEPView",NULL)); - PetscCall(PetscOptionsName("-pep_view_vectors","View computed eigenvectors","PEPVectorsView",NULL)); - PetscCall(PetscOptionsName("-pep_view_values","View computed eigenvalues","PEPValuesView",NULL)); - PetscCall(PetscOptionsName("-pep_converged_reason","Print reason for convergence, and number of iterations","PEPConvergedReasonView",NULL)); - PetscCall(PetscOptionsName("-pep_error_absolute","Print absolute errors of each eigenpair","PEPErrorView",NULL)); - PetscCall(PetscOptionsName("-pep_error_relative","Print relative errors of each eigenpair","PEPErrorView",NULL)); - PetscCall(PetscOptionsName("-pep_error_backward","Print backward errors of each eigenpair","PEPErrorView",NULL)); + PetscCall(PetscOptionsName("-pep_view","Print detailed information on solver used","PEPView",&set)); + PetscCall(PetscOptionsName("-pep_view_vectors","View computed eigenvectors","PEPVectorsView",&set)); + PetscCall(PetscOptionsName("-pep_view_values","View computed eigenvalues","PEPValuesView",&set)); + PetscCall(PetscOptionsName("-pep_converged_reason","Print reason for convergence, and number of iterations","PEPConvergedReasonView",&set)); + PetscCall(PetscOptionsName("-pep_error_absolute","Print absolute errors of each eigenpair","PEPErrorView",&set)); + PetscCall(PetscOptionsName("-pep_error_relative","Print relative errors of each eigenpair","PEPErrorView",&set)); + PetscCall(PetscOptionsName("-pep_error_backward","Print backward errors of each eigenpair","PEPErrorView",&set)); PetscTryTypeMethod(pep,setfromoptions,PetscOptionsObject); PetscCall(PetscObjectProcessOptionsHandlers((PetscObject)pep,PetscOptionsObject)); diff --git a/src/svd/interface/svdopts.c b/src/svd/interface/svdopts.c index 35e6c9e81..3922933e9 100644 --- a/src/svd/interface/svdopts.c +++ b/src/svd/interface/svdopts.c @@ -691,13 +691,13 @@ PetscErrorCode SVDSetFromOptions(SVD svd) PetscCall(SVDMonitorSetFromOptions(svd,"-svd_monitor_conditioning","conditioning",NULL,PETSC_FALSE)); /* -----------------------------------------------------------------------*/ - PetscCall(PetscOptionsName("-svd_view","Print detailed information on solver used","SVDView",NULL)); - PetscCall(PetscOptionsName("-svd_view_vectors","View computed singular vectors","SVDVectorsView",NULL)); - PetscCall(PetscOptionsName("-svd_view_values","View computed singular values","SVDValuesView",NULL)); - PetscCall(PetscOptionsName("-svd_converged_reason","Print reason for convergence, and number of iterations","SVDConvergedReasonView",NULL)); - PetscCall(PetscOptionsName("-svd_error_absolute","Print absolute errors of each singular triplet","SVDErrorView",NULL)); - PetscCall(PetscOptionsName("-svd_error_relative","Print relative errors of each singular triplet","SVDErrorView",NULL)); - PetscCall(PetscOptionsName("-svd_error_norm","Print errors relative to the matrix norms of each singular triplet","SVDErrorView",NULL)); + PetscCall(PetscOptionsName("-svd_view","Print detailed information on solver used","SVDView",&set)); + PetscCall(PetscOptionsName("-svd_view_vectors","View computed singular vectors","SVDVectorsView",&set)); + PetscCall(PetscOptionsName("-svd_view_values","View computed singular values","SVDValuesView",&set)); + PetscCall(PetscOptionsName("-svd_converged_reason","Print reason for convergence, and number of iterations","SVDConvergedReasonView",&set)); + PetscCall(PetscOptionsName("-svd_error_absolute","Print absolute errors of each singular triplet","SVDErrorView",&set)); + PetscCall(PetscOptionsName("-svd_error_relative","Print relative errors of each singular triplet","SVDErrorView",&set)); + PetscCall(PetscOptionsName("-svd_error_norm","Print errors relative to the matrix norms of each singular triplet","SVDErrorView",&set)); PetscTryTypeMethod(svd,setfromoptions,PetscOptionsObject); PetscCall(PetscObjectProcessOptionsHandlers((PetscObject)svd,PetscOptionsObject)); From 370577010bb3f01e98037e4244caea62583fa541 Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Tue, 27 Jun 2023 08:37:56 +0000 Subject: [PATCH 033/112] SVD: consider vector norm when computing residual norm --- src/svd/interface/svdsolve.c | 35 ++++++++++++++++--- src/svd/tutorials/output/ex14_3.out | 10 +++--- src/svd/tutorials/output/ex14_3_complex.out | 10 +++--- .../tutorials/output/ex14_3_complex_alt.out | 10 +++--- 4 files changed, 45 insertions(+), 20 deletions(-) diff --git a/src/svd/interface/svdsolve.c b/src/svd/interface/svdsolve.c index ebaac3ebc..daaa8ffdd 100644 --- a/src/svd/interface/svdsolve.c +++ b/src/svd/interface/svdsolve.c @@ -485,8 +485,9 @@ static PetscErrorCode SVDComputeResidualNorms_Hyperbolic(SVD svd,PetscReal sigma @*/ PetscErrorCode SVDComputeError(SVD svd,PetscInt i,SVDErrorType type,PetscReal *error) { - PetscReal sigma,norm1,norm2; + PetscReal sigma,norm1,norm2,c,s; Vec u=NULL,v=NULL,x=NULL,y=NULL,z=NULL; + PetscReal vecnorm=1.0; PetscFunctionBegin; PetscValidHeaderSpecific(svd,SVD_CLASSID,1); @@ -505,7 +506,6 @@ PetscErrorCode SVDComputeError(SVD svd,PetscInt i,SVDErrorType type,PetscReal *e y = svd->workr[1]; break; case SVD_GENERALIZED: - PetscCheck(type!=SVD_ERROR_RELATIVE,PetscObjectComm((PetscObject)svd),PETSC_ERR_SUP,"In GSVD the error should be either absolute or relative to the norms"); PetscCall(SVDSetWorkVecs(svd,1,3)); u = svd->workl[0]; v = svd->workr[0]; @@ -522,7 +522,7 @@ PetscErrorCode SVDComputeError(SVD svd,PetscInt i,SVDErrorType type,PetscReal *e break; } - /* compute residual norm and error */ + /* compute residual norm */ PetscCall(SVDGetSingularTriplet(svd,i,&sigma,u,v)); switch (svd->problem_type) { case SVD_STANDARD: @@ -536,16 +536,41 @@ PetscErrorCode SVDComputeError(SVD svd,PetscInt i,SVDErrorType type,PetscReal *e break; } *error = SlepcAbs(norm1,norm2); + + /* compute 2-norm of eigenvector of the cyclic form */ + if (type!=SVD_ERROR_ABSOLUTE) { + switch (svd->problem_type) { + case SVD_STANDARD: + vecnorm = PETSC_SQRT2; + break; + case SVD_GENERALIZED: + PetscCall(VecNorm(v,NORM_2,&vecnorm)); + vecnorm = PetscSqrtReal(1.0+vecnorm*vecnorm); + break; + case SVD_HYPERBOLIC: + PetscCall(VecNorm(u,NORM_2,&vecnorm)); + vecnorm = PetscSqrtReal(1.0+vecnorm*vecnorm); + break; + } + } + + /* compute error */ switch (type) { case SVD_ERROR_ABSOLUTE: break; case SVD_ERROR_RELATIVE: - *error /= sigma; + if (svd->isgeneralized) { + s = 1.0/PetscSqrtReal(1.0+sigma*sigma); + c = sigma*s; + norm1 /= c*vecnorm; + norm2 /= s*vecnorm; + *error = PetscMax(norm1,norm2); + } else *error /= sigma*vecnorm; break; case SVD_ERROR_NORM: if (!svd->nrma) PetscCall(MatNorm(svd->OP,NORM_INFINITY,&svd->nrma)); if (svd->isgeneralized && !svd->nrmb) PetscCall(MatNorm(svd->OPb,NORM_INFINITY,&svd->nrmb)); - *error /= PetscMax(svd->nrma,svd->nrmb); + *error /= PetscMax(svd->nrma,svd->nrmb)*vecnorm; break; default: SETERRQ(PetscObjectComm((PetscObject)svd),PETSC_ERR_ARG_OUTOFRANGE,"Invalid error type"); diff --git a/src/svd/tutorials/output/ex14_3.out b/src/svd/tutorials/output/ex14_3.out index 9e5db347d..4e5c0c48c 100644 --- a/src/svd/tutorials/output/ex14_3.out +++ b/src/svd/tutorials/output/ex14_3.out @@ -11,9 +11,9 @@ Singular value problem stored in file. ---------------------- -------------------- sigma relative error ---------------------- -------------------- - 27.583486 0.440072 - 27.269214 0.495017 - 26.665502 0.423561 - 25.229822 0.49484 - 24.658072 0.455468 + 27.583486 0.311178 + 27.269214 0.35003 + 26.665502 0.299503 + 25.229822 0.349904 + 24.658072 0.322064 ---------------------- -------------------- diff --git a/src/svd/tutorials/output/ex14_3_complex.out b/src/svd/tutorials/output/ex14_3_complex.out index 640878e88..5cc5c4d52 100644 --- a/src/svd/tutorials/output/ex14_3_complex.out +++ b/src/svd/tutorials/output/ex14_3_complex.out @@ -11,9 +11,9 @@ Singular value problem stored in file. ---------------------- -------------------- sigma relative error ---------------------- -------------------- - 1.080800 0.7142 - 0.929362 0.9281 - 0.711709 0.9984 - 0.668235 1.015 - 0.549283 0.9918 + 1.080800 0.5050 + 0.929362 0.6563 + 0.711709 0.7060 + 0.668235 0.7178 + 0.549283 0.7013 ---------------------- -------------------- diff --git a/src/svd/tutorials/output/ex14_3_complex_alt.out b/src/svd/tutorials/output/ex14_3_complex_alt.out index 164739ce3..92901341c 100644 --- a/src/svd/tutorials/output/ex14_3_complex_alt.out +++ b/src/svd/tutorials/output/ex14_3_complex_alt.out @@ -11,9 +11,9 @@ Singular value problem stored in file. ---------------------- -------------------- sigma relative error ---------------------- -------------------- - 1.081225 0.7146 - 0.929000 0.9278 - 0.712978 0.9958 - 0.669691 1.018 - 0.549176 0.9955 + 1.081225 0.5053 + 0.929000 0.6560 + 0.712978 0.7041 + 0.669691 0.7203 + 0.549176 0.703 ---------------------- -------------------- From 43030245c04a43df7afdcf90d1a58671946815b3 Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Fri, 16 Jun 2023 09:29:55 +0200 Subject: [PATCH 034/112] Sync with PETSc: HAVE_FORTRAN has been renamed to USE_FORTRAN --- config/packages/petsc.py | 2 +- lib/slepc/bin/maint/generatefortranstubs.py | 2 +- makefile | 4 ++-- src/eps/f90-mod/makefile | 2 +- src/eps/impls/krylov/krylovschur/ftn-custom/makefile | 2 +- src/eps/interface/ftn-custom/makefile | 2 +- src/lme/f90-mod/makefile | 2 +- src/lme/interface/ftn-custom/makefile | 2 +- src/mfn/f90-mod/makefile | 2 +- src/mfn/interface/ftn-custom/makefile | 2 +- src/nep/f90-mod/makefile | 2 +- src/nep/impls/nleigs/ftn-custom/makefile | 2 +- src/nep/interface/ftn-custom/makefile | 2 +- src/pep/f90-mod/makefile | 2 +- src/pep/impls/krylov/stoar/ftn-custom/makefile | 2 +- src/pep/interface/ftn-custom/makefile | 2 +- src/svd/f90-mod/makefile | 2 +- src/svd/interface/ftn-custom/makefile | 2 +- src/sys/classes/bv/f90-mod/makefile | 2 +- src/sys/classes/bv/interface/ftn-custom/makefile | 2 +- src/sys/classes/ds/f90-mod/makefile | 2 +- src/sys/classes/ds/impls/pep/ftn-custom/makefile | 2 +- src/sys/classes/ds/interface/ftn-custom/makefile | 2 +- src/sys/classes/fn/f90-mod/makefile | 2 +- src/sys/classes/fn/impls/rational/ftn-custom/makefile | 2 +- src/sys/classes/fn/interface/ftn-custom/makefile | 2 +- src/sys/classes/rg/f90-mod/makefile | 2 +- src/sys/classes/rg/impls/ellipse/ftn-custom/makefile | 2 +- src/sys/classes/rg/impls/interval/ftn-custom/makefile | 2 +- src/sys/classes/rg/impls/polygon/ftn-custom/makefile | 2 +- src/sys/classes/rg/interface/ftn-custom/makefile | 2 +- src/sys/classes/st/f90-mod/makefile | 2 +- src/sys/classes/st/impls/shell/ftn-custom/makefile | 2 +- src/sys/classes/st/interface/ftn-custom/makefile | 2 +- src/sys/f90-mod/makefile | 2 +- src/sys/ftn-custom/makefile | 2 +- 36 files changed, 37 insertions(+), 37 deletions(-) diff --git a/config/packages/petsc.py b/config/packages/petsc.py index 8558b8e46..546f03b16 100644 --- a/config/packages/petsc.py +++ b/config/packages/petsc.py @@ -161,7 +161,7 @@ def LoadConf(self): self.blaslapackmangling = 'caps' elif len(l)==3 and l[0]=='#define' and l[1]=='PETSC_HAVE_64BIT_BLAS_INDICES' and l[2]=='1': self.blaslapackint64 = True - elif len(l)==3 and l[0]=='#define' and l[1]=='PETSC_HAVE_FORTRAN' and l[2]=='1': + elif len(l)==3 and l[0]=='#define' and l[1]=='PETSC_USE_FORTRAN_BINDINGS' and l[2]=='1': self.fortran = True elif len(l)==3 and l[0]=='#define' and l[1]=='PETSC_CLANGUAGE_CXX' and l[2]=='1': self.language = 'c++' diff --git a/lib/slepc/bin/maint/generatefortranstubs.py b/lib/slepc/bin/maint/generatefortranstubs.py index 22959394d..b22a49382 100644 --- a/lib/slepc/bin/maint/generatefortranstubs.py +++ b/lib/slepc/bin/maint/generatefortranstubs.py @@ -113,7 +113,7 @@ def FixDir(petscdir,dir,verbose): # now assemble the makefile outbuf = '\n' - outbuf += "#requiresdefine 'PETSC_HAVE_FORTRAN'\n" + outbuf += "#requiresdefine 'PETSC_USE_FORTRAN_BINDINGS'\n" outbuf += cppflags + '\n' outbuf += libbase + '\n' outbuf += 'include ${SLEPC_DIR}/lib/slepc/conf/slepc_common\n' diff --git a/makefile b/makefile index 25765cdc0..14e902937 100644 --- a/makefile +++ b/makefile @@ -134,7 +134,7 @@ check_build: +@cd src/eps/tests >/dev/null; ${RUN_TEST} clean-legacy +@cd src/eps/tests >/dev/null; ${RUN_TEST} testtest10 +@if [ ! "${MPI_IS_MPIUNI}" ]; then cd src/eps/tests >/dev/null; ${RUN_TEST} testtest10_mpi; fi - +@grep -E "^#define PETSC_HAVE_FORTRAN 1" ${PETSCCONF_H} | tee .ftn.log > /dev/null; \ + +@grep -E "^#define PETSC_USE_FORTRAN_BINDINGS 1" ${PETSCCONF_H} | tee .ftn.log > /dev/null; \ if test -s .ftn.log; then \ cd src/eps/tests >/dev/null; ${RUN_TEST} testtest7f; \ fi ; ${RM} .ftn.log @@ -230,7 +230,7 @@ check_usermakefile: -@echo "Using SLEPC_DIR=${SLEPC_DIR}, PETSC_DIR=${PETSC_DIR}, and PETSC_ARCH=${PETSC_ARCH}" @cd src/eps/tutorials; ${RUN_TEST} clean-legacy @cd src/eps/tutorials; ${OMAKE} SLEPC_DIR=${SLEPC_DIR} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} -f ${SLEPC_DIR}/share/slepc/Makefile.user ex10 - @grep -E "^#define PETSC_HAVE_FORTRAN 1" ${PETSCCONF_H} | tee .ftn.log > /dev/null; \ + @grep -E "^#define PETSC_USE_FORTRAN_BINDINGS 1" ${PETSCCONF_H} | tee .ftn.log > /dev/null; \ if test -s .ftn.log; then \ cd src/eps/tutorials; ${OMAKE} SLEPC_DIR=${SLEPC_DIR} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} -f ${SLEPC_DIR}/share/slepc/Makefile.user ex10f90; \ fi; ${RM} .ftn.log; diff --git a/src/eps/f90-mod/makefile b/src/eps/f90-mod/makefile index 57e2a1dcc..db54081dc 100644 --- a/src/eps/f90-mod/makefile +++ b/src/eps/f90-mod/makefile @@ -7,7 +7,7 @@ # SLEPc is distributed under a 2-clause BSD license (see LICENSE). # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # -#requiresdefine 'PETSC_HAVE_FORTRAN' +#requiresdefine 'PETSC_USE_FORTRAN_BINDINGS' LIBBASE = libslepceps MANSEC = EPS diff --git a/src/eps/impls/krylov/krylovschur/ftn-custom/makefile b/src/eps/impls/krylov/krylovschur/ftn-custom/makefile index dca1fc315..5d24d1a73 100644 --- a/src/eps/impls/krylov/krylovschur/ftn-custom/makefile +++ b/src/eps/impls/krylov/krylovschur/ftn-custom/makefile @@ -7,7 +7,7 @@ # SLEPc is distributed under a 2-clause BSD license (see LICENSE). # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # -#requiresdefine 'PETSC_HAVE_FORTRAN' +#requiresdefine 'PETSC_USE_FORTRAN_BINDINGS' LIBBASE = libslepceps diff --git a/src/eps/interface/ftn-custom/makefile b/src/eps/interface/ftn-custom/makefile index dca1fc315..5d24d1a73 100644 --- a/src/eps/interface/ftn-custom/makefile +++ b/src/eps/interface/ftn-custom/makefile @@ -7,7 +7,7 @@ # SLEPc is distributed under a 2-clause BSD license (see LICENSE). # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # -#requiresdefine 'PETSC_HAVE_FORTRAN' +#requiresdefine 'PETSC_USE_FORTRAN_BINDINGS' LIBBASE = libslepceps diff --git a/src/lme/f90-mod/makefile b/src/lme/f90-mod/makefile index 30adc1135..579a461e3 100644 --- a/src/lme/f90-mod/makefile +++ b/src/lme/f90-mod/makefile @@ -7,7 +7,7 @@ # SLEPc is distributed under a 2-clause BSD license (see LICENSE). # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # -#requiresdefine 'PETSC_HAVE_FORTRAN' +#requiresdefine 'PETSC_USE_FORTRAN_BINDINGS' LIBBASE = libslepclme MANSEC = LME diff --git a/src/lme/interface/ftn-custom/makefile b/src/lme/interface/ftn-custom/makefile index 062ed5a9f..e842f861f 100644 --- a/src/lme/interface/ftn-custom/makefile +++ b/src/lme/interface/ftn-custom/makefile @@ -7,7 +7,7 @@ # SLEPc is distributed under a 2-clause BSD license (see LICENSE). # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # -#requiresdefine 'PETSC_HAVE_FORTRAN' +#requiresdefine 'PETSC_USE_FORTRAN_BINDINGS' LIBBASE = libslepclme diff --git a/src/mfn/f90-mod/makefile b/src/mfn/f90-mod/makefile index 6dcf95d60..a2e2ba2d1 100644 --- a/src/mfn/f90-mod/makefile +++ b/src/mfn/f90-mod/makefile @@ -7,7 +7,7 @@ # SLEPc is distributed under a 2-clause BSD license (see LICENSE). # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # -#requiresdefine 'PETSC_HAVE_FORTRAN' +#requiresdefine 'PETSC_USE_FORTRAN_BINDINGS' LIBBASE = libslepcmfn MANSEC = MFN diff --git a/src/mfn/interface/ftn-custom/makefile b/src/mfn/interface/ftn-custom/makefile index 11eb40d7b..44b759aaa 100644 --- a/src/mfn/interface/ftn-custom/makefile +++ b/src/mfn/interface/ftn-custom/makefile @@ -7,7 +7,7 @@ # SLEPc is distributed under a 2-clause BSD license (see LICENSE). # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # -#requiresdefine 'PETSC_HAVE_FORTRAN' +#requiresdefine 'PETSC_USE_FORTRAN_BINDINGS' LIBBASE = libslepcmfn diff --git a/src/nep/f90-mod/makefile b/src/nep/f90-mod/makefile index 53377f381..37bc6df30 100644 --- a/src/nep/f90-mod/makefile +++ b/src/nep/f90-mod/makefile @@ -7,7 +7,7 @@ # SLEPc is distributed under a 2-clause BSD license (see LICENSE). # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # -#requiresdefine 'PETSC_HAVE_FORTRAN' +#requiresdefine 'PETSC_USE_FORTRAN_BINDINGS' LIBBASE = libslepcnep MANSEC = NEP diff --git a/src/nep/impls/nleigs/ftn-custom/makefile b/src/nep/impls/nleigs/ftn-custom/makefile index 26987854b..cfa14f008 100644 --- a/src/nep/impls/nleigs/ftn-custom/makefile +++ b/src/nep/impls/nleigs/ftn-custom/makefile @@ -7,7 +7,7 @@ # SLEPc is distributed under a 2-clause BSD license (see LICENSE). # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # -#requiresdefine 'PETSC_HAVE_FORTRAN' +#requiresdefine 'PETSC_USE_FORTRAN_BINDINGS' LIBBASE = libslepcnep diff --git a/src/nep/interface/ftn-custom/makefile b/src/nep/interface/ftn-custom/makefile index 26987854b..cfa14f008 100644 --- a/src/nep/interface/ftn-custom/makefile +++ b/src/nep/interface/ftn-custom/makefile @@ -7,7 +7,7 @@ # SLEPc is distributed under a 2-clause BSD license (see LICENSE). # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # -#requiresdefine 'PETSC_HAVE_FORTRAN' +#requiresdefine 'PETSC_USE_FORTRAN_BINDINGS' LIBBASE = libslepcnep diff --git a/src/pep/f90-mod/makefile b/src/pep/f90-mod/makefile index 15cbc81f4..76c334bf2 100644 --- a/src/pep/f90-mod/makefile +++ b/src/pep/f90-mod/makefile @@ -7,7 +7,7 @@ # SLEPc is distributed under a 2-clause BSD license (see LICENSE). # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # -#requiresdefine 'PETSC_HAVE_FORTRAN' +#requiresdefine 'PETSC_USE_FORTRAN_BINDINGS' LIBBASE = libslepcpep MANSEC = PEP diff --git a/src/pep/impls/krylov/stoar/ftn-custom/makefile b/src/pep/impls/krylov/stoar/ftn-custom/makefile index 8761e70e4..6d99dbfd7 100644 --- a/src/pep/impls/krylov/stoar/ftn-custom/makefile +++ b/src/pep/impls/krylov/stoar/ftn-custom/makefile @@ -7,7 +7,7 @@ # SLEPc is distributed under a 2-clause BSD license (see LICENSE). # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # -#requiresdefine 'PETSC_HAVE_FORTRAN' +#requiresdefine 'PETSC_USE_FORTRAN_BINDINGS' LIBBASE = libslepcpep diff --git a/src/pep/interface/ftn-custom/makefile b/src/pep/interface/ftn-custom/makefile index 8761e70e4..6d99dbfd7 100644 --- a/src/pep/interface/ftn-custom/makefile +++ b/src/pep/interface/ftn-custom/makefile @@ -7,7 +7,7 @@ # SLEPc is distributed under a 2-clause BSD license (see LICENSE). # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # -#requiresdefine 'PETSC_HAVE_FORTRAN' +#requiresdefine 'PETSC_USE_FORTRAN_BINDINGS' LIBBASE = libslepcpep diff --git a/src/svd/f90-mod/makefile b/src/svd/f90-mod/makefile index c214992c1..3989116a8 100644 --- a/src/svd/f90-mod/makefile +++ b/src/svd/f90-mod/makefile @@ -7,7 +7,7 @@ # SLEPc is distributed under a 2-clause BSD license (see LICENSE). # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # -#requiresdefine 'PETSC_HAVE_FORTRAN' +#requiresdefine 'PETSC_USE_FORTRAN_BINDINGS' LIBBASE = libslepcsvd MANSEC = SVD diff --git a/src/svd/interface/ftn-custom/makefile b/src/svd/interface/ftn-custom/makefile index 174d56aa2..72790223f 100644 --- a/src/svd/interface/ftn-custom/makefile +++ b/src/svd/interface/ftn-custom/makefile @@ -7,7 +7,7 @@ # SLEPc is distributed under a 2-clause BSD license (see LICENSE). # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # -#requiresdefine 'PETSC_HAVE_FORTRAN' +#requiresdefine 'PETSC_USE_FORTRAN_BINDINGS' LIBBASE = libslepcsvd diff --git a/src/sys/classes/bv/f90-mod/makefile b/src/sys/classes/bv/f90-mod/makefile index d8ff8adf1..4b7cf689d 100644 --- a/src/sys/classes/bv/f90-mod/makefile +++ b/src/sys/classes/bv/f90-mod/makefile @@ -7,7 +7,7 @@ # SLEPc is distributed under a 2-clause BSD license (see LICENSE). # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # -#requiresdefine 'PETSC_HAVE_FORTRAN' +#requiresdefine 'PETSC_USE_FORTRAN_BINDINGS' LIBBASE = libslepcsys MANSEC = BV diff --git a/src/sys/classes/bv/interface/ftn-custom/makefile b/src/sys/classes/bv/interface/ftn-custom/makefile index 51af84da3..25eefc709 100644 --- a/src/sys/classes/bv/interface/ftn-custom/makefile +++ b/src/sys/classes/bv/interface/ftn-custom/makefile @@ -7,7 +7,7 @@ # SLEPc is distributed under a 2-clause BSD license (see LICENSE). # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # -#requiresdefine 'PETSC_HAVE_FORTRAN' +#requiresdefine 'PETSC_USE_FORTRAN_BINDINGS' LIBBASE = libslepcsys diff --git a/src/sys/classes/ds/f90-mod/makefile b/src/sys/classes/ds/f90-mod/makefile index 288e76432..b950079a8 100644 --- a/src/sys/classes/ds/f90-mod/makefile +++ b/src/sys/classes/ds/f90-mod/makefile @@ -7,7 +7,7 @@ # SLEPc is distributed under a 2-clause BSD license (see LICENSE). # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # -#requiresdefine 'PETSC_HAVE_FORTRAN' +#requiresdefine 'PETSC_USE_FORTRAN_BINDINGS' LIBBASE = libslepcsys MANSEC = DS diff --git a/src/sys/classes/ds/impls/pep/ftn-custom/makefile b/src/sys/classes/ds/impls/pep/ftn-custom/makefile index 51af84da3..25eefc709 100644 --- a/src/sys/classes/ds/impls/pep/ftn-custom/makefile +++ b/src/sys/classes/ds/impls/pep/ftn-custom/makefile @@ -7,7 +7,7 @@ # SLEPc is distributed under a 2-clause BSD license (see LICENSE). # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # -#requiresdefine 'PETSC_HAVE_FORTRAN' +#requiresdefine 'PETSC_USE_FORTRAN_BINDINGS' LIBBASE = libslepcsys diff --git a/src/sys/classes/ds/interface/ftn-custom/makefile b/src/sys/classes/ds/interface/ftn-custom/makefile index 51af84da3..25eefc709 100644 --- a/src/sys/classes/ds/interface/ftn-custom/makefile +++ b/src/sys/classes/ds/interface/ftn-custom/makefile @@ -7,7 +7,7 @@ # SLEPc is distributed under a 2-clause BSD license (see LICENSE). # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # -#requiresdefine 'PETSC_HAVE_FORTRAN' +#requiresdefine 'PETSC_USE_FORTRAN_BINDINGS' LIBBASE = libslepcsys diff --git a/src/sys/classes/fn/f90-mod/makefile b/src/sys/classes/fn/f90-mod/makefile index f30e477a2..d8c41494f 100644 --- a/src/sys/classes/fn/f90-mod/makefile +++ b/src/sys/classes/fn/f90-mod/makefile @@ -7,7 +7,7 @@ # SLEPc is distributed under a 2-clause BSD license (see LICENSE). # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # -#requiresdefine 'PETSC_HAVE_FORTRAN' +#requiresdefine 'PETSC_USE_FORTRAN_BINDINGS' MANSEC = FN CLEANFILES = *.mod diff --git a/src/sys/classes/fn/impls/rational/ftn-custom/makefile b/src/sys/classes/fn/impls/rational/ftn-custom/makefile index 51af84da3..25eefc709 100644 --- a/src/sys/classes/fn/impls/rational/ftn-custom/makefile +++ b/src/sys/classes/fn/impls/rational/ftn-custom/makefile @@ -7,7 +7,7 @@ # SLEPc is distributed under a 2-clause BSD license (see LICENSE). # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # -#requiresdefine 'PETSC_HAVE_FORTRAN' +#requiresdefine 'PETSC_USE_FORTRAN_BINDINGS' LIBBASE = libslepcsys diff --git a/src/sys/classes/fn/interface/ftn-custom/makefile b/src/sys/classes/fn/interface/ftn-custom/makefile index 51af84da3..25eefc709 100644 --- a/src/sys/classes/fn/interface/ftn-custom/makefile +++ b/src/sys/classes/fn/interface/ftn-custom/makefile @@ -7,7 +7,7 @@ # SLEPc is distributed under a 2-clause BSD license (see LICENSE). # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # -#requiresdefine 'PETSC_HAVE_FORTRAN' +#requiresdefine 'PETSC_USE_FORTRAN_BINDINGS' LIBBASE = libslepcsys diff --git a/src/sys/classes/rg/f90-mod/makefile b/src/sys/classes/rg/f90-mod/makefile index 283035f64..84379c023 100644 --- a/src/sys/classes/rg/f90-mod/makefile +++ b/src/sys/classes/rg/f90-mod/makefile @@ -7,7 +7,7 @@ # SLEPc is distributed under a 2-clause BSD license (see LICENSE). # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # -#requiresdefine 'PETSC_HAVE_FORTRAN' +#requiresdefine 'PETSC_USE_FORTRAN_BINDINGS' LIBBASE = libslepcsys MANSEC = RG diff --git a/src/sys/classes/rg/impls/ellipse/ftn-custom/makefile b/src/sys/classes/rg/impls/ellipse/ftn-custom/makefile index 51af84da3..25eefc709 100644 --- a/src/sys/classes/rg/impls/ellipse/ftn-custom/makefile +++ b/src/sys/classes/rg/impls/ellipse/ftn-custom/makefile @@ -7,7 +7,7 @@ # SLEPc is distributed under a 2-clause BSD license (see LICENSE). # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # -#requiresdefine 'PETSC_HAVE_FORTRAN' +#requiresdefine 'PETSC_USE_FORTRAN_BINDINGS' LIBBASE = libslepcsys diff --git a/src/sys/classes/rg/impls/interval/ftn-custom/makefile b/src/sys/classes/rg/impls/interval/ftn-custom/makefile index 51af84da3..25eefc709 100644 --- a/src/sys/classes/rg/impls/interval/ftn-custom/makefile +++ b/src/sys/classes/rg/impls/interval/ftn-custom/makefile @@ -7,7 +7,7 @@ # SLEPc is distributed under a 2-clause BSD license (see LICENSE). # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # -#requiresdefine 'PETSC_HAVE_FORTRAN' +#requiresdefine 'PETSC_USE_FORTRAN_BINDINGS' LIBBASE = libslepcsys diff --git a/src/sys/classes/rg/impls/polygon/ftn-custom/makefile b/src/sys/classes/rg/impls/polygon/ftn-custom/makefile index 51af84da3..25eefc709 100644 --- a/src/sys/classes/rg/impls/polygon/ftn-custom/makefile +++ b/src/sys/classes/rg/impls/polygon/ftn-custom/makefile @@ -7,7 +7,7 @@ # SLEPc is distributed under a 2-clause BSD license (see LICENSE). # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # -#requiresdefine 'PETSC_HAVE_FORTRAN' +#requiresdefine 'PETSC_USE_FORTRAN_BINDINGS' LIBBASE = libslepcsys diff --git a/src/sys/classes/rg/interface/ftn-custom/makefile b/src/sys/classes/rg/interface/ftn-custom/makefile index 51af84da3..25eefc709 100644 --- a/src/sys/classes/rg/interface/ftn-custom/makefile +++ b/src/sys/classes/rg/interface/ftn-custom/makefile @@ -7,7 +7,7 @@ # SLEPc is distributed under a 2-clause BSD license (see LICENSE). # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # -#requiresdefine 'PETSC_HAVE_FORTRAN' +#requiresdefine 'PETSC_USE_FORTRAN_BINDINGS' LIBBASE = libslepcsys diff --git a/src/sys/classes/st/f90-mod/makefile b/src/sys/classes/st/f90-mod/makefile index 60c7c7e92..f62e8a8ce 100644 --- a/src/sys/classes/st/f90-mod/makefile +++ b/src/sys/classes/st/f90-mod/makefile @@ -7,7 +7,7 @@ # SLEPc is distributed under a 2-clause BSD license (see LICENSE). # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # -#requiresdefine 'PETSC_HAVE_FORTRAN' +#requiresdefine 'PETSC_USE_FORTRAN_BINDINGS' LIBBASE = libslepcsys MANSEC = ST diff --git a/src/sys/classes/st/impls/shell/ftn-custom/makefile b/src/sys/classes/st/impls/shell/ftn-custom/makefile index 51af84da3..25eefc709 100644 --- a/src/sys/classes/st/impls/shell/ftn-custom/makefile +++ b/src/sys/classes/st/impls/shell/ftn-custom/makefile @@ -7,7 +7,7 @@ # SLEPc is distributed under a 2-clause BSD license (see LICENSE). # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # -#requiresdefine 'PETSC_HAVE_FORTRAN' +#requiresdefine 'PETSC_USE_FORTRAN_BINDINGS' LIBBASE = libslepcsys diff --git a/src/sys/classes/st/interface/ftn-custom/makefile b/src/sys/classes/st/interface/ftn-custom/makefile index 51af84da3..25eefc709 100644 --- a/src/sys/classes/st/interface/ftn-custom/makefile +++ b/src/sys/classes/st/interface/ftn-custom/makefile @@ -7,7 +7,7 @@ # SLEPc is distributed under a 2-clause BSD license (see LICENSE). # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # -#requiresdefine 'PETSC_HAVE_FORTRAN' +#requiresdefine 'PETSC_USE_FORTRAN_BINDINGS' LIBBASE = libslepcsys diff --git a/src/sys/f90-mod/makefile b/src/sys/f90-mod/makefile index f227b38c5..fb4ab4fd6 100644 --- a/src/sys/f90-mod/makefile +++ b/src/sys/f90-mod/makefile @@ -7,7 +7,7 @@ # SLEPc is distributed under a 2-clause BSD license (see LICENSE). # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # -#requiresdefine 'PETSC_HAVE_FORTRAN' +#requiresdefine 'PETSC_USE_FORTRAN_BINDINGS' LIBBASE = libslepcsys MANSEC = sys diff --git a/src/sys/ftn-custom/makefile b/src/sys/ftn-custom/makefile index 0c30ae4b9..0fc68ad23 100644 --- a/src/sys/ftn-custom/makefile +++ b/src/sys/ftn-custom/makefile @@ -7,7 +7,7 @@ # SLEPc is distributed under a 2-clause BSD license (see LICENSE). # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # -#requiresdefine 'PETSC_HAVE_FORTRAN' +#requiresdefine 'PETSC_USE_FORTRAN_BINDINGS' LIBBASE = libslepcsys MANSEC = sys From 0a83d62bc2ead12f6f85a205f0c4665ff1facdda Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Thu, 6 Jul 2023 18:20:16 +0200 Subject: [PATCH 035/112] makefile: fix make check in the case of prefix builds The following fix is discarded because it is GNU specific: ifeq (${SLEPC_INSTALLDIR},${SLEPC_DIR}/${PETSC_ARCH}) PETSCCONF_H = ${PETSC_DIR}/${PETSC_ARCH}/include/petscconf.h else PETSCCONF_H = ${PETSC_DIR}/include/petscconf.h endif --- makefile | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/makefile b/makefile index 14e902937..d99249a64 100644 --- a/makefile +++ b/makefile @@ -37,7 +37,6 @@ include ${SLEPC_DIR}/lib/slepc/conf/slepc_rules.utils OMAKE_SELF = $(OMAKE) -f makefile OMAKE_SELF_PRINTDIR = $(OMAKE_PRINTDIR) -f makefile -PETSCCONF_H = ${PETSC_DIR}/${PETSC_ARCH}/include/petscconf.h # ******** Rules for make all ************************************************************************** @@ -134,7 +133,11 @@ check_build: +@cd src/eps/tests >/dev/null; ${RUN_TEST} clean-legacy +@cd src/eps/tests >/dev/null; ${RUN_TEST} testtest10 +@if [ ! "${MPI_IS_MPIUNI}" ]; then cd src/eps/tests >/dev/null; ${RUN_TEST} testtest10_mpi; fi - +@grep -E "^#define PETSC_USE_FORTRAN_BINDINGS 1" ${PETSCCONF_H} | tee .ftn.log > /dev/null; \ + +@if [ "${SLEPC_INSTALLDIR}" = "${SLEPC_DIR}/${PETSC_ARCH}" ]; then \ + grep -E "^#define PETSC_USE_FORTRAN_BINDINGS 1" ${PETSC_DIR}/${PETSC_ARCH}/include/petscconf.h | tee .ftn.log > /dev/null; \ + else \ + grep -E "^#define PETSC_USE_FORTRAN_BINDINGS 1" ${PETSC_DIR}/include/petscconf.h | tee .ftn.log > /dev/null; \ + fi; \ if test -s .ftn.log; then \ cd src/eps/tests >/dev/null; ${RUN_TEST} testtest7f; \ fi ; ${RM} .ftn.log @@ -230,7 +233,11 @@ check_usermakefile: -@echo "Using SLEPC_DIR=${SLEPC_DIR}, PETSC_DIR=${PETSC_DIR}, and PETSC_ARCH=${PETSC_ARCH}" @cd src/eps/tutorials; ${RUN_TEST} clean-legacy @cd src/eps/tutorials; ${OMAKE} SLEPC_DIR=${SLEPC_DIR} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} -f ${SLEPC_DIR}/share/slepc/Makefile.user ex10 - @grep -E "^#define PETSC_USE_FORTRAN_BINDINGS 1" ${PETSCCONF_H} | tee .ftn.log > /dev/null; \ + @if [ "${SLEPC_INSTALLDIR}" = "${SLEPC_DIR}/${PETSC_ARCH}" ]; then \ + grep -E "^#define PETSC_USE_FORTRAN_BINDINGS 1" ${PETSC_DIR}/${PETSC_ARCH}/include/petscconf.h | tee .ftn.log > /dev/null; \ + else \ + grep -E "^#define PETSC_USE_FORTRAN_BINDINGS 1" ${PETSC_DIR}/include/petscconf.h | tee .ftn.log > /dev/null; \ + fi; \ if test -s .ftn.log; then \ cd src/eps/tutorials; ${OMAKE} SLEPC_DIR=${SLEPC_DIR} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} -f ${SLEPC_DIR}/share/slepc/Makefile.user ex10f90; \ fi; ${RM} .ftn.log; From 5fc5d10d825a27880d45b824874a30d7aa07b8ee Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Sun, 9 Jul 2023 20:22:25 +0000 Subject: [PATCH 036/112] Generate Fortran stubs out of src and into PETSC_ARCH --- config/packages/sowing.py | 4 +- gmakefile | 42 +++--- gmakefile.test | 2 +- lib/slepc/bin/maint/generatefortranstubs.py | 157 ++++++++++---------- makefile | 16 +- 5 files changed, 116 insertions(+), 105 deletions(-) diff --git a/config/packages/sowing.py b/config/packages/sowing.py index 7aa027d28..0511ca55e 100644 --- a/config/packages/sowing.py +++ b/config/packages/sowing.py @@ -61,8 +61,8 @@ def Process(self,slepcconf,slepcvars,slepcrules,slepc,petsc,archdir=''): self.log.write('Using BFORT='+bfort) sys.path.insert(0, os.path.abspath(os.path.join('lib','slepc','bin','maint'))) import generatefortranstubs - generatefortranstubs.main(slepc.dir,bfort,os.getcwd(),0) - generatefortranstubs.processf90interfaces(slepc.dir,0) + generatefortranstubs.main(slepc.dir,petsc.archname,bfort,os.path.join(slepc.dir,'src'),0) + generatefortranstubs.processf90interfaces(slepc.dir,petsc.archname,0) except: self.log.Exit('Try configuring with --download-sowing or use a git version of PETSc') if bfort != petsc.bfort: diff --git a/gmakefile b/gmakefile index fbcb3324a..86c2c8a12 100644 --- a/gmakefile +++ b/gmakefile @@ -61,7 +61,7 @@ $(generated) : $(slepcconf) $(slepcvariables) $(PETSCCONFIGDIR)/gmakegen.py $(PYTHON) $(PETSCCONFIGDIR)/gmakegen.py --petsc-arch=$(PETSC_ARCH_DIR) --pkg-dir=$(SLEPC_DIR) --pkg-name=slepc --pkg-pkgs=$(spkgs) --pkg-arch=$(PETSC_ARCH) # Skip including generated files (which triggers rebuilding them) when we're just going to clean anyway. -ifneq ($(filter-out help clean check info gmakeinfo,$(MAKECMDGOALS:clean%=clean)),) +ifneq ($(filter-out alletags allfortranstubs help clean check info gmakeinfo,$(MAKECMDGOALS:clean%=clean)),) include $(generated) endif @@ -86,7 +86,7 @@ ifneq ($(KOKKOS_LIB),) langs += kokkos.cxx endif -concatlang = $(foreach lang, $(langs), $(srcs-$(1).$(lang):src/%.$(lang)=$(OBJDIR)/%.o)) +concatlang = $(foreach lang, $(langs), $(srcs-$(1).$(lang):%.$(lang)=$(OBJDIR)/%.o)) srcs.o := $(foreach pkg, $(pkgs), $(call concatlang,$(pkg))) concatlangsrc = $(foreach lang, $(langs), $(srcs-$(1).$(lang))) csrc := $(foreach pkg, $(pkgs), $(srcs-$(pkg).c)) @@ -185,27 +185,27 @@ $(call soname_function,%) : $(call libname_function,%) .PRECIOUS: $(call soname_function,%) -$(OBJDIR)/%.o : src/%.sycl.cxx | $$(@D)/.DIR +$(OBJDIR)/%.o : %.sycl.cxx | $$(@D)/.DIR $(PETSC_COMPILE.sycl.cxx) $(abspath $<) -o $@ -$(OBJDIR)/%.o : src/%.c | $$(@D)/.DIR +$(OBJDIR)/%.o : %.c | $$(@D)/.DIR $(PETSC_COMPILE.c) $(abspath $<) -o $@ -$(OBJDIR)/%.o : src/%.kokkos.cxx | $$(@D)/.DIR +$(OBJDIR)/%.o : %.kokkos.cxx | $$(@D)/.DIR $(PETSC_COMPILE.kokkos.cxx) $(abspath $<) -o $@ -$(OBJDIR)/%.o : src/%.cxx | $$(@D)/.DIR +$(OBJDIR)/%.o : %.cxx | $$(@D)/.DIR $(PETSC_COMPILE.cxx) $(abspath $<) -o $@ -$(OBJDIR)/%.o : src/%.hip.cpp | $$(@D)/.DIR +$(OBJDIR)/%.o : %.hip.cpp | $$(@D)/.DIR $(PETSC_COMPILE.hip.cpp) $(abspath $<) -o $@ -$(OBJDIR)/%.o : src/%.cu | $$(@D)/.DIR +$(OBJDIR)/%.o : %.cu | $$(@D)/.DIR $(PETSC_COMPILE.cu) $(abspath $<) -o $@ # Compile first so that if there is an error, it comes from a normal compile @$(PETSC_GENDEPS.cu) $(abspath $<) -o $(@:%.o=%.d) # Generate the dependencies for later FCMOD = cd -$(OBJDIR)/%.o : src/%.F | $$(@D)/.DIR +$(OBJDIR)/%.o : %.F | $$(@D)/.DIR ifeq ($(FC_MODULE_OUTPUT_FLAG),) $(call quiet,FCMOD) $(MODDIR) && $(FC) -c $(FC_FLAGS) $(FFLAGS) $(FCPPFLAGS) $(FC_DEPFLAGS) $(abspath $<) -o $(abspath $@) else @@ -213,7 +213,7 @@ else endif -@$(GFORTRAN_DEP_CLEANUP) -$(OBJDIR)/%.o : src/%.F90 | $$(@D)/.DIR +$(OBJDIR)/%.o : %.F90 | $$(@D)/.DIR ifeq ($(FC_MODULE_OUTPUT_FLAG),) $(call quiet,FCMOD) $(MODDIR) && $(FC) -c $(FC_FLAGS) $(FFLAGS) $(FCPPFLAGS) $(FC_DEPFLAGS) $(abspath $<) -o $(abspath $@) else @@ -222,17 +222,17 @@ endif -@$(GFORTRAN_DEP_CLEANUP) # Hack: manual dependencies on object files -$(OBJDIR)/sys/classes/bv/f90-mod/slepcbvmod.o : $(OBJDIR)/sys/f90-mod/slepcsysmod.o -$(OBJDIR)/sys/classes/fn/f90-mod/slepcfnmod.o : $(OBJDIR)/sys/f90-mod/slepcsysmod.o -$(OBJDIR)/sys/classes/rg/f90-mod/slepcrgmod.o : $(OBJDIR)/sys/f90-mod/slepcsysmod.o -$(OBJDIR)/sys/classes/ds/f90-mod/slepcdsmod.o : $(OBJDIR)/sys/classes/fn/f90-mod/slepcfnmod.o $(OBJDIR)/sys/classes/rg/f90-mod/slepcrgmod.o -$(OBJDIR)/sys/classes/st/f90-mod/slepcstmod.o : $(OBJDIR)/sys/classes/bv/f90-mod/slepcbvmod.o -$(OBJDIR)/mfn/f90-mod/slepcmfnmod.o : $(OBJDIR)/sys/classes/bv/f90-mod/slepcbvmod.o $(OBJDIR)/sys/classes/fn/f90-mod/slepcfnmod.o -$(OBJDIR)/lme/f90-mod/slepclmemod.o : $(OBJDIR)/sys/classes/bv/f90-mod/slepcbvmod.o -$(OBJDIR)/eps/f90-mod/slepcepsmod.o : $(OBJDIR)/sys/classes/bv/f90-mod/slepcbvmod.o $(OBJDIR)/sys/classes/fn/f90-mod/slepcfnmod.o $(OBJDIR)/sys/classes/ds/f90-mod/slepcdsmod.o $(OBJDIR)/sys/classes/rg/f90-mod/slepcrgmod.o $(OBJDIR)/sys/classes/st/f90-mod/slepcstmod.o $(OBJDIR)/lme/f90-mod/slepclmemod.o -$(OBJDIR)/pep/f90-mod/slepcpepmod.o : $(OBJDIR)/eps/f90-mod/slepcepsmod.o -$(OBJDIR)/nep/f90-mod/slepcnepmod.o : $(OBJDIR)/pep/f90-mod/slepcpepmod.o -$(OBJDIR)/svd/f90-mod/slepcsvdmod.o : $(OBJDIR)/eps/f90-mod/slepcepsmod.o +$(OBJDIR)/src/sys/classes/bv/f90-mod/slepcbvmod.o : $(OBJDIR)/src/sys/f90-mod/slepcsysmod.o +$(OBJDIR)/src/sys/classes/fn/f90-mod/slepcfnmod.o : $(OBJDIR)/src/sys/f90-mod/slepcsysmod.o +$(OBJDIR)/src/sys/classes/rg/f90-mod/slepcrgmod.o : $(OBJDIR)/src/sys/f90-mod/slepcsysmod.o +$(OBJDIR)/src/sys/classes/ds/f90-mod/slepcdsmod.o : $(OBJDIR)/src/sys/classes/fn/f90-mod/slepcfnmod.o $(OBJDIR)/src/sys/classes/rg/f90-mod/slepcrgmod.o +$(OBJDIR)/src/sys/classes/st/f90-mod/slepcstmod.o : $(OBJDIR)/src/sys/classes/bv/f90-mod/slepcbvmod.o +$(OBJDIR)/src/mfn/f90-mod/slepcmfnmod.o : $(OBJDIR)/src/sys/classes/bv/f90-mod/slepcbvmod.o $(OBJDIR)/src/sys/classes/fn/f90-mod/slepcfnmod.o +$(OBJDIR)/src/lme/f90-mod/slepclmemod.o : $(OBJDIR)/src/sys/classes/bv/f90-mod/slepcbvmod.o +$(OBJDIR)/src/eps/f90-mod/slepcepsmod.o : $(OBJDIR)/src/sys/classes/bv/f90-mod/slepcbvmod.o $(OBJDIR)/src/sys/classes/fn/f90-mod/slepcfnmod.o $(OBJDIR)/src/sys/classes/ds/f90-mod/slepcdsmod.o $(OBJDIR)/src/sys/classes/rg/f90-mod/slepcrgmod.o $(OBJDIR)/src/sys/classes/st/f90-mod/slepcstmod.o $(OBJDIR)/src/lme/f90-mod/slepclmemod.o +$(OBJDIR)/src/pep/f90-mod/slepcpepmod.o : $(OBJDIR)/src/eps/f90-mod/slepcepsmod.o +$(OBJDIR)/src/nep/f90-mod/slepcnepmod.o : $(OBJDIR)/src/pep/f90-mod/slepcpepmod.o +$(OBJDIR)/src/svd/f90-mod/slepcsvdmod.o : $(OBJDIR)/src/eps/f90-mod/slepcepsmod.o # all sources should get recompiled when slepcvariables changes (i.e when configure is rerun or when slepcvariables is manually edited.) $(srcs.o) : $(slepcvariables) diff --git a/gmakefile.test b/gmakefile.test index 984bc196a..3eee4e3d8 100644 --- a/gmakefile.test +++ b/gmakefile.test @@ -116,7 +116,7 @@ endif $(generatedtest) : $(slepcconf) $(slepcvariables) $(PETSCCONFIGDIR)/gmakegentest.py $(TESTDIR)/.DIR | $$(@D)/.DIR $(PYTHON) $(PETSCCONFIGDIR)/gmakegentest.py --petsc-dir=$(PETSC_DIR) --petsc-arch=$(PETSC_ARCH_DIR) --testdir=$(TESTDIR) --srcdir=$(TESTSRCDIR) --pkg-name=slepc --pkg-pkgs=$(spkgs) --pkg-arch=$(PETSC_ARCH) --pkg-dir=$(SLEPC_DIR) -ifneq ($(filter-out help clean check info gmakeinfo slepc_libs all install install-lib checkbadSource checkbadFileChange allfortranstubs alletags get%,$(MAKECMDGOALS:clean%=clean)),) +ifneq ($(filter-out help clean check info gmakeinfo slepc_libs all install install-lib checkbadSource checkbadFileChange deletefortranstubs allfortranstubs alletags get%,$(MAKECMDGOALS:clean%=clean)),) include $(generatedtest) endif diff --git a/lib/slepc/bin/maint/generatefortranstubs.py b/lib/slepc/bin/maint/generatefortranstubs.py index b22a49382..8e872d59a 100644 --- a/lib/slepc/bin/maint/generatefortranstubs.py +++ b/lib/slepc/bin/maint/generatefortranstubs.py @@ -1,12 +1,13 @@ #!/usr/bin/env python3 #!/bin/env python3 # -# Generates fortran stubs for PETSc using Sowings bfort program +# Generates fortran stubs for PETSc using the Sowing bfort program # from __future__ import print_function import os import subprocess +from subprocess import check_output # def FixFile(filename): @@ -63,7 +64,7 @@ def FindSource(filename): shutil.copystat(sourcefile, filename) return -def FixDir(petscdir,dir,verbose): +def FixDir(petscdir,petscarch,parentdir,dir,verbose): ''' Fixes a directory of files generated by bfort. + Fixes the C stub files to be compilable C + Generates a makefile @@ -75,7 +76,6 @@ def FixDir(petscdir,dir,verbose): bfortsubmansec = 'unknown' cnames = [] hnames = [] - parentdir = os.path.abspath(os.path.join(dir,'..')) for f in os.listdir(dir): ext = os.path.splitext(f)[1] if ext == '.c' or ext == '.cxx': @@ -83,44 +83,47 @@ def FixDir(petscdir,dir,verbose): cnames.append(f) elif ext == '.h90': hnames.append(f) - if (cnames != [] or hnames != []): - mfile=os.path.abspath(os.path.join(parentdir,'makefile')) - try: - fd=open(mfile,'r') - except: - print('Error! missing file:', mfile) - return - inbuf = fd.read() - fd.close() - cppflags = "" - libbase = "" - for line in inbuf.splitlines(): - if line.find('CPPFLAGS') >=0: - cppflags = line - if line.find('LIBBASE') >=0: - libbase = line - elif line.find('SUBMANSEC') >=0: - submansec = line.split('=')[1].lower().strip() - elif line.find('BFORTSUBMANSEC') >=0: - bfortsubmansec = line.split('=')[1].lower().strip() - elif line.find('MANSEC') >=0: - submansec = line.split('=')[1].lower().strip() - if line.find('MANSEC') >=0 and not line.find('SUBMANSEC') >=0: - mansec = line.split('=')[1].lower().strip() + if cnames == [] and hnames == []: + for filename in [f for f in os.listdir(parentdir) if re.match(r'f90module[0-9]+.f90', f)]: + os.remove(os.path.join(parentdir, filename)) + return - if not bfortsubmansec == 'unknown': - submansec = bfortsubmansec + mfile=os.path.abspath(os.path.join(parentdir,'makefile')) + try: + fd=open(mfile,'r') + except: + print('Error! missing file:', mfile) + return + inbuf = fd.read() + fd.close() + cppflags = "" + libbase = "" - # now assemble the makefile - outbuf = '\n' - outbuf += "#requiresdefine 'PETSC_USE_FORTRAN_BINDINGS'\n" - outbuf += cppflags + '\n' - outbuf += libbase + '\n' - outbuf += 'include ${SLEPC_DIR}/lib/slepc/conf/slepc_common\n' + # new makefile will be created from outbuf + outbuf = '\n' + outbuf += "#requiresdefine 'PETSC_USE_FORTRAN_BINDINGS'\n" + for line in inbuf.splitlines(): + if line.startswith('#requires'): + outbuf += line + '\n' + if line.find('CPPFLAGS') >=0: + outbuf += line + '\n' + if line.find('LIBBASE') >=0: + outbuf += line + '\n' + elif line.find('SUBMANSEC') >=0: + submansec = line.split('=')[1].lower().strip() + elif line.find('BFORTSUBMANSEC') >=0: + bfortsubmansec = line.split('=')[1].lower().strip() + elif line.find('MANSEC') >=0: + submansec = line.split('=')[1].lower().strip() + if line.find('MANSEC') >=0 and not line.find('SUBMANSEC') >=0: + mansec = line.split('=')[1].lower().strip() - ff = open(os.path.join(dir, 'makefile'), 'w') - ff.write(outbuf) - ff.close() + if not bfortsubmansec == 'unknown': + submansec = bfortsubmansec + + ff = open(os.path.join(dir, 'makefile'), 'w') + ff.write(outbuf) + ff.close() # if dir is empty - remove it if os.path.exists(dir) and os.path.isdir(dir) and os.listdir(dir) == []: @@ -135,24 +138,25 @@ def FixDir(petscdir,dir,verbose): txt = fd.read() fd.close() if txt: + if mansec == 'unknown': raise RuntimeError("Cannot have unknown mansec in " + parentdir) if mansec in ['bv','ds','fn','rg','st']: - basedir = os.path.join(petscdir,'src','sys','classes',mansec,'f90-mod','ftn-auto-interfaces') + basedir = os.path.join(petscdir,petscarch,'src','sys','classes',mansec,'f90-mod','ftn-auto-interfaces') else: - basedir = os.path.join(petscdir,'src',mansec,'f90-mod','ftn-auto-interfaces') - if not os.path.isdir(basedir): os.mkdir(basedir) - if not os.path.isdir(os.path.join(basedir,submansec+'-tmpdir')): os.mkdir(os.path.join(basedir,submansec+'-tmpdir')) + basedir = os.path.join(petscdir,petscarch,'src',mansec,'f90-mod','ftn-auto-interfaces') + if not os.path.isdir(basedir): os.makedirs(basedir) + if not os.path.isdir(os.path.join(basedir,submansec+'-tmpdir')): os.makedirs(os.path.join(basedir,submansec+'-tmpdir')) fname = os.path.join(basedir,submansec+'-tmpdir',os.path.relpath(parentdir,petscdir).replace('/','_')+'.h90') with open(fname,'a') as fd: fd.write(txt) os.remove(modfile) def PrepFtnDir(dir): - ''' Generate a ftn-auto directory if needed''' + ''' Generate a ftn-auto directory if needed. Deletes anything currently in the directory''' import shutil if os.path.exists(dir) and not os.path.isdir(dir): raise RuntimeError('Error - specified path is not a dir: ' + dir) elif not os.path.exists(dir): - os.mkdir(dir) + os.makedirs(dir) else: files = os.listdir(dir) for file in files: @@ -160,35 +164,25 @@ def PrepFtnDir(dir): else: os.remove(os.path.join(dir,file)) return -def processDir(petscdir, bfort, verbose, dirpath, dirnames, filenames): +def processDir(petscdir, petscarch, bfort, verbose, dirpath, dirnames, filenames): ''' Runs bfort on a directory and then fixes the files generated by bfort including moving generated F90 fortran interface files''' - outdir = os.path.join(dirpath,'ftn-auto') - newls = [l for l in filenames if os.path.splitext(l)[1] in ['.c','.h','.cxx','.cu']] - if newls: + if not dirpath.startswith(petscdir): raise RuntimeError("Error, the directory being processed "+dirpath+" does not begin with SLEPC_DIR "+petscdir) + sdirpath = dirpath.replace(petscdir+'/','') + outdir = os.path.join(petscdir,petscarch,sdirpath,'ftn-auto') + if filenames: PrepFtnDir(outdir) options = ['-dir '+outdir, '-mnative', '-ansi', '-nomsgs', '-noprofile', '-anyname', '-mapptr', '-mpi', '-shortargname', '-ferr', '-ptrprefix Petsc', '-ptr64 PETSC_USE_POINTER_CONVERSION', '-fcaps PETSC_HAVE_FORTRAN_CAPS', '-fuscore PETSC_HAVE_FORTRAN_UNDERSCORE', '-f90mod_skip_header','-on_error_abort'] split_ct = 10 - for i in range(0, len(newls), split_ct): - cmd = 'BFORT_CONFIG_PATH='+os.path.join(petscdir,'lib','slepc','conf')+' '+bfort+' '+' '.join(options+newls[i:i+split_ct])+' -f90modfile f90module'+str(i)+'.f90' + for i in range(0, len(filenames), split_ct): + cmd = 'BFORT_CONFIG_PATH='+os.path.join(petscdir,'lib','slepc','conf')+' '+bfort+' '+' '.join(options+filenames[i:i+split_ct])+' -f90modfile f90module'+str(i)+'.f90' try: - output = subprocess.check_output(cmd, cwd=dirpath, shell=True, stderr=subprocess.STDOUT) + output = check_output(cmd, cwd=dirpath, shell=True, stderr=subprocess.STDOUT) except subprocess.CalledProcessError as e: raise SystemError(str(e)+'\nIn '+dirpath+'\n'+e.output.decode(encoding='UTF-8',errors='replace')); - FixDir(petscdir,outdir,verbose) - - # remove from list of subdirectories all directories without source code - dirnames[:] = [name for name in dirnames - if name not in ['SCCS', 'output', 'BitKeeper', 'examples', 'externalpackages', 'bilinear', 'ftn-auto','ftn-auto-interfaces', 'fortran','bin','maint','ftn-custom','config','f90-custom','ftn-kernels'] - and not name.startswith(".") - # skip for ./configure generated $PETSC_ARCH directories - and not os.path.isdir(os.path.join(dirpath,name,'lib','slepc')) - and not os.path.isdir(os.path.join(dirpath,name,'lib','slepc-conf')) - and not os.path.isdir(os.path.join(dirpath,name,'conf')) - # skip include/slepc directory - and name != 'slepc'] + FixDir(petscdir,petscarch,dirpath,outdir,verbose) return def updatePetscTypesFromMansec(types, path): @@ -209,7 +203,7 @@ def checkHandWrittenF90Interfaces(badSrc, path): with open(os.path.join(path,file),'r') as fdr: lineno = 1 raw = fdr.read() - for ibuf in re.split(r'(?i)\n\s*interface',raw): + for ibuf in re.split('(?i)\n\\s*interface',raw): res = re.search(r'(.*)(\s+end\s+interface)',ibuf,flags=re.DOTALL|re.IGNORECASE) try: lines = res.group(0).split('\n') @@ -224,24 +218,28 @@ def checkHandWrittenF90Interfaces(badSrc, path): lineno = lineno+ibuf.count('\n') return badSrc -def processf90interfaces(petscdir,verbose): +def processf90interfaces(petscdir,petscarch,verbose): import shutil ''' Takes all the individually generated fortran interface files and merges them into one for each mansec''' ptypes = set() mansecs1 = ['bv','ds','fn','rg','st'] mansecs2 = ['sys','eps','svd','pep','nep','mfn','lme'] - mansecF90Dirs = [os.path.join(petscdir,'src','sys','classes',ms,'f90-mod') for ms in mansecs1] - mansecF90Dirs = mansecF90Dirs + [os.path.join(petscdir,'src',ms,'f90-mod') for ms in mansecs2] badSrc = [] - for msfd in mansecF90Dirs: - badSrc = checkHandWrittenF90Interfaces(badSrc, msfd) - ptypes = updatePetscTypesFromMansec(ptypes,msfd) + for ms in mansecs1: + badSrc = checkHandWrittenF90Interfaces(badSrc,os.path.join(petscdir,'src','sys','classes',ms,'f90-mod')) + ptypes = updatePetscTypesFromMansec(ptypes,os.path.join(petscdir,'src','sys','classes',ms,'f90-mod')) + for ms in mansecs2: + badSrc = checkHandWrittenF90Interfaces(badSrc,os.path.join(petscdir,'src',ms,'f90-mod')) + ptypes = updatePetscTypesFromMansec(ptypes,os.path.join(petscdir,'src',ms,'f90-mod')) ptypes.update(['tDM','tVecScatter','tKSPGuess','tDMLabel','tISColoring','tIS','tPetscSection','PetscSFNode','tPC','tTSAdapt','tPetscRandom','tVecTagger','tTSTrajectory','tMatFDColoring','tMat','tTS','tVec','tMatNullSpace','tPetscConvEst','tPetscSubcomm','tPetscSectionSym','tPetscSF','tKSP','tPetscViewer','tPetscOptions','tSNES','tDMPlexCellRefiner']) for src in badSrc: print('Importing entire package: "'+src[0]+'" line '+str(src[1])+' file '+src[2]) if len(badSrc): raise RuntimeError - for msfd in mansecF90Dirs: - msfad = os.path.join(msfd,'ftn-auto-interfaces') + for ms in mansecs1+mansecs2: + if ms in mansecs1: + msfad = os.path.join(petscdir,petscarch,'src','sys','classes',ms,'f90-mod','ftn-auto-interfaces') + else: + msfad = os.path.join(petscdir,petscarch,'src',ms,'f90-mod','ftn-auto-interfaces') for submansec in os.listdir(msfad): if verbose: print('Processing F90 interface for '+submansec) if os.path.isdir(os.path.join(msfad,submansec)): @@ -263,10 +261,11 @@ def processf90interfaces(petscdir,verbose): # FixDir(petscdir,os.path.join(petscdir,'include','slepc','finclude','ftn-auto-interfaces'),verbose) return -def main(petscdir,bfort,dir,verbose): - for dirpath, dirnames, filenames in os.walk(dir): - fnames = [i for i in filenames if not i.find('#') > -1] - processDir(petscdir, bfort, verbose, dirpath, dirnames, fnames) +def main(petscdir,petscarch,bfort,dir,verbose): + for dirpath, dirnames, filenames in os.walk(dir, topdown=True): + filenames = [i for i in filenames if not i.find('#') > -1 and os.path.splitext(i)[1] in ['.c','.h','.cxx','.cu']] + dirnames[:] = [d for d in dirnames if d not in ['output','tutorials','tests','binding','benchmarks'] and not d.startswith('ftn-') and not d.startswith('f90-')] + processDir(petscdir, petscarch,bfort, verbose, dirpath, dirnames, filenames) return # # generatefortranstubs bfortexectuable -verbose ----- generates fortran stubs for a directory and all its children @@ -276,9 +275,11 @@ def main(petscdir,bfort,dir,verbose): import sys if len(sys.argv) < 2: sys.exit('Must give the BFORT program or -merge as the first argument') petscdir = os.environ['SLEPC_DIR'] + if 'PETSC_ARCH' in os.environ: petscarch = os.environ['PETSC_ARCH'] + else: petscarch = '' if len(sys.argv) > 2: verbose = 1 else: verbose = 0 if not sys.argv[1].startswith('-'): - main(petscdir,sys.argv[1],os.getcwd(),verbose) + main(petscdir,petscarch,sys.argv[1],os.path.join(petscdir,'src'),verbose) else: - processf90interfaces(petscdir,verbose) + processf90interfaces(petscdir,petscarch,verbose) diff --git a/makefile b/makefile index d99249a64..7f196dca8 100644 --- a/makefile +++ b/makefile @@ -96,12 +96,22 @@ chk_slepcdir: allfortranstubs: -@${RM} -rf ${PETSC_ARCH}/include/slepc/finclude/ftn-auto/*-tmpdir - @${PYTHON} ${SLEPC_DIR}/lib/slepc/bin/maint/generatefortranstubs.py ${BFORT} ${VERBOSE} - -@${PYTHON} ${SLEPC_DIR}/lib/slepc/bin/maint/generatefortranstubs.py -merge ${VERBOSE} + @${PYTHON} lib/slepc/bin/maint/generatefortranstubs.py ${BFORT} ${VERBOSE} + -@${PYTHON} lib/slepc/bin/maint/generatefortranstubs.py -merge ${VERBOSE} + -@${RM} -rf ${PETSC_ARCH}/include/slepc/finclude/ftn-auto/*-tmpdir + +#copy of allfortranstubs with PETSC_ARCH='' +allfortranstubstarball: + -@${RM} -rf include/slepc/finclude/ftn-auto/*-tmpdir + @PETSC_ARCH='' ${PYTHON} lib/slepc/bin/maint/generatefortranstubs.py ${BFORT} ${VERBOSE} + -@PETSC_ARCH='' ${PYTHON} lib/slepc/bin/maint/generatefortranstubs.py -merge ${VERBOSE} -@${RM} -rf include/slepc/finclude/ftn-auto/*-tmpdir deletefortranstubs: - -@find . -type d -name ftn-auto | xargs rm -rf + -@find src -type d -name ftn-auto* | xargs rm -rf + -@if [ -x ${PETSC_ARCH} ]; then \ + find ${PETSC_ARCH}/src -type d -name ftn-auto* | xargs rm -rf ;\ + fi reconfigure: allclean @unset MAKEFLAGS && ${PYTHON} ${PETSC_ARCH}/lib/slepc/conf/reconfigure-${PETSC_ARCH}.py From e78b1a6a7f8fd3b5930b8ff3fee37eee7429929a Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Tue, 11 Jul 2023 15:36:35 +0200 Subject: [PATCH 037/112] EPS: fix the implementation of the -eps_view_mat0/1 option If the option is not provided, it should not do EPSGetOperators() as it may fail in some exceptional cases. --- src/eps/interface/epssolve.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/eps/interface/epssolve.c b/src/eps/interface/epssolve.c index 6ccea9d7a..2d33a926a 100644 --- a/src/eps/interface/epssolve.c +++ b/src/eps/interface/epssolve.c @@ -121,6 +121,7 @@ static PetscErrorCode EPSComputeValues(EPS eps) PetscErrorCode EPSSolve(EPS eps) { PetscInt i; + PetscBool hasname; STMatMode matmode; Mat A,B; @@ -185,9 +186,19 @@ PetscErrorCode EPSSolve(EPS eps) PetscCall(EPSErrorViewFromOptions(eps)); PetscCall(EPSValuesViewFromOptions(eps)); PetscCall(EPSVectorsViewFromOptions(eps)); - PetscCall(EPSGetOperators(eps,&A,&B)); - PetscCall(MatViewFromOptions(A,(PetscObject)eps,"-eps_view_mat0")); - if (eps->isgeneralized) PetscCall(MatViewFromOptions(B,(PetscObject)eps,"-eps_view_mat1")); + + PetscCall(PetscOptionsHasName(NULL,NULL,"-eps_view_mat0",&hasname)); + if (hasname) { + PetscCall(EPSGetOperators(eps,&A,NULL)); + PetscCall(MatViewFromOptions(A,(PetscObject)eps,"-eps_view_mat0")); + } + if (eps->isgeneralized) { + PetscCall(PetscOptionsHasName(NULL,NULL,"-eps_view_mat1",&hasname)); + if (hasname) { + PetscCall(EPSGetOperators(eps,NULL,&B)); + PetscCall(MatViewFromOptions(B,(PetscObject)eps,"-eps_view_mat1")); + } + } /* Remove deflation and initial subspaces */ if (eps->nds) { From cb05ade3557fc6f3554bc7db65fb4e57abb2a80a Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Tue, 11 Jul 2023 15:44:36 +0200 Subject: [PATCH 038/112] CI: temporarily disable tests in the GPU server --- .gitlab-ci.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 104a848e2..565e8dc8c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -212,7 +212,7 @@ gnu-lint: - bash -c "${PYTHON} ./configure ${SLEPC_CONFIG_OPTS}" - make CFLAGS="${MAKE_CFLAGS}" CXXFLAGS="${MAKE_CXXFLAGS}" FFLAGS="${MAKE_FFLAGS}" CUDAFLAGS="${MAKE_CUDAFLAGS}" - if [ ! -z ${INSTALL+x} ]; then make install; SLEPC_DIR=$INSTALL_DIR; fi - - make CFLAGS="${MAKE_CFLAGS}" CXXFLAGS="${MAKE_CXXFLAGS}" FFLAGS="${MAKE_FFLAGS}" CUDAFLAGS="${MAKE_CUDAFLAGS}" check + - if [ -z ${DISABLE_TESTS+x} ]; then make CFLAGS="${MAKE_CFLAGS}" CXXFLAGS="${MAKE_CXXFLAGS}" FFLAGS="${MAKE_FFLAGS}" CUDAFLAGS="${MAKE_CUDAFLAGS}" check; fi - if [ ! -z ${PKG_CONFIG+x} ]; then make check_usermakefile PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$PETSC_DIR/$PETSC_ARCH/lib/pkgconfig; fi - if [ ! -z ${BUILD_DOCS+x} ]; then make alldoc LOC=$SLEPC_DIR; tar czf ${CI_JOB_NAME}-docs.tar.gz --exclude "*.out" --exclude "makefile*" --exclude "ftn-*" --exclude slepc4py docs include src; fi - if [ ! -z ${BUILD_DOCS+x} ] && [ ! -z ${SLEPC4PY+x} ]; then make -C src/binding/slepc4py rst2html sphinx-html sphinx-pdf PYTHON=${PYTHON}; tar czf ${CI_JOB_NAME}-docs-py.tar.gz -C src/binding/slepc4py docs; fi @@ -220,7 +220,7 @@ gnu-lint: - echo -e "section_start:`date +%s`:tests_slepc\r\e[0KSLEPc test suite" - if [ ! -z ${SLEPC4PY+x} ]; then make slepc4pytest; make -C src/binding/slepc4py/demo PYTHON=${PYTHON}; fi - if [ -z ${DISABLE_TESTS+x} ]; then make cleantest; make CFLAGS="${MAKE_CFLAGS}" CXXFLAGS="${MAKE_CXXFLAGS}" FFLAGS="${MAKE_FFLAGS}" CUDAFLAGS="${MAKE_CUDAFLAGS}" allgtests-tap TIMEOUT=${TIMEOUT} ${TEST_OPTS}; fi - - if [ ! -z ${COVERAGE+x} ]; then lcov --capture --exclude "/usr/*" --directory $SLEPC_DIR --output-file coverage.info; genhtml coverage.info --legend --title SLEPc --output-directory coverage; tar czf ${CI_JOB_NAME}-cov.tar.gz coverage; fi + - if [ ! -z ${COVERAGE+x} -a -z ${DISABLE_TESTS+x} ]; then lcov --capture --exclude "/usr/*" --directory $SLEPC_DIR --output-file coverage.info; genhtml coverage.info --legend --title SLEPc --output-directory coverage; tar czf ${CI_JOB_NAME}-cov.tar.gz coverage; fi - echo -e "section_end:`date +%s`:tests_slepc\r\e[0K" artifacts: reports: @@ -367,6 +367,7 @@ gnu-c-cuda: - linux-ubuntu, gpu:nvidia, name:hapy variables: PETSC_CONFIG_OPTS: --with-fortran-bindings=0 --with-cuda --download-mumps --download-scalapack --download-metis --download-parmetis --download-suitesparse --with-magma-dir=/usr/local/opt/magma-2.7.1 + DISABLE_TESTS: 1 clang-c: extends: @@ -482,6 +483,7 @@ gnu-c-cuda-complex: variables: PETSC_CONFIG_OPTS: --with-scalar-type=complex --with-cuda --with-magma-dir=/usr/local/opt/magma-2.7.1 TEST_OPTS: -j1 -l6 query=requires queryval=cuda + DISABLE_TESTS: 1 gnu-c-cuda-single: extends: @@ -492,6 +494,7 @@ gnu-c-cuda-single: variables: PETSC_CONFIG_OPTS: --with-precision=single --with-single-library=0 --with-cuda TEST_OPTS: -j1 -l6 query=requires queryval=cuda + DISABLE_TESTS: 1 gnu-c-multilib: extends: @@ -631,6 +634,7 @@ gnu-c-complex-coverage: PETSC_CONFIG_OPTS: --with-fortran-bindings=0 --with-scalar-type=complex --with-debugging=1 --with-coverage=1 SLEPC_CONFIG_OPTS: --DATAFILESPATH=/var/local --with-packages-download-dir=/var/local/downloads --with-arpack-dir=/usr/local/opt/arpack-ng-3.8.0 --with-primme-dir=/usr/local/opt/primme-3.2 --download-blopex --download-hpddm COVERAGE: 1 + DISABLE_TESTS: 1 intel-c-complex-int64-mkl: extends: @@ -654,6 +658,7 @@ nvidia-c-nompi: PETSC_CONFIG_OPTS: --with-cc=nvc --with-fc=nvfortran --with-cxx=nvc++ --with-mpi=0 --with-cuda --with-magma-dir=/usr/local/opt/magma-2.7.1 SLEPC_CONFIG_OPTS: --DATAFILESPATH=/var/local --with-packages-download-dir=/var/local/downloads --download-blopex --download-primme=/var/local/downloads/primme-3.2.tar.gz --download-arpack TEST_OPTS: -j4 -l12 + DISABLE_TESTS: 1 gnu-c-complex-valgrind: extends: @@ -687,6 +692,7 @@ nvidia-c-complex-nompi: PETSC_CONFIG_OPTS: --with-cc=nvc --with-fc=nvfortran --with-cxx=nvc++ --with-scalar-type=complex --with-mpi=0 --with-cuda --with-magma-dir=/usr/local/opt/magma-2.7.1 SLEPC_CONFIG_OPTS: --DATAFILESPATH=/var/local --with-packages-download-dir=/var/local/downloads --download-blopex --download-primme --download-arpack TEST_OPTS: -j4 -l12 + DISABLE_TESTS: 1 nvidia-cxx-mpi: extends: @@ -699,6 +705,7 @@ nvidia-cxx-mpi: PETSC_CONFIG_OPTS: --with-cc=mpicc --with-fc=mpifort --with-cxx=mpicxx --with-clanguage=c++ --with-cuda --with-magma-dir=/usr/local/opt/magma-2.7.1 SLEPC_CONFIG_OPTS: --DATAFILESPATH=/var/local --with-packages-download-dir=/var/local/downloads --download-blopex --download-primme --download-arpack TEST_OPTS: -j4 -l12 + DISABLE_TESTS: 1 intel-c-mkl-install: extends: @@ -742,6 +749,7 @@ gnu-c-cuda-int64: PETSC_CONFIG_OPTS: --with-cuda --with-64-bit-indices --with-magma-dir=/usr/local/opt/magma-2.7.1 TEST_OPTS: -j2 -l6 query=requires queryval=cuda MAKE_CUDAFLAGS: --compiler-options -Wall,-Wunused-parameter,-Wno-deprecated-declarations,-Werror + DISABLE_TESTS: 1 gnu-c-nocxx: extends: From 0e374596108e6a28cb2c2c557a9d83a46410d932 Mon Sep 17 00:00:00 2001 From: Pierre Jolivet Date: Tue, 11 Jul 2023 07:08:39 +0200 Subject: [PATCH 039/112] configure: add --with-fortran-bindings-inplace --- .gitlab-ci.yml | 2 +- config/packages/sowing.py | 16 ++++++++++++---- makefile | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 19346a89c..56cee58d0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -387,7 +387,7 @@ gnu-c-complex-multilib: - linux-ubuntu, name:maat variables: PETSC_CONFIG_OPTS: --with-scalar-type=complex --with-single-library=0 --download-elemental --download-metis --download-parmetis --download-scalapack - SLEPC_CONFIG_OPTS: --DATAFILESPATH=/var/local --with-packages-download-dir=/var/local/downloads --download-elpa + SLEPC_CONFIG_OPTS: --DATAFILESPATH=/var/local --with-packages-download-dir=/var/local/downloads --download-elpa --with-fortran-bindings-inplace intel-c-complex-mkl: extends: diff --git a/config/packages/sowing.py b/config/packages/sowing.py index 0511ca55e..1dd7b97e0 100644 --- a/config/packages/sowing.py +++ b/config/packages/sowing.py @@ -17,6 +17,7 @@ def __init__(self,argdb,log): package.Package.__init__(self,argdb,log) self.packagename = 'sowing' self.downloadable = True + self.inplace = False #self.gitcommit = '7e1bbd0d8427274768a13849372ce0ee911f4ac5' self.version = '1.1.26-p7' obj = self.version if hasattr(self,'version') else self.gitcommit @@ -24,10 +25,17 @@ def __init__(self,argdb,log): self.archive = 'sowing-'+obj+'.tar.gz' self.ProcessArgs(argdb) + def ProcessArgs(self,argdb): + value,found = argdb.PopBool('with-fortran-bindings-inplace') + if found: + self.inplace = value + package.Package.ProcessArgs(self,argdb) + def ShowHelp(self): wd = package.Package.wd print(' --download-sowing[=]'.ljust(wd)+': Download and install SOWING') - print(' The latter is needed (for Fortran) only if using a git version of SLEPc and a non-git version of PETSc') + print(' The latter is needed (for Fortran) only if using a Git version of SLEPc and a non-Git version of PETSc') + print(' --with-fortran-bindings-inplace=: Generate Fortran bindings in SLEPc source tree') def DownloadAndInstall(self,slepc,petsc,archdir): name = self.packagename.upper() @@ -61,10 +69,10 @@ def Process(self,slepcconf,slepcvars,slepcrules,slepc,petsc,archdir=''): self.log.write('Using BFORT='+bfort) sys.path.insert(0, os.path.abspath(os.path.join('lib','slepc','bin','maint'))) import generatefortranstubs - generatefortranstubs.main(slepc.dir,petsc.archname,bfort,os.path.join(slepc.dir,'src'),0) - generatefortranstubs.processf90interfaces(slepc.dir,petsc.archname,0) + generatefortranstubs.main(slepc.dir,'' if self.inplace else petsc.archname,bfort,os.path.join(slepc.dir,'src'),0) + generatefortranstubs.processf90interfaces(slepc.dir,'' if self.inplace else petsc.archname,0) except: - self.log.Exit('Try configuring with --download-sowing or use a git version of PETSc') + self.log.Exit('Try configuring with --download-sowing or use a Git version of PETSc') if bfort != petsc.bfort: slepcvars.write('BFORT = '+bfort+'\n') diff --git a/makefile b/makefile index 7f196dca8..3e4b2f6e1 100644 --- a/makefile +++ b/makefile @@ -101,7 +101,7 @@ allfortranstubs: -@${RM} -rf ${PETSC_ARCH}/include/slepc/finclude/ftn-auto/*-tmpdir #copy of allfortranstubs with PETSC_ARCH='' -allfortranstubstarball: +allfortranstubsinplace: -@${RM} -rf include/slepc/finclude/ftn-auto/*-tmpdir @PETSC_ARCH='' ${PYTHON} lib/slepc/bin/maint/generatefortranstubs.py ${BFORT} ${VERBOSE} -@PETSC_ARCH='' ${PYTHON} lib/slepc/bin/maint/generatefortranstubs.py -merge ${VERBOSE} From 2552db1b515d1874316f973e256c1749db65ccc4 Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Wed, 12 Jul 2023 11:29:01 +0200 Subject: [PATCH 040/112] No extra blanks in test harness rules --- src/eps/tutorials/ex7.c | 2 +- src/svd/tests/test4.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/eps/tutorials/ex7.c b/src/eps/tutorials/ex7.c index b876b3065..4c32795c0 100644 --- a/src/eps/tutorials/ex7.c +++ b/src/eps/tutorials/ex7.c @@ -207,7 +207,7 @@ int main(int argc,char **argv) timeoutfactor: 2 test: - suffix: 3 # test problem (A,A) + suffix: 3 # test problem (A,A) args: -f1 ${SLEPC_DIR}/share/slepc/datafiles/matrices/bfw62a.petsc -f2 ${SLEPC_DIR}/share/slepc/datafiles/matrices/bfw62a.petsc -eps_nev 4 -terse requires: double !complex !defined(PETSC_USE_64BIT_INDICES) diff --git a/src/svd/tests/test4.c b/src/svd/tests/test4.c index 3696e1e99..ca0c57539 100644 --- a/src/svd/tests/test4.c +++ b/src/svd/tests/test4.c @@ -162,7 +162,7 @@ int main(int argc,char **argv) requires: scalapack testset: - args: -svd_monitor_cancel -mat_type aijcusparse + args: -svd_monitor_cancel -mat_type aijcusparse requires: cuda !single filter: grep -v "Transpose mode" | sed -e "s/seqaijcusparse/seqaij/" output_file: output/test4_1.out From 23ff1648a9b0a9665f4db94df661bcd4a9a9f1d4 Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Thu, 13 Jul 2023 11:39:32 +0200 Subject: [PATCH 041/112] gitlab-ci: updates required with new installation of GPU runner --- .gitlab-ci.yml | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 565e8dc8c..606509c89 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -47,6 +47,7 @@ variables: - nproc - lscpu - ccache --zero-stats + - if [ ! -z ${LOAD_MODULES+x} ]; then module load ${LOAD_MODULES}; module list; fi - printf "PYTHON:${PYTHON}\n" script: - printf "PETSC_CONFIG_OPTS:${PETSC_CONFIG_OPTS}\n" @@ -122,8 +123,9 @@ variables: gnu-c-single-nofort: extends: .stage-1 tags: - - linux-ubuntu, name:hapy + - name:hapy variables: + LOAD_MODULES: mpi PETSC_CONFIG_OPTS: --with-fc=0 --with-precision=single TEST_SEARCH: eps_tests-test10_1 @@ -364,8 +366,9 @@ gnu-c-cuda: - .stage-2 - .linux_test tags: - - linux-ubuntu, gpu:nvidia, name:hapy + - gpu:nvidia, name:hapy variables: + LOAD_MODULES: mpi PETSC_CONFIG_OPTS: --with-fortran-bindings=0 --with-cuda --download-mumps --download-scalapack --download-metis --download-parmetis --download-suitesparse --with-magma-dir=/usr/local/opt/magma-2.7.1 DISABLE_TESTS: 1 @@ -479,8 +482,9 @@ gnu-c-cuda-complex: - .stage-3 - .linux_test tags: - - linux-ubuntu, gpu:nvidia, name:hapy + - gpu:nvidia, name:hapy variables: + LOAD_MODULES: mpi PETSC_CONFIG_OPTS: --with-scalar-type=complex --with-cuda --with-magma-dir=/usr/local/opt/magma-2.7.1 TEST_OPTS: -j1 -l6 query=requires queryval=cuda DISABLE_TESTS: 1 @@ -490,8 +494,9 @@ gnu-c-cuda-single: - .stage-3 - .linux_test tags: - - linux-ubuntu, gpu:nvidia, name:hapy + - gpu:nvidia, name:hapy variables: + LOAD_MODULES: mpi PETSC_CONFIG_OPTS: --with-precision=single --with-single-library=0 --with-cuda TEST_OPTS: -j1 -l6 query=requires queryval=cuda DISABLE_TESTS: 1 @@ -629,10 +634,11 @@ gnu-c-complex-coverage: - .stage-3 - .linux_test tags: - - linux-ubuntu, name:hapy + - name:hapy variables: + LOAD_MODULES: mpi PETSC_CONFIG_OPTS: --with-fortran-bindings=0 --with-scalar-type=complex --with-debugging=1 --with-coverage=1 - SLEPC_CONFIG_OPTS: --DATAFILESPATH=/var/local --with-packages-download-dir=/var/local/downloads --with-arpack-dir=/usr/local/opt/arpack-ng-3.8.0 --with-primme-dir=/usr/local/opt/primme-3.2 --download-blopex --download-hpddm + SLEPC_CONFIG_OPTS: --DATAFILESPATH=/var/local --with-packages-download-dir=/var/local/downloads --with-arpack-dir=/usr/local/opt/arpack-ng-3.9.0 --with-primme-dir=/usr/local/opt/primme-3.2 --download-blopex --download-hpddm COVERAGE: 1 DISABLE_TESTS: 1 @@ -652,7 +658,7 @@ nvidia-c-nompi: - .stage-3 - .linux_test_noflags tags: - - linux-ubuntu, compiler:nvidia, name:hapy + - compiler:nvidia, name:hapy variables: LOAD_MODULES: nvhpc-nompi PETSC_CONFIG_OPTS: --with-cc=nvc --with-fc=nvfortran --with-cxx=nvc++ --with-mpi=0 --with-cuda --with-magma-dir=/usr/local/opt/magma-2.7.1 @@ -686,7 +692,7 @@ nvidia-c-complex-nompi: - .stage-3 - .linux_test_noflags tags: - - linux-ubuntu, compiler:nvidia, name:hapy + - compiler:nvidia, name:hapy variables: LOAD_MODULES: nvhpc-nompi PETSC_CONFIG_OPTS: --with-cc=nvc --with-fc=nvfortran --with-cxx=nvc++ --with-scalar-type=complex --with-mpi=0 --with-cuda --with-magma-dir=/usr/local/opt/magma-2.7.1 @@ -699,10 +705,10 @@ nvidia-cxx-mpi: - .stage-3 - .linux_test_noflags tags: - - linux-ubuntu, compiler:nvidia, name:hapy + - compiler:nvidia, name:hapy variables: LOAD_MODULES: nvhpc - PETSC_CONFIG_OPTS: --with-cc=mpicc --with-fc=mpifort --with-cxx=mpicxx --with-clanguage=c++ --with-cuda --with-magma-dir=/usr/local/opt/magma-2.7.1 + PETSC_CONFIG_OPTS: --with-cc=mpicc --with-fc=mpifort --with-cxx=mpicxx --with-clanguage=c++ --with-cuda --with-magma-dir=/usr/local/opt/magma-2.7.1-nvidia SLEPC_CONFIG_OPTS: --DATAFILESPATH=/var/local --with-packages-download-dir=/var/local/downloads --download-blopex --download-primme --download-arpack TEST_OPTS: -j4 -l12 DISABLE_TESTS: 1 @@ -744,8 +750,9 @@ gnu-c-cuda-int64: - .stage-3 - .linux_test tags: - - linux-ubuntu, gpu:nvidia, name:hapy + - gpu:nvidia, name:hapy variables: + LOAD_MODULES: mpi PETSC_CONFIG_OPTS: --with-cuda --with-64-bit-indices --with-magma-dir=/usr/local/opt/magma-2.7.1 TEST_OPTS: -j2 -l6 query=requires queryval=cuda MAKE_CUDAFLAGS: --compiler-options -Wall,-Wunused-parameter,-Wno-deprecated-declarations,-Werror From 252a5e1b4b8e03f2e37e6d61b1957d92a0852458 Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Wed, 28 Jun 2023 18:58:51 +0200 Subject: [PATCH 042/112] Docs: remove step latexinexamples.py It was not really used in source code and it has been removed in PETSc --- lib/slepc/conf/slepc_rules.doc | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/slepc/conf/slepc_rules.doc b/lib/slepc/conf/slepc_rules.doc index 1e0775268..6c28b10bf 100644 --- a/lib/slepc/conf/slepc_rules.doc +++ b/lib/slepc/conf/slepc_rules.doc @@ -183,7 +183,6 @@ slepc_html: cmess=`grep "static\( const\)\? char help" $${file} | cut -d\" -f2 | cut -d\. -f1`; \ fi; \ echo "$${file}: $${cmess}
" >> $${loc}/index.html;\ - ${PYTHON} ${PETSC_DIR}/lib/petsc/bin/maint/latexinexamples.py $${loc}/$${file}.html;\ fi; \ done ;\ else \ From 7bb5cbb9703bda25d5f543caa1a1d0a9aefd75c9 Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Thu, 13 Jul 2023 07:29:41 +0200 Subject: [PATCH 043/112] configure: no longer need to check for cython In the slepc4py source code reorganization prior to 3.19 the automatic download of dependencies was added. Hence, checking for cython is wrong --- config/packages/slepc4py.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/config/packages/slepc4py.py b/config/packages/slepc4py.py index 2f15f5d2d..250b8201e 100644 --- a/config/packages/slepc4py.py +++ b/config/packages/slepc4py.py @@ -56,12 +56,6 @@ def Process(self,slepcconf,slepcvars,slepcrules,slepc,petsc,archdir=''): elif not self.have_petsc4py: self.log.Exit('petsc4py is required but had been marked as not installed') - # Check for cython - try: - import Cython - except ImportError: - self.log.Exit('--with-slepc4py requires that cython is installed on your system') - builddir = os.path.join(slepc.dir,'src','binding','slepc4py') destdir = os.path.join(slepc.prefixdir,'lib') From de5d8cd7ee4410c1a9b662efd314127569e7e27f Mon Sep 17 00:00:00 2001 From: Jacob Faibussowitsch Date: Thu, 13 Jul 2023 11:37:41 -0400 Subject: [PATCH 044/112] bump HPDDM hash --- config/packages/hpddm.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/packages/hpddm.py b/config/packages/hpddm.py index 0e736c4aa..73b8738cc 100644 --- a/config/packages/hpddm.py +++ b/config/packages/hpddm.py @@ -17,8 +17,8 @@ def __init__(self,argdb,log): package.Package.__init__(self,argdb,log) self.packagename = 'hpddm' self.downloadable = True - # self.gitcommit = '6de1168878a50fd9ee55e80758cc9a6820d7b1f1' - self.version = '2.2.3' + self.gitcommit = '1af2600a191428d4fc2cc1f630bf14b5878675ff' + # self.version = '2.2.3' obj = self.version if hasattr(self,'version') else self.gitcommit self.url = 'https://github.com/hpddm/hpddm/archive/'+('v'+obj if hasattr(self,'version') else obj)+'.tar.gz' self.archive = 'hpddm-'+obj+'.tar.gz' From 4404c6f9d584aa909e006f864a82b4f13dd6a1da Mon Sep 17 00:00:00 2001 From: Jacob Faibussowitsch Date: Wed, 12 Jul 2023 14:15:14 -0400 Subject: [PATCH 045/112] Use more precise PETSC_DEPRECATED_XXX() version. See https://gitlab.com/petsc/petsc/-/merge_requests/6692 --- include/slepcbv.h | 2 +- include/slepcds.h | 2 +- include/slepceps.h | 10 +++++----- include/slepclme.h | 6 +++--- include/slepcmat.h | 4 ++-- include/slepcmfn.h | 4 ++-- include/slepcnep.h | 12 ++++++------ include/slepcpep.h | 14 +++++++------- include/slepcst.h | 12 ++++++------ include/slepcsvd.h | 18 +++++++++--------- include/slepcvec.h | 4 ++-- 11 files changed, 44 insertions(+), 44 deletions(-) diff --git a/include/slepcbv.h b/include/slepcbv.h index 0f09a453f..40b205ea9 100644 --- a/include/slepcbv.h +++ b/include/slepcbv.h @@ -158,7 +158,7 @@ SLEPC_EXTERN PetscErrorCode BVMultVec(BV,PetscScalar,PetscScalar,Vec,PetscScalar SLEPC_EXTERN PetscErrorCode BVMultColumn(BV,PetscScalar,PetscScalar,PetscInt,PetscScalar*); SLEPC_EXTERN PetscErrorCode BVMultInPlace(BV,Mat,PetscInt,PetscInt); SLEPC_EXTERN PetscErrorCode BVMultInPlaceHermitianTranspose(BV,Mat,PetscInt,PetscInt); -PETSC_DEPRECATED_FUNCTION("Use BVMultInPlaceHermitianTranspose()") static inline PetscErrorCode BVMultInPlaceTranspose(BV bv,Mat A,PetscInt s,PetscInt e) {return BVMultInPlaceHermitianTranspose(bv,A,s,e);} +PETSC_DEPRECATED_FUNCTION(3, 16, 0, "BVMultInPlaceHermitianTranspose()", ) static inline PetscErrorCode BVMultInPlaceTranspose(BV bv,Mat A,PetscInt s,PetscInt e) {return BVMultInPlaceHermitianTranspose(bv,A,s,e);} SLEPC_EXTERN PetscErrorCode BVMatMult(BV,Mat,BV); SLEPC_EXTERN PetscErrorCode BVMatMultTranspose(BV,Mat,BV); SLEPC_EXTERN PetscErrorCode BVMatMultHermitianTranspose(BV,Mat,BV); diff --git a/include/slepcds.h b/include/slepcds.h index 752417fff..3eafb6bcf 100644 --- a/include/slepcds.h +++ b/include/slepcds.h @@ -191,7 +191,7 @@ SLEPC_EXTERN PetscErrorCode DSSolve(DS,PetscScalar*,PetscScalar*); SLEPC_EXTERN PetscErrorCode DSSort(DS,PetscScalar*,PetscScalar*,PetscScalar*,PetscScalar*,PetscInt*); SLEPC_EXTERN PetscErrorCode DSSortWithPermutation(DS,PetscInt*,PetscScalar*,PetscScalar*); SLEPC_EXTERN PetscErrorCode DSSynchronize(DS,PetscScalar*,PetscScalar*); -PETSC_DEPRECATED_FUNCTION("Use DSGetMat()+MatDenseGetSubMatrix()+MatCopy()") static inline PetscErrorCode DSCopyMat(DS ds,DSMatType m,PetscInt mr,PetscInt mc,Mat A,PetscInt Ar,PetscInt Ac,PetscInt rows,PetscInt cols,PetscBool out) +PETSC_DEPRECATED_FUNCTION(3, 18, 0, "DSGetMat()+MatDenseGetSubMatrix()+MatCopy()", ) static inline PetscErrorCode DSCopyMat(DS ds,DSMatType m,PetscInt mr,PetscInt mc,Mat A,PetscInt Ar,PetscInt Ac,PetscInt rows,PetscInt cols,PetscBool out) { Mat M,M0,A0; PetscFunctionBegin; diff --git a/include/slepceps.h b/include/slepceps.h index 03a81794d..4e1c704c7 100644 --- a/include/slepceps.h +++ b/include/slepceps.h @@ -202,12 +202,12 @@ SLEPC_EXTERN PetscErrorCode EPSSolve(EPS); SLEPC_EXTERN PetscErrorCode EPSView(EPS,PetscViewer); SLEPC_EXTERN PetscErrorCode EPSViewFromOptions(EPS,PetscObject,const char[]); SLEPC_EXTERN PetscErrorCode EPSErrorView(EPS,EPSErrorType,PetscViewer); -PETSC_DEPRECATED_FUNCTION("Use EPSErrorView()") static inline PetscErrorCode EPSPrintSolution(EPS eps,PetscViewer v) {return EPSErrorView(eps,EPS_ERROR_RELATIVE,v);} +PETSC_DEPRECATED_FUNCTION(3, 6, 0, "EPSErrorView()", ) static inline PetscErrorCode EPSPrintSolution(EPS eps,PetscViewer v) {return EPSErrorView(eps,EPS_ERROR_RELATIVE,v);} SLEPC_EXTERN PetscErrorCode EPSErrorViewFromOptions(EPS); SLEPC_EXTERN PetscErrorCode EPSConvergedReasonView(EPS,PetscViewer); SLEPC_EXTERN PetscErrorCode EPSConvergedReasonViewFromOptions(EPS); -PETSC_DEPRECATED_FUNCTION("Use EPSConvergedReasonView() (since version 3.14)") static inline PetscErrorCode EPSReasonView(EPS eps,PetscViewer v) {return EPSConvergedReasonView(eps,v);} -PETSC_DEPRECATED_FUNCTION("Use EPSConvergedReasonViewFromOptions() (since version 3.14)") static inline PetscErrorCode EPSReasonViewFromOptions(EPS eps) {return EPSConvergedReasonViewFromOptions(eps);} +PETSC_DEPRECATED_FUNCTION(3, 14, 0, "EPSConvergedReasonView()", ) static inline PetscErrorCode EPSReasonView(EPS eps,PetscViewer v) {return EPSConvergedReasonView(eps,v);} +PETSC_DEPRECATED_FUNCTION(3, 14, 0, "EPSConvergedReasonViewFromOptions()", ) static inline PetscErrorCode EPSReasonViewFromOptions(EPS eps) {return EPSConvergedReasonViewFromOptions(eps);} SLEPC_EXTERN PetscErrorCode EPSValuesView(EPS,PetscViewer); SLEPC_EXTERN PetscErrorCode EPSValuesViewFromOptions(EPS); SLEPC_EXTERN PetscErrorCode EPSVectorsView(EPS,PetscViewer); @@ -249,8 +249,8 @@ SLEPC_EXTERN PetscErrorCode EPSGetEigenvector(EPS,PetscInt,Vec,Vec); SLEPC_EXTERN PetscErrorCode EPSGetLeftEigenvector(EPS,PetscInt,Vec,Vec); SLEPC_EXTERN PetscErrorCode EPSComputeError(EPS,PetscInt,EPSErrorType,PetscReal*); -PETSC_DEPRECATED_FUNCTION("Use EPSComputeError()") static inline PetscErrorCode EPSComputeRelativeError(EPS eps,PetscInt i,PetscReal *r) {return EPSComputeError(eps,i,EPS_ERROR_RELATIVE,r);} -PETSC_DEPRECATED_FUNCTION("Use EPSComputeError() with EPS_ERROR_ABSOLUTE") static inline PetscErrorCode EPSComputeResidualNorm(EPS eps,PetscInt i,PetscReal *r) {return EPSComputeError(eps,i,EPS_ERROR_ABSOLUTE,r);} +PETSC_DEPRECATED_FUNCTION(3, 6, 0, "EPSComputeError()", ) static inline PetscErrorCode EPSComputeRelativeError(EPS eps,PetscInt i,PetscReal *r) {return EPSComputeError(eps,i,EPS_ERROR_RELATIVE,r);} +PETSC_DEPRECATED_FUNCTION(3, 6, 0, "EPSComputeError() with EPS_ERROR_ABSOLUTE", ) static inline PetscErrorCode EPSComputeResidualNorm(EPS eps,PetscInt i,PetscReal *r) {return EPSComputeError(eps,i,EPS_ERROR_ABSOLUTE,r);} SLEPC_EXTERN PetscErrorCode EPSGetInvariantSubspace(EPS,Vec[]); SLEPC_EXTERN PetscErrorCode EPSGetErrorEstimate(EPS,PetscInt,PetscReal*); SLEPC_EXTERN PetscErrorCode EPSGetIterationNumber(EPS,PetscInt*); diff --git a/include/slepclme.h b/include/slepclme.h index 785f79eec..5a8dda88c 100644 --- a/include/slepclme.h +++ b/include/slepclme.h @@ -77,8 +77,8 @@ SLEPC_EXTERN PetscErrorCode LMEView(LME,PetscViewer); SLEPC_EXTERN PetscErrorCode LMEViewFromOptions(LME,PetscObject,const char[]); SLEPC_EXTERN PetscErrorCode LMEConvergedReasonView(LME,PetscViewer); SLEPC_EXTERN PetscErrorCode LMEConvergedReasonViewFromOptions(LME); -PETSC_DEPRECATED_FUNCTION("Use LMEConvergedReasonView() (since version 3.14)") static inline PetscErrorCode LMEReasonView(LME lme,PetscViewer v) {return LMEConvergedReasonView(lme,v);} -PETSC_DEPRECATED_FUNCTION("Use LMEConvergedReasonViewFromOptions() (since version 3.14)") static inline PetscErrorCode LMEReasonViewFromOptions(LME lme) {return LMEConvergedReasonViewFromOptions(lme);} +PETSC_DEPRECATED_FUNCTION(3, 14, 0, "LMEConvergedReasonView()", ) static inline PetscErrorCode LMEReasonView(LME lme,PetscViewer v) {return LMEConvergedReasonView(lme,v);} +PETSC_DEPRECATED_FUNCTION(3, 14, 0, "LMEConvergedReasonViewFromOptions()", ) static inline PetscErrorCode LMEReasonViewFromOptions(LME lme) {return LMEConvergedReasonViewFromOptions(lme);} SLEPC_EXTERN PetscErrorCode LMESetBV(LME,BV); SLEPC_EXTERN PetscErrorCode LMEGetBV(LME,BV*); @@ -95,7 +95,7 @@ SLEPC_EXTERN PetscErrorCode LMEGetErrorIfNotConverged(LME,PetscBool*); SLEPC_EXTERN PetscErrorCode LMEDenseLyapunov(LME,PetscInt,PetscScalar*,PetscInt,PetscScalar*,PetscInt,PetscScalar*,PetscInt); SLEPC_EXTERN PetscErrorCode LMEDenseHessLyapunovChol(LME,PetscInt,PetscScalar*,PetscInt,PetscInt,PetscScalar*,PetscInt,PetscScalar*,PetscInt,PetscReal*); -PETSC_DEPRECATED_FUNCTION("Use LMEDenseHessLyapunovChol()") static inline PetscErrorCode LMEDenseLyapunovChol(LME lme,PetscScalar *H,PetscInt m,PetscInt ldh,PetscScalar *r,PetscScalar *L,PetscInt ldl,PetscReal *res) {return LMEDenseHessLyapunovChol(lme,m,H,ldh,1,r,m,L,ldl,res);} +PETSC_DEPRECATED_FUNCTION(3, 8, 0, "LMEDenseHessLyapunovChol()", ) static inline PetscErrorCode LMEDenseLyapunovChol(LME lme,PetscScalar *H,PetscInt m,PetscInt ldh,PetscScalar *r,PetscScalar *L,PetscInt ldl,PetscReal *res) {return LMEDenseHessLyapunovChol(lme,m,H,ldh,1,r,m,L,ldl,res);} SLEPC_EXTERN PetscErrorCode LMEMonitor(LME,PetscInt,PetscReal); SLEPC_EXTERN PetscErrorCode LMEMonitorSet(LME,PetscErrorCode (*)(LME,PetscInt,PetscReal,void*),void*,PetscErrorCode (*)(void**)); diff --git a/include/slepcmat.h b/include/slepcmat.h index c42fe458f..385d28c55 100644 --- a/include/slepcmat.h +++ b/include/slepcmat.h @@ -23,7 +23,7 @@ SLEPC_EXTERN PetscErrorCode MatCreateVecsEmpty(Mat,Vec*,Vec*); SLEPC_EXTERN PetscErrorCode MatNormEstimate(Mat,Vec,Vec,PetscReal*); /* Deprecated functions */ -PETSC_DEPRECATED_FUNCTION("Use MatCreateRedundantMatrix() followed by MatConvert()") static inline PetscErrorCode SlepcMatConvertSeqDense(Mat mat,Mat *newmat) +PETSC_DEPRECATED_FUNCTION(3, 6, 0, "MatCreateRedundantMatrix() followed by MatConvert()", ) static inline PetscErrorCode SlepcMatConvertSeqDense(Mat mat,Mat *newmat) { Mat Ar; PetscFunctionBegin; @@ -32,6 +32,6 @@ PETSC_DEPRECATED_FUNCTION("Use MatCreateRedundantMatrix() followed by MatConvert PetscCall(MatDestroy(&Ar)); PetscFunctionReturn(PETSC_SUCCESS); } -PETSC_DEPRECATED_FUNCTION("Use MatCreateTile()") static inline PetscErrorCode SlepcMatTile(PetscScalar a,Mat A,PetscScalar b,Mat B,PetscScalar c,Mat C,PetscScalar d,Mat D,Mat *G) {return MatCreateTile(a,A,b,B,c,C,d,D,G);} +PETSC_DEPRECATED_FUNCTION(3, 8, 0, "MatCreateTile()", ) static inline PetscErrorCode SlepcMatTile(PetscScalar a,Mat A,PetscScalar b,Mat B,PetscScalar c,Mat C,PetscScalar d,Mat D,Mat *G) {return MatCreateTile(a,A,b,B,c,C,d,D,G);} #endif diff --git a/include/slepcmfn.h b/include/slepcmfn.h index 4c6c9fe5f..0f2385962 100644 --- a/include/slepcmfn.h +++ b/include/slepcmfn.h @@ -59,8 +59,8 @@ SLEPC_EXTERN PetscErrorCode MFNView(MFN,PetscViewer); SLEPC_EXTERN PetscErrorCode MFNViewFromOptions(MFN,PetscObject,const char[]); SLEPC_EXTERN PetscErrorCode MFNConvergedReasonView(MFN,PetscViewer); SLEPC_EXTERN PetscErrorCode MFNConvergedReasonViewFromOptions(MFN); -PETSC_DEPRECATED_FUNCTION("Use MFNConvergedReasonView() (since version 3.14)") static inline PetscErrorCode MFNReasonView(MFN mfn,PetscViewer v) {return MFNConvergedReasonView(mfn,v);} -PETSC_DEPRECATED_FUNCTION("Use MFNConvergedReasonViewFromOptions() (since version 3.14)") static inline PetscErrorCode MFNReasonViewFromOptions(MFN mfn) {return MFNConvergedReasonViewFromOptions(mfn);} +PETSC_DEPRECATED_FUNCTION(3, 14, 0, "MFNConvergedReasonView()", ) static inline PetscErrorCode MFNReasonView(MFN mfn,PetscViewer v) {return MFNConvergedReasonView(mfn,v);} +PETSC_DEPRECATED_FUNCTION(3, 14, 0, "MFNConvergedReasonViewFromOptions()", ) static inline PetscErrorCode MFNReasonViewFromOptions(MFN mfn) {return MFNConvergedReasonViewFromOptions(mfn);} SLEPC_EXTERN PetscErrorCode MFNSetBV(MFN,BV); SLEPC_EXTERN PetscErrorCode MFNGetBV(MFN,BV*); diff --git a/include/slepcnep.h b/include/slepcnep.h index 9d8b3d917..f61637347 100644 --- a/include/slepcnep.h +++ b/include/slepcnep.h @@ -177,8 +177,8 @@ SLEPC_EXTERN PetscErrorCode NEPErrorView(NEP,NEPErrorType,PetscViewer); SLEPC_EXTERN PetscErrorCode NEPErrorViewFromOptions(NEP); SLEPC_EXTERN PetscErrorCode NEPConvergedReasonView(NEP,PetscViewer); SLEPC_EXTERN PetscErrorCode NEPConvergedReasonViewFromOptions(NEP); -PETSC_DEPRECATED_FUNCTION("Use NEPConvergedReasonView() (since version 3.14)") static inline PetscErrorCode NEPReasonView(NEP nep,PetscViewer v) {return NEPConvergedReasonView(nep,v);} -PETSC_DEPRECATED_FUNCTION("Use NEPConvergedReasonViewFromOptions() (since version 3.14)") static inline PetscErrorCode NEPReasonViewFromOptions(NEP nep) {return NEPConvergedReasonViewFromOptions(nep);} +PETSC_DEPRECATED_FUNCTION(3, 14, 0, "NEPConvergedReasonView()", ) static inline PetscErrorCode NEPReasonView(NEP nep,PetscViewer v) {return NEPConvergedReasonView(nep,v);} +PETSC_DEPRECATED_FUNCTION(3, 14, 0, "NEPConvergedReasonViewFromOptions()", ) static inline PetscErrorCode NEPReasonViewFromOptions(NEP nep) {return NEPConvergedReasonViewFromOptions(nep);} SLEPC_EXTERN PetscErrorCode NEPValuesView(NEP,PetscViewer); SLEPC_EXTERN PetscErrorCode NEPValuesViewFromOptions(NEP); SLEPC_EXTERN PetscErrorCode NEPVectorsView(NEP,PetscViewer); @@ -188,8 +188,8 @@ SLEPC_EXTERN PetscErrorCode NEPSetFunction(NEP,Mat,Mat,PetscErrorCode (*)(NEP,Pe SLEPC_EXTERN PetscErrorCode NEPGetFunction(NEP,Mat*,Mat*,PetscErrorCode (**)(NEP,PetscScalar,Mat,Mat,void*),void**); SLEPC_EXTERN PetscErrorCode NEPSetJacobian(NEP,Mat,PetscErrorCode (*)(NEP,PetscScalar,Mat,void*),void*); SLEPC_EXTERN PetscErrorCode NEPGetJacobian(NEP,Mat*,PetscErrorCode (**)(NEP,PetscScalar,Mat,void*),void**); -PETSC_DEPRECATED_FUNCTION("Use NEPSetFunction() and NEPSetJacobian") static inline PetscErrorCode NEPSetDerivatives(NEP nep,Mat A,PetscErrorCode (*fun)(NEP,PetscScalar,PetscInt,Mat,void*),void *ctx) {(void)A;(void)fun;(void)ctx;SETERRQ(PetscObjectComm((PetscObject)nep),PETSC_ERR_SUP,"Not implemented in this version");} -PETSC_DEPRECATED_FUNCTION("Use NEPGetFunction() and NEPGetJacobian") static inline PetscErrorCode NEPGetDerivatives(NEP nep,Mat *A,PetscErrorCode (**fun)(NEP,PetscScalar,PetscInt,Mat,void*),void **ctx) {(void)A;(void)fun;(void)ctx;SETERRQ(PetscObjectComm((PetscObject)nep),PETSC_ERR_SUP,"Not implemented in this version");} +PETSC_DEPRECATED_FUNCTION(3, 12, 0, "NEPSetFunction() and NEPSetJacobian()", ) static inline PetscErrorCode NEPSetDerivatives(NEP nep,Mat A,PetscErrorCode (*fun)(NEP,PetscScalar,PetscInt,Mat,void*),void *ctx) {(void)A;(void)fun;(void)ctx;SETERRQ(PetscObjectComm((PetscObject)nep),PETSC_ERR_SUP,"Not implemented in this version");} +PETSC_DEPRECATED_FUNCTION(3, 12, 0, "NEPGetFunction() and NEPGetJacobian()", ) static inline PetscErrorCode NEPGetDerivatives(NEP nep,Mat *A,PetscErrorCode (**fun)(NEP,PetscScalar,PetscInt,Mat,void*),void **ctx) {(void)A;(void)fun;(void)ctx;SETERRQ(PetscObjectComm((PetscObject)nep),PETSC_ERR_SUP,"Not implemented in this version");} SLEPC_EXTERN PetscErrorCode NEPSetSplitOperator(NEP,PetscInt,Mat[],FN[],MatStructure); SLEPC_EXTERN PetscErrorCode NEPGetSplitOperatorTerm(NEP,PetscInt,Mat*,FN*); SLEPC_EXTERN PetscErrorCode NEPGetSplitOperatorInfo(NEP,PetscInt*,MatStructure*); @@ -226,8 +226,8 @@ SLEPC_EXTERN PetscErrorCode NEPGetEigenpair(NEP,PetscInt,PetscScalar*,PetscScala SLEPC_EXTERN PetscErrorCode NEPGetLeftEigenvector(NEP,PetscInt,Vec,Vec); SLEPC_EXTERN PetscErrorCode NEPComputeError(NEP,PetscInt,NEPErrorType,PetscReal*); -PETSC_DEPRECATED_FUNCTION("Use NEPComputeError()") static inline PetscErrorCode NEPComputeRelativeError(NEP nep,PetscInt i,PetscReal *r) {return NEPComputeError(nep,i,NEP_ERROR_RELATIVE,r);} -PETSC_DEPRECATED_FUNCTION("Use NEPComputeError() with NEP_ERROR_ABSOLUTE") static inline PetscErrorCode NEPComputeResidualNorm(NEP nep,PetscInt i,PetscReal *r) {return NEPComputeError(nep,i,NEP_ERROR_ABSOLUTE,r);} +PETSC_DEPRECATED_FUNCTION(3, 6, 0, "NEPComputeError()", ) static inline PetscErrorCode NEPComputeRelativeError(NEP nep,PetscInt i,PetscReal *r) {return NEPComputeError(nep,i,NEP_ERROR_RELATIVE,r);} +PETSC_DEPRECATED_FUNCTION(3, 6, 0, "NEPComputeError() with NEP_ERROR_ABSOLUTE", ) static inline PetscErrorCode NEPComputeResidualNorm(NEP nep,PetscInt i,PetscReal *r) {return NEPComputeError(nep,i,NEP_ERROR_ABSOLUTE,r);} SLEPC_EXTERN PetscErrorCode NEPGetErrorEstimate(NEP,PetscInt,PetscReal*); SLEPC_EXTERN PetscErrorCode NEPComputeFunction(NEP,PetscScalar,Mat,Mat); diff --git a/include/slepcpep.h b/include/slepcpep.h index ba7585a80..7cc70fff7 100644 --- a/include/slepcpep.h +++ b/include/slepcpep.h @@ -219,12 +219,12 @@ SLEPC_EXTERN PetscErrorCode PEPSolve(PEP); SLEPC_EXTERN PetscErrorCode PEPView(PEP,PetscViewer); SLEPC_EXTERN PetscErrorCode PEPViewFromOptions(PEP,PetscObject,const char[]); SLEPC_EXTERN PetscErrorCode PEPErrorView(PEP,PEPErrorType,PetscViewer); -PETSC_DEPRECATED_FUNCTION("Use PEPErrorView()") static inline PetscErrorCode PEPPrintSolution(PEP pep,PetscViewer v) {return PEPErrorView(pep,PEP_ERROR_BACKWARD,v);} +PETSC_DEPRECATED_FUNCTION(3, 6, 0, "PEPErrorView()", ) static inline PetscErrorCode PEPPrintSolution(PEP pep,PetscViewer v) {return PEPErrorView(pep,PEP_ERROR_BACKWARD,v);} SLEPC_EXTERN PetscErrorCode PEPErrorViewFromOptions(PEP); SLEPC_EXTERN PetscErrorCode PEPConvergedReasonView(PEP,PetscViewer); SLEPC_EXTERN PetscErrorCode PEPConvergedReasonViewFromOptions(PEP); -PETSC_DEPRECATED_FUNCTION("Use PEPConvergedReasonView() (since version 3.14)") static inline PetscErrorCode PEPReasonView(PEP pep,PetscViewer v) {return PEPConvergedReasonView(pep,v);} -PETSC_DEPRECATED_FUNCTION("Use PEPConvergedReasonViewFromOptions() (since version 3.14)") static inline PetscErrorCode PEPReasonViewFromOptions(PEP pep) {return PEPConvergedReasonViewFromOptions(pep);} +PETSC_DEPRECATED_FUNCTION(3, 14, 0, "PEPConvergedReasonView()", ) static inline PetscErrorCode PEPReasonView(PEP pep,PetscViewer v) {return PEPConvergedReasonView(pep,v);} +PETSC_DEPRECATED_FUNCTION(3, 14, 0, "PEPConvergedReasonViewFromOptions()", ) static inline PetscErrorCode PEPReasonViewFromOptions(PEP pep) {return PEPConvergedReasonViewFromOptions(pep);} SLEPC_EXTERN PetscErrorCode PEPValuesView(PEP,PetscViewer); SLEPC_EXTERN PetscErrorCode PEPValuesViewFromOptions(PEP); SLEPC_EXTERN PetscErrorCode PEPVectorsView(PEP,PetscViewer); @@ -267,8 +267,8 @@ SLEPC_EXTERN PetscErrorCode PEPGetBasis(PEP,PEPBasis*); SLEPC_EXTERN PetscErrorCode PEPGetConverged(PEP,PetscInt*); SLEPC_EXTERN PetscErrorCode PEPGetEigenpair(PEP,PetscInt,PetscScalar*,PetscScalar*,Vec,Vec); SLEPC_EXTERN PetscErrorCode PEPComputeError(PEP,PetscInt,PEPErrorType,PetscReal*); -PETSC_DEPRECATED_FUNCTION("Use PEPComputeError()") static inline PetscErrorCode PEPComputeRelativeError(PEP pep,PetscInt i,PetscReal *r) {return PEPComputeError(pep,i,PEP_ERROR_BACKWARD,r);} -PETSC_DEPRECATED_FUNCTION("Use PEPComputeError() with PEP_ERROR_ABSOLUTE") static inline PetscErrorCode PEPComputeResidualNorm(PEP pep,PetscInt i,PetscReal *r) {return PEPComputeError(pep,i,PEP_ERROR_ABSOLUTE,r);} +PETSC_DEPRECATED_FUNCTION(3, 6, 0, "PEPComputeError()", ) static inline PetscErrorCode PEPComputeRelativeError(PEP pep,PetscInt i,PetscReal *r) {return PEPComputeError(pep,i,PEP_ERROR_BACKWARD,r);} +PETSC_DEPRECATED_FUNCTION(3, 6, 0, "PEPComputeError() with PEP_ERROR_ABSOLUTE", ) static inline PetscErrorCode PEPComputeResidualNorm(PEP pep,PetscInt i,PetscReal *r) {return PEPComputeError(pep,i,PEP_ERROR_ABSOLUTE,r);} SLEPC_EXTERN PetscErrorCode PEPGetErrorEstimate(PEP,PetscInt,PetscReal*); SLEPC_EXTERN PetscErrorCode PEPGetIterationNumber(PEP,PetscInt*); @@ -321,8 +321,8 @@ SLEPC_EXTERN PetscErrorCode PEPLinearSetExplicitMatrix(PEP,PetscBool); SLEPC_EXTERN PetscErrorCode PEPLinearGetExplicitMatrix(PEP,PetscBool*); SLEPC_EXTERN PetscErrorCode PEPLinearSetEPS(PEP,EPS); SLEPC_EXTERN PetscErrorCode PEPLinearGetEPS(PEP,EPS*); -PETSC_DEPRECATED_FUNCTION("Use PEPLinearSetLinearization()") static inline PetscErrorCode PEPLinearSetCompanionForm(PEP pep,PetscInt cform) {return (cform==1)?PEPLinearSetLinearization(pep,1.0,0.0):PEPLinearSetLinearization(pep,0.0,1.0);} -PETSC_DEPRECATED_FUNCTION("Use PEPLinearGetLinearization()") static inline PetscErrorCode PEPLinearGetCompanionForm(PEP pep,PetscInt *cform) {(void)pep; if (cform) *cform=1; return PETSC_SUCCESS;} +PETSC_DEPRECATED_FUNCTION(3, 10, 0, "PEPLinearSetLinearization()", ) static inline PetscErrorCode PEPLinearSetCompanionForm(PEP pep,PetscInt cform) {return (cform==1)?PEPLinearSetLinearization(pep,1.0,0.0):PEPLinearSetLinearization(pep,0.0,1.0);} +PETSC_DEPRECATED_FUNCTION(3, 10, 0, "PEPLinearGetLinearization()", ) static inline PetscErrorCode PEPLinearGetCompanionForm(PEP pep,PetscInt *cform) {(void)pep; if (cform) *cform=1; return PETSC_SUCCESS;} SLEPC_EXTERN PetscErrorCode PEPQArnoldiSetRestart(PEP,PetscReal); SLEPC_EXTERN PetscErrorCode PEPQArnoldiGetRestart(PEP,PetscReal*); diff --git a/include/slepcst.h b/include/slepcst.h index 43d8766dd..d8b516e77 100644 --- a/include/slepcst.h +++ b/include/slepcst.h @@ -66,10 +66,10 @@ SLEPC_EXTERN PetscErrorCode STSetFromOptions(ST); SLEPC_EXTERN PetscErrorCode STView(ST,PetscViewer); SLEPC_EXTERN PetscErrorCode STViewFromOptions(ST,PetscObject,const char[]); -PETSC_DEPRECATED_FUNCTION("Use STSetMatrices()") static inline PetscErrorCode STSetOperators(ST st,PetscInt n,Mat *A) {return STSetMatrices(st,n,A);} -PETSC_DEPRECATED_FUNCTION("Use STGetMatrix()") static inline PetscErrorCode STGetOperators(ST st,PetscInt k,Mat *A) {return STGetMatrix(st,k,A);} -PETSC_DEPRECATED_FUNCTION("Use STGetMatrixTransformed()") static inline PetscErrorCode STGetTOperators(ST st,PetscInt k,Mat *A) {return STGetMatrixTransformed(st,k,A);} -PETSC_DEPRECATED_FUNCTION("Use STGetOperator() followed by MatComputeOperator()") static inline PetscErrorCode STComputeExplicitOperator(ST st,Mat *A) +PETSC_DEPRECATED_FUNCTION(3, 15, 0, "STSetMatrices()", ) static inline PetscErrorCode STSetOperators(ST st,PetscInt n,Mat *A) {return STSetMatrices(st,n,A);} +PETSC_DEPRECATED_FUNCTION(3, 15, 0, "STGetMatrix()", ) static inline PetscErrorCode STGetOperators(ST st,PetscInt k,Mat *A) {return STGetMatrix(st,k,A);} +PETSC_DEPRECATED_FUNCTION(3, 15, 0, "STGetMatrixTransformed()", ) static inline PetscErrorCode STGetTOperators(ST st,PetscInt k,Mat *A) {return STGetMatrixTransformed(st,k,A);} +PETSC_DEPRECATED_FUNCTION(3, 15, 0, "STGetOperator() followed by MatComputeOperator()", ) static inline PetscErrorCode STComputeExplicitOperator(ST st,Mat *A) { Mat Op; PetscFunctionBegin; @@ -157,8 +157,8 @@ SLEPC_EXTERN PetscErrorCode STShellSetBackTransform(ST,PetscErrorCode (*)(ST,Pet SLEPC_EXTERN PetscErrorCode STCayleyGetAntishift(ST,PetscScalar*); SLEPC_EXTERN PetscErrorCode STCayleySetAntishift(ST,PetscScalar); -PETSC_DEPRECATED_FUNCTION("Use STGetPreconditionerMat()") static inline PetscErrorCode STPrecondGetMatForPC(ST st,Mat *A) {return STGetPreconditionerMat(st,A);} -PETSC_DEPRECATED_FUNCTION("Use STSetPreconditionerMat()") static inline PetscErrorCode STPrecondSetMatForPC(ST st,Mat A) {return STSetPreconditionerMat(st,A);} +PETSC_DEPRECATED_FUNCTION(3, 15, 0, "STGetPreconditionerMat()", ) static inline PetscErrorCode STPrecondGetMatForPC(ST st,Mat *A) {return STGetPreconditionerMat(st,A);} +PETSC_DEPRECATED_FUNCTION(3, 15, 0, "STSetPreconditionerMat()", ) static inline PetscErrorCode STPrecondSetMatForPC(ST st,Mat A) {return STSetPreconditionerMat(st,A);} SLEPC_EXTERN PetscErrorCode STPrecondGetKSPHasMat(ST,PetscBool*); SLEPC_EXTERN PetscErrorCode STPrecondSetKSPHasMat(ST,PetscBool); diff --git a/include/slepcsvd.h b/include/slepcsvd.h index 9ad7a2050..8050364da 100644 --- a/include/slepcsvd.h +++ b/include/slepcsvd.h @@ -143,14 +143,14 @@ SLEPC_EXTERN PetscErrorCode SVDGetProblemType(SVD,SVDProblemType*); SLEPC_EXTERN PetscErrorCode SVDIsGeneralized(SVD,PetscBool*); SLEPC_EXTERN PetscErrorCode SVDIsHyperbolic(SVD,PetscBool*); SLEPC_EXTERN PetscErrorCode SVDSetOperators(SVD,Mat,Mat); -PETSC_DEPRECATED_FUNCTION("Use SVDSetOperators()") static inline PetscErrorCode SVDSetOperator(SVD svd,Mat A) {return SVDSetOperators(svd,A,PETSC_NULLPTR);} +PETSC_DEPRECATED_FUNCTION(3, 15, 0, "SVDSetOperators()", ) static inline PetscErrorCode SVDSetOperator(SVD svd,Mat A) {return SVDSetOperators(svd,A,PETSC_NULLPTR);} SLEPC_EXTERN PetscErrorCode SVDGetOperators(SVD,Mat*,Mat*); -PETSC_DEPRECATED_FUNCTION("Use SVDGetOperators()") static inline PetscErrorCode SVDGetOperator(SVD svd,Mat *A) {return SVDGetOperators(svd,A,PETSC_NULLPTR);} +PETSC_DEPRECATED_FUNCTION(3, 15, 0, "SVDGetOperators()", ) static inline PetscErrorCode SVDGetOperator(SVD svd,Mat *A) {return SVDGetOperators(svd,A,PETSC_NULLPTR);} SLEPC_EXTERN PetscErrorCode SVDSetSignature(SVD,Vec); SLEPC_EXTERN PetscErrorCode SVDGetSignature(SVD,Vec*); SLEPC_EXTERN PetscErrorCode SVDSetInitialSpaces(SVD,PetscInt,Vec[],PetscInt,Vec[]); -PETSC_DEPRECATED_FUNCTION("Use SVDSetInitialSpaces()") static inline PetscErrorCode SVDSetInitialSpace(SVD svd,PetscInt nr,Vec *isr) {return SVDSetInitialSpaces(svd,nr,isr,0,PETSC_NULLPTR);} -PETSC_DEPRECATED_FUNCTION("Use SVDSetInitialSpaces()") static inline PetscErrorCode SVDSetInitialSpaceLeft(SVD svd,PetscInt nl,Vec *isl) {return SVDSetInitialSpaces(svd,0,PETSC_NULLPTR,nl,isl);} +PETSC_DEPRECATED_FUNCTION(3, 1, 0, "SVDSetInitialSpaces()", ) static inline PetscErrorCode SVDSetInitialSpace(SVD svd,PetscInt nr,Vec *isr) {return SVDSetInitialSpaces(svd,nr,isr,0,PETSC_NULLPTR);} +PETSC_DEPRECATED_FUNCTION(3, 1, 0, "SVDSetInitialSpaces()", ) static inline PetscErrorCode SVDSetInitialSpaceLeft(SVD svd,PetscInt nl,Vec *isl) {return SVDSetInitialSpaces(svd,0,PETSC_NULLPTR,nl,isl);} SLEPC_EXTERN PetscErrorCode SVDSetImplicitTranspose(SVD,PetscBool); SLEPC_EXTERN PetscErrorCode SVDGetImplicitTranspose(SVD,PetscBool*); SLEPC_EXTERN PetscErrorCode SVDSetDimensions(SVD,PetscInt,PetscInt,PetscInt); @@ -182,17 +182,17 @@ SLEPC_EXTERN PetscErrorCode SVDGetConvergedReason(SVD,SVDConvergedReason*); SLEPC_EXTERN PetscErrorCode SVDGetConverged(SVD,PetscInt*); SLEPC_EXTERN PetscErrorCode SVDGetSingularTriplet(SVD,PetscInt,PetscReal*,Vec,Vec); SLEPC_EXTERN PetscErrorCode SVDComputeError(SVD,PetscInt,SVDErrorType,PetscReal*); -PETSC_DEPRECATED_FUNCTION("Use SVDComputeError()") static inline PetscErrorCode SVDComputeRelativeError(SVD svd,PetscInt i,PetscReal *r) {return SVDComputeError(svd,i,SVD_ERROR_RELATIVE,r);} -PETSC_DEPRECATED_FUNCTION("Use SVDComputeError() with SVD_ERROR_ABSOLUTE") static inline PetscErrorCode SVDComputeResidualNorms(SVD svd,PetscInt i,PetscReal *r1,PETSC_UNUSED PetscReal *r2) {return SVDComputeError(svd,i,SVD_ERROR_ABSOLUTE,r1);} +PETSC_DEPRECATED_FUNCTION(3, 6, 0, "SVDComputeError()", ) static inline PetscErrorCode SVDComputeRelativeError(SVD svd,PetscInt i,PetscReal *r) {return SVDComputeError(svd,i,SVD_ERROR_RELATIVE,r);} +PETSC_DEPRECATED_FUNCTION(3, 6, 0, "SVDComputeError() with SVD_ERROR_ABSOLUTE", ) static inline PetscErrorCode SVDComputeResidualNorms(SVD svd,PetscInt i,PetscReal *r1,PETSC_UNUSED PetscReal *r2) {return SVDComputeError(svd,i,SVD_ERROR_ABSOLUTE,r1);} SLEPC_EXTERN PetscErrorCode SVDView(SVD,PetscViewer); SLEPC_EXTERN PetscErrorCode SVDViewFromOptions(SVD,PetscObject,const char[]); SLEPC_EXTERN PetscErrorCode SVDErrorView(SVD,SVDErrorType,PetscViewer); -PETSC_DEPRECATED_FUNCTION("Use SVDErrorView()") static inline PetscErrorCode SVDPrintSolution(SVD svd,PetscViewer v) {return SVDErrorView(svd,SVD_ERROR_RELATIVE,v);} +PETSC_DEPRECATED_FUNCTION(3, 6, 0, "SVDErrorView()", ) static inline PetscErrorCode SVDPrintSolution(SVD svd,PetscViewer v) {return SVDErrorView(svd,SVD_ERROR_RELATIVE,v);} SLEPC_EXTERN PetscErrorCode SVDErrorViewFromOptions(SVD); SLEPC_EXTERN PetscErrorCode SVDConvergedReasonView(SVD,PetscViewer); SLEPC_EXTERN PetscErrorCode SVDConvergedReasonViewFromOptions(SVD); -PETSC_DEPRECATED_FUNCTION("Use SVDConvergedReasonView() (since version 3.14)") static inline PetscErrorCode SVDReasonView(SVD svd,PetscViewer v) {return SVDConvergedReasonView(svd,v);} -PETSC_DEPRECATED_FUNCTION("Use SVDConvergedReasonViewFromOptions() (since version 3.14)") static inline PetscErrorCode SVDReasonViewFromOptions(SVD svd) {return SVDConvergedReasonViewFromOptions(svd);} +PETSC_DEPRECATED_FUNCTION(3, 14, 0, "SVDConvergedReasonView()", ) static inline PetscErrorCode SVDReasonView(SVD svd,PetscViewer v) {return SVDConvergedReasonView(svd,v);} +PETSC_DEPRECATED_FUNCTION(3, 14, 0, "SVDConvergedReasonViewFromOptions()", ) static inline PetscErrorCode SVDReasonViewFromOptions(SVD svd) {return SVDConvergedReasonViewFromOptions(svd);} SLEPC_EXTERN PetscErrorCode SVDValuesView(SVD,PetscViewer); SLEPC_EXTERN PetscErrorCode SVDValuesViewFromOptions(SVD); SLEPC_EXTERN PetscErrorCode SVDVectorsView(SVD,PetscViewer); diff --git a/include/slepcvec.h b/include/slepcvec.h index 01187d4b9..9c9fd5c74 100644 --- a/include/slepcvec.h +++ b/include/slepcvec.h @@ -34,8 +34,8 @@ SLEPC_EXTERN PetscErrorCode VecDuplicateEmpty(Vec,Vec*); SLEPC_EXTERN PetscErrorCode VecSetRandomNormal(Vec,PetscRandom,Vec,Vec); /* Deprecated functions */ -PETSC_DEPRECATED_FUNCTION("Use VecNormalizeComplex()") static inline PetscErrorCode SlepcVecNormalize(Vec xr,Vec xi,PetscBool c,PetscReal *nrm) {return VecNormalizeComplex(xr,xi,c,nrm);} -PETSC_DEPRECATED_FUNCTION("Use VecCheckOrthogonality()") static inline PetscErrorCode SlepcCheckOrthogonality(Vec *V,PetscInt nv,Vec *W,PetscInt nw,Mat B,PetscViewer viewer,PetscReal *lev) {return VecCheckOrthogonality(V,nv,W,nw,B,viewer,lev);} +PETSC_DEPRECATED_FUNCTION(3, 8, 0, "VecNormalizeComplex()", ) static inline PetscErrorCode SlepcVecNormalize(Vec xr,Vec xi,PetscBool c,PetscReal *nrm) {return VecNormalizeComplex(xr,xi,c,nrm);} +PETSC_DEPRECATED_FUNCTION(3, 8, 0, "VecCheckOrthogonality()", ) static inline PetscErrorCode SlepcCheckOrthogonality(Vec *V,PetscInt nv,Vec *W,PetscInt nw,Mat B,PetscViewer viewer,PetscReal *lev) {return VecCheckOrthogonality(V,nv,W,nw,B,viewer,lev);} #endif From 52a327a4bebf4e3f876048cf196147655f0e4000 Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Fri, 14 Jul 2023 08:04:00 +0200 Subject: [PATCH 046/112] Sync with PETSc: some deprecated options were removed --- docs/manual/pep.tex | 2 +- src/sys/tests/output/test2_1.out | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/docs/manual/pep.tex b/docs/manual/pep.tex index 70cf74dd2..607a8adff 100644 --- a/docs/manual/pep.tex +++ b/docs/manual/pep.tex @@ -533,7 +533,7 @@ \subsection{\label{sec:refine}Iterative Refinement} If good accuracy is required, one possibility is to perform a few steps of iterative refinement on the solution computed by the polynomial eigensolver algorithm. Iterative refinement can be seen as the Newton method applied to a set of nonlinear equations related to the polynomial eigenvalue problem \citep{Betcke:2011:PER}. It is well known that global convergence of Newton's iteration is guaranteed only if the initial guess is close enough to the exact solution, so we still need an eigensolver such as TOAR to compute this initial guess. -Iterative refinement can be very costly (sometimes a single refinement step is more expensive than the whole iteration to compute the initial guess with TOAR), that is why in \slepc it is disabled by default. When the user activates it, the computation of Newton iterations will take place within \ident{PEPSolve} as a final stage (identified as \texttt{PEPRefine} in the \Verb!-log_summary! report). +Iterative refinement can be very costly (sometimes a single refinement step is more expensive than the whole iteration to compute the initial guess with TOAR), that is why in \slepc it is disabled by default. When the user activates it, the computation of Newton iterations will take place within \ident{PEPSolve} as a final stage (identified as \texttt{PEPRefine} in the \Verb!-log_view! report). \findex{PEPSetRefine} \begin{Verbatim}[fontsize=\small] diff --git a/src/sys/tests/output/test2_1.out b/src/sys/tests/output/test2_1.out index 0d3009111..3380525eb 100644 --- a/src/sys/tests/output/test2_1.out +++ b/src/sys/tests/output/test2_1.out @@ -42,9 +42,6 @@ Options for all PETSc programs: -fp_trap: stop on floating point exceptions note on IBM RS6000 this slows run greatly -malloc_dump : dump list of unfreed memory at conclusion - -malloc: use PETSc error checking malloc (deprecated, use -malloc_debug) - -malloc no: don't use PETSc error checking malloc (deprecated, use -malloc_debug no) - -malloc_info: prints total memory usage (deprecated, use -memory_view) -malloc_view : keeps log of all memory allocations, displays in PetscFinalize() -malloc_debug : enables or disables extended checking for memory corruption -options_view: dump list of options inputted From 5be23ddcbf2d2b742ed3dd29532949fd463d1701 Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Thu, 13 Jul 2023 19:14:30 +0200 Subject: [PATCH 047/112] Make allfortranstubs should call deletefortranstubs first --- gmakefile | 2 +- gmakefile.test | 2 +- lib/slepc/bin/maint/generatefortranstubs.py | 50 +++++++++++++++++---- makefile | 18 +++----- 4 files changed, 50 insertions(+), 22 deletions(-) diff --git a/gmakefile b/gmakefile index 86c2c8a12..196f1f1e7 100644 --- a/gmakefile +++ b/gmakefile @@ -61,7 +61,7 @@ $(generated) : $(slepcconf) $(slepcvariables) $(PETSCCONFIGDIR)/gmakegen.py $(PYTHON) $(PETSCCONFIGDIR)/gmakegen.py --petsc-arch=$(PETSC_ARCH_DIR) --pkg-dir=$(SLEPC_DIR) --pkg-name=slepc --pkg-pkgs=$(spkgs) --pkg-arch=$(PETSC_ARCH) # Skip including generated files (which triggers rebuilding them) when we're just going to clean anyway. -ifneq ($(filter-out alletags allfortranstubs help clean check info gmakeinfo,$(MAKECMDGOALS:clean%=clean)),) +ifneq ($(filter-out alletags deletefortranstubs allfortranstubs allfortranstubsinplace help clean check info gmakeinfo,$(MAKECMDGOALS:clean%=clean)),) include $(generated) endif diff --git a/gmakefile.test b/gmakefile.test index 3eee4e3d8..32e4c09af 100644 --- a/gmakefile.test +++ b/gmakefile.test @@ -116,7 +116,7 @@ endif $(generatedtest) : $(slepcconf) $(slepcvariables) $(PETSCCONFIGDIR)/gmakegentest.py $(TESTDIR)/.DIR | $$(@D)/.DIR $(PYTHON) $(PETSCCONFIGDIR)/gmakegentest.py --petsc-dir=$(PETSC_DIR) --petsc-arch=$(PETSC_ARCH_DIR) --testdir=$(TESTDIR) --srcdir=$(TESTSRCDIR) --pkg-name=slepc --pkg-pkgs=$(spkgs) --pkg-arch=$(PETSC_ARCH) --pkg-dir=$(SLEPC_DIR) -ifneq ($(filter-out help clean check info gmakeinfo slepc_libs all install install-lib checkbadSource checkbadFileChange deletefortranstubs allfortranstubs alletags get%,$(MAKECMDGOALS:clean%=clean)),) +ifneq ($(filter-out help clean check info gmakeinfo slepc_libs all install install-lib checkbadSource checkbadFileChange deletefortranstubs allfortranstubs allfortranstubsinplace alletags get%,$(MAKECMDGOALS:clean%=clean)),) include $(generatedtest) endif diff --git a/lib/slepc/bin/maint/generatefortranstubs.py b/lib/slepc/bin/maint/generatefortranstubs.py index 8e872d59a..1fc431a96 100644 --- a/lib/slepc/bin/maint/generatefortranstubs.py +++ b/lib/slepc/bin/maint/generatefortranstubs.py @@ -273,13 +273,45 @@ def main(petscdir,petscarch,bfort,dir,verbose): # if __name__ == '__main__': import sys - if len(sys.argv) < 2: sys.exit('Must give the BFORT program or -merge as the first argument') - petscdir = os.environ['SLEPC_DIR'] - if 'PETSC_ARCH' in os.environ: petscarch = os.environ['PETSC_ARCH'] - else: petscarch = '' - if len(sys.argv) > 2: verbose = 1 - else: verbose = 0 - if not sys.argv[1].startswith('-'): - main(petscdir,petscarch,sys.argv[1],os.path.join(petscdir,'src'),verbose) + import argparse + + def str2bool(v): + if isinstance(v, bool): + return v + if not isinstance(v, str): + raise argparse.ArgumentTypeError(type(v)) + v = v.casefold() + if v in {'yes', 'true', 't', 'y', '1'}: + return True + if v in {'no', 'false', 'f', 'n', '0', ''}: + return False + raise argparse.ArgumentTypeError('Boolean value expected, got ' + v) + + def not_empty(v): + if not v: + raise argparse.ArgumentTypeError('option cannot be empty string') + return v + + parser = argparse.ArgumentParser( + description='generate SLEPc FORTRAN stubs', formatter_class=argparse.ArgumentDefaultsHelpFormatter + ) + + parser.add_argument('--slepc-dir', metavar='path', required=True, type=not_empty, help='SLEPc root directory') + parser.add_argument('--petsc-arch', metavar='string', required=True, help='PETSc arch name') + parser.add_argument('--verbose', metavar='bool', nargs='?', const=True, default=False, type=str2bool, help='verbose program output') + parser.add_argument('--bfort', metavar='bfort_prog', nargs=1, help='path to bfort program') + parser.add_argument('--mode', choices=('generate', 'merge'), default='generate', help='merge fortran 90 interfaces definitions') + args = parser.parse_args() + + if args.mode == 'merge': + ret = processf90interfaces(args.slepc_dir, args.petsc_arch, args.verbose) else: - processf90interfaces(petscdir,petscarch,verbose) + if not args.bfort: + parser.error('--mode=generate requires --bfort!') + assert isinstance(args.bfort, (list, tuple)) + bfort_exec = args.bfort[0] + assert isinstance(bfort_exec, str) + ret = main( + args.slepc_dir, args.petsc_arch, bfort_exec, os.path.join(args.slepc_dir, 'src'), args.verbose + ) + sys.exit(ret) diff --git a/makefile b/makefile index 3e4b2f6e1..1415a36b5 100644 --- a/makefile +++ b/makefile @@ -94,22 +94,18 @@ chk_slepcdir: printf "******************************************************"${PETSC_TEXT_NORMAL}"\n" ; \ fi -allfortranstubs: - -@${RM} -rf ${PETSC_ARCH}/include/slepc/finclude/ftn-auto/*-tmpdir - @${PYTHON} lib/slepc/bin/maint/generatefortranstubs.py ${BFORT} ${VERBOSE} - -@${PYTHON} lib/slepc/bin/maint/generatefortranstubs.py -merge ${VERBOSE} - -@${RM} -rf ${PETSC_ARCH}/include/slepc/finclude/ftn-auto/*-tmpdir +allfortranstubs: deletefortranstubs + @${PYTHON} lib/slepc/bin/maint/generatefortranstubs.py --slepc-dir=${SLEPC_DIR} --petsc-arch=${PETSC_ARCH} --bfort=${BFORT} --mode=generate --verbose=${V} + -@${PYTHON} lib/slepc/bin/maint/generatefortranstubs.py --slepc-dir=${SLEPC_DIR} --petsc-arch=${PETSC_ARCH} --mode=merge --verbose=${V} #copy of allfortranstubs with PETSC_ARCH='' -allfortranstubsinplace: - -@${RM} -rf include/slepc/finclude/ftn-auto/*-tmpdir - @PETSC_ARCH='' ${PYTHON} lib/slepc/bin/maint/generatefortranstubs.py ${BFORT} ${VERBOSE} - -@PETSC_ARCH='' ${PYTHON} lib/slepc/bin/maint/generatefortranstubs.py -merge ${VERBOSE} - -@${RM} -rf include/slepc/finclude/ftn-auto/*-tmpdir +allfortranstubsinplace: deletefortranstubs + @${PYTHON} lib/slepc/bin/maint/generatefortranstubs.py --slepc-dir=${SLEPC_DIR} --petsc-arch='' --bfort=${BFORT} --mode=generate --verbose=${V} + -@${PYTHON} lib/slepc/bin/maint/generatefortranstubs.py --slepc-dir=${SLEPC_DIR} --petsc-arch='' --mode=merge --verbose=${V} deletefortranstubs: -@find src -type d -name ftn-auto* | xargs rm -rf - -@if [ -x ${PETSC_ARCH} ]; then \ + -@if [ -n "${PETSC_ARCH}" ] && [ -d ${PETSC_ARCH} ] && [ -d ${PETSC_ARCH}/src ]; then \ find ${PETSC_ARCH}/src -type d -name ftn-auto* | xargs rm -rf ;\ fi From 6b4c04bf222edaf4145a61ba177c00060695d8de Mon Sep 17 00:00:00 2001 From: Pierre Jolivet Date: Fri, 14 Jul 2023 17:00:00 +0200 Subject: [PATCH 048/112] Fix SLEPc make check from PETSc --- makefile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/makefile b/makefile index 3e4b2f6e1..e2b4ababe 100644 --- a/makefile +++ b/makefile @@ -122,7 +122,7 @@ RUN_TEST = ${OMAKE_SELF} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} SLEPC_D check_install: check check: - -@echo "Running check examples to verify correct installation" + -@echo "Running SLEPc check examples to verify correct installation" -@echo "Using SLEPC_DIR=${SLEPC_DIR}, PETSC_DIR=${PETSC_DIR}, and PETSC_ARCH=${PETSC_ARCH}" @if [ "${PETSC_WITH_BATCH}" != "" ]; then \ echo "Running with batch filesystem, cannot run make check"; \ @@ -143,9 +143,9 @@ check_build: +@cd src/eps/tests >/dev/null; ${RUN_TEST} clean-legacy +@cd src/eps/tests >/dev/null; ${RUN_TEST} testtest10 +@if [ ! "${MPI_IS_MPIUNI}" ]; then cd src/eps/tests >/dev/null; ${RUN_TEST} testtest10_mpi; fi - +@if [ "${SLEPC_INSTALLDIR}" = "${SLEPC_DIR}/${PETSC_ARCH}" ]; then \ + +@if [ -f ${PETSC_DIR}/${PETSC_ARCH}/include/petscconf.h ]; then \ grep -E "^#define PETSC_USE_FORTRAN_BINDINGS 1" ${PETSC_DIR}/${PETSC_ARCH}/include/petscconf.h | tee .ftn.log > /dev/null; \ - else \ + elif [ -f ${PETSC_DIR}/include/petscconf.h ]; then \ grep -E "^#define PETSC_USE_FORTRAN_BINDINGS 1" ${PETSC_DIR}/include/petscconf.h | tee .ftn.log > /dev/null; \ fi; \ if test -s .ftn.log; then \ @@ -158,7 +158,7 @@ check_build: cd src/eps/tests >/dev/null; ${RUN_TEST} testtest5_blopex; \ fi +@cd src/eps/tests >/dev/null; ${RUN_TEST} clean-legacy - -@echo "Completed SLEPc test examples" + -@echo "Completed SLEPc check examples" # ******** Rules for make install ********************************************************************** @@ -243,9 +243,9 @@ check_usermakefile: -@echo "Using SLEPC_DIR=${SLEPC_DIR}, PETSC_DIR=${PETSC_DIR}, and PETSC_ARCH=${PETSC_ARCH}" @cd src/eps/tutorials; ${RUN_TEST} clean-legacy @cd src/eps/tutorials; ${OMAKE} SLEPC_DIR=${SLEPC_DIR} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} -f ${SLEPC_DIR}/share/slepc/Makefile.user ex10 - @if [ "${SLEPC_INSTALLDIR}" = "${SLEPC_DIR}/${PETSC_ARCH}" ]; then \ + @if [ -f ${PETSC_DIR}/${PETSC_ARCH}/include/petscconf.h ]; then \ grep -E "^#define PETSC_USE_FORTRAN_BINDINGS 1" ${PETSC_DIR}/${PETSC_ARCH}/include/petscconf.h | tee .ftn.log > /dev/null; \ - else \ + elif [ -f ${PETSC_DIR}/include/petscconf.h ]; then \ grep -E "^#define PETSC_USE_FORTRAN_BINDINGS 1" ${PETSC_DIR}/include/petscconf.h | tee .ftn.log > /dev/null; \ fi; \ if test -s .ftn.log; then \ From 4750fe6ef71c86221c45c4c28faabb5cbfd2010e Mon Sep 17 00:00:00 2001 From: Pierre Jolivet Date: Fri, 14 Jul 2023 16:53:33 +0200 Subject: [PATCH 049/112] Fix -Wextra-semi-stmt --- src/eps/impls/krylov/krylovschur/ks-slice.c | 2 +- src/eps/interface/epssolve.c | 2 +- src/pep/impls/krylov/stoar/qslice.c | 2 +- src/svd/impls/trlanczos/trlanczos.c | 2 +- src/sys/classes/fn/impls/exp/fnexp.c | 2 +- src/sys/classes/fn/impls/fnutil.c | 2 +- src/sys/classes/st/impls/cayley/cayley.c | 4 ++-- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/eps/impls/krylov/krylovschur/ks-slice.c b/src/eps/impls/krylov/krylovschur/ks-slice.c index 28ed12729..d471fdbc1 100644 --- a/src/eps/impls/krylov/krylovschur/ks-slice.c +++ b/src/eps/impls/krylov/krylovschur/ks-slice.c @@ -554,7 +554,7 @@ PetscErrorCode EPSComputeVectors_Slice(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -#define SWAP(a,b,t) {t=a;a=b;b=t;} +#define SWAP(a,b,t) {t=a;a=b;b=t;}do {} while(0) static PetscErrorCode EPSSliceGetInertias(EPS eps,PetscInt *n,PetscReal **shifts,PetscInt **inertias) { diff --git a/src/eps/interface/epssolve.c b/src/eps/interface/epssolve.c index 2d33a926a..03f7e292b 100644 --- a/src/eps/interface/epssolve.c +++ b/src/eps/interface/epssolve.c @@ -24,7 +24,7 @@ PetscErrorCode EPSComputeVectors(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -#define SWAP(a,b,t) {t=a;a=b;b=t;} +#define SWAP(a,b,t) {t=a;a=b;b=t;}do {} while(0) static PetscErrorCode EPSComputeValues(EPS eps) { diff --git a/src/pep/impls/krylov/stoar/qslice.c b/src/pep/impls/krylov/stoar/qslice.c index 61e3a9810..b250c8118 100644 --- a/src/pep/impls/krylov/stoar/qslice.c +++ b/src/pep/impls/krylov/stoar/qslice.c @@ -1311,7 +1311,7 @@ static PetscErrorCode PEPSTOAR_QSlice(PEP pep,Mat B) PetscFunctionReturn(PETSC_SUCCESS); } -#define SWAP(a,b,t) {t=a;a=b;b=t;} +#define SWAP(a,b,t) {t=a;a=b;b=t;}do {} while(0) static PetscErrorCode PEPQSliceGetInertias(PEP pep,PetscInt *n,PetscReal **shifts,PetscInt **inertias) { diff --git a/src/svd/impls/trlanczos/trlanczos.c b/src/svd/impls/trlanczos/trlanczos.c index 09c8ef874..c97f046f9 100644 --- a/src/svd/impls/trlanczos/trlanczos.c +++ b/src/svd/impls/trlanczos/trlanczos.c @@ -198,7 +198,7 @@ static PetscErrorCode MatCreateVecs_Z(Mat Z,Vec *right,Vec *left) PetscFunctionReturn(PETSC_SUCCESS); } -#define SWAP(a,b,t) {t=a;a=b;b=t;} +#define SWAP(a,b,t) {t=a;a=b;b=t;}do {} while(0) PetscErrorCode SVDSetUp_TRLanczos(SVD svd) { diff --git a/src/sys/classes/fn/impls/exp/fnexp.c b/src/sys/classes/fn/impls/exp/fnexp.c index e65f1a39b..c7fe8c9f2 100644 --- a/src/sys/classes/fn/impls/exp/fnexp.c +++ b/src/sys/classes/fn/impls/exp/fnexp.c @@ -29,7 +29,7 @@ PetscErrorCode FNEvaluateDerivative_Exp(FN fn,PetscScalar x,PetscScalar *y) } #define MAX_PADE 6 -#define SWAP(a,b,t) {t=a;a=b;b=t;} +#define SWAP(a,b,t) {t=a;a=b;b=t;}do {} while(0) PetscErrorCode FNEvaluateFunctionMat_Exp_Pade(FN fn,Mat A,Mat B) { diff --git a/src/sys/classes/fn/impls/fnutil.c b/src/sys/classes/fn/impls/fnutil.c index 6dc7cdd2b..9e77ffd6e 100644 --- a/src/sys/classes/fn/impls/fnutil.c +++ b/src/sys/classes/fn/impls/fnutil.c @@ -515,7 +515,7 @@ PetscErrorCode FNSqrtmDenmanBeavers_CUDAm(FN fn,PetscBLASInt n,PetscScalar *d_T, #endif /* PETSC_HAVE_CUDA */ #define ITMAX 5 -#define SWAP(a,b,t) {t=a;a=b;b=t;} +#define SWAP(a,b,t) {t=a;a=b;b=t;}do {} while(0) /* Estimate norm(A^m,1) by block 1-norm power method (required workspace is 11*n) diff --git a/src/sys/classes/st/impls/cayley/cayley.c b/src/sys/classes/st/impls/cayley/cayley.c index 6ea17af43..2b40d76c4 100644 --- a/src/sys/classes/st/impls/cayley/cayley.c +++ b/src/sys/classes/st/impls/cayley/cayley.c @@ -29,7 +29,7 @@ static PetscErrorCode MatMult_Cayley(Mat B,Vec x,Vec y) ctx = (ST_CAYLEY*)st->data; nu = ctx->nu; - if (st->matmode == ST_MATMODE_INPLACE) { nu = nu + st->sigma; }; + if (st->matmode == ST_MATMODE_INPLACE) { nu = nu + st->sigma; } if (st->nmat>1) { /* generalized eigenproblem: y = (A + tB)x */ @@ -55,7 +55,7 @@ static PetscErrorCode MatMultTranspose_Cayley(Mat B,Vec x,Vec y) ctx = (ST_CAYLEY*)st->data; nu = ctx->nu; - if (st->matmode == ST_MATMODE_INPLACE) { nu = nu + st->sigma; }; + if (st->matmode == ST_MATMODE_INPLACE) { nu = nu + st->sigma; } nu = PetscConj(nu); if (st->nmat>1) { From dcde58248ed3f1e7405c4edabfa200a8b7d78895 Mon Sep 17 00:00:00 2001 From: Pierre Jolivet Date: Fri, 14 Jul 2023 22:08:00 +0200 Subject: [PATCH 050/112] Fix bad style from !560 --- src/eps/impls/krylov/krylovschur/ks-slice.c | 2 +- src/eps/interface/epssolve.c | 2 +- src/pep/impls/krylov/stoar/qslice.c | 2 +- src/svd/impls/trlanczos/trlanczos.c | 2 +- src/sys/classes/fn/impls/exp/fnexp.c | 2 +- src/sys/classes/fn/impls/fnutil.c | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/eps/impls/krylov/krylovschur/ks-slice.c b/src/eps/impls/krylov/krylovschur/ks-slice.c index d471fdbc1..eeec52b1a 100644 --- a/src/eps/impls/krylov/krylovschur/ks-slice.c +++ b/src/eps/impls/krylov/krylovschur/ks-slice.c @@ -554,7 +554,7 @@ PetscErrorCode EPSComputeVectors_Slice(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -#define SWAP(a,b,t) {t=a;a=b;b=t;}do {} while(0) +#define SWAP(a,b,t) do {t=a;a=b;b=t;} while (0) static PetscErrorCode EPSSliceGetInertias(EPS eps,PetscInt *n,PetscReal **shifts,PetscInt **inertias) { diff --git a/src/eps/interface/epssolve.c b/src/eps/interface/epssolve.c index 03f7e292b..2007b2bb3 100644 --- a/src/eps/interface/epssolve.c +++ b/src/eps/interface/epssolve.c @@ -24,7 +24,7 @@ PetscErrorCode EPSComputeVectors(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -#define SWAP(a,b,t) {t=a;a=b;b=t;}do {} while(0) +#define SWAP(a,b,t) do {t=a;a=b;b=t;} while (0) static PetscErrorCode EPSComputeValues(EPS eps) { diff --git a/src/pep/impls/krylov/stoar/qslice.c b/src/pep/impls/krylov/stoar/qslice.c index b250c8118..754e84588 100644 --- a/src/pep/impls/krylov/stoar/qslice.c +++ b/src/pep/impls/krylov/stoar/qslice.c @@ -1311,7 +1311,7 @@ static PetscErrorCode PEPSTOAR_QSlice(PEP pep,Mat B) PetscFunctionReturn(PETSC_SUCCESS); } -#define SWAP(a,b,t) {t=a;a=b;b=t;}do {} while(0) +#define SWAP(a,b,t) do {t=a;a=b;b=t;} while (0) static PetscErrorCode PEPQSliceGetInertias(PEP pep,PetscInt *n,PetscReal **shifts,PetscInt **inertias) { diff --git a/src/svd/impls/trlanczos/trlanczos.c b/src/svd/impls/trlanczos/trlanczos.c index c97f046f9..2f60d77f8 100644 --- a/src/svd/impls/trlanczos/trlanczos.c +++ b/src/svd/impls/trlanczos/trlanczos.c @@ -198,7 +198,7 @@ static PetscErrorCode MatCreateVecs_Z(Mat Z,Vec *right,Vec *left) PetscFunctionReturn(PETSC_SUCCESS); } -#define SWAP(a,b,t) {t=a;a=b;b=t;}do {} while(0) +#define SWAP(a,b,t) do {t=a;a=b;b=t;} while (0) PetscErrorCode SVDSetUp_TRLanczos(SVD svd) { diff --git a/src/sys/classes/fn/impls/exp/fnexp.c b/src/sys/classes/fn/impls/exp/fnexp.c index c7fe8c9f2..7ecec9760 100644 --- a/src/sys/classes/fn/impls/exp/fnexp.c +++ b/src/sys/classes/fn/impls/exp/fnexp.c @@ -29,7 +29,7 @@ PetscErrorCode FNEvaluateDerivative_Exp(FN fn,PetscScalar x,PetscScalar *y) } #define MAX_PADE 6 -#define SWAP(a,b,t) {t=a;a=b;b=t;}do {} while(0) +#define SWAP(a,b,t) do {t=a;a=b;b=t;} while (0) PetscErrorCode FNEvaluateFunctionMat_Exp_Pade(FN fn,Mat A,Mat B) { diff --git a/src/sys/classes/fn/impls/fnutil.c b/src/sys/classes/fn/impls/fnutil.c index 9e77ffd6e..6f6da2f85 100644 --- a/src/sys/classes/fn/impls/fnutil.c +++ b/src/sys/classes/fn/impls/fnutil.c @@ -515,7 +515,7 @@ PetscErrorCode FNSqrtmDenmanBeavers_CUDAm(FN fn,PetscBLASInt n,PetscScalar *d_T, #endif /* PETSC_HAVE_CUDA */ #define ITMAX 5 -#define SWAP(a,b,t) {t=a;a=b;b=t;}do {} while(0) +#define SWAP(a,b,t) do {t=a;a=b;b=t;} while (0) /* Estimate norm(A^m,1) by block 1-norm power method (required workspace is 11*n) From d7c0657867981af9bd2e2d60d204a45f42954f23 Mon Sep 17 00:00:00 2001 From: Pierre Jolivet Date: Tue, 18 Jul 2023 06:52:31 +0200 Subject: [PATCH 051/112] slepc4py: pin Cython version below 3.0.0 See also https://gitlab.com/petsc/petsc/-/merge_requests/6720 *** Building slepc4py *** running build running build_src removing Cython 0.29.14 from sys.modules fetching build requirement 'Cython >= 0.29.32' using Cython 3.0.0 cythonizing 'slepc4py/SLEPc.pyx' -> 'slepc4py/SLEPc.c' warning: /var/lib/gitlab-runner/builds/v_xs4Kha/0/slepc/petsc/arch-gnu-c/lib/petsc4py/PETSc.pxd:332:72: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython. Error compiling Cython file: ------------------------------------------------------------ ... if (SlepcInitializeCalled): return 1 if (SlepcFinalizeCalled): return 0 # initialize SLEPC CHKERR( SlepcInitialize(NULL, NULL, NULL, NULL) ) # register finalization function if Py_AtExit(finalize) < 0: ^ ------------------------------------------------------------ slepc4py/SLEPc/SLEPc.pyx:212:17: Cannot assign type 'void (void) except * nogil' to 'void (*)(void) noexcept' error: Cython failure: 'slepc4py/SLEPc.pyx' -> 'slepc4py/SLEPc.c' --- src/binding/slepc4py/conf/confpetsc.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/binding/slepc4py/conf/confpetsc.py b/src/binding/slepc4py/conf/confpetsc.py index 89c4e1247..d9cf7886f 100644 --- a/src/binding/slepc4py/conf/confpetsc.py +++ b/src/binding/slepc4py/conf/confpetsc.py @@ -100,8 +100,8 @@ def printer(*s): sys.stderr.write(" ".join(s)+"\n") return False REQUIRED = Version(VERSION) PROVIDED = Version(m.groups()[0]) - if PROVIDED < REQUIRED: - warn("You need Cython >= {0} (you have version {1})" + if PROVIDED != REQUIRED: + warn("You need Cython == {0} (you have version {1})" .format(VERSION, CYTHON_VERSION)) return False # @@ -130,7 +130,7 @@ def cython_run( return finally: os.chdir(cwd) - require = 'Cython >= %s' % VERSION + require = 'Cython == %s' % VERSION if setuptools and not cython_chk(VERSION, verbose=False): if sys.modules.get('Cython'): removed = getattr(sys.modules['Cython'], '__version__', '') @@ -764,7 +764,7 @@ def setup(**attrs): version = cython_req() if not cython_chk(version, verbose=False): reqs = attrs.setdefault('setup_requires', []) - reqs += ['Cython>='+version] + reqs += ['Cython=='+version] return _setup(**attrs) # -------------------------------------------------------------------- From 07c11beb47a3a8a7022b7ce6fa8eb054eb5cf88f Mon Sep 17 00:00:00 2001 From: Pierre Jolivet Date: Tue, 18 Jul 2023 10:52:49 +0200 Subject: [PATCH 052/112] Minor typo in make check --- src/eps/tests/makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/eps/tests/makefile b/src/eps/tests/makefile index 7edac7ea5..4193fa0e0 100644 --- a/src/eps/tests/makefile +++ b/src/eps/tests/makefile @@ -58,9 +58,9 @@ testtest10_mpi: test10.PETSc options="-eps_nev 4 -eps_ncv 14 -m 11 -eps_largest_magnitude"; \ ${MPIEXEC} -n 2 ./test10 $${options} | ${SED} -e 's/82109/82110/' > $${test}.tmp 2>&1; \ if (${DIFF} output/$${check}.out $${test}.tmp > /dev/null 2>&1) then \ - echo "C/C++ example src/eps/tests/test10 run successfully with 2 MPI process"; \ + echo "C/C++ example src/eps/tests/test10 run successfully with 2 MPI processes"; \ else \ - echo "Possible error running C/C++ src/eps/tests/test10 with 2 MPI process"; \ + echo "Possible error running C/C++ src/eps/tests/test10 with 2 MPI processes"; \ cat $${test}.tmp; \ touch ../../../check_error; \ fi; \ From 1812ab28a0b9f45dfc4b5e661bf6e3ca899f73ab Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Tue, 18 Jul 2023 11:16:44 +0200 Subject: [PATCH 053/112] Add new project reference --- README.md | 1 + docs/manual/slepc.tex | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index 62e1ff52d..88e783e6f 100644 --- a/README.md +++ b/README.md @@ -62,4 +62,5 @@ The development of SLEPc has been partially supported by the following grants: - Ministerio de Economia y Competitividad, TIN2013-41049-P. - Agencia Estatal de Investigacion, TIN2016-75985-P. - Agencia Estatal de Investigacion, PID2019-107379RB-I00. +- Agencia Estatal de Investigacion, PID2022-139568NB-I00. diff --git a/docs/manual/slepc.tex b/docs/manual/slepc.tex index d0ffcc7e7..27a523528 100644 --- a/docs/manual/slepc.tex +++ b/docs/manual/slepc.tex @@ -200,6 +200,7 @@ \subsubsection*{Acknowledgments} Development of \slepc has been partially funded by the following grants: \begin{itemize} \setlength{\itemsep}{-2pt} +\item Agencia Estatal de Investigaci\'on (Spain), grant no.\ PID2022-139568NB-I00, PI: Jos\'e E. Rom\'an. \item Agencia Estatal de Investigaci\'on (Spain), grant no.\ PID2019-107379RB-I00, PI: Jos\'e E. Rom\'an. \item Agencia Estatal de Investigaci\'on (Spain), grant no.\ TIN2016-75985-P, PI: Jos\'e E. Rom\'an. \item Ministerio de Econom\'{\i}a y Comp.\ (Spain), grant no.\ TIN2013-41049-P, PI: Jos\'e E. Rom\'an. From 33dad61114829d18d37f9b5907ec20f3daee5868 Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Thu, 22 Jun 2023 18:11:54 +0200 Subject: [PATCH 054/112] configure: bump ELPA version, disable tests during configure --- .gitlab-ci.yml | 2 +- config/packages/elpa.py | 4 ++-- config/packages/ksvd.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cd2c07064..8d8050a1f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -389,7 +389,7 @@ gnu-c-complex-multilib: tags: - linux-ubuntu, name:maat variables: - PETSC_CONFIG_OPTS: --with-scalar-type=complex --with-single-library=0 --download-elemental --download-metis --download-parmetis --download-scalapack + PETSC_CONFIG_OPTS: --with-scalar-type=complex --with-single-library=0 --download-elemental --download-metis --download-parmetis --download-scalapack --with-cxx-dialect=17 SLEPC_CONFIG_OPTS: --DATAFILESPATH=/var/local --with-packages-download-dir=/var/local/downloads --download-elpa --with-fortran-bindings-inplace intel-c-complex-mkl: diff --git a/config/packages/elpa.py b/config/packages/elpa.py index 8793a8632..20560f341 100644 --- a/config/packages/elpa.py +++ b/config/packages/elpa.py @@ -18,7 +18,7 @@ def __init__(self,argdb,log): self.packagetype = 'gnu' self.installable = True self.downloadable = True - self.version = '2022.11.001' + self.version = '2023.05.001' self.archive = 'elpa-'+self.version+'.tar.gz' self.url = 'https://elpa.mpcdf.mpg.de/software/tarball-archive/Releases/'+self.version+'/'+self.archive self.supportssingle = True @@ -101,7 +101,7 @@ def DownloadAndInstall(self,slepcconf,slepcvars,slepc,petsc,archdir,prefixdir): self.log.Exit('--download-elpa requires that the command autoreconf is available on your PATH') # Build package - confopt = ['--prefix='+prefixdir, '--libdir='+os.path.join(prefixdir,'lib'), 'CC="'+petsc.cc+'"', 'CFLAGS="'+petsc.getCFlags()+'"', 'F77="'+petsc.fc+'"', 'FFLAGS="'+petsc.getFFlags()+'"', 'FC="'+petsc.fc+'"', 'FCFLAGS="'+petsc.getFFlags()+'"', 'CXX="'+petsc.cxx+'"', 'CXXFLAGS="'+petsc.getCXXFlags()+'"', 'CPP="'+petsc.cpp+'"', 'SCALAPACK_LDFLAGS="'+petsc.scalapack_lib+'"', '--disable-sse', '--disable-sse-assembly', '--disable-avx', '--disable-avx2', '--disable-avx512'] + confopt = ['--prefix='+prefixdir, '--libdir='+os.path.join(prefixdir,'lib'), 'CC="'+petsc.cc+'"', 'CFLAGS="'+petsc.getCFlags()+'"', 'F77="'+petsc.fc+'"', 'FFLAGS="'+petsc.getFFlags()+'"', 'FC="'+petsc.fc+'"', 'FCFLAGS="'+petsc.getFFlags()+'"', 'CXX="'+petsc.cxx+'"', 'CXXFLAGS="'+petsc.getCXXFlags()+'"', 'CPP="'+petsc.cpp+'"', 'SCALAPACK_LDFLAGS="'+petsc.scalapack_lib+'"', '--disable-sse', '--disable-sse-assembly', '--disable-avx', '--disable-avx2', '--disable-avx512', '-disable-c-tests', '-disable-cpp-tests'] if petsc.fc_version.startswith('nvf'): confopt.append('LIBS="'+petsc.blaslapack_lib+' -lnvf"') else: diff --git a/config/packages/ksvd.py b/config/packages/ksvd.py index cc5b7d89a..bf3f2ca64 100644 --- a/config/packages/ksvd.py +++ b/config/packages/ksvd.py @@ -137,7 +137,7 @@ def DownloadAndInstall(self,slepcconf,slepcvars,slepc,petsc,archdir,prefixdir): # Build package builddir = slepc.CreateDir(builddir,'build') - confopt = ['-DCMAKE_INSTALL_PREFIX='+prefixdir, '-DCMAKE_INSTALL_NAME_DIR:STRING="'+os.path.join(prefixdir,'lib')+'"', '-DCMAKE_C_COMPILER="'+petsc.cc+'"', '-DCMAKE_C_FLAGS:STRING="'+petsc.getCFlags()+'"', '-DELPA_INCDIR="'+os.path.join(incdir,'elpa-2022.11.001')+'"', '-DELPA_LIBDIR="'+libdir+'"', '-DPOLAR_DIR="'+prefixdir+'"', '-DBLAS_LIBRARIES="'+petsc.blaslapack_lib+'"'] + confopt = ['-DCMAKE_INSTALL_PREFIX='+prefixdir, '-DCMAKE_INSTALL_NAME_DIR:STRING="'+os.path.join(prefixdir,'lib')+'"', '-DCMAKE_C_COMPILER="'+petsc.cc+'"', '-DCMAKE_C_FLAGS:STRING="'+petsc.getCFlags()+'"', '-DELPA_INCDIR="'+os.path.join(incdir,'elpa-'+self.elpa.version)+'"', '-DELPA_LIBDIR="'+libdir+'"', '-DPOLAR_DIR="'+prefixdir+'"', '-DBLAS_LIBRARIES="'+petsc.blaslapack_lib+'"'] confopt.append('-DCMAKE_BUILD_TYPE='+('Debug' if petsc.debug else 'Release')) if petsc.buildsharedlib: confopt = confopt + ['-DBUILD_SHARED_LIBS=ON', '-DCMAKE_INSTALL_RPATH:PATH='+os.path.join(prefixdir,'lib')] From cd29b40a6c208f4c6181504adee38a2da3468034 Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Fri, 23 Jun 2023 10:38:02 +0200 Subject: [PATCH 055/112] configure: add support for --download-slicot --- .gitlab-ci.yml | 4 ++-- config/packages/slicot.py | 28 +++++++++++++++++++++++----- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8d8050a1f..9d85503e0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -389,7 +389,7 @@ gnu-c-complex-multilib: tags: - linux-ubuntu, name:maat variables: - PETSC_CONFIG_OPTS: --with-scalar-type=complex --with-single-library=0 --download-elemental --download-metis --download-parmetis --download-scalapack --with-cxx-dialect=17 + PETSC_CONFIG_OPTS: --with-scalar-type=complex --with-single-library=0 --download-metis --download-parmetis --download-scalapack --with-cxx-dialect=17 SLEPC_CONFIG_OPTS: --DATAFILESPATH=/var/local --with-packages-download-dir=/var/local/downloads --download-elpa --with-fortran-bindings-inplace intel-c-complex-mkl: @@ -411,7 +411,7 @@ gnu-c-libs: - linux-suse, name:igai variables: PETSC_CONFIG_OPTS: --with-single-library=0 --download-scalapack - SLEPC_CONFIG_OPTS: --DATAFILESPATH=/var/local --download-arpack --download-evsl --download-primme --download-blopex --download-trlan --with-packages-download-dir=/var/local/downloads + SLEPC_CONFIG_OPTS: --DATAFILESPATH=/var/local --download-arpack --download-evsl --download-primme --download-blopex --download-trlan --download-slicot --with-packages-download-dir=/var/local/downloads gnu-cxx-int64: extends: diff --git a/config/packages/slicot.py b/config/packages/slicot.py index 978bb7d7d..7b7961585 100644 --- a/config/packages/slicot.py +++ b/config/packages/slicot.py @@ -16,9 +16,12 @@ def __init__(self,argdb,log): package.Package.__init__(self,argdb,log) self.packagename = 'slicot' self.installable = True - self.version = '4.5' - self.archive = 'slicot45.tar.gz' - self.url = 'http://slicot.org/objects/software/shared/'+self.archive + self.downloadable = True + self.gitcommit = '401037e4992827cd7476baae615be6fe818b71d4' + #self.version = '5.8' + obj = self.version if hasattr(self,'version') else self.gitcommit + self.url = 'https://github.com/SLICOT/SLICOT-Reference/archive/'+('v'+obj if hasattr(self,'version') else obj)+'.tar.gz' + self.archive = 'slicot-'+obj+'.tar.gz' self.supportsscalar = ['real'] self.fortran = True self.ProcessArgs(argdb) @@ -50,11 +53,26 @@ def DownloadAndInstall(self,slepcconf,slepcvars,slepc,petsc,archdir,prefixdir): cont += 'ARCH = '+petsc.ar+'\n' cont += 'ARCHFLAGS = '+petsc.ar_flags+'\n' cont += 'SLICOTLIB = ../'+libname+'\n' - self.WriteMakefile('make.inc',builddir,cont) + cont += 'LPKAUXLIB = ../'+libname+'\n' # TODO: use a separate library for this + self.WriteMakefile('make_Unix.inc',builddir,cont) + + # Patch top level makefile_Unix + (result,output) = self.RunCommand('cd '+builddir+' && '+petsc.sedinplace+' -e "s?MAKE.?MAKE) -f makefile_Unix?" makefile_Unix') + if result: + self.log.Exit('Problem when patching file makefile_Unix') + + # Patch makefile_Unix in src + sedargs = ' -e "s?make.inc?make_Unix.inc?"' + remfiles = ['MB04RD', 'MB04RS', 'MB04RT', 'MB04RV', 'MB04RW', 'MB04RZ', 'zelctg'] + for f in remfiles: + sedargs = sedargs + ' -e "s?'+f+'.o??"' + (result,output) = self.RunCommand('cd '+os.path.join(builddir,'src')+' && '+petsc.sedinplace+' '+sedargs+' makefile_Unix') + if result: + self.log.Exit('Problem when patching file makefile_Unix in src') # Build package target = 'lib' - (result,output) = self.RunCommand('cd '+builddir+'&&'+petsc.make+' clean &&'+petsc.make+' '+target) + (result,output) = self.RunCommand('cd '+builddir+' && '+petsc.make+' -f makefile_Unix cleanlib && '+petsc.make+' -f makefile_Unix -j'+petsc.make_np+' '+target) if result: self.log.Exit('Installation of SLICOT failed') From 4a4de486eaf9d317d2b71d0f25c44acc8fb6810f Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Sun, 16 Jul 2023 11:27:13 +0200 Subject: [PATCH 056/112] gitlab-ci: add a job to test DESTDIR builds --- .gitlab-ci.yml | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9d85503e0..dd22ff949 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -473,6 +473,72 @@ pip-install: after_script: - date +# +# Special job in stage-3 to check DESTDIR install (only in scheduled pipelines). +# + +destdir-install: + extends: + - .stage-3-sched + - .linux_test + tags: + - name:hapy + before_script: + - date + - hostname + - grep PRETTY_NAME /etc/os-release + - nproc + - lscpu + script: + - printf "PETSC_CONFIG_OPTS:${PETSC_CONFIG_OPTS}\n" + - export SLEPC_DIR=$PWD + - echo -e "section_start:`date +%s`:build_petsc\r\e[0KPETSc configure and make" + - cd .. + - export DESTDIR=${PWD}/destdir + - export PREFIX=${PWD}/prefix + - rm -rf ${DESTDIR} ${PREFIX} + - if [ ! -d petsc ]; then git clone https://gitlab.com/petsc/petsc.git; fi + - cd petsc + - git clean ${GIT_CLEAN_FLAGS} + - git fetch + - | + if [ -z ${PETSC_BRANCH+x} ]; then + if [ $(awk '/define SLEPC_VERSION_RELEASE/{print $3}' $SLEPC_DIR/include/slepcversion.h) == 1 ]; + then git checkout origin/release; + else git checkout origin/main; + fi + else + echo "Using PETSC_BRANCH=" $PETSC_BRANCH + git checkout origin/$PETSC_BRANCH + fi + - export PETSC_DIR=$PWD + - export PETSC_ARCH=arch-$CI_JOB_NAME + - bash -c "${PYTHON} ./configure --with-debugging=0 --with-mpi=0 --prefix=${PREFIX} COPTFLAGS=-O CXXOPTFLAGS=-O FOPTFLAGS=-O CUDAOPTFLAGS=-O1 ${PETSC_CONFIG_OPTS}" + - make CFLAGS="${MAKE_CFLAGS}" CXXFLAGS="${MAKE_CXXFLAGS}" FFLAGS="${MAKE_FFLAGS}" CUDAFLAGS="${MAKE_CUDAFLAGS}" + - make install-lib DESTDIR=${DESTDIR}; cp -r ${DESTDIR}${PREFIX} ..; PETSC_DIR=${PREFIX}; unset PETSC_ARCH + - echo -e "section_end:`date +%s`:build_petsc\r\e[0K" + - echo -e "section_start:`date +%s`:build_slepc\r\e[0KSLEPc configure and make" + - cd $SLEPC_DIR + - ${PYTHON} ./configure --prefix=${PREFIX} + - make CFLAGS="${MAKE_CFLAGS}" CXXFLAGS="${MAKE_CXXFLAGS}" FFLAGS="${MAKE_FFLAGS}" CUDAFLAGS="${MAKE_CUDAFLAGS}" + - make install-lib DESTDIR=${DESTDIR}; cp -r ${DESTDIR}${PREFIX} ..; SLEPC_DIR=${PREFIX} + - make CFLAGS="${MAKE_CFLAGS}" CXXFLAGS="${MAKE_CXXFLAGS}" FFLAGS="${MAKE_FFLAGS}" CUDAFLAGS="${MAKE_CUDAFLAGS}" check + - echo -e "section_end:`date +%s`:build_slepc\r\e[0K" + variables: + PYTHON: python3 + MAKE_CFLAGS: -Werror + MAKE_CXXFLAGS: -Werror -Wzero-as-null-pointer-constant + MAKE_FFLAGS: -Werror + after_script: + - date + artifacts: + name: "$CI_JOB_NAME" + when: always + paths: + - arch-*/lib/slepc/conf/*.log + - arch-*/lib/slepc/conf/slepc* + expire_in: 4 days + # # The following tests run as part of stage-3. # From 1cd8dac406b0cae33c6acc0ad645201bd2b6c808 Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Wed, 19 Jul 2023 09:36:32 +0200 Subject: [PATCH 057/112] Replace PetscValid*Pointer by PetscAssertPointer --- src/eps/impls/cg/lobpcg/lobpcg.c | 6 +-- src/eps/impls/cg/rqcg/rqcg.c | 2 +- src/eps/impls/ciss/ciss.c | 6 +-- src/eps/impls/davidson/gd/gd.c | 10 ++--- src/eps/impls/davidson/jd/jd.c | 12 +++--- src/eps/impls/external/blopex/blopex.c | 2 +- src/eps/impls/external/evsl/evsl.c | 4 +- src/eps/impls/external/feast/feast.c | 2 +- src/eps/impls/external/primme/primme.c | 4 +- src/eps/impls/krylov/arnoldi/arnoldi.c | 2 +- .../impls/krylov/krylovschur/krylovschur.c | 12 +++--- src/eps/impls/krylov/lanczos/lanczos.c | 2 +- src/eps/impls/lyapii/lyapii.c | 2 +- src/eps/impls/power/power.c | 8 ++-- src/eps/interface/epsbasic.c | 22 +++++----- src/eps/interface/epsopts.c | 20 +++++----- src/eps/interface/epssetup.c | 6 +-- src/eps/interface/epssolve.c | 12 +++--- src/lme/interface/lmebasic.c | 8 ++-- src/lme/interface/lmedense.c | 12 +++--- src/lme/interface/lmeopts.c | 8 ++-- src/lme/interface/lmesetup.c | 4 +- src/lme/interface/lmesolve.c | 8 ++-- src/mfn/interface/mfnbasic.c | 10 ++--- src/mfn/interface/mfnopts.c | 6 +-- src/mfn/interface/mfnsetup.c | 2 +- src/mfn/interface/mfnsolve.c | 4 +- src/nep/impls/ciss/nciss.c | 2 +- src/nep/impls/interpol/interpol.c | 2 +- src/nep/impls/narnoldi/narnoldi.c | 4 +- src/nep/impls/nleigs/nleigs-fullb.c | 2 +- src/nep/impls/nleigs/nleigs.c | 12 +++--- src/nep/impls/rii/rii.c | 12 +++--- src/nep/impls/slp/slp.c | 8 ++-- src/nep/interface/nepbasic.c | 24 +++++------ src/nep/interface/nepdefault.c | 2 +- src/nep/interface/nepopts.c | 14 +++---- src/nep/interface/nepsetup.c | 2 +- src/nep/interface/nepsolve.c | 10 ++--- src/pep/impls/ciss/pciss.c | 2 +- src/pep/impls/jd/pjd.c | 10 ++--- src/pep/impls/krylov/qarnoldi/qarnoldi.c | 4 +- src/pep/impls/krylov/stoar/stoar.c | 8 ++-- src/pep/impls/krylov/toar/ptoar.c | 4 +- src/pep/impls/linear/linear.c | 4 +- src/pep/interface/pepbasic.c | 18 ++++----- src/pep/interface/pepopts.c | 16 ++++---- src/pep/interface/pepsetup.c | 8 ++-- src/pep/interface/pepsolve.c | 10 ++--- src/svd/impls/cross/cross.c | 4 +- src/svd/impls/cyclic/cyclic.c | 4 +- src/svd/impls/external/ksvd/svdksvd.c | 4 +- src/svd/impls/external/primme/svdprimme.c | 4 +- src/svd/impls/lanczos/gklanczos.c | 2 +- src/svd/impls/trlanczos/trlanczos.c | 14 +++---- src/svd/interface/svdbasic.c | 8 ++-- src/svd/interface/svdopts.c | 18 ++++----- src/svd/interface/svdsetup.c | 6 +-- src/svd/interface/svdsolve.c | 8 ++-- src/sys/classes/bv/impls/tensor/bvtensor.c | 2 +- src/sys/classes/bv/interface/bvbasic.c | 30 +++++++------- src/sys/classes/bv/interface/bvcontour.c | 6 +-- src/sys/classes/bv/interface/bvfunc.c | 12 +++--- src/sys/classes/bv/interface/bvglobal.c | 14 +++---- src/sys/classes/bv/interface/bvkrylov.c | 4 +- src/sys/classes/bv/interface/bvops.c | 2 +- src/sys/classes/bv/interface/bvorthog.c | 2 +- src/sys/classes/ds/impls/ghiep/dsghiep.c | 6 +-- src/sys/classes/ds/impls/ghiep/hz.c | 2 +- src/sys/classes/ds/impls/gnhep/dsgnhep.c | 2 +- src/sys/classes/ds/impls/hsvd/dshsvd.c | 4 +- src/sys/classes/ds/impls/nep/dsnep.c | 14 +++---- src/sys/classes/ds/impls/nhep/dsnhep.c | 2 +- src/sys/classes/ds/impls/nhepts/dsnhepts.c | 2 +- src/sys/classes/ds/impls/pep/dspep.c | 4 +- src/sys/classes/ds/impls/svd/dssvd.c | 2 +- src/sys/classes/ds/interface/dsbasic.c | 26 ++++++------ src/sys/classes/ds/interface/dsops.c | 40 +++++++++---------- src/sys/classes/ds/interface/dspriv.c | 8 ++-- src/sys/classes/fn/impls/phi/fnphi.c | 2 +- .../classes/fn/impls/rational/fnrational.c | 4 +- src/sys/classes/fn/interface/fnbasic.c | 18 ++++----- src/sys/classes/rg/impls/polygon/rgpolygon.c | 4 +- src/sys/classes/rg/interface/rgbasic.c | 32 +++++++-------- src/sys/classes/st/impls/cayley/cayley.c | 2 +- src/sys/classes/st/impls/filter/filter.c | 4 +- src/sys/classes/st/impls/precond/precond.c | 2 +- src/sys/classes/st/impls/shell/shell.c | 2 +- src/sys/classes/st/interface/stfunc.c | 22 +++++----- src/sys/classes/st/interface/stset.c | 10 ++--- src/sys/classes/st/interface/stsles.c | 2 +- src/sys/classes/st/interface/stsolve.c | 6 +-- src/sys/mat/matutil.c | 4 +- src/sys/slepcsc.c | 10 ++--- src/sys/vec/pool.c | 6 +-- src/sys/vec/veccomp.c | 10 ++--- src/sys/vec/vecutil.c | 10 ++--- 97 files changed, 390 insertions(+), 390 deletions(-) diff --git a/src/eps/impls/cg/lobpcg/lobpcg.c b/src/eps/impls/cg/lobpcg/lobpcg.c index 723a37a07..3a95a9d85 100644 --- a/src/eps/impls/cg/lobpcg/lobpcg.c +++ b/src/eps/impls/cg/lobpcg/lobpcg.c @@ -461,7 +461,7 @@ PetscErrorCode EPSLOBPCGGetBlockSize(EPS eps,PetscInt *bs) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidIntPointer(bs,2); + PetscAssertPointer(bs,2); PetscUseMethod(eps,"EPSLOBPCGGetBlockSize_C",(EPS,PetscInt*),(eps,bs)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -539,7 +539,7 @@ PetscErrorCode EPSLOBPCGGetRestart(EPS eps,PetscReal *restart) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidRealPointer(restart,2); + PetscAssertPointer(restart,2); PetscUseMethod(eps,"EPSLOBPCGGetRestart_C",(EPS,PetscReal*),(eps,restart)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -612,7 +612,7 @@ PetscErrorCode EPSLOBPCGGetLocking(EPS eps,PetscBool *lock) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidBoolPointer(lock,2); + PetscAssertPointer(lock,2); PetscUseMethod(eps,"EPSLOBPCGGetLocking_C",(EPS,PetscBool*),(eps,lock)); PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/eps/impls/cg/rqcg/rqcg.c b/src/eps/impls/cg/rqcg/rqcg.c index fde90643a..5d446c72b 100644 --- a/src/eps/impls/cg/rqcg/rqcg.c +++ b/src/eps/impls/cg/rqcg/rqcg.c @@ -309,7 +309,7 @@ PetscErrorCode EPSRQCGGetReset(EPS eps,PetscInt *nrest) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidIntPointer(nrest,2); + PetscAssertPointer(nrest,2); PetscUseMethod(eps,"EPSRQCGGetReset_C",(EPS,PetscInt*),(eps,nrest)); PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/eps/impls/ciss/ciss.c b/src/eps/impls/ciss/ciss.c index 5e4af7ad6..241a02f30 100644 --- a/src/eps/impls/ciss/ciss.c +++ b/src/eps/impls/ciss/ciss.c @@ -1030,7 +1030,7 @@ PetscErrorCode EPSCISSGetUseST(EPS eps,PetscBool *usest) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidBoolPointer(usest,2); + PetscAssertPointer(usest,2); PetscUseMethod(eps,"EPSCISSGetUseST_C",(EPS,PetscBool*),(eps,usest)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -1107,7 +1107,7 @@ PetscErrorCode EPSCISSGetQuadRule(EPS eps,EPSCISSQuadRule *quad) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidPointer(quad,2); + PetscAssertPointer(quad,2); PetscUseMethod(eps,"EPSCISSGetQuadRule_C",(EPS,EPSCISSQuadRule*),(eps,quad)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -1184,7 +1184,7 @@ PetscErrorCode EPSCISSGetExtraction(EPS eps,EPSCISSExtraction *extraction) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidPointer(extraction,2); + PetscAssertPointer(extraction,2); PetscUseMethod(eps,"EPSCISSGetExtraction_C",(EPS,EPSCISSExtraction*),(eps,extraction)); PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/eps/impls/davidson/gd/gd.c b/src/eps/impls/davidson/gd/gd.c index 2759966e7..9fec73125 100644 --- a/src/eps/impls/davidson/gd/gd.c +++ b/src/eps/impls/davidson/gd/gd.c @@ -175,7 +175,7 @@ PetscErrorCode EPSGDGetKrylovStart(EPS eps,PetscBool *krylovstart) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidBoolPointer(krylovstart,2); + PetscAssertPointer(krylovstart,2); PetscUseMethod(eps,"EPSGDGetKrylovStart_C",(EPS,PetscBool*),(eps,krylovstart)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -226,7 +226,7 @@ PetscErrorCode EPSGDGetBlockSize(EPS eps,PetscInt *blocksize) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidIntPointer(blocksize,2); + PetscAssertPointer(blocksize,2); PetscUseMethod(eps,"EPSGDGetBlockSize_C",(EPS,PetscInt*),(eps,blocksize)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -345,7 +345,7 @@ PetscErrorCode EPSGDGetInitialSize(EPS eps,PetscInt *initialsize) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidIntPointer(initialsize,2); + PetscAssertPointer(initialsize,2); PetscUseMethod(eps,"EPSGDGetInitialSize_C",(EPS,PetscInt*),(eps,initialsize)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -396,7 +396,7 @@ PetscErrorCode EPSGDGetBOrth(EPS eps,PetscBool *borth) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidBoolPointer(borth,2); + PetscAssertPointer(borth,2); PetscUseMethod(eps,"EPSGDGetBOrth_C",(EPS,PetscBool*),(eps,borth)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -469,7 +469,7 @@ PetscErrorCode EPSGDGetDoubleExpansion(EPS eps,PetscBool *doubleexp) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidBoolPointer(doubleexp,2); + PetscAssertPointer(doubleexp,2); PetscUseMethod(eps,"EPSGDGetDoubleExpansion_C",(EPS,PetscBool*),(eps,doubleexp)); PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/eps/impls/davidson/jd/jd.c b/src/eps/impls/davidson/jd/jd.c index e981be19f..7e536a4c4 100644 --- a/src/eps/impls/davidson/jd/jd.c +++ b/src/eps/impls/davidson/jd/jd.c @@ -205,7 +205,7 @@ PetscErrorCode EPSJDGetKrylovStart(EPS eps,PetscBool *krylovstart) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidBoolPointer(krylovstart,2); + PetscAssertPointer(krylovstart,2); PetscUseMethod(eps,"EPSJDGetKrylovStart_C",(EPS,PetscBool*),(eps,krylovstart)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -256,7 +256,7 @@ PetscErrorCode EPSJDGetBlockSize(EPS eps,PetscInt *blocksize) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidIntPointer(blocksize,2); + PetscAssertPointer(blocksize,2); PetscUseMethod(eps,"EPSJDGetBlockSize_C",(EPS,PetscInt*),(eps,blocksize)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -375,7 +375,7 @@ PetscErrorCode EPSJDGetInitialSize(EPS eps,PetscInt *initialsize) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidIntPointer(initialsize,2); + PetscAssertPointer(initialsize,2); PetscUseMethod(eps,"EPSJDGetInitialSize_C",(EPS,PetscInt*),(eps,initialsize)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -456,7 +456,7 @@ PetscErrorCode EPSJDGetFix(EPS eps,PetscReal *fix) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidRealPointer(fix,2); + PetscAssertPointer(fix,2); PetscUseMethod(eps,"EPSJDGetFix_C",(EPS,PetscReal*),(eps,fix)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -530,7 +530,7 @@ PetscErrorCode EPSJDGetConstCorrectionTol(EPS eps,PetscBool *constant) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidBoolPointer(constant,2); + PetscAssertPointer(constant,2); PetscUseMethod(eps,"EPSJDGetConstCorrectionTol_C",(EPS,PetscBool*),(eps,constant)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -581,7 +581,7 @@ PetscErrorCode EPSJDGetBOrth(EPS eps,PetscBool *borth) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidBoolPointer(borth,2); + PetscAssertPointer(borth,2); PetscUseMethod(eps,"EPSJDGetBOrth_C",(EPS,PetscBool*),(eps,borth)); PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/eps/impls/external/blopex/blopex.c b/src/eps/impls/external/blopex/blopex.c index a4e8e9e94..01afcc3a1 100644 --- a/src/eps/impls/external/blopex/blopex.c +++ b/src/eps/impls/external/blopex/blopex.c @@ -333,7 +333,7 @@ PetscErrorCode EPSBLOPEXGetBlockSize(EPS eps,PetscInt *bs) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidIntPointer(bs,2); + PetscAssertPointer(bs,2); PetscUseMethod(eps,"EPSBLOPEXGetBlockSize_C",(EPS,PetscInt*),(eps,bs)); PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/eps/impls/external/evsl/evsl.c b/src/eps/impls/external/evsl/evsl.c index 2e9e54a11..9bac5cd08 100644 --- a/src/eps/impls/external/evsl/evsl.c +++ b/src/eps/impls/external/evsl/evsl.c @@ -330,7 +330,7 @@ PetscErrorCode EPSEVSLGetSlices(EPS eps,PetscInt *nslices) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidIntPointer(nslices,2); + PetscAssertPointer(nslices,2); PetscUseMethod(eps,"EPSEVSLGetSlices_C",(EPS,PetscInt*),(eps,nslices)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -692,7 +692,7 @@ PetscErrorCode EPSEVSLGetDamping(EPS eps,EPSEVSLDamping *damping) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidIntPointer(damping,2); + PetscAssertPointer(damping,2); PetscUseMethod(eps,"EPSEVSLGetDamping_C",(EPS,EPSEVSLDamping*),(eps,damping)); PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/eps/impls/external/feast/feast.c b/src/eps/impls/external/feast/feast.c index 3af32e9af..cfcad7ca0 100644 --- a/src/eps/impls/external/feast/feast.c +++ b/src/eps/impls/external/feast/feast.c @@ -314,7 +314,7 @@ PetscErrorCode EPSFEASTGetNumPoints(EPS eps,PetscInt *npoints) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidPointer(npoints,2); + PetscAssertPointer(npoints,2); PetscUseMethod(eps,"EPSFEASTGetNumPoints_C",(EPS,PetscInt*),(eps,npoints)); PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/eps/impls/external/primme/primme.c b/src/eps/impls/external/primme/primme.c index 6fa44c8d6..687cd1688 100644 --- a/src/eps/impls/external/primme/primme.c +++ b/src/eps/impls/external/primme/primme.c @@ -493,7 +493,7 @@ PetscErrorCode EPSPRIMMEGetBlockSize(EPS eps,PetscInt *bs) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidIntPointer(bs,2); + PetscAssertPointer(bs,2); PetscUseMethod(eps,"EPSPRIMMEGetBlockSize_C",(EPS,PetscInt*),(eps,bs)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -563,7 +563,7 @@ PetscErrorCode EPSPRIMMEGetMethod(EPS eps,EPSPRIMMEMethod *method) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidPointer(method,2); + PetscAssertPointer(method,2); PetscUseMethod(eps,"EPSPRIMMEGetMethod_C",(EPS,EPSPRIMMEMethod*),(eps,method)); PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/eps/impls/krylov/arnoldi/arnoldi.c b/src/eps/impls/krylov/arnoldi/arnoldi.c index 1b0e7bab3..b02807956 100644 --- a/src/eps/impls/krylov/arnoldi/arnoldi.c +++ b/src/eps/impls/krylov/arnoldi/arnoldi.c @@ -213,7 +213,7 @@ PetscErrorCode EPSArnoldiGetDelayed(EPS eps,PetscBool *delayed) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidBoolPointer(delayed,2); + PetscAssertPointer(delayed,2); PetscUseMethod(eps,"EPSArnoldiGetDelayed_C",(EPS,PetscBool*),(eps,delayed)); PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/eps/impls/krylov/krylovschur/krylovschur.c b/src/eps/impls/krylov/krylovschur/krylovschur.c index f793e5f0e..4d5d8f7cd 100644 --- a/src/eps/impls/krylov/krylovschur/krylovschur.c +++ b/src/eps/impls/krylov/krylovschur/krylovschur.c @@ -405,7 +405,7 @@ PetscErrorCode EPSKrylovSchurGetRestart(EPS eps,PetscReal *keep) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidRealPointer(keep,2); + PetscAssertPointer(keep,2); PetscUseMethod(eps,"EPSKrylovSchurGetRestart_C",(EPS,PetscReal*),(eps,keep)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -480,7 +480,7 @@ PetscErrorCode EPSKrylovSchurGetLocking(EPS eps,PetscBool *lock) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidBoolPointer(lock,2); + PetscAssertPointer(lock,2); PetscUseMethod(eps,"EPSKrylovSchurGetLocking_C",(EPS,PetscBool*),(eps,lock)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -579,7 +579,7 @@ PetscErrorCode EPSKrylovSchurGetPartitions(EPS eps,PetscInt *npart) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidIntPointer(npart,2); + PetscAssertPointer(npart,2); PetscUseMethod(eps,"EPSKrylovSchurGetPartitions_C",(EPS,PetscInt*),(eps,npart)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -658,7 +658,7 @@ PetscErrorCode EPSKrylovSchurGetDetectZeros(EPS eps,PetscBool *detect) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidBoolPointer(detect,2); + PetscAssertPointer(detect,2); PetscUseMethod(eps,"EPSKrylovSchurGetDetectZeros_C",(EPS,PetscBool*),(eps,detect)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -856,7 +856,7 @@ PetscErrorCode EPSKrylovSchurGetSubintervals(EPS eps,PetscReal **subint) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidPointer(subint,2); + PetscAssertPointer(subint,2); PetscUseMethod(eps,"EPSKrylovSchurGetSubintervals_C",(EPS,PetscReal**),(eps,subint)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -954,7 +954,7 @@ PetscErrorCode EPSKrylovSchurGetInertias(EPS eps,PetscInt *n,PetscReal **shifts, { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidIntPointer(n,2); + PetscAssertPointer(n,2); PetscUseMethod(eps,"EPSKrylovSchurGetInertias_C",(EPS,PetscInt*,PetscReal**,PetscInt**),(eps,n,shifts,inertias)); PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/eps/impls/krylov/lanczos/lanczos.c b/src/eps/impls/krylov/lanczos/lanczos.c index 0143edec0..8ca13c4ca 100644 --- a/src/eps/impls/krylov/lanczos/lanczos.c +++ b/src/eps/impls/krylov/lanczos/lanczos.c @@ -791,7 +791,7 @@ PetscErrorCode EPSLanczosGetReorthog(EPS eps,EPSLanczosReorthogType *reorthog) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidPointer(reorthog,2); + PetscAssertPointer(reorthog,2); PetscUseMethod(eps,"EPSLanczosGetReorthog_C",(EPS,EPSLanczosReorthogType*),(eps,reorthog)); PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/eps/impls/lyapii/lyapii.c b/src/eps/impls/lyapii/lyapii.c index 158b810b5..a8ea31f86 100644 --- a/src/eps/impls/lyapii/lyapii.c +++ b/src/eps/impls/lyapii/lyapii.c @@ -703,7 +703,7 @@ PetscErrorCode EPSLyapIIGetLME(EPS eps,LME *lme) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidPointer(lme,2); + PetscAssertPointer(lme,2); PetscUseMethod(eps,"EPSLyapIIGetLME_C",(EPS,LME*),(eps,lme)); PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/eps/impls/power/power.c b/src/eps/impls/power/power.c index f3f1b5b59..43daf66d6 100644 --- a/src/eps/impls/power/power.c +++ b/src/eps/impls/power/power.c @@ -801,7 +801,7 @@ PetscErrorCode EPSPowerGetShiftType(EPS eps,EPSPowerShiftType *shift) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidPointer(shift,2); + PetscAssertPointer(shift,2); PetscUseMethod(eps,"EPSPowerGetShiftType_C",(EPS,EPSPowerShiftType*),(eps,shift)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -887,7 +887,7 @@ PetscErrorCode EPSPowerGetNonlinear(EPS eps,PetscBool *nonlinear) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidBoolPointer(nonlinear,2); + PetscAssertPointer(nonlinear,2); PetscUseMethod(eps,"EPSPowerGetNonlinear_C",(EPS,PetscBool*),(eps,nonlinear)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -958,7 +958,7 @@ PetscErrorCode EPSPowerGetUpdate(EPS eps,PetscBool *update) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidBoolPointer(update,2); + PetscAssertPointer(update,2); PetscUseMethod(eps,"EPSPowerGetUpdate_C",(EPS,PetscBool*),(eps,update)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -1035,7 +1035,7 @@ PetscErrorCode EPSPowerGetSNES(EPS eps,SNES *snes) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidPointer(snes,2); + PetscAssertPointer(snes,2); PetscUseMethod(eps,"EPSPowerGetSNES_C",(EPS,SNES*),(eps,snes)); PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/eps/interface/epsbasic.c b/src/eps/interface/epsbasic.c index ddb6d6300..cdee56a1e 100644 --- a/src/eps/interface/epsbasic.c +++ b/src/eps/interface/epsbasic.c @@ -50,7 +50,7 @@ PetscErrorCode EPSCreate(MPI_Comm comm,EPS *outeps) EPS eps; PetscFunctionBegin; - PetscValidPointer(outeps,2); + PetscAssertPointer(outeps,2); *outeps = NULL; PetscCall(EPSInitializePackage()); PetscCall(SlepcHeaderCreate(eps,EPS_CLASSID,"EPS","Eigenvalue Problem Solver","EPS",comm,EPSDestroy,EPSView)); @@ -163,7 +163,7 @@ PetscErrorCode EPSSetType(EPS eps,EPSType type) PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidCharPointer(type,2); + PetscAssertPointer(type,2); PetscCall(PetscObjectTypeCompare((PetscObject)eps,type,&match)); if (match) PetscFunctionReturn(PETSC_SUCCESS); @@ -199,7 +199,7 @@ PetscErrorCode EPSGetType(EPS eps,EPSType *type) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidPointer(type,2); + PetscAssertPointer(type,2); *type = ((PetscObject)eps)->type_name; PetscFunctionReturn(PETSC_SUCCESS); } @@ -409,7 +409,7 @@ PetscErrorCode EPSGetTarget(EPS eps,PetscScalar* target) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidScalarPointer(target,2); + PetscAssertPointer(target,2); *target = eps->target; PetscFunctionReturn(PETSC_SUCCESS); } @@ -534,7 +534,7 @@ PetscErrorCode EPSGetST(EPS eps,ST *st) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidPointer(st,2); + PetscAssertPointer(st,2); if (!eps->st) { PetscCall(STCreate(PetscObjectComm((PetscObject)eps),&eps->st)); PetscCall(PetscObjectIncrementTabLevel((PetscObject)eps->st,(PetscObject)eps,0)); @@ -588,7 +588,7 @@ PetscErrorCode EPSGetBV(EPS eps,BV *V) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidPointer(V,2); + PetscAssertPointer(V,2); if (!eps->V) { PetscCall(BVCreate(PetscObjectComm((PetscObject)eps),&eps->V)); PetscCall(PetscObjectIncrementTabLevel((PetscObject)eps->V,(PetscObject)eps,0)); @@ -648,7 +648,7 @@ PetscErrorCode EPSGetRG(EPS eps,RG *rg) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidPointer(rg,2); + PetscAssertPointer(rg,2); if (!eps->rg) { PetscCall(RGCreate(PetscObjectComm((PetscObject)eps),&eps->rg)); PetscCall(PetscObjectIncrementTabLevel((PetscObject)eps->rg,(PetscObject)eps,0)); @@ -706,7 +706,7 @@ PetscErrorCode EPSGetDS(EPS eps,DS *ds) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidPointer(ds,2); + PetscAssertPointer(ds,2); if (!eps->ds) { PetscCall(DSCreate(PetscObjectComm((PetscObject)eps),&eps->ds)); PetscCall(PetscObjectIncrementTabLevel((PetscObject)eps->ds,(PetscObject)eps,0)); @@ -736,7 +736,7 @@ PetscErrorCode EPSIsGeneralized(EPS eps,PetscBool* is) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidBoolPointer(is,2); + PetscAssertPointer(is,2); *is = eps->isgeneralized; PetscFunctionReturn(PETSC_SUCCESS); } @@ -761,7 +761,7 @@ PetscErrorCode EPSIsHermitian(EPS eps,PetscBool* is) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidBoolPointer(is,2); + PetscAssertPointer(is,2); *is = eps->ishermitian; PetscFunctionReturn(PETSC_SUCCESS); } @@ -786,7 +786,7 @@ PetscErrorCode EPSIsPositive(EPS eps,PetscBool* is) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidBoolPointer(is,2); + PetscAssertPointer(is,2); *is = eps->ispositive; PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/eps/interface/epsopts.c b/src/eps/interface/epsopts.c index 61ae31307..9f917dbb7 100644 --- a/src/eps/interface/epsopts.c +++ b/src/eps/interface/epsopts.c @@ -522,7 +522,7 @@ PetscErrorCode EPSGetWhichEigenpairs(EPS eps,EPSWhich *which) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidPointer(which,2); + PetscAssertPointer(which,2); *which = eps->which; PetscFunctionReturn(PETSC_SUCCESS); } @@ -737,7 +737,7 @@ PetscErrorCode EPSGetConvergenceTest(EPS eps,EPSConv *conv) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidPointer(conv,2); + PetscAssertPointer(conv,2); *conv = eps->conv; PetscFunctionReturn(PETSC_SUCCESS); } @@ -851,7 +851,7 @@ PetscErrorCode EPSGetStoppingTest(EPS eps,EPSStop *stop) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidPointer(stop,2); + PetscAssertPointer(stop,2); *stop = eps->stop; PetscFunctionReturn(PETSC_SUCCESS); } @@ -955,7 +955,7 @@ PetscErrorCode EPSGetProblemType(EPS eps,EPSProblemType *type) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidPointer(type,2); + PetscAssertPointer(type,2); *type = eps->problem_type; PetscFunctionReturn(PETSC_SUCCESS); } @@ -1021,7 +1021,7 @@ PetscErrorCode EPSGetExtraction(EPS eps,EPSExtraction *extr) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidPointer(extr,2); + PetscAssertPointer(extr,2); *extr = eps->extraction; PetscFunctionReturn(PETSC_SUCCESS); } @@ -1189,7 +1189,7 @@ PetscErrorCode EPSGetTwoSided(EPS eps,PetscBool *twosided) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidBoolPointer(twosided,2); + PetscAssertPointer(twosided,2); *twosided = eps->twosided; PetscFunctionReturn(PETSC_SUCCESS); } @@ -1250,7 +1250,7 @@ PetscErrorCode EPSGetTrueResidual(EPS eps,PetscBool *trueres) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidBoolPointer(trueres,2); + PetscAssertPointer(trueres,2); *trueres = eps->trueres; PetscFunctionReturn(PETSC_SUCCESS); } @@ -1306,7 +1306,7 @@ PetscErrorCode EPSGetTrackAll(EPS eps,PetscBool *trackall) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidBoolPointer(trackall,2); + PetscAssertPointer(trackall,2); *trackall = eps->trackall; PetscFunctionReturn(PETSC_SUCCESS); } @@ -1365,7 +1365,7 @@ PetscErrorCode EPSGetPurify(EPS eps,PetscBool *purify) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidBoolPointer(purify,2); + PetscAssertPointer(purify,2); *purify = eps->purify; PetscFunctionReturn(PETSC_SUCCESS); } @@ -1470,7 +1470,7 @@ PetscErrorCode EPSGetOptionsPrefix(EPS eps,const char *prefix[]) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidPointer(prefix,2); + PetscAssertPointer(prefix,2); PetscCall(PetscObjectGetOptionsPrefix((PetscObject)eps,prefix)); PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/eps/interface/epssetup.c b/src/eps/interface/epssetup.c index a8891a690..c820a03cb 100644 --- a/src/eps/interface/epssetup.c +++ b/src/eps/interface/epssetup.c @@ -541,7 +541,7 @@ PetscErrorCode EPSSetDeflationSpace(EPS eps,PetscInt n,Vec v[]) PetscValidLogicalCollectiveInt(eps,n,2); PetscCheck(n>=0,PetscObjectComm((PetscObject)eps),PETSC_ERR_ARG_OUTOFRANGE,"Argument n cannot be negative"); if (n>0) { - PetscValidPointer(v,3); + PetscAssertPointer(v,3); PetscValidHeaderSpecific(*v,VEC_CLASSID,3); } PetscCall(SlepcBasisReference_Private(n,v,&eps->nds,&eps->defl)); @@ -584,7 +584,7 @@ PetscErrorCode EPSSetInitialSpace(EPS eps,PetscInt n,Vec is[]) PetscValidLogicalCollectiveInt(eps,n,2); PetscCheck(n>=0,PetscObjectComm((PetscObject)eps),PETSC_ERR_ARG_OUTOFRANGE,"Argument n cannot be negative"); if (n>0) { - PetscValidPointer(is,3); + PetscAssertPointer(is,3); PetscValidHeaderSpecific(*is,VEC_CLASSID,3); } PetscCall(SlepcBasisReference_Private(n,is,&eps->nini,&eps->IS)); @@ -621,7 +621,7 @@ PetscErrorCode EPSSetLeftInitialSpace(EPS eps,PetscInt n,Vec isl[]) PetscValidLogicalCollectiveInt(eps,n,2); PetscCheck(n>=0,PetscObjectComm((PetscObject)eps),PETSC_ERR_ARG_OUTOFRANGE,"Argument n cannot be negative"); if (n>0) { - PetscValidPointer(isl,3); + PetscAssertPointer(isl,3); PetscValidHeaderSpecific(*isl,VEC_CLASSID,3); } PetscCall(SlepcBasisReference_Private(n,isl,&eps->ninil,&eps->ISL)); diff --git a/src/eps/interface/epssolve.c b/src/eps/interface/epssolve.c index 2007b2bb3..f4820dc24 100644 --- a/src/eps/interface/epssolve.c +++ b/src/eps/interface/epssolve.c @@ -237,7 +237,7 @@ PetscErrorCode EPSGetIterationNumber(EPS eps,PetscInt *its) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidIntPointer(its,2); + PetscAssertPointer(its,2); *its = eps->its; PetscFunctionReturn(PETSC_SUCCESS); } @@ -264,7 +264,7 @@ PetscErrorCode EPSGetConverged(EPS eps,PetscInt *nconv) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidIntPointer(nconv,2); + PetscAssertPointer(nconv,2); EPSCheckSolved(eps,1); *nconv = eps->nconv; PetscFunctionReturn(PETSC_SUCCESS); @@ -303,7 +303,7 @@ PetscErrorCode EPSGetConvergedReason(EPS eps,EPSConvergedReason *reason) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidIntPointer(reason,2); + PetscAssertPointer(reason,2); EPSCheckSolved(eps,1); *reason = eps->reason; PetscFunctionReturn(PETSC_SUCCESS); @@ -346,7 +346,7 @@ PetscErrorCode EPSGetInvariantSubspace(EPS eps,Vec v[]) PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidPointer(v,2); + PetscAssertPointer(v,2); PetscValidHeaderSpecific(*v,VEC_CLASSID,2); EPSCheckSolved(eps,1); PetscCheck(eps->ishermitian || eps->state!=EPS_STATE_EIGENVECTORS,PetscObjectComm((PetscObject)eps),PETSC_ERR_ARG_WRONGSTATE,"EPSGetInvariantSubspace must be called before EPSGetEigenpair,EPSGetEigenvector or EPSComputeError"); @@ -594,7 +594,7 @@ PetscErrorCode EPSGetErrorEstimate(EPS eps,PetscInt i,PetscReal *errest) { PetscFunctionBegin; PetscValidHeaderSpecific(eps,EPS_CLASSID,1); - PetscValidRealPointer(errest,3); + PetscAssertPointer(errest,3); EPSCheckSolved(eps,1); PetscCheck(i>=0,PetscObjectComm((PetscObject)eps),PETSC_ERR_ARG_OUTOFRANGE,"The index cannot be negative"); PetscCheck(inconv,PetscObjectComm((PetscObject)eps),PETSC_ERR_ARG_OUTOFRANGE,"The index can be nconv-1 at most, see EPSGetConverged()"); @@ -700,7 +700,7 @@ PetscErrorCode EPSComputeError(EPS eps,PetscInt i,EPSErrorType type,PetscReal *e PetscValidHeaderSpecific(eps,EPS_CLASSID,1); PetscValidLogicalCollectiveInt(eps,i,2); PetscValidLogicalCollectiveEnum(eps,type,3); - PetscValidRealPointer(error,4); + PetscAssertPointer(error,4); EPSCheckSolved(eps,1); /* allocate work vectors */ diff --git a/src/lme/interface/lmebasic.c b/src/lme/interface/lmebasic.c index ae5315a35..c695766e4 100644 --- a/src/lme/interface/lmebasic.c +++ b/src/lme/interface/lmebasic.c @@ -208,7 +208,7 @@ PetscErrorCode LMECreate(MPI_Comm comm,LME *outlme) LME lme; PetscFunctionBegin; - PetscValidPointer(outlme,2); + PetscAssertPointer(outlme,2); *outlme = NULL; PetscCall(LMEInitializePackage()); PetscCall(SlepcHeaderCreate(lme,LME_CLASSID,"LME","Linear Matrix Equation","LME",comm,LMEDestroy,LMEView)); @@ -277,7 +277,7 @@ PetscErrorCode LMESetType(LME lme,LMEType type) PetscFunctionBegin; PetscValidHeaderSpecific(lme,LME_CLASSID,1); - PetscValidCharPointer(type,2); + PetscAssertPointer(type,2); PetscCall(PetscObjectTypeCompare((PetscObject)lme,type,&match)); if (match) PetscFunctionReturn(PETSC_SUCCESS); @@ -313,7 +313,7 @@ PetscErrorCode LMEGetType(LME lme,LMEType *type) { PetscFunctionBegin; PetscValidHeaderSpecific(lme,LME_CLASSID,1); - PetscValidPointer(type,2); + PetscAssertPointer(type,2); *type = ((PetscObject)lme)->type_name; PetscFunctionReturn(PETSC_SUCCESS); } @@ -501,7 +501,7 @@ PetscErrorCode LMEGetBV(LME lme,BV *bv) { PetscFunctionBegin; PetscValidHeaderSpecific(lme,LME_CLASSID,1); - PetscValidPointer(bv,2); + PetscAssertPointer(bv,2); if (!lme->V) { PetscCall(BVCreate(PetscObjectComm((PetscObject)lme),&lme->V)); PetscCall(PetscObjectIncrementTabLevel((PetscObject)lme->V,(PetscObject)lme,0)); diff --git a/src/lme/interface/lmedense.c b/src/lme/interface/lmedense.c index 7e7c8c41b..a14a40686 100644 --- a/src/lme/interface/lmedense.c +++ b/src/lme/interface/lmedense.c @@ -325,12 +325,12 @@ PetscErrorCode LMEDenseHessLyapunovChol(LME lme,PetscInt m,PetscScalar *H,PetscI PetscFunctionBegin; PetscValidHeaderSpecific(lme,LME_CLASSID,1); PetscValidLogicalCollectiveInt(lme,m,2); - PetscValidScalarPointer(H,3); + PetscAssertPointer(H,3); PetscValidLogicalCollectiveInt(lme,ldh,4); PetscValidLogicalCollectiveInt(lme,k,5); - PetscValidScalarPointer(B,6); + PetscAssertPointer(B,6); PetscValidLogicalCollectiveInt(lme,ldb,7); - PetscValidScalarPointer(U,8); + PetscAssertPointer(U,8); PetscValidLogicalCollectiveInt(lme,ldu,9); if (res) PetscValidLogicalCollectiveReal(lme,*res,10); @@ -493,11 +493,11 @@ PetscErrorCode LMEDenseLyapunov(LME lme,PetscInt m,PetscScalar *A,PetscInt lda,P PetscFunctionBegin; PetscValidHeaderSpecific(lme,LME_CLASSID,1); PetscValidLogicalCollectiveInt(lme,m,2); - PetscValidScalarPointer(A,3); + PetscAssertPointer(A,3); PetscValidLogicalCollectiveInt(lme,lda,4); - PetscValidScalarPointer(B,5); + PetscAssertPointer(B,5); PetscValidLogicalCollectiveInt(lme,ldb,6); - PetscValidScalarPointer(X,7); + PetscAssertPointer(X,7); PetscValidLogicalCollectiveInt(lme,ldx,8); #if defined(SLEPC_HAVE_SLICOT) diff --git a/src/lme/interface/lmeopts.c b/src/lme/interface/lmeopts.c index 29bc0d16e..d988313b6 100644 --- a/src/lme/interface/lmeopts.c +++ b/src/lme/interface/lmeopts.c @@ -224,7 +224,7 @@ PetscErrorCode LMEGetProblemType(LME lme,LMEProblemType *type) { PetscFunctionBegin; PetscValidHeaderSpecific(lme,LME_CLASSID,1); - PetscValidPointer(type,2); + PetscAssertPointer(type,2); *type = lme->problem_type; PetscFunctionReturn(PETSC_SUCCESS); } @@ -322,7 +322,7 @@ PetscErrorCode LMEGetDimensions(LME lme,PetscInt *ncv) { PetscFunctionBegin; PetscValidHeaderSpecific(lme,LME_CLASSID,1); - PetscValidIntPointer(ncv,2); + PetscAssertPointer(ncv,2); *ncv = lme->ncv; PetscFunctionReturn(PETSC_SUCCESS); } @@ -412,7 +412,7 @@ PetscErrorCode LMEGetErrorIfNotConverged(LME lme,PetscBool *flag) { PetscFunctionBegin; PetscValidHeaderSpecific(lme,LME_CLASSID,1); - PetscValidBoolPointer(flag,2); + PetscAssertPointer(flag,2); *flag = lme->errorifnotconverged; PetscFunctionReturn(PETSC_SUCCESS); } @@ -505,7 +505,7 @@ PetscErrorCode LMEGetOptionsPrefix(LME lme,const char *prefix[]) { PetscFunctionBegin; PetscValidHeaderSpecific(lme,LME_CLASSID,1); - PetscValidPointer(prefix,2); + PetscAssertPointer(prefix,2); PetscCall(PetscObjectGetOptionsPrefix((PetscObject)lme,prefix)); PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/lme/interface/lmesetup.c b/src/lme/interface/lmesetup.c index 5a19201f5..2118d1aa6 100644 --- a/src/lme/interface/lmesetup.c +++ b/src/lme/interface/lmesetup.c @@ -269,7 +269,7 @@ PetscErrorCode LMEGetRHS(LME lme,Mat *C) { PetscFunctionBegin; PetscValidHeaderSpecific(lme,LME_CLASSID,1); - PetscValidPointer(C,2); + PetscAssertPointer(C,2); *C = lme->C; PetscFunctionReturn(PETSC_SUCCESS); } @@ -340,7 +340,7 @@ PetscErrorCode LMEGetSolution(LME lme,Mat *X) { PetscFunctionBegin; PetscValidHeaderSpecific(lme,LME_CLASSID,1); - PetscValidPointer(X,2); + PetscAssertPointer(X,2); *X = lme->X; PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/lme/interface/lmesolve.c b/src/lme/interface/lmesolve.c index abdd64dec..f7a35ecea 100644 --- a/src/lme/interface/lmesolve.c +++ b/src/lme/interface/lmesolve.c @@ -97,7 +97,7 @@ PetscErrorCode LMEGetIterationNumber(LME lme,PetscInt *its) { PetscFunctionBegin; PetscValidHeaderSpecific(lme,LME_CLASSID,1); - PetscValidIntPointer(its,2); + PetscAssertPointer(its,2); *its = lme->its; PetscFunctionReturn(PETSC_SUCCESS); } @@ -131,7 +131,7 @@ PetscErrorCode LMEGetConvergedReason(LME lme,LMEConvergedReason *reason) { PetscFunctionBegin; PetscValidHeaderSpecific(lme,LME_CLASSID,1); - PetscValidIntPointer(reason,2); + PetscAssertPointer(reason,2); *reason = lme->reason; PetscFunctionReturn(PETSC_SUCCESS); } @@ -160,7 +160,7 @@ PetscErrorCode LMEGetErrorEstimate(LME lme,PetscReal *errest) { PetscFunctionBegin; PetscValidHeaderSpecific(lme,LME_CLASSID,1); - PetscValidRealPointer(errest,2); + PetscAssertPointer(errest,2); *errest = lme->errest; PetscFunctionReturn(PETSC_SUCCESS); } @@ -300,7 +300,7 @@ PetscErrorCode LMEComputeError(LME lme,PetscReal *error) { PetscFunctionBegin; PetscValidHeaderSpecific(lme,LME_CLASSID,1); - PetscValidRealPointer(error,2); + PetscAssertPointer(error,2); PetscCall(PetscLogEventBegin(LME_ComputeError,lme,0,0,0)); /* compute residual norm */ diff --git a/src/mfn/interface/mfnbasic.c b/src/mfn/interface/mfnbasic.c index 734a971f1..8e1f6284f 100644 --- a/src/mfn/interface/mfnbasic.c +++ b/src/mfn/interface/mfnbasic.c @@ -201,7 +201,7 @@ PetscErrorCode MFNCreate(MPI_Comm comm,MFN *outmfn) MFN mfn; PetscFunctionBegin; - PetscValidPointer(outmfn,2); + PetscAssertPointer(outmfn,2); *outmfn = NULL; PetscCall(MFNInitializePackage()); PetscCall(SlepcHeaderCreate(mfn,MFN_CLASSID,"MFN","Matrix Function","MFN",comm,MFNDestroy,MFNView)); @@ -266,7 +266,7 @@ PetscErrorCode MFNSetType(MFN mfn,MFNType type) PetscFunctionBegin; PetscValidHeaderSpecific(mfn,MFN_CLASSID,1); - PetscValidCharPointer(type,2); + PetscAssertPointer(type,2); PetscCall(PetscObjectTypeCompare((PetscObject)mfn,type,&match)); if (match) PetscFunctionReturn(PETSC_SUCCESS); @@ -302,7 +302,7 @@ PetscErrorCode MFNGetType(MFN mfn,MFNType *type) { PetscFunctionBegin; PetscValidHeaderSpecific(mfn,MFN_CLASSID,1); - PetscValidPointer(type,2); + PetscAssertPointer(type,2); *type = ((PetscObject)mfn)->type_name; PetscFunctionReturn(PETSC_SUCCESS); } @@ -487,7 +487,7 @@ PetscErrorCode MFNGetBV(MFN mfn,BV *bv) { PetscFunctionBegin; PetscValidHeaderSpecific(mfn,MFN_CLASSID,1); - PetscValidPointer(bv,2); + PetscAssertPointer(bv,2); if (!mfn->V) { PetscCall(BVCreate(PetscObjectComm((PetscObject)mfn),&mfn->V)); PetscCall(PetscObjectIncrementTabLevel((PetscObject)mfn->V,(PetscObject)mfn,0)); @@ -545,7 +545,7 @@ PetscErrorCode MFNGetFN(MFN mfn,FN *fn) { PetscFunctionBegin; PetscValidHeaderSpecific(mfn,MFN_CLASSID,1); - PetscValidPointer(fn,2); + PetscAssertPointer(fn,2); if (!mfn->fn) { PetscCall(FNCreate(PetscObjectComm((PetscObject)mfn),&mfn->fn)); PetscCall(PetscObjectIncrementTabLevel((PetscObject)mfn->fn,(PetscObject)mfn,0)); diff --git a/src/mfn/interface/mfnopts.c b/src/mfn/interface/mfnopts.c index 1eb6f4687..132248820 100644 --- a/src/mfn/interface/mfnopts.c +++ b/src/mfn/interface/mfnopts.c @@ -221,7 +221,7 @@ PetscErrorCode MFNGetDimensions(MFN mfn,PetscInt *ncv) { PetscFunctionBegin; PetscValidHeaderSpecific(mfn,MFN_CLASSID,1); - PetscValidIntPointer(ncv,2); + PetscAssertPointer(ncv,2); *ncv = mfn->ncv; PetscFunctionReturn(PETSC_SUCCESS); } @@ -311,7 +311,7 @@ PetscErrorCode MFNGetErrorIfNotConverged(MFN mfn,PetscBool *flag) { PetscFunctionBegin; PetscValidHeaderSpecific(mfn,MFN_CLASSID,1); - PetscValidBoolPointer(flag,2); + PetscAssertPointer(flag,2); *flag = mfn->errorifnotconverged; PetscFunctionReturn(PETSC_SUCCESS); } @@ -408,7 +408,7 @@ PetscErrorCode MFNGetOptionsPrefix(MFN mfn,const char *prefix[]) { PetscFunctionBegin; PetscValidHeaderSpecific(mfn,MFN_CLASSID,1); - PetscValidPointer(prefix,2); + PetscAssertPointer(prefix,2); PetscCall(PetscObjectGetOptionsPrefix((PetscObject)mfn,prefix)); PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/mfn/interface/mfnsetup.c b/src/mfn/interface/mfnsetup.c index e43a443c4..d3c94aaa9 100644 --- a/src/mfn/interface/mfnsetup.c +++ b/src/mfn/interface/mfnsetup.c @@ -120,7 +120,7 @@ PetscErrorCode MFNGetOperator(MFN mfn,Mat *A) { PetscFunctionBegin; PetscValidHeaderSpecific(mfn,MFN_CLASSID,1); - PetscValidPointer(A,2); + PetscAssertPointer(A,2); *A = mfn->A; PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/mfn/interface/mfnsolve.c b/src/mfn/interface/mfnsolve.c index 804ab81ef..ef5b1d600 100644 --- a/src/mfn/interface/mfnsolve.c +++ b/src/mfn/interface/mfnsolve.c @@ -154,7 +154,7 @@ PetscErrorCode MFNGetIterationNumber(MFN mfn,PetscInt *its) { PetscFunctionBegin; PetscValidHeaderSpecific(mfn,MFN_CLASSID,1); - PetscValidIntPointer(its,2); + PetscAssertPointer(its,2); *its = mfn->its; PetscFunctionReturn(PETSC_SUCCESS); } @@ -195,7 +195,7 @@ PetscErrorCode MFNGetConvergedReason(MFN mfn,MFNConvergedReason *reason) { PetscFunctionBegin; PetscValidHeaderSpecific(mfn,MFN_CLASSID,1); - PetscValidIntPointer(reason,2); + PetscAssertPointer(reason,2); *reason = mfn->reason; PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/nep/impls/ciss/nciss.c b/src/nep/impls/ciss/nciss.c index 24aa279ce..8de04fd68 100644 --- a/src/nep/impls/ciss/nciss.c +++ b/src/nep/impls/ciss/nciss.c @@ -883,7 +883,7 @@ PetscErrorCode NEPCISSGetExtraction(NEP nep,NEPCISSExtraction *extraction) { PetscFunctionBegin; PetscValidHeaderSpecific(nep,NEP_CLASSID,1); - PetscValidPointer(extraction,2); + PetscAssertPointer(extraction,2); PetscUseMethod(nep,"NEPCISSGetExtraction_C",(NEP,NEPCISSExtraction*),(nep,extraction)); PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/nep/impls/interpol/interpol.c b/src/nep/impls/interpol/interpol.c index dcf2a4a65..c5782aa19 100644 --- a/src/nep/impls/interpol/interpol.c +++ b/src/nep/impls/interpol/interpol.c @@ -416,7 +416,7 @@ PetscErrorCode NEPInterpolGetPEP(NEP nep,PEP *pep) { PetscFunctionBegin; PetscValidHeaderSpecific(nep,NEP_CLASSID,1); - PetscValidPointer(pep,2); + PetscAssertPointer(pep,2); PetscUseMethod(nep,"NEPInterpolGetPEP_C",(NEP,PEP*),(nep,pep)); PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/nep/impls/narnoldi/narnoldi.c b/src/nep/impls/narnoldi/narnoldi.c index 39805c38f..8cbdae73a 100644 --- a/src/nep/impls/narnoldi/narnoldi.c +++ b/src/nep/impls/narnoldi/narnoldi.c @@ -275,7 +275,7 @@ PetscErrorCode NEPNArnoldiGetLagPreconditioner(NEP nep,PetscInt *lag) { PetscFunctionBegin; PetscValidHeaderSpecific(nep,NEP_CLASSID,1); - PetscValidIntPointer(lag,2); + PetscAssertPointer(lag,2); PetscUseMethod(nep,"NEPNArnoldiGetLagPreconditioner_C",(NEP,PetscInt*),(nep,lag)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -373,7 +373,7 @@ PetscErrorCode NEPNArnoldiGetKSP(NEP nep,KSP *ksp) { PetscFunctionBegin; PetscValidHeaderSpecific(nep,NEP_CLASSID,1); - PetscValidPointer(ksp,2); + PetscAssertPointer(ksp,2); PetscUseMethod(nep,"NEPNArnoldiGetKSP_C",(NEP,KSP*),(nep,ksp)); PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/nep/impls/nleigs/nleigs-fullb.c b/src/nep/impls/nleigs/nleigs-fullb.c index e999e9c5b..77dab9e1c 100644 --- a/src/nep/impls/nleigs/nleigs-fullb.c +++ b/src/nep/impls/nleigs/nleigs-fullb.c @@ -492,7 +492,7 @@ PetscErrorCode NEPNLEIGSGetEPS(NEP nep,EPS *eps) { PetscFunctionBegin; PetscValidHeaderSpecific(nep,NEP_CLASSID,1); - PetscValidPointer(eps,2); + PetscAssertPointer(eps,2); PetscUseMethod(nep,"NEPNLEIGSGetEPS_C",(NEP,EPS*),(nep,eps)); PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/nep/impls/nleigs/nleigs.c b/src/nep/impls/nleigs/nleigs.c index 00cc21147..f9968cad6 100644 --- a/src/nep/impls/nleigs/nleigs.c +++ b/src/nep/impls/nleigs/nleigs.c @@ -1437,7 +1437,7 @@ PetscErrorCode NEPNLEIGSGetRestart(NEP nep,PetscReal *keep) { PetscFunctionBegin; PetscValidHeaderSpecific(nep,NEP_CLASSID,1); - PetscValidRealPointer(keep,2); + PetscAssertPointer(keep,2); PetscUseMethod(nep,"NEPNLEIGSGetRestart_C",(NEP,PetscReal*),(nep,keep)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -1511,7 +1511,7 @@ PetscErrorCode NEPNLEIGSGetLocking(NEP nep,PetscBool *lock) { PetscFunctionBegin; PetscValidHeaderSpecific(nep,NEP_CLASSID,1); - PetscValidBoolPointer(lock,2); + PetscAssertPointer(lock,2); PetscUseMethod(nep,"NEPNLEIGSGetLocking_C",(NEP,PetscBool*),(nep,lock)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -1665,7 +1665,7 @@ PetscErrorCode NEPNLEIGSSetRKShifts(NEP nep,PetscInt ns,PetscScalar shifts[]) PetscFunctionBegin; PetscValidHeaderSpecific(nep,NEP_CLASSID,1); PetscValidLogicalCollectiveInt(nep,ns,2); - if (ns) PetscValidScalarPointer(shifts,3); + if (ns) PetscAssertPointer(shifts,3); PetscTryMethod(nep,"NEPNLEIGSSetRKShifts_C",(NEP,PetscInt,PetscScalar*),(nep,ns,shifts)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -1708,8 +1708,8 @@ PetscErrorCode NEPNLEIGSGetRKShifts(NEP nep,PetscInt *ns,PetscScalar *shifts[]) { PetscFunctionBegin; PetscValidHeaderSpecific(nep,NEP_CLASSID,1); - PetscValidIntPointer(ns,2); - PetscValidPointer(shifts,3); + PetscAssertPointer(ns,2); + PetscAssertPointer(shifts,3); PetscTryMethod(nep,"NEPNLEIGSGetRKShifts_C",(NEP,PetscInt*,PetscScalar**),(nep,ns,shifts)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -1854,7 +1854,7 @@ PetscErrorCode NEPNLEIGSGetFullBasis(NEP nep,PetscBool *fullbasis) { PetscFunctionBegin; PetscValidHeaderSpecific(nep,NEP_CLASSID,1); - PetscValidBoolPointer(fullbasis,2); + PetscAssertPointer(fullbasis,2); PetscUseMethod(nep,"NEPNLEIGSGetFullBasis_C",(NEP,PetscBool*),(nep,fullbasis)); PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/nep/impls/rii/rii.c b/src/nep/impls/rii/rii.c index 985eb01c9..d6bd40939 100644 --- a/src/nep/impls/rii/rii.c +++ b/src/nep/impls/rii/rii.c @@ -301,7 +301,7 @@ PetscErrorCode NEPRIIGetMaximumIterations(NEP nep,PetscInt *its) { PetscFunctionBegin; PetscValidHeaderSpecific(nep,NEP_CLASSID,1); - PetscValidIntPointer(its,2); + PetscAssertPointer(its,2); PetscUseMethod(nep,"NEPRIIGetMaximumIterations_C",(NEP,PetscInt*),(nep,its)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -376,7 +376,7 @@ PetscErrorCode NEPRIIGetLagPreconditioner(NEP nep,PetscInt *lag) { PetscFunctionBegin; PetscValidHeaderSpecific(nep,NEP_CLASSID,1); - PetscValidIntPointer(lag,2); + PetscAssertPointer(lag,2); PetscUseMethod(nep,"NEPRIIGetLagPreconditioner_C",(NEP,PetscInt*),(nep,lag)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -450,7 +450,7 @@ PetscErrorCode NEPRIIGetConstCorrectionTol(NEP nep,PetscBool *cct) { PetscFunctionBegin; PetscValidHeaderSpecific(nep,NEP_CLASSID,1); - PetscValidBoolPointer(cct,2); + PetscAssertPointer(cct,2); PetscUseMethod(nep,"NEPRIIGetConstCorrectionTol_C",(NEP,PetscBool*),(nep,cct)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -525,7 +525,7 @@ PetscErrorCode NEPRIIGetHermitian(NEP nep,PetscBool *herm) { PetscFunctionBegin; PetscValidHeaderSpecific(nep,NEP_CLASSID,1); - PetscValidBoolPointer(herm,2); + PetscAssertPointer(herm,2); PetscUseMethod(nep,"NEPRIIGetHermitian_C",(NEP,PetscBool*),(nep,herm)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -601,7 +601,7 @@ PetscErrorCode NEPRIIGetDeflationThreshold(NEP nep,PetscReal *deftol) { PetscFunctionBegin; PetscValidHeaderSpecific(nep,NEP_CLASSID,1); - PetscValidRealPointer(deftol,2); + PetscAssertPointer(deftol,2); PetscUseMethod(nep,"NEPRIIGetDeflationThreshold_C",(NEP,PetscReal*),(nep,deftol)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -680,7 +680,7 @@ PetscErrorCode NEPRIIGetKSP(NEP nep,KSP *ksp) { PetscFunctionBegin; PetscValidHeaderSpecific(nep,NEP_CLASSID,1); - PetscValidPointer(ksp,2); + PetscAssertPointer(ksp,2); PetscUseMethod(nep,"NEPRIIGetKSP_C",(NEP,KSP*),(nep,ksp)); PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/nep/impls/slp/slp.c b/src/nep/impls/slp/slp.c index 32daa8fc8..58607b551 100644 --- a/src/nep/impls/slp/slp.c +++ b/src/nep/impls/slp/slp.c @@ -348,7 +348,7 @@ PetscErrorCode NEPSLPGetDeflationThreshold(NEP nep,PetscReal *deftol) { PetscFunctionBegin; PetscValidHeaderSpecific(nep,NEP_CLASSID,1); - PetscValidRealPointer(deftol,2); + PetscAssertPointer(deftol,2); PetscUseMethod(nep,"NEPSLPGetDeflationThreshold_C",(NEP,PetscReal*),(nep,deftol)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -425,7 +425,7 @@ PetscErrorCode NEPSLPGetEPS(NEP nep,EPS *eps) { PetscFunctionBegin; PetscValidHeaderSpecific(nep,NEP_CLASSID,1); - PetscValidPointer(eps,2); + PetscAssertPointer(eps,2); PetscUseMethod(nep,"NEPSLPGetEPS_C",(NEP,EPS*),(nep,eps)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -504,7 +504,7 @@ PetscErrorCode NEPSLPGetEPSLeft(NEP nep,EPS *eps) { PetscFunctionBegin; PetscValidHeaderSpecific(nep,NEP_CLASSID,1); - PetscValidPointer(eps,2); + PetscAssertPointer(eps,2); PetscUseMethod(nep,"NEPSLPGetEPSLeft_C",(NEP,EPS*),(nep,eps)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -583,7 +583,7 @@ PetscErrorCode NEPSLPGetKSP(NEP nep,KSP *ksp) { PetscFunctionBegin; PetscValidHeaderSpecific(nep,NEP_CLASSID,1); - PetscValidPointer(ksp,2); + PetscAssertPointer(ksp,2); PetscUseMethod(nep,"NEPSLPGetKSP_C",(NEP,KSP*),(nep,ksp)); PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/nep/interface/nepbasic.c b/src/nep/interface/nepbasic.c index 845ba9a0d..aa86eabd2 100644 --- a/src/nep/interface/nepbasic.c +++ b/src/nep/interface/nepbasic.c @@ -47,7 +47,7 @@ PetscErrorCode NEPCreate(MPI_Comm comm,NEP *outnep) NEP nep; PetscFunctionBegin; - PetscValidPointer(outnep,2); + PetscAssertPointer(outnep,2); *outnep = NULL; PetscCall(NEPInitializePackage()); PetscCall(SlepcHeaderCreate(nep,NEP_CLASSID,"NEP","Nonlinear Eigenvalue Problem","NEP",comm,NEPDestroy,NEPView)); @@ -158,7 +158,7 @@ PetscErrorCode NEPSetType(NEP nep,NEPType type) PetscFunctionBegin; PetscValidHeaderSpecific(nep,NEP_CLASSID,1); - PetscValidCharPointer(type,2); + PetscAssertPointer(type,2); PetscCall(PetscObjectTypeCompare((PetscObject)nep,type,&match)); if (match) PetscFunctionReturn(PETSC_SUCCESS); @@ -194,7 +194,7 @@ PetscErrorCode NEPGetType(NEP nep,NEPType *type) { PetscFunctionBegin; PetscValidHeaderSpecific(nep,NEP_CLASSID,1); - PetscValidPointer(type,2); + PetscAssertPointer(type,2); *type = ((PetscObject)nep)->type_name; PetscFunctionReturn(PETSC_SUCCESS); } @@ -411,7 +411,7 @@ PetscErrorCode NEPGetBV(NEP nep,BV *bv) { PetscFunctionBegin; PetscValidHeaderSpecific(nep,NEP_CLASSID,1); - PetscValidPointer(bv,2); + PetscAssertPointer(bv,2); if (!nep->V) { PetscCall(BVCreate(PetscObjectComm((PetscObject)nep),&nep->V)); PetscCall(PetscObjectIncrementTabLevel((PetscObject)nep->V,(PetscObject)nep,0)); @@ -472,7 +472,7 @@ PetscErrorCode NEPGetRG(NEP nep,RG *rg) { PetscFunctionBegin; PetscValidHeaderSpecific(nep,NEP_CLASSID,1); - PetscValidPointer(rg,2); + PetscAssertPointer(rg,2); if (!nep->rg) { PetscCall(RGCreate(PetscObjectComm((PetscObject)nep),&nep->rg)); PetscCall(PetscObjectIncrementTabLevel((PetscObject)nep->rg,(PetscObject)nep,0)); @@ -531,7 +531,7 @@ PetscErrorCode NEPGetDS(NEP nep,DS *ds) { PetscFunctionBegin; PetscValidHeaderSpecific(nep,NEP_CLASSID,1); - PetscValidPointer(ds,2); + PetscAssertPointer(ds,2); if (!nep->ds) { PetscCall(DSCreate(PetscObjectComm((PetscObject)nep),&nep->ds)); PetscCall(PetscObjectIncrementTabLevel((PetscObject)nep->ds,(PetscObject)nep,0)); @@ -563,7 +563,7 @@ PetscErrorCode NEPRefineGetKSP(NEP nep,KSP *ksp) PetscFunctionBegin; PetscValidHeaderSpecific(nep,NEP_CLASSID,1); - PetscValidPointer(ksp,2); + PetscAssertPointer(ksp,2); if (!nep->refineksp) { if (nep->npart>1) { /* Split in subcomunicators */ @@ -638,7 +638,7 @@ PetscErrorCode NEPGetTarget(NEP nep,PetscScalar* target) { PetscFunctionBegin; PetscValidHeaderSpecific(nep,NEP_CLASSID,1); - PetscValidScalarPointer(target,2); + PetscAssertPointer(target,2); *target = nep->target; PetscFunctionReturn(PETSC_SUCCESS); } @@ -849,8 +849,8 @@ PetscErrorCode NEPSetSplitOperator(NEP nep,PetscInt nt,Mat A[],FN f[],MatStructu PetscValidHeaderSpecific(nep,NEP_CLASSID,1); PetscValidLogicalCollectiveInt(nep,nt,2); PetscCheck(nt>0,PetscObjectComm((PetscObject)nep),PETSC_ERR_ARG_OUTOFRANGE,"Must have one or more terms, you have %" PetscInt_FMT,nt); - PetscValidPointer(A,3); - PetscValidPointer(f,4); + PetscAssertPointer(A,3); + PetscAssertPointer(f,4); PetscValidLogicalCollectiveEnum(nep,str,5); for (i=0;i=0,PetscObjectComm((PetscObject)nep),PETSC_ERR_ARG_OUTOFRANGE,"Negative value of ntp = %" PetscInt_FMT,ntp); PetscCheck(nep->fui==NEP_USER_INTERFACE_SPLIT,PetscObjectComm((PetscObject)nep),PETSC_ERR_ORDER,"Must call NEPSetSplitOperator first"); PetscCheck(ntp==0 || nep->nt==ntp,PetscObjectComm((PetscObject)nep),PETSC_ERR_SUP,"The number of terms must be the same as in NEPSetSplitOperator()"); - if (ntp) PetscValidPointer(P,3); + if (ntp) PetscAssertPointer(P,3); PetscValidLogicalCollectiveEnum(nep,strp,4); for (i=0;i=0 && knt,PetscObjectComm((PetscObject)nep),PETSC_ERR_ARG_OUTOFRANGE,"k must be between 0 and %" PetscInt_FMT,nep->nt-1); PetscCheck(nep->P,PetscObjectComm((PetscObject)nep),PETSC_ERR_ORDER,"You have not called NEPSetSplitPreconditioner()"); diff --git a/src/nep/interface/nepdefault.c b/src/nep/interface/nepdefault.c index f1f8ba5e1..527a2fef5 100644 --- a/src/nep/interface/nepdefault.c +++ b/src/nep/interface/nepdefault.c @@ -54,7 +54,7 @@ PetscErrorCode NEPSetWorkVecs(NEP nep,PetscInt nw) PetscErrorCode NEPGetDefaultShift(NEP nep,PetscScalar *sigma) { PetscFunctionBegin; - PetscValidScalarPointer(sigma,2); + PetscAssertPointer(sigma,2); switch (nep->which) { case NEP_LARGEST_MAGNITUDE: case NEP_LARGEST_IMAGINARY: diff --git a/src/nep/interface/nepopts.c b/src/nep/interface/nepopts.c index fbe8437f1..c0b2d0032 100644 --- a/src/nep/interface/nepopts.c +++ b/src/nep/interface/nepopts.c @@ -483,7 +483,7 @@ PetscErrorCode NEPGetWhichEigenpairs(NEP nep,NEPWhich *which) { PetscFunctionBegin; PetscValidHeaderSpecific(nep,NEP_CLASSID,1); - PetscValidPointer(which,2); + PetscAssertPointer(which,2); *which = nep->which; PetscFunctionReturn(PETSC_SUCCESS); } @@ -585,7 +585,7 @@ PetscErrorCode NEPGetProblemType(NEP nep,NEPProblemType *type) { PetscFunctionBegin; PetscValidHeaderSpecific(nep,NEP_CLASSID,1); - PetscValidPointer(type,2); + PetscAssertPointer(type,2); *type = nep->problem_type; PetscFunctionReturn(PETSC_SUCCESS); } @@ -647,7 +647,7 @@ PetscErrorCode NEPGetTwoSided(NEP nep,PetscBool *twosided) { PetscFunctionBegin; PetscValidHeaderSpecific(nep,NEP_CLASSID,1); - PetscValidBoolPointer(twosided,2); + PetscAssertPointer(twosided,2); *twosided = nep->twosided; PetscFunctionReturn(PETSC_SUCCESS); } @@ -765,7 +765,7 @@ PetscErrorCode NEPGetConvergenceTest(NEP nep,NEPConv *conv) { PetscFunctionBegin; PetscValidHeaderSpecific(nep,NEP_CLASSID,1); - PetscValidPointer(conv,2); + PetscAssertPointer(conv,2); *conv = nep->conv; PetscFunctionReturn(PETSC_SUCCESS); } @@ -879,7 +879,7 @@ PetscErrorCode NEPGetStoppingTest(NEP nep,NEPStop *stop) { PetscFunctionBegin; PetscValidHeaderSpecific(nep,NEP_CLASSID,1); - PetscValidPointer(stop,2); + PetscAssertPointer(stop,2); *stop = nep->stop; PetscFunctionReturn(PETSC_SUCCESS); } @@ -935,7 +935,7 @@ PetscErrorCode NEPGetTrackAll(NEP nep,PetscBool *trackall) { PetscFunctionBegin; PetscValidHeaderSpecific(nep,NEP_CLASSID,1); - PetscValidBoolPointer(trackall,2); + PetscAssertPointer(trackall,2); *trackall = nep->trackall; PetscFunctionReturn(PETSC_SUCCESS); } @@ -1161,7 +1161,7 @@ PetscErrorCode NEPGetOptionsPrefix(NEP nep,const char *prefix[]) { PetscFunctionBegin; PetscValidHeaderSpecific(nep,NEP_CLASSID,1); - PetscValidPointer(prefix,2); + PetscAssertPointer(prefix,2); PetscCall(PetscObjectGetOptionsPrefix((PetscObject)nep,prefix)); PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/nep/interface/nepsetup.c b/src/nep/interface/nepsetup.c index c0a2a6cf8..697a73c8c 100644 --- a/src/nep/interface/nepsetup.c +++ b/src/nep/interface/nepsetup.c @@ -251,7 +251,7 @@ PetscErrorCode NEPSetInitialSpace(NEP nep,PetscInt n,Vec is[]) PetscValidLogicalCollectiveInt(nep,n,2); PetscCheck(n>=0,PetscObjectComm((PetscObject)nep),PETSC_ERR_ARG_OUTOFRANGE,"Argument n cannot be negative"); if (n>0) { - PetscValidPointer(is,3); + PetscAssertPointer(is,3); PetscValidHeaderSpecific(*is,VEC_CLASSID,3); } PetscCall(SlepcBasisReference_Private(n,is,&nep->nini,&nep->IS)); diff --git a/src/nep/interface/nepsolve.c b/src/nep/interface/nepsolve.c index 5a8f9630b..26dc4663f 100644 --- a/src/nep/interface/nepsolve.c +++ b/src/nep/interface/nepsolve.c @@ -365,7 +365,7 @@ PetscErrorCode NEPGetIterationNumber(NEP nep,PetscInt *its) { PetscFunctionBegin; PetscValidHeaderSpecific(nep,NEP_CLASSID,1); - PetscValidIntPointer(its,2); + PetscAssertPointer(its,2); *its = nep->its; PetscFunctionReturn(PETSC_SUCCESS); } @@ -392,7 +392,7 @@ PetscErrorCode NEPGetConverged(NEP nep,PetscInt *nconv) { PetscFunctionBegin; PetscValidHeaderSpecific(nep,NEP_CLASSID,1); - PetscValidIntPointer(nconv,2); + PetscAssertPointer(nconv,2); NEPCheckSolved(nep,1); *nconv = nep->nconv; PetscFunctionReturn(PETSC_SUCCESS); @@ -433,7 +433,7 @@ PetscErrorCode NEPGetConvergedReason(NEP nep,NEPConvergedReason *reason) { PetscFunctionBegin; PetscValidHeaderSpecific(nep,NEP_CLASSID,1); - PetscValidPointer(reason,2); + PetscAssertPointer(reason,2); NEPCheckSolved(nep,1); *reason = nep->reason; PetscFunctionReturn(PETSC_SUCCESS); @@ -581,7 +581,7 @@ PetscErrorCode NEPGetErrorEstimate(NEP nep,PetscInt i,PetscReal *errest) { PetscFunctionBegin; PetscValidHeaderSpecific(nep,NEP_CLASSID,1); - PetscValidRealPointer(errest,3); + PetscAssertPointer(errest,3); NEPCheckSolved(nep,1); PetscCheck(i>=0,PetscObjectComm((PetscObject)nep),PETSC_ERR_ARG_OUTOFRANGE,"The index cannot be negative"); PetscCheck(inconv,PetscObjectComm((PetscObject)nep),PETSC_ERR_ARG_OUTOFRANGE,"The index can be nconv-1 at most, see NEPGetConverged()"); @@ -647,7 +647,7 @@ PetscErrorCode NEPComputeError(NEP nep,PetscInt i,NEPErrorType type,PetscReal *e PetscValidHeaderSpecific(nep,NEP_CLASSID,1); PetscValidLogicalCollectiveInt(nep,i,2); PetscValidLogicalCollectiveEnum(nep,type,3); - PetscValidRealPointer(error,4); + PetscAssertPointer(error,4); NEPCheckSolved(nep,1); /* allocate work vectors */ diff --git a/src/pep/impls/ciss/pciss.c b/src/pep/impls/ciss/pciss.c index 196743239..3dec91c7c 100644 --- a/src/pep/impls/ciss/pciss.c +++ b/src/pep/impls/ciss/pciss.c @@ -848,7 +848,7 @@ PetscErrorCode PEPCISSGetExtraction(PEP pep,PEPCISSExtraction *extraction) { PetscFunctionBegin; PetscValidHeaderSpecific(pep,PEP_CLASSID,1); - PetscValidPointer(extraction,2); + PetscAssertPointer(extraction,2); PetscUseMethod(pep,"PEPCISSGetExtraction_C",(PEP,PEPCISSExtraction*),(pep,extraction)); PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/pep/impls/jd/pjd.c b/src/pep/impls/jd/pjd.c index effc82637..27f154d0f 100644 --- a/src/pep/impls/jd/pjd.c +++ b/src/pep/impls/jd/pjd.c @@ -1533,7 +1533,7 @@ PetscErrorCode PEPJDGetRestart(PEP pep,PetscReal *keep) { PetscFunctionBegin; PetscValidHeaderSpecific(pep,PEP_CLASSID,1); - PetscValidRealPointer(keep,2); + PetscAssertPointer(keep,2); PetscUseMethod(pep,"PEPJDGetRestart_C",(PEP,PetscReal*),(pep,keep)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -1616,7 +1616,7 @@ PetscErrorCode PEPJDGetFix(PEP pep,PetscReal *fix) { PetscFunctionBegin; PetscValidHeaderSpecific(pep,PEP_CLASSID,1); - PetscValidRealPointer(fix,2); + PetscAssertPointer(fix,2); PetscUseMethod(pep,"PEPJDGetFix_C",(PEP,PetscReal*),(pep,fix)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -1689,7 +1689,7 @@ PetscErrorCode PEPJDGetReusePreconditioner(PEP pep,PetscBool *reusepc) { PetscFunctionBegin; PetscValidHeaderSpecific(pep,PEP_CLASSID,1); - PetscValidBoolPointer(reusepc,2); + PetscAssertPointer(reusepc,2); PetscUseMethod(pep,"PEPJDGetReusePreconditioner_C",(PEP,PetscBool*),(pep,reusepc)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -1768,7 +1768,7 @@ PetscErrorCode PEPJDGetMinimalityIndex(PEP pep,PetscInt *mmidx) { PetscFunctionBegin; PetscValidHeaderSpecific(pep,PEP_CLASSID,1); - PetscValidIntPointer(mmidx,2); + PetscAssertPointer(mmidx,2); PetscUseMethod(pep,"PEPJDGetMinimalityIndex_C",(PEP,PetscInt*),(pep,mmidx)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -1845,7 +1845,7 @@ PetscErrorCode PEPJDGetProjection(PEP pep,PEPJDProjection *proj) { PetscFunctionBegin; PetscValidHeaderSpecific(pep,PEP_CLASSID,1); - PetscValidPointer(proj,2); + PetscAssertPointer(proj,2); PetscUseMethod(pep,"PEPJDGetProjection_C",(PEP,PEPJDProjection*),(pep,proj)); PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/pep/impls/krylov/qarnoldi/qarnoldi.c b/src/pep/impls/krylov/qarnoldi/qarnoldi.c index 787dbd89d..45b7d7947 100644 --- a/src/pep/impls/krylov/qarnoldi/qarnoldi.c +++ b/src/pep/impls/krylov/qarnoldi/qarnoldi.c @@ -365,7 +365,7 @@ PetscErrorCode PEPQArnoldiGetRestart(PEP pep,PetscReal *keep) { PetscFunctionBegin; PetscValidHeaderSpecific(pep,PEP_CLASSID,1); - PetscValidRealPointer(keep,2); + PetscAssertPointer(keep,2); PetscUseMethod(pep,"PEPQArnoldiGetRestart_C",(PEP,PetscReal*),(pep,keep)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -439,7 +439,7 @@ PetscErrorCode PEPQArnoldiGetLocking(PEP pep,PetscBool *lock) { PetscFunctionBegin; PetscValidHeaderSpecific(pep,PEP_CLASSID,1); - PetscValidBoolPointer(lock,2); + PetscAssertPointer(lock,2); PetscUseMethod(pep,"PEPQArnoldiGetLocking_C",(PEP,PetscBool*),(pep,lock)); PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/pep/impls/krylov/stoar/stoar.c b/src/pep/impls/krylov/stoar/stoar.c index c0cc9a0b8..4e76eef7e 100644 --- a/src/pep/impls/krylov/stoar/stoar.c +++ b/src/pep/impls/krylov/stoar/stoar.c @@ -576,7 +576,7 @@ PetscErrorCode PEPSTOARGetLocking(PEP pep,PetscBool *lock) { PetscFunctionBegin; PetscValidHeaderSpecific(pep,PEP_CLASSID,1); - PetscValidBoolPointer(lock,2); + PetscAssertPointer(lock,2); PetscUseMethod(pep,"PEPSTOARGetLocking_C",(PEP,PetscBool*),(pep,lock)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -671,7 +671,7 @@ PetscErrorCode PEPSTOARGetInertias(PEP pep,PetscInt *n,PetscReal **shifts,PetscI { PetscFunctionBegin; PetscValidHeaderSpecific(pep,PEP_CLASSID,1); - PetscValidIntPointer(n,2); + PetscAssertPointer(n,2); PetscUseMethod(pep,"PEPSTOARGetInertias_C",(PEP,PetscInt*,PetscReal**,PetscInt**),(pep,n,shifts,inertias)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -749,7 +749,7 @@ PetscErrorCode PEPSTOARGetDetectZeros(PEP pep,PetscBool *detect) { PetscFunctionBegin; PetscValidHeaderSpecific(pep,PEP_CLASSID,1); - PetscValidBoolPointer(detect,2); + PetscAssertPointer(detect,2); PetscUseMethod(pep,"PEPSTOARGetDetectZeros_C",(PEP,PetscBool*),(pep,detect)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -1001,7 +1001,7 @@ PetscErrorCode PEPSTOARGetCheckEigenvalueType(PEP pep,PetscBool *checket) { PetscFunctionBegin; PetscValidHeaderSpecific(pep,PEP_CLASSID,1); - PetscValidBoolPointer(checket,2); + PetscAssertPointer(checket,2); PetscUseMethod(pep,"PEPSTOARGetCheckEigenvalueType_C",(PEP,PetscBool*),(pep,checket)); PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/pep/impls/krylov/toar/ptoar.c b/src/pep/impls/krylov/toar/ptoar.c index f5659e507..ed331c025 100644 --- a/src/pep/impls/krylov/toar/ptoar.c +++ b/src/pep/impls/krylov/toar/ptoar.c @@ -675,7 +675,7 @@ PetscErrorCode PEPTOARGetRestart(PEP pep,PetscReal *keep) { PetscFunctionBegin; PetscValidHeaderSpecific(pep,PEP_CLASSID,1); - PetscValidRealPointer(keep,2); + PetscAssertPointer(keep,2); PetscUseMethod(pep,"PEPTOARGetRestart_C",(PEP,PetscReal*),(pep,keep)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -749,7 +749,7 @@ PetscErrorCode PEPTOARGetLocking(PEP pep,PetscBool *lock) { PetscFunctionBegin; PetscValidHeaderSpecific(pep,PEP_CLASSID,1); - PetscValidBoolPointer(lock,2); + PetscAssertPointer(lock,2); PetscUseMethod(pep,"PEPTOARGetLocking_C",(PEP,PetscBool*),(pep,lock)); PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/pep/impls/linear/linear.c b/src/pep/impls/linear/linear.c index 21c7e7228..f921c2786 100644 --- a/src/pep/impls/linear/linear.c +++ b/src/pep/impls/linear/linear.c @@ -867,7 +867,7 @@ PetscErrorCode PEPLinearGetExplicitMatrix(PEP pep,PetscBool *explicitmat) { PetscFunctionBegin; PetscValidHeaderSpecific(pep,PEP_CLASSID,1); - PetscValidBoolPointer(explicitmat,2); + PetscAssertPointer(explicitmat,2); PetscUseMethod(pep,"PEPLinearGetExplicitMatrix_C",(PEP,PetscBool*),(pep,explicitmat)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -946,7 +946,7 @@ PetscErrorCode PEPLinearGetEPS(PEP pep,EPS *eps) { PetscFunctionBegin; PetscValidHeaderSpecific(pep,PEP_CLASSID,1); - PetscValidPointer(eps,2); + PetscAssertPointer(eps,2); PetscUseMethod(pep,"PEPLinearGetEPS_C",(PEP,EPS*),(pep,eps)); PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/pep/interface/pepbasic.c b/src/pep/interface/pepbasic.c index f89dccb2b..bdb9c149d 100644 --- a/src/pep/interface/pepbasic.c +++ b/src/pep/interface/pepbasic.c @@ -50,7 +50,7 @@ PetscErrorCode PEPCreate(MPI_Comm comm,PEP *outpep) PEP pep; PetscFunctionBegin; - PetscValidPointer(outpep,2); + PetscAssertPointer(outpep,2); *outpep = NULL; PetscCall(PEPInitializePackage()); PetscCall(SlepcHeaderCreate(pep,PEP_CLASSID,"PEP","Polynomial Eigenvalue Problem","PEP",comm,PEPDestroy,PEPView)); @@ -162,7 +162,7 @@ PetscErrorCode PEPSetType(PEP pep,PEPType type) PetscFunctionBegin; PetscValidHeaderSpecific(pep,PEP_CLASSID,1); - PetscValidCharPointer(type,2); + PetscAssertPointer(type,2); PetscCall(PetscObjectTypeCompare((PetscObject)pep,type,&match)); if (match) PetscFunctionReturn(PETSC_SUCCESS); @@ -198,7 +198,7 @@ PetscErrorCode PEPGetType(PEP pep,PEPType *type) { PetscFunctionBegin; PetscValidHeaderSpecific(pep,PEP_CLASSID,1); - PetscValidPointer(type,2); + PetscAssertPointer(type,2); *type = ((PetscObject)pep)->type_name; PetscFunctionReturn(PETSC_SUCCESS); } @@ -400,7 +400,7 @@ PetscErrorCode PEPGetBV(PEP pep,BV *bv) { PetscFunctionBegin; PetscValidHeaderSpecific(pep,PEP_CLASSID,1); - PetscValidPointer(bv,2); + PetscAssertPointer(bv,2); if (!pep->V) { PetscCall(BVCreate(PetscObjectComm((PetscObject)pep),&pep->V)); PetscCall(PetscObjectIncrementTabLevel((PetscObject)pep->V,(PetscObject)pep,0)); @@ -461,7 +461,7 @@ PetscErrorCode PEPGetRG(PEP pep,RG *rg) { PetscFunctionBegin; PetscValidHeaderSpecific(pep,PEP_CLASSID,1); - PetscValidPointer(rg,2); + PetscAssertPointer(rg,2); if (!pep->rg) { PetscCall(RGCreate(PetscObjectComm((PetscObject)pep),&pep->rg)); PetscCall(PetscObjectIncrementTabLevel((PetscObject)pep->rg,(PetscObject)pep,0)); @@ -520,7 +520,7 @@ PetscErrorCode PEPGetDS(PEP pep,DS *ds) { PetscFunctionBegin; PetscValidHeaderSpecific(pep,PEP_CLASSID,1); - PetscValidPointer(ds,2); + PetscAssertPointer(ds,2); if (!pep->ds) { PetscCall(DSCreate(PetscObjectComm((PetscObject)pep),&pep->ds)); PetscCall(PetscObjectIncrementTabLevel((PetscObject)pep->ds,(PetscObject)pep,0)); @@ -579,7 +579,7 @@ PetscErrorCode PEPGetST(PEP pep,ST *st) { PetscFunctionBegin; PetscValidHeaderSpecific(pep,PEP_CLASSID,1); - PetscValidPointer(st,2); + PetscAssertPointer(st,2); if (!pep->st) { PetscCall(STCreate(PetscObjectComm((PetscObject)pep),&pep->st)); PetscCall(PetscObjectIncrementTabLevel((PetscObject)pep->st,(PetscObject)pep,0)); @@ -611,7 +611,7 @@ PetscErrorCode PEPRefineGetKSP(PEP pep,KSP *ksp) PetscFunctionBegin; PetscValidHeaderSpecific(pep,PEP_CLASSID,1); - PetscValidPointer(ksp,2); + PetscAssertPointer(ksp,2); if (!pep->refineksp) { if (pep->npart>1) { /* Split in subcomunicators */ @@ -688,7 +688,7 @@ PetscErrorCode PEPGetTarget(PEP pep,PetscScalar* target) { PetscFunctionBegin; PetscValidHeaderSpecific(pep,PEP_CLASSID,1); - PetscValidScalarPointer(target,2); + PetscAssertPointer(target,2); *target = pep->target; PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/pep/interface/pepopts.c b/src/pep/interface/pepopts.c index e89e136e0..c6a33dbfd 100644 --- a/src/pep/interface/pepopts.c +++ b/src/pep/interface/pepopts.c @@ -519,7 +519,7 @@ PetscErrorCode PEPGetWhichEigenpairs(PEP pep,PEPWhich *which) { PetscFunctionBegin; PetscValidHeaderSpecific(pep,PEP_CLASSID,1); - PetscValidPointer(which,2); + PetscAssertPointer(which,2); *which = pep->which; PetscFunctionReturn(PETSC_SUCCESS); } @@ -628,7 +628,7 @@ PetscErrorCode PEPGetProblemType(PEP pep,PEPProblemType *type) { PetscFunctionBegin; PetscValidHeaderSpecific(pep,PEP_CLASSID,1); - PetscValidPointer(type,2); + PetscAssertPointer(type,2); *type = pep->problem_type; PetscFunctionReturn(PETSC_SUCCESS); } @@ -685,7 +685,7 @@ PetscErrorCode PEPGetBasis(PEP pep,PEPBasis *basis) { PetscFunctionBegin; PetscValidHeaderSpecific(pep,PEP_CLASSID,1); - PetscValidPointer(basis,2); + PetscAssertPointer(basis,2); *basis = pep->basis; PetscFunctionReturn(PETSC_SUCCESS); } @@ -741,7 +741,7 @@ PetscErrorCode PEPGetTrackAll(PEP pep,PetscBool *trackall) { PetscFunctionBegin; PetscValidHeaderSpecific(pep,PEP_CLASSID,1); - PetscValidBoolPointer(trackall,2); + PetscAssertPointer(trackall,2); *trackall = pep->trackall; PetscFunctionReturn(PETSC_SUCCESS); } @@ -860,7 +860,7 @@ PetscErrorCode PEPGetConvergenceTest(PEP pep,PEPConv *conv) { PetscFunctionBegin; PetscValidHeaderSpecific(pep,PEP_CLASSID,1); - PetscValidPointer(conv,2); + PetscAssertPointer(conv,2); *conv = pep->conv; PetscFunctionReturn(PETSC_SUCCESS); } @@ -974,7 +974,7 @@ PetscErrorCode PEPGetStoppingTest(PEP pep,PEPStop *stop) { PetscFunctionBegin; PetscValidHeaderSpecific(pep,PEP_CLASSID,1); - PetscValidPointer(stop,2); + PetscAssertPointer(stop,2); *stop = pep->stop; PetscFunctionReturn(PETSC_SUCCESS); } @@ -1152,7 +1152,7 @@ PetscErrorCode PEPGetExtract(PEP pep,PEPExtract *extract) { PetscFunctionBegin; PetscValidHeaderSpecific(pep,PEP_CLASSID,1); - PetscValidPointer(extract,2); + PetscAssertPointer(extract,2); *extract = pep->extract; PetscFunctionReturn(PETSC_SUCCESS); } @@ -1382,7 +1382,7 @@ PetscErrorCode PEPGetOptionsPrefix(PEP pep,const char *prefix[]) { PetscFunctionBegin; PetscValidHeaderSpecific(pep,PEP_CLASSID,1); - PetscValidPointer(prefix,2); + PetscAssertPointer(prefix,2); PetscCall(PetscObjectGetOptionsPrefix((PetscObject)pep,prefix)); PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/pep/interface/pepsetup.c b/src/pep/interface/pepsetup.c index ad5db968e..b98728238 100644 --- a/src/pep/interface/pepsetup.c +++ b/src/pep/interface/pepsetup.c @@ -286,7 +286,7 @@ PetscErrorCode PEPSetOperators(PEP pep,PetscInt nmat,Mat A[]) PetscValidLogicalCollectiveInt(pep,nmat,2); PetscCheck(nmat>0,PetscObjectComm((PetscObject)pep),PETSC_ERR_ARG_OUTOFRANGE,"Non-positive value of nmat: %" PetscInt_FMT,nmat); PetscCheck(nmat>2,PetscObjectComm((PetscObject)pep),PETSC_ERR_ARG_OUTOFRANGE,"Cannot solve linear eigenproblems with PEP; use EPS instead"); - PetscValidPointer(A,3); + PetscAssertPointer(A,3); for (i=0;i=0 && knmat,PetscObjectComm((PetscObject)pep),PETSC_ERR_ARG_OUTOFRANGE,"k must be between 0 and %" PetscInt_FMT,pep->nmat-1); *A = pep->A[k]; PetscFunctionReturn(PETSC_SUCCESS); @@ -364,7 +364,7 @@ PetscErrorCode PEPGetNumMatrices(PEP pep,PetscInt *nmat) { PetscFunctionBegin; PetscValidHeaderSpecific(pep,PEP_CLASSID,1); - PetscValidIntPointer(nmat,2); + PetscAssertPointer(nmat,2); *nmat = pep->nmat; PetscFunctionReturn(PETSC_SUCCESS); } @@ -404,7 +404,7 @@ PetscErrorCode PEPSetInitialSpace(PEP pep,PetscInt n,Vec is[]) PetscValidLogicalCollectiveInt(pep,n,2); PetscCheck(n>=0,PetscObjectComm((PetscObject)pep),PETSC_ERR_ARG_OUTOFRANGE,"Argument n cannot be negative"); if (n>0) { - PetscValidPointer(is,3); + PetscAssertPointer(is,3); PetscValidHeaderSpecific(*is,VEC_CLASSID,3); } PetscCall(SlepcBasisReference_Private(n,is,&pep->nini,&pep->IS)); diff --git a/src/pep/interface/pepsolve.c b/src/pep/interface/pepsolve.c index c5a9161af..177f7fd24 100644 --- a/src/pep/interface/pepsolve.c +++ b/src/pep/interface/pepsolve.c @@ -192,7 +192,7 @@ PetscErrorCode PEPGetIterationNumber(PEP pep,PetscInt *its) { PetscFunctionBegin; PetscValidHeaderSpecific(pep,PEP_CLASSID,1); - PetscValidIntPointer(its,2); + PetscAssertPointer(its,2); *its = pep->its; PetscFunctionReturn(PETSC_SUCCESS); } @@ -219,7 +219,7 @@ PetscErrorCode PEPGetConverged(PEP pep,PetscInt *nconv) { PetscFunctionBegin; PetscValidHeaderSpecific(pep,PEP_CLASSID,1); - PetscValidIntPointer(nconv,2); + PetscAssertPointer(nconv,2); PEPCheckSolved(pep,1); *nconv = pep->nconv; PetscFunctionReturn(PETSC_SUCCESS); @@ -258,7 +258,7 @@ PetscErrorCode PEPGetConvergedReason(PEP pep,PEPConvergedReason *reason) { PetscFunctionBegin; PetscValidHeaderSpecific(pep,PEP_CLASSID,1); - PetscValidPointer(reason,2); + PetscAssertPointer(reason,2); PEPCheckSolved(pep,1); *reason = pep->reason; PetscFunctionReturn(PETSC_SUCCESS); @@ -355,7 +355,7 @@ PetscErrorCode PEPGetErrorEstimate(PEP pep,PetscInt i,PetscReal *errest) { PetscFunctionBegin; PetscValidHeaderSpecific(pep,PEP_CLASSID,1); - PetscValidRealPointer(errest,3); + PetscAssertPointer(errest,3); PEPCheckSolved(pep,1); PetscCheck(i>=0,PetscObjectComm((PetscObject)pep),PETSC_ERR_ARG_OUTOFRANGE,"The index cannot be negative"); PetscCheck(inconv,PetscObjectComm((PetscObject)pep),PETSC_ERR_ARG_OUTOFRANGE,"The index can be nconv-1 at most, see PEPGetConverged()"); @@ -477,7 +477,7 @@ PetscErrorCode PEPComputeError(PEP pep,PetscInt i,PEPErrorType type,PetscReal *e PetscValidHeaderSpecific(pep,PEP_CLASSID,1); PetscValidLogicalCollectiveInt(pep,i,2); PetscValidLogicalCollectiveEnum(pep,type,3); - PetscValidRealPointer(error,4); + PetscAssertPointer(error,4); PEPCheckSolved(pep,1); /* allocate work vectors */ diff --git a/src/svd/impls/cross/cross.c b/src/svd/impls/cross/cross.c index c342d0e1a..bf0e8c8ea 100644 --- a/src/svd/impls/cross/cross.c +++ b/src/svd/impls/cross/cross.c @@ -463,7 +463,7 @@ PetscErrorCode SVDCrossGetExplicitMatrix(SVD svd,PetscBool *explicitmat) { PetscFunctionBegin; PetscValidHeaderSpecific(svd,SVD_CLASSID,1); - PetscValidBoolPointer(explicitmat,2); + PetscAssertPointer(explicitmat,2); PetscUseMethod(svd,"SVDCrossGetExplicitMatrix_C",(SVD,PetscBool*),(svd,explicitmat)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -543,7 +543,7 @@ PetscErrorCode SVDCrossGetEPS(SVD svd,EPS *eps) { PetscFunctionBegin; PetscValidHeaderSpecific(svd,SVD_CLASSID,1); - PetscValidPointer(eps,2); + PetscAssertPointer(eps,2); PetscUseMethod(svd,"SVDCrossGetEPS_C",(SVD,EPS*),(svd,eps)); PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/svd/impls/cyclic/cyclic.c b/src/svd/impls/cyclic/cyclic.c index 0f94e7423..e3abc1a35 100644 --- a/src/svd/impls/cyclic/cyclic.c +++ b/src/svd/impls/cyclic/cyclic.c @@ -894,7 +894,7 @@ PetscErrorCode SVDCyclicGetExplicitMatrix(SVD svd,PetscBool *explicitmat) { PetscFunctionBegin; PetscValidHeaderSpecific(svd,SVD_CLASSID,1); - PetscValidBoolPointer(explicitmat,2); + PetscAssertPointer(explicitmat,2); PetscUseMethod(svd,"SVDCyclicGetExplicitMatrix_C",(SVD,PetscBool*),(svd,explicitmat)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -974,7 +974,7 @@ PetscErrorCode SVDCyclicGetEPS(SVD svd,EPS *eps) { PetscFunctionBegin; PetscValidHeaderSpecific(svd,SVD_CLASSID,1); - PetscValidPointer(eps,2); + PetscAssertPointer(eps,2); PetscUseMethod(svd,"SVDCyclicGetEPS_C",(SVD,EPS*),(svd,eps)); PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/svd/impls/external/ksvd/svdksvd.c b/src/svd/impls/external/ksvd/svdksvd.c index e8cc9d36e..50418cd72 100644 --- a/src/svd/impls/external/ksvd/svdksvd.c +++ b/src/svd/impls/external/ksvd/svdksvd.c @@ -240,7 +240,7 @@ PetscErrorCode SVDKSVDGetEigenMethod(SVD svd,SVDKSVDEigenMethod *eigen) { PetscFunctionBegin; PetscValidHeaderSpecific(svd,SVD_CLASSID,1); - PetscValidPointer(eigen,2); + PetscAssertPointer(eigen,2); PetscUseMethod(svd,"SVDKSVDGetEigenMethod_C",(SVD,SVDKSVDEigenMethod*),(svd,eigen)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -309,7 +309,7 @@ PetscErrorCode SVDKSVDGetPolarMethod(SVD svd,SVDKSVDPolarMethod *polar) { PetscFunctionBegin; PetscValidHeaderSpecific(svd,SVD_CLASSID,1); - PetscValidPointer(polar,2); + PetscAssertPointer(polar,2); PetscUseMethod(svd,"SVDKSVDGetPolarMethod_C",(SVD,SVDKSVDPolarMethod*),(svd,polar)); PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/svd/impls/external/primme/svdprimme.c b/src/svd/impls/external/primme/svdprimme.c index d5aa51988..2c4790471 100644 --- a/src/svd/impls/external/primme/svdprimme.c +++ b/src/svd/impls/external/primme/svdprimme.c @@ -419,7 +419,7 @@ PetscErrorCode SVDPRIMMEGetBlockSize(SVD svd,PetscInt *bs) { PetscFunctionBegin; PetscValidHeaderSpecific(svd,SVD_CLASSID,1); - PetscValidIntPointer(bs,2); + PetscAssertPointer(bs,2); PetscUseMethod(svd,"SVDPRIMMEGetBlockSize_C",(SVD,PetscInt*),(svd,bs)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -489,7 +489,7 @@ PetscErrorCode SVDPRIMMEGetMethod(SVD svd,SVDPRIMMEMethod *method) { PetscFunctionBegin; PetscValidHeaderSpecific(svd,SVD_CLASSID,1); - PetscValidPointer(method,2); + PetscAssertPointer(method,2); PetscUseMethod(svd,"SVDPRIMMEGetMethod_C",(SVD,SVDPRIMMEMethod*),(svd,method)); PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/svd/impls/lanczos/gklanczos.c b/src/svd/impls/lanczos/gklanczos.c index c10a0f47b..d3d0fb61b 100644 --- a/src/svd/impls/lanczos/gklanczos.c +++ b/src/svd/impls/lanczos/gklanczos.c @@ -397,7 +397,7 @@ PetscErrorCode SVDLanczosGetOneSide(SVD svd,PetscBool *oneside) { PetscFunctionBegin; PetscValidHeaderSpecific(svd,SVD_CLASSID,1); - PetscValidBoolPointer(oneside,2); + PetscAssertPointer(oneside,2); PetscUseMethod(svd,"SVDLanczosGetOneSide_C",(SVD,PetscBool*),(svd,oneside)); PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/svd/impls/trlanczos/trlanczos.c b/src/svd/impls/trlanczos/trlanczos.c index 2f60d77f8..a690c6d01 100644 --- a/src/svd/impls/trlanczos/trlanczos.c +++ b/src/svd/impls/trlanczos/trlanczos.c @@ -1727,7 +1727,7 @@ PetscErrorCode SVDTRLanczosGetOneSide(SVD svd,PetscBool *oneside) { PetscFunctionBegin; PetscValidHeaderSpecific(svd,SVD_CLASSID,1); - PetscValidBoolPointer(oneside,2); + PetscAssertPointer(oneside,2); PetscUseMethod(svd,"SVDTRLanczosGetOneSide_C",(SVD,PetscBool*),(svd,oneside)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -1808,7 +1808,7 @@ PetscErrorCode SVDTRLanczosGetGBidiag(SVD svd,SVDTRLanczosGBidiag *bidiag) { PetscFunctionBegin; PetscValidHeaderSpecific(svd,SVD_CLASSID,1); - PetscValidPointer(bidiag,2); + PetscAssertPointer(bidiag,2); PetscUseMethod(svd,"SVDTRLanczosGetGBidiag_C",(SVD,SVDTRLanczosGBidiag*),(svd,bidiag)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -1894,7 +1894,7 @@ PetscErrorCode SVDTRLanczosGetKSP(SVD svd,KSP *ksp) { PetscFunctionBegin; PetscValidHeaderSpecific(svd,SVD_CLASSID,1); - PetscValidPointer(ksp,2); + PetscAssertPointer(ksp,2); PetscUseMethod(svd,"SVDTRLanczosGetKSP_C",(SVD,KSP*),(svd,ksp)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -1971,7 +1971,7 @@ PetscErrorCode SVDTRLanczosGetRestart(SVD svd,PetscReal *keep) { PetscFunctionBegin; PetscValidHeaderSpecific(svd,SVD_CLASSID,1); - PetscValidRealPointer(keep,2); + PetscAssertPointer(keep,2); PetscUseMethod(svd,"SVDTRLanczosGetRestart_C",(SVD,PetscReal*),(svd,keep)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -2046,7 +2046,7 @@ PetscErrorCode SVDTRLanczosGetLocking(SVD svd,PetscBool *lock) { PetscFunctionBegin; PetscValidHeaderSpecific(svd,SVD_CLASSID,1); - PetscValidBoolPointer(lock,2); + PetscAssertPointer(lock,2); PetscUseMethod(svd,"SVDTRLanczosGetLocking_C",(SVD,PetscBool*),(svd,lock)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -2121,7 +2121,7 @@ PetscErrorCode SVDTRLanczosGetExplicitMatrix(SVD svd,PetscBool *explicitmat) { PetscFunctionBegin; PetscValidHeaderSpecific(svd,SVD_CLASSID,1); - PetscValidBoolPointer(explicitmat,2); + PetscAssertPointer(explicitmat,2); PetscUseMethod(svd,"SVDTRLanczosGetExplicitMatrix_C",(SVD,PetscBool*),(svd,explicitmat)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -2209,7 +2209,7 @@ PetscErrorCode SVDTRLanczosGetScale(SVD svd,PetscReal *scale) { PetscFunctionBegin; PetscValidHeaderSpecific(svd,SVD_CLASSID,1); - PetscValidRealPointer(scale,2); + PetscAssertPointer(scale,2); PetscUseMethod(svd,"SVDTRLanczosGetScale_C",(SVD,PetscReal*),(svd,scale)); PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/svd/interface/svdbasic.c b/src/svd/interface/svdbasic.c index af675ddb0..29f18a059 100644 --- a/src/svd/interface/svdbasic.c +++ b/src/svd/interface/svdbasic.c @@ -50,7 +50,7 @@ PetscErrorCode SVDCreate(MPI_Comm comm,SVD *outsvd) SVD svd; PetscFunctionBegin; - PetscValidPointer(outsvd,2); + PetscAssertPointer(outsvd,2); *outsvd = NULL; PetscCall(SVDInitializePackage()); PetscCall(SlepcHeaderCreate(svd,SVD_CLASSID,"SVD","Singular Value Decomposition","SVD",comm,SVDDestroy,SVDView)); @@ -222,7 +222,7 @@ PetscErrorCode SVDSetType(SVD svd,SVDType type) PetscFunctionBegin; PetscValidHeaderSpecific(svd,SVD_CLASSID,1); - PetscValidCharPointer(type,2); + PetscAssertPointer(type,2); PetscCall(PetscObjectTypeCompare((PetscObject)svd,type,&match)); if (match) PetscFunctionReturn(PETSC_SUCCESS); @@ -258,7 +258,7 @@ PetscErrorCode SVDGetType(SVD svd,SVDType *type) { PetscFunctionBegin; PetscValidHeaderSpecific(svd,SVD_CLASSID,1); - PetscValidPointer(type,2); + PetscAssertPointer(type,2); *type = ((PetscObject)svd)->type_name; PetscFunctionReturn(PETSC_SUCCESS); } @@ -468,7 +468,7 @@ PetscErrorCode SVDGetDS(SVD svd,DS *ds) { PetscFunctionBegin; PetscValidHeaderSpecific(svd,SVD_CLASSID,1); - PetscValidPointer(ds,2); + PetscAssertPointer(ds,2); if (!svd->ds) { PetscCall(DSCreate(PetscObjectComm((PetscObject)svd),&svd->ds)); PetscCall(PetscObjectIncrementTabLevel((PetscObject)svd->ds,(PetscObject)svd,0)); diff --git a/src/svd/interface/svdopts.c b/src/svd/interface/svdopts.c index 3922933e9..4a7be8d81 100644 --- a/src/svd/interface/svdopts.c +++ b/src/svd/interface/svdopts.c @@ -73,7 +73,7 @@ PetscErrorCode SVDGetImplicitTranspose(SVD svd,PetscBool *impl) { PetscFunctionBegin; PetscValidHeaderSpecific(svd,SVD_CLASSID,1); - PetscValidBoolPointer(impl,2); + PetscAssertPointer(impl,2); *impl = svd->impltrans; PetscFunctionReturn(PETSC_SUCCESS); } @@ -310,7 +310,7 @@ PetscErrorCode SVDGetWhichSingularTriplets(SVD svd,SVDWhich *which) { PetscFunctionBegin; PetscValidHeaderSpecific(svd,SVD_CLASSID,1); - PetscValidPointer(which,2); + PetscAssertPointer(which,2); *which = svd->which; PetscFunctionReturn(PETSC_SUCCESS); } @@ -434,7 +434,7 @@ PetscErrorCode SVDGetConvergenceTest(SVD svd,SVDConv *conv) { PetscFunctionBegin; PetscValidHeaderSpecific(svd,SVD_CLASSID,1); - PetscValidPointer(conv,2); + PetscAssertPointer(conv,2); *conv = svd->conv; PetscFunctionReturn(PETSC_SUCCESS); } @@ -548,7 +548,7 @@ PetscErrorCode SVDGetStoppingTest(SVD svd,SVDStop *stop) { PetscFunctionBegin; PetscValidHeaderSpecific(svd,SVD_CLASSID,1); - PetscValidPointer(stop,2); + PetscAssertPointer(stop,2); *stop = svd->stop; PetscFunctionReturn(PETSC_SUCCESS); } @@ -781,7 +781,7 @@ PetscErrorCode SVDGetProblemType(SVD svd,SVDProblemType *type) { PetscFunctionBegin; PetscValidHeaderSpecific(svd,SVD_CLASSID,1); - PetscValidPointer(type,2); + PetscAssertPointer(type,2); *type = svd->problem_type; PetscFunctionReturn(PETSC_SUCCESS); } @@ -806,7 +806,7 @@ PetscErrorCode SVDIsGeneralized(SVD svd,PetscBool* is) { PetscFunctionBegin; PetscValidHeaderSpecific(svd,SVD_CLASSID,1); - PetscValidBoolPointer(is,2); + PetscAssertPointer(is,2); *is = svd->isgeneralized; PetscFunctionReturn(PETSC_SUCCESS); } @@ -831,7 +831,7 @@ PetscErrorCode SVDIsHyperbolic(SVD svd,PetscBool* is) { PetscFunctionBegin; PetscValidHeaderSpecific(svd,SVD_CLASSID,1); - PetscValidBoolPointer(is,2); + PetscAssertPointer(is,2); *is = svd->ishyperbolic; PetscFunctionReturn(PETSC_SUCCESS); } @@ -887,7 +887,7 @@ PetscErrorCode SVDGetTrackAll(SVD svd,PetscBool *trackall) { PetscFunctionBegin; PetscValidHeaderSpecific(svd,SVD_CLASSID,1); - PetscValidBoolPointer(trackall,2); + PetscAssertPointer(trackall,2); *trackall = svd->trackall; PetscFunctionReturn(PETSC_SUCCESS); } @@ -986,7 +986,7 @@ PetscErrorCode SVDGetOptionsPrefix(SVD svd,const char *prefix[]) { PetscFunctionBegin; PetscValidHeaderSpecific(svd,SVD_CLASSID,1); - PetscValidPointer(prefix,2); + PetscAssertPointer(prefix,2); PetscCall(PetscObjectGetOptionsPrefix((PetscObject)svd,prefix)); PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/svd/interface/svdsetup.c b/src/svd/interface/svdsetup.c index bd03527be..758dd01dd 100644 --- a/src/svd/interface/svdsetup.c +++ b/src/svd/interface/svdsetup.c @@ -166,7 +166,7 @@ PetscErrorCode SVDGetSignature(SVD svd,Vec *omega) { PetscFunctionBegin; PetscValidHeaderSpecific(svd,SVD_CLASSID,1); - PetscValidPointer(omega,2); + PetscAssertPointer(omega,2); *omega = svd->omega; PetscFunctionReturn(PETSC_SUCCESS); } @@ -416,12 +416,12 @@ PetscErrorCode SVDSetInitialSpaces(SVD svd,PetscInt nr,Vec isr[],PetscInt nl,Vec PetscValidLogicalCollectiveInt(svd,nl,4); PetscCheck(nr>=0,PetscObjectComm((PetscObject)svd),PETSC_ERR_ARG_OUTOFRANGE,"Argument nr cannot be negative"); if (nr>0) { - PetscValidPointer(isr,3); + PetscAssertPointer(isr,3); PetscValidHeaderSpecific(*isr,VEC_CLASSID,3); } PetscCheck(nl>=0,PetscObjectComm((PetscObject)svd),PETSC_ERR_ARG_OUTOFRANGE,"Argument nl cannot be negative"); if (nl>0) { - PetscValidPointer(isl,5); + PetscAssertPointer(isl,5); PetscValidHeaderSpecific(*isl,VEC_CLASSID,5); } PetscCall(SlepcBasisReference_Private(nr,isr,&svd->nini,&svd->IS)); diff --git a/src/svd/interface/svdsolve.c b/src/svd/interface/svdsolve.c index daaa8ffdd..c45c36ee9 100644 --- a/src/svd/interface/svdsolve.c +++ b/src/svd/interface/svdsolve.c @@ -201,7 +201,7 @@ PetscErrorCode SVDGetIterationNumber(SVD svd,PetscInt *its) { PetscFunctionBegin; PetscValidHeaderSpecific(svd,SVD_CLASSID,1); - PetscValidIntPointer(its,2); + PetscAssertPointer(its,2); *its = svd->its; PetscFunctionReturn(PETSC_SUCCESS); } @@ -241,7 +241,7 @@ PetscErrorCode SVDGetConvergedReason(SVD svd,SVDConvergedReason *reason) { PetscFunctionBegin; PetscValidHeaderSpecific(svd,SVD_CLASSID,1); - PetscValidIntPointer(reason,2); + PetscAssertPointer(reason,2); SVDCheckSolved(svd,1); *reason = svd->reason; PetscFunctionReturn(PETSC_SUCCESS); @@ -269,7 +269,7 @@ PetscErrorCode SVDGetConverged(SVD svd,PetscInt *nconv) { PetscFunctionBegin; PetscValidHeaderSpecific(svd,SVD_CLASSID,1); - PetscValidIntPointer(nconv,2); + PetscAssertPointer(nconv,2); SVDCheckSolved(svd,1); *nconv = svd->nconv; PetscFunctionReturn(PETSC_SUCCESS); @@ -493,7 +493,7 @@ PetscErrorCode SVDComputeError(SVD svd,PetscInt i,SVDErrorType type,PetscReal *e PetscValidHeaderSpecific(svd,SVD_CLASSID,1); PetscValidLogicalCollectiveInt(svd,i,2); PetscValidLogicalCollectiveEnum(svd,type,3); - PetscValidRealPointer(error,4); + PetscAssertPointer(error,4); SVDCheckSolved(svd,1); /* allocate work vectors */ diff --git a/src/sys/classes/bv/impls/tensor/bvtensor.c b/src/sys/classes/bv/impls/tensor/bvtensor.c index b89ec390a..58ffaff15 100644 --- a/src/sys/classes/bv/impls/tensor/bvtensor.c +++ b/src/sys/classes/bv/impls/tensor/bvtensor.c @@ -598,7 +598,7 @@ PetscErrorCode BVTensorGetDegree(BV bv,PetscInt *d) { PetscFunctionBegin; PetscValidHeaderSpecific(bv,BV_CLASSID,1); - PetscValidIntPointer(d,2); + PetscAssertPointer(d,2); PetscUseMethod(bv,"BVTensorGetDegree_C",(BV,PetscInt*),(bv,d)); PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/sys/classes/bv/interface/bvbasic.c b/src/sys/classes/bv/interface/bvbasic.c index e88a6647e..aa07a8141 100644 --- a/src/sys/classes/bv/interface/bvbasic.c +++ b/src/sys/classes/bv/interface/bvbasic.c @@ -39,7 +39,7 @@ PetscErrorCode BVSetType(BV bv,BVType type) PetscFunctionBegin; PetscValidHeaderSpecific(bv,BV_CLASSID,1); - PetscValidCharPointer(type,2); + PetscAssertPointer(type,2); PetscCall(PetscObjectTypeCompare((PetscObject)bv,type,&match)); if (match) PetscFunctionReturn(PETSC_SUCCESS); @@ -82,7 +82,7 @@ PetscErrorCode BVGetType(BV bv,BVType *type) { PetscFunctionBegin; PetscValidHeaderSpecific(bv,BV_CLASSID,1); - PetscValidPointer(type,2); + PetscAssertPointer(type,2); *type = ((PetscObject)bv)->type_name; PetscFunctionReturn(PETSC_SUCCESS); } @@ -304,7 +304,7 @@ PetscErrorCode BVGetNumConstraints(BV bv,PetscInt *nc) { PetscFunctionBegin; PetscValidHeaderSpecific(bv,BV_CLASSID,1); - PetscValidIntPointer(nc,2); + PetscAssertPointer(nc,2); *nc = bv->nc; PetscFunctionReturn(PETSC_SUCCESS); } @@ -761,7 +761,7 @@ PetscErrorCode BVGetBufferVec(BV bv,Vec *buffer) PetscFunctionBegin; PetscValidHeaderSpecific(bv,BV_CLASSID,1); - PetscValidPointer(buffer,2); + PetscAssertPointer(buffer,2); BVCheckSizes(bv,1); if (!bv->buffer) { ld = bv->m+bv->nc; @@ -818,7 +818,7 @@ PetscErrorCode BVGetRandomContext(BV bv,PetscRandom* rand) { PetscFunctionBegin; PetscValidHeaderSpecific(bv,BV_CLASSID,1); - PetscValidPointer(rand,2); + PetscAssertPointer(rand,2); if (!bv->rand) { PetscCall(PetscRandomCreate(PetscObjectComm((PetscObject)bv),&bv->rand)); if (bv->cuda) PetscCall(PetscRandomSetType(bv->rand,PETSCCURAND)); @@ -1061,7 +1061,7 @@ PetscErrorCode BVGetMatMultMethod(BV bv,BVMatMultType *method) { PetscFunctionBegin; PetscValidHeaderSpecific(bv,BV_CLASSID,1); - PetscValidPointer(method,2); + PetscAssertPointer(method,2); *method = bv->vmm; PetscFunctionReturn(PETSC_SUCCESS); } @@ -1146,7 +1146,7 @@ PetscErrorCode BVRestoreColumn(BV bv,PetscInt j,Vec *v) PetscValidType(bv,1); BVCheckSizes(bv,1); PetscValidLogicalCollectiveInt(bv,j,2); - PetscValidPointer(v,3); + PetscAssertPointer(v,3); PetscValidHeaderSpecific(*v,VEC_CLASSID,3); PetscCheck(j>=0 || -j<=bv->nc,PetscObjectComm((PetscObject)bv),PETSC_ERR_ARG_OUTOFRANGE,"You requested constraint %" PetscInt_FMT " but only %" PetscInt_FMT " are available",-j,bv->nc); PetscCheck(jm,PetscObjectComm((PetscObject)bv),PETSC_ERR_ARG_OUTOFRANGE,"You requested column %" PetscInt_FMT " but only %" PetscInt_FMT " are available",j,bv->m); @@ -1312,7 +1312,7 @@ PetscErrorCode BVCreateVec(BV bv,Vec *v) PetscFunctionBegin; PetscValidHeaderSpecific(bv,BV_CLASSID,1); BVCheckSizes(bv,1); - PetscValidPointer(v,2); + PetscAssertPointer(v,2); PetscCall(VecDuplicate(bv->t,v)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -1346,7 +1346,7 @@ PetscErrorCode BVCreateMat(BV bv,Mat *A) PetscFunctionBegin; PetscValidHeaderSpecific(bv,BV_CLASSID,1); BVCheckSizes(bv,1); - PetscValidPointer(A,2); + PetscAssertPointer(A,2); PetscCall(MatCreateDense(PetscObjectComm((PetscObject)bv->t),bv->n,PETSC_DECIDE,bv->N,bv->m,NULL,A)); PetscCall(MatDenseGetArrayWrite(*A,&aa)); @@ -1414,7 +1414,7 @@ PetscErrorCode BVGetMat(BV bv,Mat *A) PetscFunctionBegin; PetscValidHeaderSpecific(bv,BV_CLASSID,1); BVCheckSizes(bv,1); - PetscValidPointer(A,2); + PetscAssertPointer(A,2); PetscUseTypeMethod(bv,getmat,A); PetscFunctionReturn(PETSC_SUCCESS); } @@ -1455,7 +1455,7 @@ PetscErrorCode BVRestoreMat(BV bv,Mat *A) PetscFunctionBegin; PetscValidHeaderSpecific(bv,BV_CLASSID,1); BVCheckSizes(bv,1); - PetscValidPointer(A,2); + PetscAssertPointer(A,2); PetscCheck(bv->Aget,PetscObjectComm((PetscObject)bv),PETSC_ERR_ARG_WRONGSTATE,"BVRestoreMat must match a previous call to BVGetMat"); PetscCheck(bv->Aget==*A,PetscObjectComm((PetscObject)bv),PETSC_ERR_ARG_WRONGSTATE,"Mat argument is not the same as the one obtained with BVGetMat"); PetscUseTypeMethod(bv,restoremat,A); @@ -1517,7 +1517,7 @@ PetscErrorCode BVDuplicate(BV V,BV *W) PetscValidHeaderSpecific(V,BV_CLASSID,1); PetscValidType(V,1); BVCheckSizes(V,1); - PetscValidPointer(W,2); + PetscAssertPointer(W,2); PetscCall(BVCreate(PetscObjectComm((PetscObject)V),W)); PetscCall(BVSetSizesFromVec(*W,V->t,V->m)); PetscCall(BVDuplicate_Private(V,*W)); @@ -1552,7 +1552,7 @@ PetscErrorCode BVDuplicateResize(BV V,PetscInt m,BV *W) PetscValidType(V,1); BVCheckSizes(V,1); PetscValidLogicalCollectiveInt(V,m,2); - PetscValidPointer(W,3); + PetscAssertPointer(W,3); PetscCall(BVCreate(PetscObjectComm((PetscObject)V),W)); PetscCall(BVSetSizesFromVec(*W,V->t,m)); PetscCall(BVDuplicate_Private(V,*W)); @@ -1582,7 +1582,7 @@ PetscErrorCode BVGetCachedBV(BV bv,BV *cached) { PetscFunctionBegin; PetscValidHeaderSpecific(bv,BV_CLASSID,1); - PetscValidPointer(cached,2); + PetscAssertPointer(cached,2); BVCheckSizes(bv,1); if (!bv->cached) { PetscCall(BVCreate(PetscObjectComm((PetscObject)bv),&bv->cached)); @@ -1903,7 +1903,7 @@ PetscErrorCode BVGetDefiniteTolerance(BV bv,PetscReal *deftol) { PetscFunctionBegin; PetscValidHeaderSpecific(bv,BV_CLASSID,1); - PetscValidRealPointer(deftol,2); + PetscAssertPointer(deftol,2); *deftol = bv->deftol; PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/sys/classes/bv/interface/bvcontour.c b/src/sys/classes/bv/interface/bvcontour.c index 14b001429..4cfcce5f7 100644 --- a/src/sys/classes/bv/interface/bvcontour.c +++ b/src/sys/classes/bv/interface/bvcontour.c @@ -541,9 +541,9 @@ PetscErrorCode BVSVDAndRank(BV S,PetscInt m,PetscInt l,PetscReal delta,BVSVDMeth PetscValidLogicalCollectiveInt(S,l,3); PetscValidLogicalCollectiveReal(S,delta,4); PetscValidLogicalCollectiveEnum(S,meth,5); - PetscValidScalarPointer(A,6); - PetscValidRealPointer(sigma,7); - PetscValidIntPointer(rank,8); + PetscAssertPointer(A,6); + PetscAssertPointer(sigma,7); + PetscAssertPointer(rank,8); PetscCall(PetscLogEventBegin(BV_SVDAndRank,S,0,0,0)); PetscCall(BVSetActiveColumns(S,0,m*l)); diff --git a/src/sys/classes/bv/interface/bvfunc.c b/src/sys/classes/bv/interface/bvfunc.c index 9a6f01996..b7cb8e448 100644 --- a/src/sys/classes/bv/interface/bvfunc.c +++ b/src/sys/classes/bv/interface/bvfunc.c @@ -159,7 +159,7 @@ PetscErrorCode BVCreate(MPI_Comm comm,BV *newbv) BV bv; PetscFunctionBegin; - PetscValidPointer(newbv,2); + PetscAssertPointer(newbv,2); *newbv = NULL; PetscCall(BVInitializePackage()); PetscCall(SlepcHeaderCreate(bv,BV_CLASSID,"BV","Basis Vectors","BV",comm,BVDestroy,BVView)); @@ -333,11 +333,11 @@ PetscErrorCode BVInsertVecs(BV V,PetscInt s,PetscInt *m,Vec *W,PetscBool orth) PetscFunctionBegin; PetscValidHeaderSpecific(V,BV_CLASSID,1); PetscValidLogicalCollectiveInt(V,s,2); - PetscValidIntPointer(m,3); + PetscAssertPointer(m,3); PetscValidLogicalCollectiveInt(V,*m,3); if (!*m) PetscFunctionReturn(PETSC_SUCCESS); PetscCheck(*m>0,PetscObjectComm((PetscObject)V),PETSC_ERR_ARG_OUTOFRANGE,"Number of vectors (given %" PetscInt_FMT ") cannot be negative",*m); - PetscValidPointer(W,4); + PetscAssertPointer(W,4); PetscValidHeaderSpecific(*W,VEC_CLASSID,4); PetscValidLogicalCollectiveBool(V,orth,5); PetscValidType(V,1); @@ -409,11 +409,11 @@ PetscErrorCode BVInsertConstraints(BV V,PetscInt *nc,Vec *C) PetscFunctionBegin; PetscValidHeaderSpecific(V,BV_CLASSID,1); - PetscValidIntPointer(nc,2); + PetscAssertPointer(nc,2); PetscValidLogicalCollectiveInt(V,*nc,2); if (!*nc) PetscFunctionReturn(PETSC_SUCCESS); PetscCheck(*nc>0,PetscObjectComm((PetscObject)V),PETSC_ERR_ARG_OUTOFRANGE,"Number of constraints (given %" PetscInt_FMT ") cannot be negative",*nc); - PetscValidPointer(C,3); + PetscAssertPointer(C,3); PetscValidHeaderSpecific(*C,VEC_CLASSID,3); PetscValidType(V,1); BVCheckSizes(V,1); @@ -511,7 +511,7 @@ PetscErrorCode BVGetOptionsPrefix(BV bv,const char *prefix[]) { PetscFunctionBegin; PetscValidHeaderSpecific(bv,BV_CLASSID,1); - PetscValidPointer(prefix,2); + PetscAssertPointer(prefix,2); PetscCall(PetscObjectGetOptionsPrefix((PetscObject)bv,prefix)); PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/sys/classes/bv/interface/bvglobal.c b/src/sys/classes/bv/interface/bvglobal.c index 60f47b449..20470741d 100644 --- a/src/sys/classes/bv/interface/bvglobal.c +++ b/src/sys/classes/bv/interface/bvglobal.c @@ -500,7 +500,7 @@ PetscErrorCode BVNorm(BV bv,NormType type,PetscReal *val) PetscFunctionBegin; PetscValidHeaderSpecific(bv,BV_CLASSID,1); PetscValidLogicalCollectiveEnum(bv,type,2); - PetscValidRealPointer(val,3); + PetscAssertPointer(val,3); PetscValidType(bv,1); BVCheckSizes(bv,1); @@ -544,7 +544,7 @@ PetscErrorCode BVNormVec(BV bv,Vec v,NormType type,PetscReal *val) PetscValidHeaderSpecific(bv,BV_CLASSID,1); PetscValidHeaderSpecific(v,VEC_CLASSID,2); PetscValidLogicalCollectiveEnum(bv,type,3); - PetscValidRealPointer(val,4); + PetscAssertPointer(val,4); PetscValidType(bv,1); BVCheckSizes(bv,1); PetscValidType(v,2); @@ -586,7 +586,7 @@ PetscErrorCode BVNormVecBegin(BV bv,Vec v,NormType type,PetscReal *val) PetscValidHeaderSpecific(bv,BV_CLASSID,1); PetscValidHeaderSpecific(v,VEC_CLASSID,2); PetscValidLogicalCollectiveEnum(bv,type,3); - PetscValidRealPointer(val,4); + PetscAssertPointer(val,4); PetscValidType(bv,1); BVCheckSizes(bv,1); PetscValidType(v,2); @@ -625,7 +625,7 @@ PetscErrorCode BVNormVecEnd(BV bv,Vec v,NormType type,PetscReal *val) PetscFunctionBegin; PetscValidHeaderSpecific(bv,BV_CLASSID,1); PetscValidLogicalCollectiveEnum(bv,type,3); - PetscValidRealPointer(val,4); + PetscAssertPointer(val,4); PetscValidType(bv,1); BVCheckSizes(bv,1); @@ -667,7 +667,7 @@ PetscErrorCode BVNormColumn(BV bv,PetscInt j,NormType type,PetscReal *val) PetscValidHeaderSpecific(bv,BV_CLASSID,1); PetscValidLogicalCollectiveInt(bv,j,2); PetscValidLogicalCollectiveEnum(bv,type,3); - PetscValidRealPointer(val,4); + PetscAssertPointer(val,4); PetscValidType(bv,1); BVCheckSizes(bv,1); @@ -711,7 +711,7 @@ PetscErrorCode BVNormColumnBegin(BV bv,PetscInt j,NormType type,PetscReal *val) PetscValidHeaderSpecific(bv,BV_CLASSID,1); PetscValidLogicalCollectiveInt(bv,j,2); PetscValidLogicalCollectiveEnum(bv,type,3); - PetscValidRealPointer(val,4); + PetscAssertPointer(val,4); PetscValidType(bv,1); BVCheckSizes(bv,1); @@ -766,7 +766,7 @@ PetscErrorCode BVNormColumnEnd(BV bv,PetscInt j,NormType type,PetscReal *val) PetscValidHeaderSpecific(bv,BV_CLASSID,1); PetscValidLogicalCollectiveInt(bv,j,2); PetscValidLogicalCollectiveEnum(bv,type,3); - PetscValidRealPointer(val,4); + PetscAssertPointer(val,4); PetscValidType(bv,1); BVCheckSizes(bv,1); diff --git a/src/sys/classes/bv/interface/bvkrylov.c b/src/sys/classes/bv/interface/bvkrylov.c index 5266203cc..341d3074c 100644 --- a/src/sys/classes/bv/interface/bvkrylov.c +++ b/src/sys/classes/bv/interface/bvkrylov.c @@ -65,7 +65,7 @@ PetscErrorCode BVMatArnoldi(BV V,Mat A,Mat H,PetscInt k,PetscInt *m,PetscReal *b PetscValidHeaderSpecific(V,BV_CLASSID,1); PetscValidHeaderSpecific(A,MAT_CLASSID,2); PetscValidLogicalCollectiveInt(V,k,4); - PetscValidIntPointer(m,5); + PetscAssertPointer(m,5); PetscValidLogicalCollectiveInt(V,*m,5); PetscValidType(V,1); BVCheckSizes(V,1); @@ -175,7 +175,7 @@ PetscErrorCode BVMatLanczos(BV V,Mat A,Mat T,PetscInt k,PetscInt *m,PetscReal *b PetscValidHeaderSpecific(V,BV_CLASSID,1); PetscValidHeaderSpecific(A,MAT_CLASSID,2); PetscValidLogicalCollectiveInt(V,k,4); - PetscValidIntPointer(m,5); + PetscAssertPointer(m,5); PetscValidLogicalCollectiveInt(V,*m,5); PetscValidType(V,1); BVCheckSizes(V,1); diff --git a/src/sys/classes/bv/interface/bvops.c b/src/sys/classes/bv/interface/bvops.c index fded437f0..3642d03ad 100644 --- a/src/sys/classes/bv/interface/bvops.c +++ b/src/sys/classes/bv/interface/bvops.c @@ -116,7 +116,7 @@ PetscErrorCode BVMultVec(BV X,PetscScalar alpha,PetscScalar beta,Vec y,PetscScal PetscValidLogicalCollectiveScalar(X,alpha,2); PetscValidLogicalCollectiveScalar(X,beta,3); PetscValidHeaderSpecific(y,VEC_CLASSID,4); - PetscValidScalarPointer(q,5); + PetscAssertPointer(q,5); PetscValidType(X,1); BVCheckSizes(X,1); BVCheckOp(X,1,multvec); diff --git a/src/sys/classes/bv/interface/bvorthog.c b/src/sys/classes/bv/interface/bvorthog.c index f5b8e19c1..408f1d917 100644 --- a/src/sys/classes/bv/interface/bvorthog.c +++ b/src/sys/classes/bv/interface/bvorthog.c @@ -464,7 +464,7 @@ PetscErrorCode BVOrthogonalizeSomeColumn(BV bv,PetscInt j,PetscBool *which,Petsc PetscFunctionBegin; PetscValidHeaderSpecific(bv,BV_CLASSID,1); PetscValidLogicalCollectiveInt(bv,j,2); - PetscValidBoolPointer(which,3); + PetscAssertPointer(which,3); PetscValidType(bv,1); BVCheckSizes(bv,1); PetscCheck(j>=0,PetscObjectComm((PetscObject)bv),PETSC_ERR_ARG_OUTOFRANGE,"Index j must be non-negative"); diff --git a/src/sys/classes/ds/impls/ghiep/dsghiep.c b/src/sys/classes/ds/impls/ghiep/dsghiep.c index 6f9f0b958..929b9ec1e 100644 --- a/src/sys/classes/ds/impls/ghiep/dsghiep.c +++ b/src/sys/classes/ds/impls/ghiep/dsghiep.c @@ -384,7 +384,7 @@ PetscErrorCode DSSort_GHIEP(DS ds,PetscScalar *wr,PetscScalar *wi,PetscScalar *r PetscFunctionBegin; #if !defined(PETSC_USE_COMPLEX) - PetscValidScalarPointer(wi,3); + PetscAssertPointer(wi,3); #endif n = ds->n; PetscCall(DSGetArrayReal(ds,DS_MAT_T,&d)); @@ -678,7 +678,7 @@ PetscErrorCode DSSolve_GHIEP_QR_II(DS ds,PetscScalar *wr,PetscScalar *wi) PetscFunctionBegin; #if !defined(PETSC_USE_COMPLEX) - PetscValidScalarPointer(wi,3); + PetscAssertPointer(wi,3); #endif PetscCall(PetscBLASIntCast(ds->n-ds->l,&n1)); PetscCall(PetscBLASIntCast(ds->ld,&ld)); @@ -802,7 +802,7 @@ PetscErrorCode DSSolve_GHIEP_QR(DS ds,PetscScalar *wr,PetscScalar *wi) PetscFunctionBegin; #if !defined(PETSC_USE_COMPLEX) - PetscValidScalarPointer(wi,3); + PetscAssertPointer(wi,3); #endif n = ds->n-ds->l; PetscCall(PetscBLASIntCast(n,&n_)); diff --git a/src/sys/classes/ds/impls/ghiep/hz.c b/src/sys/classes/ds/impls/ghiep/hz.c index 87d440401..f4227519d 100644 --- a/src/sys/classes/ds/impls/ghiep/hz.c +++ b/src/sys/classes/ds/impls/ghiep/hz.c @@ -293,7 +293,7 @@ PetscErrorCode DSSolve_GHIEP_HZ(DS ds,PetscScalar *wr,PetscScalar *wi) PetscFunctionBegin; #if !defined(PETSC_USE_COMPLEX) - PetscValidScalarPointer(wi,3); + PetscAssertPointer(wi,3); #endif PetscCall(PetscBLASIntCast(ds->ld,&ld)); n1 = ds->n - ds->l; diff --git a/src/sys/classes/ds/impls/gnhep/dsgnhep.c b/src/sys/classes/ds/impls/gnhep/dsgnhep.c index e0c3039fe..e9cd40fa5 100644 --- a/src/sys/classes/ds/impls/gnhep/dsgnhep.c +++ b/src/sys/classes/ds/impls/gnhep/dsgnhep.c @@ -504,7 +504,7 @@ PetscErrorCode DSSolve_GNHEP(DS ds,PetscScalar *wr,PetscScalar *wi) PetscFunctionBegin; #if !defined(PETSC_USE_COMPLEX) - PetscValidScalarPointer(wi,3); + PetscAssertPointer(wi,3); #endif PetscCall(PetscBLASIntCast(ds->n,&n)); PetscCall(PetscBLASIntCast(ds->ld,&ld)); diff --git a/src/sys/classes/ds/impls/hsvd/dshsvd.c b/src/sys/classes/ds/impls/hsvd/dshsvd.c index b65c496ed..933c59391 100644 --- a/src/sys/classes/ds/impls/hsvd/dshsvd.c +++ b/src/sys/classes/ds/impls/hsvd/dshsvd.c @@ -554,7 +554,7 @@ PetscErrorCode DSHSVDGetDimensions(DS ds,PetscInt *m) { PetscFunctionBegin; PetscValidHeaderSpecific(ds,DS_CLASSID,1); - PetscValidIntPointer(m,2); + PetscAssertPointer(m,2); PetscUseMethod(ds,"DSHSVDGetDimensions_C",(DS,PetscInt*),(ds,m)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -626,7 +626,7 @@ PetscErrorCode DSHSVDGetReorthogonalize(DS ds,PetscBool *reorth) { PetscFunctionBegin; PetscValidHeaderSpecific(ds,DS_CLASSID,1); - PetscValidBoolPointer(reorth,2); + PetscAssertPointer(reorth,2); PetscUseMethod(ds,"DSHSVDGetReorthogonalize_C",(DS,PetscBool*),(ds,reorth)); PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/sys/classes/ds/impls/nep/dsnep.c b/src/sys/classes/ds/impls/nep/dsnep.c index d2f78241b..5a8eaf058 100644 --- a/src/sys/classes/ds/impls/nep/dsnep.c +++ b/src/sys/classes/ds/impls/nep/dsnep.c @@ -619,7 +619,7 @@ PetscErrorCode DSNEPSetFN(DS ds,PetscInt n,FN fn[]) PetscFunctionBegin; PetscValidHeaderSpecific(ds,DS_CLASSID,1); PetscValidLogicalCollectiveInt(ds,n,2); - PetscValidPointer(fn,3); + PetscAssertPointer(fn,3); for (i=0;iwr,ctx->wi)); diff --git a/src/sys/classes/ds/impls/pep/dspep.c b/src/sys/classes/ds/impls/pep/dspep.c index eeb5256a1..c5db62c9c 100644 --- a/src/sys/classes/ds/impls/pep/dspep.c +++ b/src/sys/classes/ds/impls/pep/dspep.c @@ -350,7 +350,7 @@ PetscErrorCode DSPEPGetDegree(DS ds,PetscInt *d) { PetscFunctionBegin; PetscValidHeaderSpecific(ds,DS_CLASSID,1); - PetscValidIntPointer(d,2); + PetscAssertPointer(d,2); PetscUseMethod(ds,"DSPEPGetDegree_C",(DS,PetscInt*),(ds,d)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -445,7 +445,7 @@ PetscErrorCode DSPEPGetCoefficients(DS ds,PetscReal **pbc) { PetscFunctionBegin; PetscValidHeaderSpecific(ds,DS_CLASSID,1); - PetscValidPointer(pbc,2); + PetscAssertPointer(pbc,2); PetscUseMethod(ds,"DSPEPGetCoefficients_C",(DS,PetscReal**),(ds,pbc)); PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/sys/classes/ds/impls/svd/dssvd.c b/src/sys/classes/ds/impls/svd/dssvd.c index 767d8c5c9..8036e0f17 100644 --- a/src/sys/classes/ds/impls/svd/dssvd.c +++ b/src/sys/classes/ds/impls/svd/dssvd.c @@ -492,7 +492,7 @@ PetscErrorCode DSSVDGetDimensions(DS ds,PetscInt *m) { PetscFunctionBegin; PetscValidHeaderSpecific(ds,DS_CLASSID,1); - PetscValidIntPointer(m,2); + PetscAssertPointer(m,2); PetscUseMethod(ds,"DSSVDGetDimensions_C",(DS,PetscInt*),(ds,m)); PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/sys/classes/ds/interface/dsbasic.c b/src/sys/classes/ds/interface/dsbasic.c index 7026fe625..eff2d7652 100644 --- a/src/sys/classes/ds/interface/dsbasic.c +++ b/src/sys/classes/ds/interface/dsbasic.c @@ -107,7 +107,7 @@ PetscErrorCode DSCreate(MPI_Comm comm,DS *newds) PetscInt i; PetscFunctionBegin; - PetscValidPointer(newds,2); + PetscAssertPointer(newds,2); *newds = NULL; PetscCall(DSInitializePackage()); PetscCall(SlepcHeaderCreate(ds,DS_CLASSID,"DS","Direct Solver (or Dense System)","DS",comm,DSDestroy,DSView)); @@ -218,7 +218,7 @@ PetscErrorCode DSGetOptionsPrefix(DS ds,const char *prefix[]) { PetscFunctionBegin; PetscValidHeaderSpecific(ds,DS_CLASSID,1); - PetscValidPointer(prefix,2); + PetscAssertPointer(prefix,2); PetscCall(PetscObjectGetOptionsPrefix((PetscObject)ds,prefix)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -243,7 +243,7 @@ PetscErrorCode DSSetType(DS ds,DSType type) PetscFunctionBegin; PetscValidHeaderSpecific(ds,DS_CLASSID,1); - PetscValidCharPointer(type,2); + PetscAssertPointer(type,2); PetscCall(PetscObjectTypeCompare((PetscObject)ds,type,&match)); if (match) PetscFunctionReturn(PETSC_SUCCESS); @@ -277,7 +277,7 @@ PetscErrorCode DSGetType(DS ds,DSType *type) { PetscFunctionBegin; PetscValidHeaderSpecific(ds,DS_CLASSID,1); - PetscValidPointer(type,2); + PetscAssertPointer(type,2); *type = ((PetscObject)ds)->type_name; PetscFunctionReturn(PETSC_SUCCESS); } @@ -308,7 +308,7 @@ PetscErrorCode DSDuplicate(DS ds,DS *dsnew) { PetscFunctionBegin; PetscValidHeaderSpecific(ds,DS_CLASSID,1); - PetscValidPointer(dsnew,2); + PetscAssertPointer(dsnew,2); PetscCall(DSCreate(PetscObjectComm((PetscObject)ds),dsnew)); if (((PetscObject)ds)->type_name) PetscCall(DSSetType(*dsnew,((PetscObject)ds)->type_name)); (*dsnew)->method = ds->method; @@ -366,7 +366,7 @@ PetscErrorCode DSGetMethod(DS ds,PetscInt *meth) { PetscFunctionBegin; PetscValidHeaderSpecific(ds,DS_CLASSID,1); - PetscValidIntPointer(meth,2); + PetscAssertPointer(meth,2); *meth = ds->method; PetscFunctionReturn(PETSC_SUCCESS); } @@ -431,7 +431,7 @@ PetscErrorCode DSGetParallel(DS ds,DSParallelType *pmode) { PetscFunctionBegin; PetscValidHeaderSpecific(ds,DS_CLASSID,1); - PetscValidPointer(pmode,2); + PetscAssertPointer(pmode,2); *pmode = ds->pmode; PetscFunctionReturn(PETSC_SUCCESS); } @@ -485,7 +485,7 @@ PetscErrorCode DSGetCompact(DS ds,PetscBool *comp) { PetscFunctionBegin; PetscValidHeaderSpecific(ds,DS_CLASSID,1); - PetscValidBoolPointer(comp,2); + PetscAssertPointer(comp,2); *comp = ds->compact; PetscFunctionReturn(PETSC_SUCCESS); } @@ -541,7 +541,7 @@ PetscErrorCode DSGetExtraRow(DS ds,PetscBool *ext) { PetscFunctionBegin; PetscValidHeaderSpecific(ds,DS_CLASSID,1); - PetscValidBoolPointer(ext,2); + PetscAssertPointer(ext,2); *ext = ds->extrarow; PetscFunctionReturn(PETSC_SUCCESS); } @@ -598,7 +598,7 @@ PetscErrorCode DSGetRefined(DS ds,PetscBool *ref) { PetscFunctionBegin; PetscValidHeaderSpecific(ds,DS_CLASSID,1); - PetscValidBoolPointer(ref,2); + PetscAssertPointer(ref,2); *ref = ds->refined; PetscFunctionReturn(PETSC_SUCCESS); } @@ -648,7 +648,7 @@ PetscErrorCode DSGetBlockSize(DS ds,PetscInt *bs) { PetscFunctionBegin; PetscValidHeaderSpecific(ds,DS_CLASSID,1); - PetscValidIntPointer(bs,2); + PetscAssertPointer(bs,2); *bs = ds->bs; PetscFunctionReturn(PETSC_SUCCESS); } @@ -670,7 +670,7 @@ PetscErrorCode DSSetSlepcSC(DS ds,SlepcSC sc) { PetscFunctionBegin; PetscValidHeaderSpecific(ds,DS_CLASSID,1); - PetscValidPointer(sc,2); + PetscAssertPointer(sc,2); if (ds->sc && !ds->scset) PetscCall(PetscFree(ds->sc)); ds->sc = sc; ds->scset = PETSC_TRUE; @@ -696,7 +696,7 @@ PetscErrorCode DSGetSlepcSC(DS ds,SlepcSC *sc) { PetscFunctionBegin; PetscValidHeaderSpecific(ds,DS_CLASSID,1); - PetscValidPointer(sc,2); + PetscAssertPointer(sc,2); if (!ds->sc) PetscCall(PetscNew(&ds->sc)); *sc = ds->sc; PetscFunctionReturn(PETSC_SUCCESS); diff --git a/src/sys/classes/ds/interface/dsops.c b/src/sys/classes/ds/interface/dsops.c index fc56b61cb..3016bf7b5 100644 --- a/src/sys/classes/ds/interface/dsops.c +++ b/src/sys/classes/ds/interface/dsops.c @@ -33,7 +33,7 @@ PetscErrorCode DSGetLeadingDimension(DS ds,PetscInt *ld) { PetscFunctionBegin; PetscValidHeaderSpecific(ds,DS_CLASSID,1); - PetscValidIntPointer(ld,2); + PetscAssertPointer(ld,2); *ld = ds->ld; PetscFunctionReturn(PETSC_SUCCESS); } @@ -98,7 +98,7 @@ PetscErrorCode DSGetState(DS ds,DSStateType *state) { PetscFunctionBegin; PetscValidHeaderSpecific(ds,DS_CLASSID,1); - PetscValidPointer(state,2); + PetscAssertPointer(state,2); *state = ds->state; PetscFunctionReturn(PETSC_SUCCESS); } @@ -317,7 +317,7 @@ PetscErrorCode DSMatIsHermitian(DS ds,DSMatType t,PetscBool *flg) PetscValidHeaderSpecific(ds,DS_CLASSID,1); PetscValidType(ds,1); DSCheckValidMat(ds,t,2); - PetscValidBoolPointer(flg,3); + PetscAssertPointer(flg,3); *flg = PETSC_FALSE; PetscTryTypeMethod(ds,hermitian,t,flg); PetscFunctionReturn(PETSC_SUCCESS); @@ -374,7 +374,7 @@ PetscErrorCode DSGetTruncateSize(DS ds,PetscInt l,PetscInt n,PetscInt *k) DSCheckAlloc(ds,1); PetscValidLogicalCollectiveInt(ds,l,2); PetscValidLogicalCollectiveInt(ds,n,3); - PetscValidIntPointer(k,4); + PetscAssertPointer(k,4); PetscUseTypeMethod(ds,gettruncatesize,l?l:ds->l,n?n:ds->n,k); PetscFunctionReturn(PETSC_SUCCESS); } @@ -420,7 +420,7 @@ PetscErrorCode DSGetMat(DS ds,DSMatType m,Mat *A) PetscValidHeaderSpecific(ds,DS_CLASSID,1); DSCheckAlloc(ds,1); DSCheckValidMat(ds,m,2); - PetscValidPointer(A,3); + PetscAssertPointer(A,3); PetscCall(DSMatGetSize(ds,m,&rows,&cols)); PetscCheck(rows && cols,PetscObjectComm((PetscObject)ds),PETSC_ERR_ORDER,"Must call DSSetDimensions() first"); @@ -456,7 +456,7 @@ PetscErrorCode DSRestoreMat(DS ds,DSMatType m,Mat *A) PetscValidHeaderSpecific(ds,DS_CLASSID,1); DSCheckAlloc(ds,1); DSCheckValidMat(ds,m,2); - PetscValidPointer(A,3); + PetscAssertPointer(A,3); PetscCall(MatDenseRestoreSubMatrix(ds->omat[m],A)); PetscCall(PetscObjectStateIncrease((PetscObject)ds)); @@ -494,8 +494,8 @@ PetscErrorCode DSGetMatAndColumn(DS ds,DSMatType m,PetscInt col,Mat *A,Vec *v) PetscValidHeaderSpecific(ds,DS_CLASSID,1); DSCheckAlloc(ds,1); DSCheckValidMat(ds,m,2); - PetscValidPointer(A,4); - PetscValidPointer(v,5); + PetscAssertPointer(A,4); + PetscAssertPointer(v,5); PetscCall(DSGetMat(ds,m,A)); if (PetscDefined(USE_COMPLEX) && (m==DS_MAT_T || m==DS_MAT_D)) { @@ -542,8 +542,8 @@ PetscErrorCode DSRestoreMatAndColumn(DS ds,DSMatType m,PetscInt col,Mat *A,Vec * PetscValidHeaderSpecific(ds,DS_CLASSID,1); DSCheckAlloc(ds,1); DSCheckValidMat(ds,m,2); - PetscValidPointer(A,4); - PetscValidPointer(v,5); + PetscAssertPointer(A,4); + PetscAssertPointer(v,5); if (PetscDefined(USE_COMPLEX) && (m==DS_MAT_T || m==DS_MAT_D)) { const PetscScalar *vs; @@ -591,7 +591,7 @@ PetscErrorCode DSGetArray(DS ds,DSMatType m,PetscScalar *a[]) PetscValidHeaderSpecific(ds,DS_CLASSID,1); DSCheckAlloc(ds,1); DSCheckValidMat(ds,m,2); - PetscValidPointer(a,3); + PetscAssertPointer(a,3); PetscCall(MatDenseGetArray(ds->omat[m],a)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -616,7 +616,7 @@ PetscErrorCode DSRestoreArray(DS ds,DSMatType m,PetscScalar *a[]) PetscValidHeaderSpecific(ds,DS_CLASSID,1); DSCheckAlloc(ds,1); DSCheckValidMat(ds,m,2); - PetscValidPointer(a,3); + PetscAssertPointer(a,3); PetscCall(MatDenseRestoreArray(ds->omat[m],a)); PetscCall(PetscObjectStateIncrease((PetscObject)ds)); PetscFunctionReturn(PETSC_SUCCESS); @@ -654,7 +654,7 @@ PetscErrorCode DSGetArrayReal(DS ds,DSMatType m,PetscReal *a[]) PetscValidHeaderSpecific(ds,DS_CLASSID,1); DSCheckAlloc(ds,1); DSCheckValidMatReal(ds,m,2); - PetscValidPointer(a,3); + PetscAssertPointer(a,3); #if defined(PETSC_USE_COMPLEX) PetscCall(MatDenseGetArray(ds->omat[m],&as)); *a = (PetscReal*)as; @@ -688,7 +688,7 @@ PetscErrorCode DSRestoreArrayReal(DS ds,DSMatType m,PetscReal *a[]) PetscValidHeaderSpecific(ds,DS_CLASSID,1); DSCheckAlloc(ds,1); DSCheckValidMatReal(ds,m,2); - PetscValidPointer(a,3); + PetscAssertPointer(a,3); #if defined(PETSC_USE_COMPLEX) PetscCall(MatDenseRestoreArray(ds->omat[m],&as)); *a = NULL; @@ -723,7 +723,7 @@ PetscErrorCode DSSolve(DS ds,PetscScalar eigr[],PetscScalar eigi[]) PetscValidHeaderSpecific(ds,DS_CLASSID,1); PetscValidType(ds,1); DSCheckAlloc(ds,1); - PetscValidScalarPointer(eigr,2); + PetscAssertPointer(eigr,2); if (ds->state>=DS_STATE_CONDENSED) PetscFunctionReturn(PETSC_SUCCESS); PetscCheck(ds->ops->solve[ds->method],PetscObjectComm((PetscObject)ds),PETSC_ERR_ARG_OUTOFRANGE,"The specified method number does not exist for this DS"); PetscCall(PetscInfo(ds,"Starting solve with problem sizes: n=%" PetscInt_FMT ", l=%" PetscInt_FMT ", k=%" PetscInt_FMT "\n",ds->n,ds->l,ds->k)); @@ -779,8 +779,8 @@ PetscErrorCode DSSort(DS ds,PetscScalar *eigr,PetscScalar *eigi,PetscScalar *rr, PetscValidHeaderSpecific(ds,DS_CLASSID,1); PetscValidType(ds,1); DSCheckSolved(ds,1); - PetscValidScalarPointer(eigr,2); - if (rr) PetscValidScalarPointer(rr,4); + PetscAssertPointer(eigr,2); + if (rr) PetscAssertPointer(rr,4); PetscCheck(ds->statesc,PetscObjectComm((PetscObject)ds),PETSC_ERR_ORDER,"Must provide a sorting criterion first"); PetscCheck(!k || rr,PetscObjectComm((PetscObject)ds),PETSC_ERR_ARG_WRONG,"Argument k can only be used together with rr"); @@ -825,8 +825,8 @@ PetscErrorCode DSSortWithPermutation(DS ds,PetscInt *perm,PetscScalar *eigr,Pets PetscValidHeaderSpecific(ds,DS_CLASSID,1); PetscValidType(ds,1); DSCheckSolved(ds,1); - PetscValidIntPointer(perm,2); - PetscValidScalarPointer(eigr,3); + PetscAssertPointer(perm,2); + PetscAssertPointer(eigr,3); PetscCheck(ds->statetype_name; PetscFunctionReturn(PETSC_SUCCESS); } @@ -375,7 +375,7 @@ PetscErrorCode FNGetMethod(FN fn,PetscInt *meth) { PetscFunctionBegin; PetscValidHeaderSpecific(fn,FN_CLASSID,1); - PetscValidIntPointer(meth,2); + PetscAssertPointer(meth,2); *meth = fn->method; PetscFunctionReturn(PETSC_SUCCESS); } @@ -438,7 +438,7 @@ PetscErrorCode FNGetParallel(FN fn,FNParallelType *pmode) { PetscFunctionBegin; PetscValidHeaderSpecific(fn,FN_CLASSID,1); - PetscValidPointer(pmode,2); + PetscAssertPointer(pmode,2); *pmode = fn->pmode; PetscFunctionReturn(PETSC_SUCCESS); } @@ -470,7 +470,7 @@ PetscErrorCode FNEvaluateFunction(FN fn,PetscScalar x,PetscScalar *y) PetscFunctionBegin; PetscValidHeaderSpecific(fn,FN_CLASSID,1); PetscValidType(fn,1); - PetscValidScalarPointer(y,3); + PetscAssertPointer(y,3); PetscCall(PetscLogEventBegin(FN_Evaluate,fn,0,0,0)); xf = fn->alpha*x; PetscUseTypeMethod(fn,evaluatefunction,xf,&yf); @@ -506,7 +506,7 @@ PetscErrorCode FNEvaluateDerivative(FN fn,PetscScalar x,PetscScalar *y) PetscFunctionBegin; PetscValidHeaderSpecific(fn,FN_CLASSID,1); PetscValidType(fn,1); - PetscValidScalarPointer(y,3); + PetscAssertPointer(y,3); PetscCall(PetscLogEventBegin(FN_Evaluate,fn,0,0,0)); xf = fn->alpha*x; PetscUseTypeMethod(fn,evaluatederivative,xf,&yf); @@ -999,7 +999,7 @@ PetscErrorCode FNDuplicate(FN fn,MPI_Comm comm,FN *newfn) PetscFunctionBegin; PetscValidHeaderSpecific(fn,FN_CLASSID,1); PetscValidType(fn,1); - PetscValidPointer(newfn,3); + PetscAssertPointer(newfn,3); PetscCall(FNCreate(comm,newfn)); PetscCall(FNGetType(fn,&type)); PetscCall(FNSetType(*newfn,type)); diff --git a/src/sys/classes/rg/impls/polygon/rgpolygon.c b/src/sys/classes/rg/impls/polygon/rgpolygon.c index 733b93efa..8b9f88e0a 100644 --- a/src/sys/classes/rg/impls/polygon/rgpolygon.c +++ b/src/sys/classes/rg/impls/polygon/rgpolygon.c @@ -112,9 +112,9 @@ PetscErrorCode RGPolygonSetVertices(RG rg,PetscInt n,PetscScalar vr[],PetscScala PetscFunctionBegin; PetscValidHeaderSpecific(rg,RG_CLASSID,1); PetscValidLogicalCollectiveInt(rg,n,2); - PetscValidScalarPointer(vr,3); + PetscAssertPointer(vr,3); #if !defined(PETSC_USE_COMPLEX) - PetscValidScalarPointer(vi,4); + PetscAssertPointer(vi,4); #endif PetscTryMethod(rg,"RGPolygonSetVertices_C",(RG,PetscInt,PetscScalar*,PetscScalar*),(rg,n,vr,vi)); PetscFunctionReturn(PETSC_SUCCESS); diff --git a/src/sys/classes/rg/interface/rgbasic.c b/src/sys/classes/rg/interface/rgbasic.c index 75b708283..27f7bd871 100644 --- a/src/sys/classes/rg/interface/rgbasic.c +++ b/src/sys/classes/rg/interface/rgbasic.c @@ -91,7 +91,7 @@ PetscErrorCode RGCreate(MPI_Comm comm,RG *newrg) RG rg; PetscFunctionBegin; - PetscValidPointer(newrg,2); + PetscAssertPointer(newrg,2); *newrg = NULL; PetscCall(RGInitializePackage()); PetscCall(SlepcHeaderCreate(rg,RG_CLASSID,"RG","Region","RG",comm,RGDestroy,RGView)); @@ -181,7 +181,7 @@ PetscErrorCode RGGetOptionsPrefix(RG rg,const char *prefix[]) { PetscFunctionBegin; PetscValidHeaderSpecific(rg,RG_CLASSID,1); - PetscValidPointer(prefix,2); + PetscAssertPointer(prefix,2); PetscCall(PetscObjectGetOptionsPrefix((PetscObject)rg,prefix)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -206,7 +206,7 @@ PetscErrorCode RGSetType(RG rg,RGType type) PetscFunctionBegin; PetscValidHeaderSpecific(rg,RG_CLASSID,1); - PetscValidCharPointer(type,2); + PetscAssertPointer(type,2); PetscCall(PetscObjectTypeCompare((PetscObject)rg,type,&match)); if (match) PetscFunctionReturn(PETSC_SUCCESS); @@ -241,7 +241,7 @@ PetscErrorCode RGGetType(RG rg,RGType *type) { PetscFunctionBegin; PetscValidHeaderSpecific(rg,RG_CLASSID,1); - PetscValidPointer(type,2); + PetscAssertPointer(type,2); *type = ((PetscObject)rg)->type_name; PetscFunctionReturn(PETSC_SUCCESS); } @@ -376,7 +376,7 @@ PetscErrorCode RGIsTrivial(RG rg,PetscBool *trivial) PetscFunctionBegin; PetscValidHeaderSpecific(rg,RG_CLASSID,1); PetscValidType(rg,1); - PetscValidBoolPointer(trivial,2); + PetscAssertPointer(trivial,2); *trivial = PETSC_FALSE; PetscTryTypeMethod(rg,istrivial,trivial); PetscFunctionReturn(PETSC_SUCCESS); @@ -415,11 +415,11 @@ PetscErrorCode RGCheckInside(RG rg,PetscInt n,PetscScalar *ar,PetscScalar *ai,Pe PetscFunctionBegin; PetscValidHeaderSpecific(rg,RG_CLASSID,1); PetscValidType(rg,1); - PetscValidScalarPointer(ar,3); + PetscAssertPointer(ar,3); #if !defined(PETSC_USE_COMPLEX) - PetscValidScalarPointer(ai,4); + PetscAssertPointer(ai,4); #endif - PetscValidIntPointer(inside,5); + PetscAssertPointer(inside,5); for (i=0;icomplement; PetscFunctionReturn(PETSC_SUCCESS); } @@ -748,7 +748,7 @@ PetscErrorCode RGGetScale(RG rg,PetscReal *sfactor) { PetscFunctionBegin; PetscValidHeaderSpecific(rg,RG_CLASSID,1); - PetscValidRealPointer(sfactor,2); + PetscAssertPointer(sfactor,2); *sfactor = rg->sfactor; PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/sys/classes/st/impls/cayley/cayley.c b/src/sys/classes/st/impls/cayley/cayley.c index 2b40d76c4..747936490 100644 --- a/src/sys/classes/st/impls/cayley/cayley.c +++ b/src/sys/classes/st/impls/cayley/cayley.c @@ -287,7 +287,7 @@ PetscErrorCode STCayleyGetAntishift(ST st,PetscScalar *nu) { PetscFunctionBegin; PetscValidHeaderSpecific(st,ST_CLASSID,1); - PetscValidScalarPointer(nu,2); + PetscAssertPointer(nu,2); PetscUseMethod(st,"STCayleyGetAntishift_C",(ST,PetscScalar*),(st,nu)); PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/sys/classes/st/impls/filter/filter.c b/src/sys/classes/st/impls/filter/filter.c index a865e1884..39df7db22 100644 --- a/src/sys/classes/st/impls/filter/filter.c +++ b/src/sys/classes/st/impls/filter/filter.c @@ -318,7 +318,7 @@ PetscErrorCode STFilterGetDegree(ST st,PetscInt *deg) { PetscFunctionBegin; PetscValidHeaderSpecific(st,ST_CLASSID,1); - PetscValidIntPointer(deg,2); + PetscAssertPointer(deg,2); PetscUseMethod(st,"STFilterGetDegree_C",(ST,PetscInt*),(st,deg)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -352,7 +352,7 @@ PetscErrorCode STFilterGetThreshold(ST st,PetscReal *gamma) { PetscFunctionBegin; PetscValidHeaderSpecific(st,ST_CLASSID,1); - PetscValidRealPointer(gamma,2); + PetscAssertPointer(gamma,2); PetscUseMethod(st,"STFilterGetThreshold_C",(ST,PetscReal*),(st,gamma)); PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/sys/classes/st/impls/precond/precond.c b/src/sys/classes/st/impls/precond/precond.c index 63b94b639..d267c55bf 100644 --- a/src/sys/classes/st/impls/precond/precond.c +++ b/src/sys/classes/st/impls/precond/precond.c @@ -200,7 +200,7 @@ PetscErrorCode STPrecondGetKSPHasMat(ST st,PetscBool *ksphasmat) { PetscFunctionBegin; PetscValidHeaderSpecific(st,ST_CLASSID,1); - PetscValidBoolPointer(ksphasmat,2); + PetscAssertPointer(ksphasmat,2); PetscUseMethod(st,"STPrecondGetKSPHasMat_C",(ST,PetscBool*),(st,ksphasmat)); PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/sys/classes/st/impls/shell/shell.c b/src/sys/classes/st/impls/shell/shell.c index 5f4807944..2832721dd 100644 --- a/src/sys/classes/st/impls/shell/shell.c +++ b/src/sys/classes/st/impls/shell/shell.c @@ -45,7 +45,7 @@ PetscErrorCode STShellGetContext(ST st,void *ctx) PetscFunctionBegin; PetscValidHeaderSpecific(st,ST_CLASSID,1); - PetscValidPointer(ctx,2); + PetscAssertPointer(ctx,2); PetscCall(PetscObjectTypeCompare((PetscObject)st,STSHELL,&flg)); if (!flg) *(void**)ctx = NULL; else *(void**)ctx = ((ST_SHELL*)(st->data))->ctx; diff --git a/src/sys/classes/st/interface/stfunc.c b/src/sys/classes/st/interface/stfunc.c index 96aca322e..7b7c7c50e 100644 --- a/src/sys/classes/st/interface/stfunc.c +++ b/src/sys/classes/st/interface/stfunc.c @@ -167,7 +167,7 @@ PetscErrorCode STCreate(MPI_Comm comm,ST *newst) ST st; PetscFunctionBegin; - PetscValidPointer(newst,2); + PetscAssertPointer(newst,2); *newst = NULL; PetscCall(STInitializePackage()); PetscCall(SlepcHeaderCreate(st,ST_CLASSID,"ST","Spectral Transformation","ST",comm,STDestroy,STView)); @@ -270,7 +270,7 @@ PetscErrorCode STSetMatrices(ST st,PetscInt n,Mat A[]) PetscValidHeaderSpecific(st,ST_CLASSID,1); PetscValidLogicalCollectiveInt(st,n,2); PetscCheck(n>0,PetscObjectComm((PetscObject)st),PETSC_ERR_ARG_OUTOFRANGE,"Must have one or more matrices, you have %" PetscInt_FMT,n); - PetscValidPointer(A,3); + PetscAssertPointer(A,3); PetscCheckSameComm(st,1,*A,3); STCheckNotSeized(st,1); PetscCheck(!st->nsplit || st->nsplit==n,PetscObjectComm((PetscObject)st),PETSC_ERR_SUP,"The number of matrices must be the same as in STSetSplitPreconditioner()"); @@ -329,7 +329,7 @@ PetscErrorCode STGetMatrix(ST st,PetscInt k,Mat *A) PetscFunctionBegin; PetscValidHeaderSpecific(st,ST_CLASSID,1); PetscValidLogicalCollectiveInt(st,k,2); - PetscValidPointer(A,3); + PetscAssertPointer(A,3); STCheckMatrices(st,1); PetscCheck(k>=0 && knmat,PetscObjectComm((PetscObject)st),PETSC_ERR_ARG_OUTOFRANGE,"k must be between 0 and %" PetscInt_FMT,st->nmat-1); PetscCheck(((PetscObject)st->A[k])->state==st->Astate[k],PetscObjectComm((PetscObject)st),PETSC_ERR_SUP,"Cannot retrieve original matrices (have been modified)"); @@ -358,7 +358,7 @@ PetscErrorCode STGetMatrixTransformed(ST st,PetscInt k,Mat *T) PetscFunctionBegin; PetscValidHeaderSpecific(st,ST_CLASSID,1); PetscValidLogicalCollectiveInt(st,k,2); - PetscValidPointer(T,3); + PetscAssertPointer(T,3); STCheckMatrices(st,1); PetscCheck(k>=0 && knmat,PetscObjectComm((PetscObject)st),PETSC_ERR_ARG_OUTOFRANGE,"k must be between 0 and %" PetscInt_FMT,st->nmat-1); PetscCheck(st->T,PetscObjectComm((PetscObject)st),PETSC_ERR_POINTER,"There are no transformed matrices"); @@ -385,7 +385,7 @@ PetscErrorCode STGetNumMatrices(ST st,PetscInt *n) { PetscFunctionBegin; PetscValidHeaderSpecific(st,ST_CLASSID,1); - PetscValidIntPointer(n,2); + PetscAssertPointer(n,2); *n = st->nmat; PetscFunctionReturn(PETSC_SUCCESS); } @@ -492,7 +492,7 @@ PetscErrorCode STGetPreconditionerMat(ST st,Mat *mat) { PetscFunctionBegin; PetscValidHeaderSpecific(st,ST_CLASSID,1); - PetscValidPointer(mat,2); + PetscAssertPointer(mat,2); *mat = st->Pmat_set? st->Pmat: NULL; PetscFunctionReturn(PETSC_SUCCESS); } @@ -542,7 +542,7 @@ PetscErrorCode STSetSplitPreconditioner(ST st,PetscInt n,Mat Psplit[],MatStructu PetscCheck(n>=0,PetscObjectComm((PetscObject)st),PETSC_ERR_ARG_OUTOFRANGE,"Negative value of n = %" PetscInt_FMT,n); PetscCheck(!n || !st->Pmat_set,PetscObjectComm((PetscObject)st),PETSC_ERR_SUP,"Cannot call both STSetPreconditionerMat and STSetSplitPreconditioner"); PetscCheck(!n || !st->nmat || st->nmat==n,PetscObjectComm((PetscObject)st),PETSC_ERR_SUP,"The number of matrices must be the same as in STSetMatrices()"); - if (n) PetscValidPointer(Psplit,3); + if (n) PetscAssertPointer(Psplit,3); PetscValidLogicalCollectiveEnum(st,strp,4); STCheckNotSeized(st,1); @@ -594,7 +594,7 @@ PetscErrorCode STGetSplitPreconditionerTerm(ST st,PetscInt k,Mat *Psplit) PetscFunctionBegin; PetscValidHeaderSpecific(st,ST_CLASSID,1); PetscValidLogicalCollectiveInt(st,k,2); - PetscValidPointer(Psplit,3); + PetscAssertPointer(Psplit,3); PetscCheck(k>=0 && knsplit,PetscObjectComm((PetscObject)st),PETSC_ERR_ARG_OUTOFRANGE,"k must be between 0 and %" PetscInt_FMT,st->nsplit-1); PetscCheck(st->Psplit,PetscObjectComm((PetscObject)st),PETSC_ERR_ORDER,"You have not called STSetSplitPreconditioner()"); *Psplit = st->Psplit[k]; @@ -681,7 +681,7 @@ PetscErrorCode STGetShift(ST st,PetscScalar* shift) { PetscFunctionBegin; PetscValidHeaderSpecific(st,ST_CLASSID,1); - PetscValidScalarPointer(shift,2); + PetscAssertPointer(shift,2); *shift = st->sigma; PetscFunctionReturn(PETSC_SUCCESS); } @@ -799,7 +799,7 @@ PetscErrorCode STGetBalanceMatrix(ST st,Vec *D) { PetscFunctionBegin; PetscValidHeaderSpecific(st,ST_CLASSID,1); - PetscValidPointer(D,2); + PetscAssertPointer(D,2); *D = st->D; PetscFunctionReturn(PETSC_SUCCESS); } @@ -985,7 +985,7 @@ PetscErrorCode STGetOptionsPrefix(ST st,const char *prefix[]) { PetscFunctionBegin; PetscValidHeaderSpecific(st,ST_CLASSID,1); - PetscValidPointer(prefix,2); + PetscAssertPointer(prefix,2); PetscCall(PetscObjectGetOptionsPrefix((PetscObject)st,prefix)); PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/sys/classes/st/interface/stset.c b/src/sys/classes/st/interface/stset.c index 8e7932561..54b33e418 100644 --- a/src/sys/classes/st/interface/stset.c +++ b/src/sys/classes/st/interface/stset.c @@ -50,7 +50,7 @@ PetscErrorCode STSetType(ST st,STType type) PetscFunctionBegin; PetscValidHeaderSpecific(st,ST_CLASSID,1); - PetscValidCharPointer(type,2); + PetscAssertPointer(type,2); PetscCall(PetscObjectTypeCompare((PetscObject)st,type,&match)); if (match) PetscFunctionReturn(PETSC_SUCCESS); @@ -89,7 +89,7 @@ PetscErrorCode STGetType(ST st,STType *type) { PetscFunctionBegin; PetscValidHeaderSpecific(st,ST_CLASSID,1); - PetscValidPointer(type,2); + PetscAssertPointer(type,2); *type = ((PetscObject)st)->type_name; PetscFunctionReturn(PETSC_SUCCESS); } @@ -219,7 +219,7 @@ PetscErrorCode STGetMatStructure(ST st,MatStructure *str) { PetscFunctionBegin; PetscValidHeaderSpecific(st,ST_CLASSID,1); - PetscValidPointer(str,2); + PetscAssertPointer(str,2); *str = st->str; PetscFunctionReturn(PETSC_SUCCESS); } @@ -296,7 +296,7 @@ PetscErrorCode STGetMatMode(ST st,STMatMode *mode) { PetscFunctionBegin; PetscValidHeaderSpecific(st,ST_CLASSID,1); - PetscValidPointer(mode,2); + PetscAssertPointer(mode,2); *mode = st->matmode; PetscFunctionReturn(PETSC_SUCCESS); } @@ -357,7 +357,7 @@ PetscErrorCode STGetTransform(ST st,PetscBool *flg) { PetscFunctionBegin; PetscValidHeaderSpecific(st,ST_CLASSID,1); - PetscValidBoolPointer(flg,2); + PetscAssertPointer(flg,2); *flg = st->transform; PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/sys/classes/st/interface/stsles.c b/src/sys/classes/st/interface/stsles.c index 935c665d7..eee91008d 100644 --- a/src/sys/classes/st/interface/stsles.c +++ b/src/sys/classes/st/interface/stsles.c @@ -311,7 +311,7 @@ PetscErrorCode STGetKSP(ST st,KSP* ksp) { PetscFunctionBegin; PetscValidHeaderSpecific(st,ST_CLASSID,1); - PetscValidPointer(ksp,2); + PetscAssertPointer(ksp,2); if (!st->ksp) { PetscCall(KSPCreate(PetscObjectComm((PetscObject)st),&st->ksp)); PetscCall(PetscObjectIncrementTabLevel((PetscObject)st->ksp,(PetscObject)st,1)); diff --git a/src/sys/classes/st/interface/stsolve.c b/src/sys/classes/st/interface/stsolve.c index 362051255..03f73be73 100644 --- a/src/sys/classes/st/interface/stsolve.c +++ b/src/sys/classes/st/interface/stsolve.c @@ -213,7 +213,7 @@ PetscErrorCode STGetBilinearForm(ST st,Mat *B) PetscFunctionBegin; PetscValidHeaderSpecific(st,ST_CLASSID,1); PetscValidType(st,1); - PetscValidPointer(B,2); + PetscAssertPointer(B,2); STCheckMatrices(st,1); PetscUseTypeMethod(st,getbilinearform,B); PetscFunctionReturn(PETSC_SUCCESS); @@ -414,7 +414,7 @@ PetscErrorCode STRestoreOperator(ST st,Mat *Op) { PetscFunctionBegin; PetscValidHeaderSpecific(st,ST_CLASSID,1); - PetscValidPointer(Op,2); + PetscAssertPointer(Op,2); PetscValidHeaderSpecific(*Op,MAT_CLASSID,2); PetscCheck(st->opseized,PetscObjectComm((PetscObject)st),PETSC_ERR_ARG_WRONGSTATE,"Must be called after STGetOperator()"); *Op = NULL; @@ -705,7 +705,7 @@ PetscErrorCode STIsInjective(ST st,PetscBool* is) PetscFunctionBegin; PetscValidHeaderSpecific(st,ST_CLASSID,1); PetscValidType(st,1); - PetscValidBoolPointer(is,2); + PetscAssertPointer(is,2); PetscCall(PetscObjectTypeCompare((PetscObject)st,STSHELL,&shell)); if (shell) PetscCall(STIsInjective_Shell(st,is)); diff --git a/src/sys/mat/matutil.c b/src/sys/mat/matutil.c index 37559edb4..e518921f9 100644 --- a/src/sys/mat/matutil.c +++ b/src/sys/mat/matutil.c @@ -305,7 +305,7 @@ PetscErrorCode MatCreateTile(PetscScalar a,Mat A,PetscScalar b,Mat B,PetscScalar PetscValidLogicalCollectiveScalar(A,b,3); PetscValidLogicalCollectiveScalar(A,c,5); PetscValidLogicalCollectiveScalar(A,d,7); - PetscValidPointer(G,9); + PetscAssertPointer(G,9); /* check row 1 */ PetscCall(MatGetSize(A,&M1,NULL)); @@ -467,7 +467,7 @@ PetscErrorCode MatNormEstimate(Mat A,Vec vrn,Vec w,PetscReal *nrm) PetscValidType(A,1); if (vrn) PetscValidHeaderSpecific(vrn,VEC_CLASSID,2); if (w) PetscValidHeaderSpecific(w,VEC_CLASSID,3); - PetscValidRealPointer(nrm,4); + PetscAssertPointer(nrm,4); if (!vrn) { PetscCall(MatCreateVecs(A,&vv,NULL)); diff --git a/src/sys/slepcsc.c b/src/sys/slepcsc.c index f286545f1..557e7ab19 100644 --- a/src/sys/slepcsc.c +++ b/src/sys/slepcsc.c @@ -44,7 +44,7 @@ PetscErrorCode SlepcSCCompare(SlepcSC sc,PetscScalar ar,PetscScalar ai,PetscScal PetscBool inside[2]; PetscFunctionBegin; - PetscValidIntPointer(res,6); + PetscAssertPointer(res,6); #if defined(PETSC_USE_DEBUG) PetscCheck(sc->comparison,PETSC_COMM_SELF,PETSC_ERR_USER,"Undefined comparison function"); #endif @@ -92,10 +92,10 @@ PetscErrorCode SlepcSortEigenvalues(SlepcSC sc,PetscInt n,PetscScalar *eigr,Pets PetscInt i,j,result,tmp; PetscFunctionBegin; - PetscValidPointer(sc,1); - PetscValidScalarPointer(eigr,3); - PetscValidScalarPointer(eigi,4); - PetscValidIntPointer(perm,5); + PetscAssertPointer(sc,1); + PetscAssertPointer(eigr,3); + PetscAssertPointer(eigi,4); + PetscAssertPointer(perm,5); /* insertion sort */ for (i=n-1;i>=0;i--) { re = eigr[perm[i]]; diff --git a/src/sys/vec/pool.c b/src/sys/vec/pool.c index a0850b63c..8379f83c6 100644 --- a/src/sys/vec/pool.c +++ b/src/sys/vec/pool.c @@ -36,7 +36,7 @@ PetscErrorCode SlepcVecPoolCreate(Vec v,PetscInt init_size,VecPool *p) PetscFunctionBegin; PetscValidHeaderSpecific(v,VEC_CLASSID,1); PetscValidLogicalCollectiveInt(v,init_size,2); - PetscValidPointer(p,3); + PetscAssertPointer(p,3); PetscCheck(init_size>=0,PetscObjectComm((PetscObject)v),PETSC_ERR_ARG_WRONG,"init_size should be positive"); PetscCall(PetscCalloc1(1,&pool)); PetscCall(PetscObjectReference((PetscObject)v)); @@ -96,8 +96,8 @@ PetscErrorCode SlepcVecPoolGetVecs(VecPool p,PetscInt n,Vec **vecs) VecPool_ *pool = (VecPool_*)p; PetscFunctionBegin; - PetscValidPointer(p,1); - PetscValidPointer(vecs,3); + PetscAssertPointer(p,1); + PetscAssertPointer(vecs,3); PetscCheck(n>=0,PetscObjectComm((PetscObject)pool->v),PETSC_ERR_ARG_OUTOFRANGE,"n should be positive"); while (pool->next) pool = pool->next; if (pool->n-pool->used < n) { diff --git a/src/sys/vec/veccomp.c b/src/sys/vec/veccomp.c index 7fe6e4bb4..2892e399a 100644 --- a/src/sys/vec/veccomp.c +++ b/src/sys/vec/veccomp.c @@ -203,7 +203,7 @@ PetscErrorCode VecDuplicateVecs_Comp(Vec w,PetscInt m,Vec *V[]) PetscFunctionBegin; PetscValidHeaderSpecific(w,VEC_CLASSID,1); - PetscValidPointer(V,3); + PetscAssertPointer(V,3); PetscCheck(m>0,PetscObjectComm((PetscObject)w),PETSC_ERR_ARG_OUTOFRANGE,"m must be > 0: m = %" PetscInt_FMT,m); PetscCall(PetscMalloc1(m,V)); for (i=0;i0,PETSC_COMM_SELF,PETSC_ERR_ARG_OUTOFRANGE,"m must be > 0: m = %" PetscInt_FMT,m); for (i=0;idata; PetscFunctionBegin; - PetscValidIntPointer(size,2); + PetscAssertPointer(size,2); if (vs->n) { SlepcValidVecComp(v,1); *size = vs->n->N; @@ -575,7 +575,7 @@ PetscErrorCode VecGetLocalSize_Comp(Vec v,PetscInt *size) Vec_Comp *vs = (Vec_Comp*)v->data; PetscFunctionBegin; - PetscValidIntPointer(size,2); + PetscAssertPointer(size,2); if (vs->n) { SlepcValidVecComp(v,1); *size = vs->n->lN; diff --git a/src/sys/vec/vecutil.c b/src/sys/vec/vecutil.c index 232f296ca..64b1002dc 100644 --- a/src/sys/vec/vecutil.c +++ b/src/sys/vec/vecutil.c @@ -138,13 +138,13 @@ static PetscErrorCode VecCheckOrthogonality_Private(Vec V[],PetscInt nv,Vec W[], PetscErrorCode VecCheckOrthogonality(Vec V[],PetscInt nv,Vec W[],PetscInt nw,Mat B,PetscViewer viewer,PetscReal *lev) { PetscFunctionBegin; - PetscValidPointer(V,1); + PetscAssertPointer(V,1); PetscValidHeaderSpecific(*V,VEC_CLASSID,1); PetscValidLogicalCollectiveInt(*V,nv,2); PetscValidLogicalCollectiveInt(*V,nw,4); if (nv<=0 || nw<=0) PetscFunctionReturn(PETSC_SUCCESS); if (W) { - PetscValidPointer(W,3); + PetscAssertPointer(W,3); PetscValidHeaderSpecific(*W,VEC_CLASSID,3); PetscCheckSameComm(*V,1,*W,3); } @@ -180,13 +180,13 @@ PetscErrorCode VecCheckOrthogonality(Vec V[],PetscInt nv,Vec W[],PetscInt nw,Mat PetscErrorCode VecCheckOrthonormality(Vec V[],PetscInt nv,Vec W[],PetscInt nw,Mat B,PetscViewer viewer,PetscReal *lev) { PetscFunctionBegin; - PetscValidPointer(V,1); + PetscAssertPointer(V,1); PetscValidHeaderSpecific(*V,VEC_CLASSID,1); PetscValidLogicalCollectiveInt(*V,nv,2); PetscValidLogicalCollectiveInt(*V,nw,4); if (nv<=0 || nw<=0) PetscFunctionReturn(PETSC_SUCCESS); if (W) { - PetscValidPointer(W,3); + PetscAssertPointer(W,3); PetscValidHeaderSpecific(*W,VEC_CLASSID,3); PetscCheckSameComm(*V,1,*W,3); } @@ -221,7 +221,7 @@ PetscErrorCode VecDuplicateEmpty(Vec v,Vec *newv) PetscFunctionBegin; PetscValidHeaderSpecific(v,VEC_CLASSID,1); - PetscValidPointer(newv,2); + PetscAssertPointer(newv,2); PetscValidType(v,1); PetscCall(PetscObjectTypeCompareAny((PetscObject)v,&standard,VECSEQ,VECMPI,"")); From 9206c4f043ac305664c5898b92b1013064407d65 Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Wed, 19 Jul 2023 20:35:05 +0200 Subject: [PATCH 058/112] configure: update HPDDM hash with fixes for PetscAssertPointer --- config/packages/hpddm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/packages/hpddm.py b/config/packages/hpddm.py index 73b8738cc..f7852bdaa 100644 --- a/config/packages/hpddm.py +++ b/config/packages/hpddm.py @@ -17,7 +17,7 @@ def __init__(self,argdb,log): package.Package.__init__(self,argdb,log) self.packagename = 'hpddm' self.downloadable = True - self.gitcommit = '1af2600a191428d4fc2cc1f630bf14b5878675ff' + self.gitcommit = '52d9ca16756f3a13b088cd385d514acc459930af' # self.version = '2.2.3' obj = self.version if hasattr(self,'version') else self.gitcommit self.url = 'https://github.com/hpddm/hpddm/archive/'+('v'+obj if hasattr(self,'version') else obj)+'.tar.gz' From a1776dfe858ae96bbbb1a5fffbb947fa344de61b Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Sat, 22 Jul 2023 12:39:29 +0300 Subject: [PATCH 059/112] slepc4py: Pin Cython 0.29.36 --- src/binding/slepc4py/conf/confpetsc.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/binding/slepc4py/conf/confpetsc.py b/src/binding/slepc4py/conf/confpetsc.py index d9cf7886f..d1c69820d 100644 --- a/src/binding/slepc4py/conf/confpetsc.py +++ b/src/binding/slepc4py/conf/confpetsc.py @@ -68,7 +68,7 @@ def import_module(n): # Cython -CYTHON = '0.29.32' +CYTHON = '0.29.36' def cython_req(): return CYTHON @@ -315,7 +315,6 @@ def configure_extension(self, extension): if self['BUILDSHAREDLIB'] != 'yes': petsc_ext_lib = split_quoted(self['PETSC_EXTERNAL_LIB_BASIC']) petsc_lib['extra_link_args'].extend(petsc_ext_lib) - self._configure_ext(extension, petsc_inc, append=True) self._configure_ext(extension, petsc_lib) From d20114f944929762be282a41ebeac2c853e93483 Mon Sep 17 00:00:00 2001 From: Pierre Jolivet Date: Sun, 23 Jul 2023 15:06:36 +0200 Subject: [PATCH 060/112] slepc4py: fix missing CHKERR --- .../slepc4py/src/slepc4py/SLEPc/BV.pyx | 12 +++---- .../slepc4py/src/slepc4py/SLEPc/DS.pyx | 4 +-- .../slepc4py/src/slepc4py/SLEPc/EPS.pyx | 20 +++++------ .../slepc4py/src/slepc4py/SLEPc/FN.pyx | 6 ++-- .../slepc4py/src/slepc4py/SLEPc/MFN.pyx | 8 ++--- .../slepc4py/src/slepc4py/SLEPc/NEP.pyx | 36 +++++++++---------- .../slepc4py/src/slepc4py/SLEPc/PEP.pyx | 16 ++++----- .../slepc4py/src/slepc4py/SLEPc/RG.pyx | 2 +- .../slepc4py/src/slepc4py/SLEPc/ST.pyx | 10 +++--- .../slepc4py/src/slepc4py/SLEPc/SVD.pyx | 20 +++++------ .../slepc4py/src/slepc4py/SLEPc/slepceps.pxi | 2 +- .../slepc4py/src/slepc4py/SLEPc/slepcmfn.pxi | 2 +- .../slepc4py/src/slepc4py/SLEPc/slepcnep.pxi | 2 +- .../slepc4py/src/slepc4py/SLEPc/slepcpep.pxi | 2 +- .../slepc4py/src/slepc4py/SLEPc/slepcsvd.pxi | 2 +- .../slepc4py/src/slepc4py/SLEPc/slepcsys.pxi | 6 ++-- 16 files changed, 75 insertions(+), 75 deletions(-) diff --git a/src/binding/slepc4py/src/slepc4py/SLEPc/BV.pyx b/src/binding/slepc4py/src/slepc4py/SLEPc/BV.pyx index c721873a8..743683eba 100644 --- a/src/binding/slepc4py/src/slepc4py/SLEPc/BV.pyx +++ b/src/binding/slepc4py/src/slepc4py/SLEPc/BV.pyx @@ -124,7 +124,7 @@ cdef class BV(Object): cdef MPI_Comm ccomm = def_Comm(comm, SLEPC_COMM_DEFAULT()) cdef SlepcBV newbv = NULL CHKERR( BVCreate(ccomm, &newbv) ) - SlepcCLEAR(self.obj); self.bv = newbv + CHKERR( SlepcCLEAR(self.obj) ); self.bv = newbv return self def createFromMat(self, Mat A): @@ -138,7 +138,7 @@ cdef class BV(Object): """ cdef SlepcBV newbv = NULL CHKERR( BVCreateFromMat(A.mat, &newbv) ) - SlepcCLEAR(self.obj); self.bv = newbv + CHKERR( SlepcCLEAR(self.obj) ); self.bv = newbv return self def createMat(self): @@ -423,7 +423,7 @@ cdef class BV(Object): cdef Mat mat = Mat() cdef PetscBool indef = PETSC_FALSE CHKERR( BVGetMatrix(self.bv, &mat.mat, &indef) ) - PetscINCREF(mat.obj) + CHKERR( PetscINCREF(mat.obj) ) return (mat, toBool(indef)) def setMatrix(self, Mat mat or None, bint indef): @@ -777,7 +777,7 @@ cdef class BV(Object): cdef Vec v = Vec() cdef PetscInt ival = asInt(j) CHKERR( BVGetColumn(self.bv, j, &v.vec) ) - PetscINCREF(v.obj) + CHKERR( PetscINCREF(v.obj) ) return v def restoreColumn(self, j, Vec v): @@ -817,7 +817,7 @@ cdef class BV(Object): """ cdef Mat A = Mat() CHKERR( BVGetMat(self.bv, &A.mat) ) - PetscINCREF(A.obj) + CHKERR( PetscINCREF(A.obj) ) return A def restoreMat(self, Mat A): @@ -1283,7 +1283,7 @@ cdef class BV(Object): """ cdef Random rnd = Random() CHKERR( BVGetRandomContext(self.bv, &rnd.rnd) ) - PetscINCREF(rnd.obj) + CHKERR( PetscINCREF(rnd.obj) ) return rnd def orthogonalizeVec(self, Vec v): diff --git a/src/binding/slepc4py/src/slepc4py/SLEPc/DS.pyx b/src/binding/slepc4py/src/slepc4py/SLEPc/DS.pyx index 5657092cb..914febaae 100644 --- a/src/binding/slepc4py/src/slepc4py/SLEPc/DS.pyx +++ b/src/binding/slepc4py/src/slepc4py/SLEPc/DS.pyx @@ -129,7 +129,7 @@ cdef class DS(Object): cdef MPI_Comm ccomm = def_Comm(comm, SLEPC_COMM_DEFAULT()) cdef SlepcDS newds = NULL CHKERR( DSCreate(ccomm, &newds) ) - SlepcCLEAR(self.obj); self.ds = newds + CHKERR( SlepcCLEAR(self.obj) ); self.ds = newds return self def setType(self, ds_type): @@ -539,7 +539,7 @@ cdef class DS(Object): cdef SlepcDSMatType mname = matname cdef Mat mat = Mat() CHKERR( DSGetMat(self.ds, mname, &mat.mat) ) - PetscINCREF(mat.obj) + CHKERR( PetscINCREF(mat.obj) ) return mat def restoreMat(self, matname, Mat mat): diff --git a/src/binding/slepc4py/src/slepc4py/SLEPc/EPS.pyx b/src/binding/slepc4py/src/slepc4py/SLEPc/EPS.pyx index 4dc85779c..25c80f491 100644 --- a/src/binding/slepc4py/src/slepc4py/SLEPc/EPS.pyx +++ b/src/binding/slepc4py/src/slepc4py/SLEPc/EPS.pyx @@ -309,7 +309,7 @@ cdef class EPS(Object): cdef MPI_Comm ccomm = def_Comm(comm, SLEPC_COMM_DEFAULT()) cdef SlepcEPS neweps = NULL CHKERR( EPSCreate(ccomm, &neweps) ) - SlepcCLEAR(self.obj); self.eps = neweps + CHKERR( SlepcCLEAR(self.obj) ); self.eps = neweps return self def setType(self, eps_type): @@ -945,7 +945,7 @@ cdef class EPS(Object): """ cdef ST st = ST() CHKERR( EPSGetST(self.eps, &st.st) ) - PetscINCREF(st.obj) + CHKERR( PetscINCREF(st.obj) ) return st def setST(self, ST st): @@ -971,7 +971,7 @@ cdef class EPS(Object): """ cdef BV bv = BV() CHKERR( EPSGetBV(self.eps, &bv.bv) ) - PetscINCREF(bv.obj) + CHKERR( PetscINCREF(bv.obj) ) return bv def setBV(self, BV bv): @@ -996,7 +996,7 @@ cdef class EPS(Object): """ cdef DS ds = DS() CHKERR( EPSGetDS(self.eps, &ds.ds) ) - PetscINCREF(ds.obj) + CHKERR( PetscINCREF(ds.obj) ) return ds def setDS(self, DS ds): @@ -1021,7 +1021,7 @@ cdef class EPS(Object): """ cdef RG rg = RG() CHKERR( EPSGetRG(self.eps, &rg.rg) ) - PetscINCREF(rg.obj) + CHKERR( PetscINCREF(rg.obj) ) return rg def setRG(self, RG rg): @@ -1049,9 +1049,9 @@ cdef class EPS(Object): cdef Mat A = Mat() cdef Mat B = Mat() CHKERR( EPSGetOperators(self.eps, &A.mat, &B.mat) ) - PetscINCREF(A.obj) + CHKERR( PetscINCREF(A.obj) ) if B.mat: - PetscINCREF(B.obj) + CHKERR( PetscINCREF(B.obj) ) return (A, B) else: return (A, None) @@ -1936,8 +1936,8 @@ cdef class EPS(Object): cdef Mat A = Mat() cdef Mat B = Mat() CHKERR( EPSKrylovSchurGetSubcommMats(self.eps, &A.mat, &B.mat) ) - PetscINCREF(A.obj) - PetscINCREF(B.obj) + CHKERR( PetscINCREF(A.obj) ) + CHKERR( PetscINCREF(B.obj) ) return (A, B) def updateKrylovSchurSubcommMats(self, s=1.0, a=1.0, Mat Au=None, @@ -2081,7 +2081,7 @@ cdef class EPS(Object): """ cdef KSP ksp = KSP() CHKERR( EPSKrylovSchurGetKSP(self.eps, &ksp.ksp) ) - PetscINCREF(ksp.obj) + CHKERR( PetscINCREF(ksp.obj) ) return ksp # diff --git a/src/binding/slepc4py/src/slepc4py/SLEPc/FN.pyx b/src/binding/slepc4py/src/slepc4py/SLEPc/FN.pyx index 53c97e4aa..9beb079da 100644 --- a/src/binding/slepc4py/src/slepc4py/SLEPc/FN.pyx +++ b/src/binding/slepc4py/src/slepc4py/SLEPc/FN.pyx @@ -86,7 +86,7 @@ cdef class FN(Object): cdef MPI_Comm ccomm = def_Comm(comm, SLEPC_COMM_DEFAULT()) cdef SlepcFN newfn = NULL CHKERR( FNCreate(ccomm, &newfn) ) - SlepcCLEAR(self.obj); self.fn = newfn + CHKERR( SlepcCLEAR(self.obj) ); self.fn = newfn return self def setType(self, fn_type): @@ -449,8 +449,8 @@ cdef class FN(Object): cdef FN f1 = FN() cdef FN f2 = FN() CHKERR( FNCombineGetChildren(self.fn, &comb, &f1.fn, &f2.fn) ) - PetscINCREF(f1.obj) - PetscINCREF(f2.obj) + CHKERR( PetscINCREF(f1.obj) ) + CHKERR( PetscINCREF(f2.obj) ) return (comb, f1, f2) def setPhiIndex(self, k): diff --git a/src/binding/slepc4py/src/slepc4py/SLEPc/MFN.pyx b/src/binding/slepc4py/src/slepc4py/SLEPc/MFN.pyx index 47dd1c28d..594ac726c 100644 --- a/src/binding/slepc4py/src/slepc4py/SLEPc/MFN.pyx +++ b/src/binding/slepc4py/src/slepc4py/SLEPc/MFN.pyx @@ -75,7 +75,7 @@ cdef class MFN(Object): cdef MPI_Comm ccomm = def_Comm(comm, SLEPC_COMM_DEFAULT()) cdef SlepcMFN newmfn = NULL CHKERR( MFNCreate(ccomm, &newmfn) ) - SlepcCLEAR(self.obj); self.mfn = newmfn + CHKERR( SlepcCLEAR(self.obj) ); self.mfn = newmfn return self def setType(self, mfn_type): @@ -226,7 +226,7 @@ cdef class MFN(Object): """ cdef FN fn = FN() CHKERR( MFNGetFN(self.mfn, &fn.fn) ) - PetscINCREF(fn.obj) + CHKERR( PetscINCREF(fn.obj) ) return fn def setFN(self, FN fn): @@ -251,7 +251,7 @@ cdef class MFN(Object): """ cdef BV bv = BV() CHKERR( MFNGetBV(self.mfn, &bv.bv) ) - PetscINCREF(bv.obj) + CHKERR( PetscINCREF(bv.obj) ) return bv def setBV(self, BV bv): @@ -276,7 +276,7 @@ cdef class MFN(Object): """ cdef Mat A = Mat() CHKERR( MFNGetOperator(self.mfn, &A.mat) ) - PetscINCREF(A.obj) + CHKERR( PetscINCREF(A.obj) ) return A def setOperator(self, Mat A): diff --git a/src/binding/slepc4py/src/slepc4py/SLEPc/NEP.pyx b/src/binding/slepc4py/src/slepc4py/SLEPc/NEP.pyx index b3bc3ac77..14790770a 100644 --- a/src/binding/slepc4py/src/slepc4py/SLEPc/NEP.pyx +++ b/src/binding/slepc4py/src/slepc4py/SLEPc/NEP.pyx @@ -215,7 +215,7 @@ cdef class NEP(Object): cdef MPI_Comm ccomm = def_Comm(comm, SLEPC_COMM_DEFAULT()) cdef SlepcNEP newnep = NULL CHKERR( NEPCreate(ccomm, &newnep) ) - SlepcCLEAR(self.obj); self.nep = newnep + CHKERR( SlepcCLEAR(self.obj) ); self.nep = newnep return self def setType(self, nep_type): @@ -509,7 +509,7 @@ cdef class NEP(Object): """ cdef KSP ksp = KSP() CHKERR( NEPRefineGetKSP(self.nep, &ksp.ksp) ) - PetscINCREF(ksp.obj) + CHKERR( PetscINCREF(ksp.obj) ) return ksp def getTrackAll(self): @@ -593,7 +593,7 @@ cdef class NEP(Object): """ cdef BV bv = BV() CHKERR( NEPGetBV(self.nep, &bv.bv) ) - PetscINCREF(bv.obj) + CHKERR( PetscINCREF(bv.obj) ) return bv def setBV(self, BV bv): @@ -618,7 +618,7 @@ cdef class NEP(Object): """ cdef RG rg = RG() CHKERR( NEPGetRG(self.nep, &rg.rg) ) - PetscINCREF(rg.obj) + CHKERR( PetscINCREF(rg.obj) ) return rg def setRG(self, RG rg): @@ -643,7 +643,7 @@ cdef class NEP(Object): """ cdef DS ds = DS() CHKERR( NEPGetDS(self.nep, &ds.ds) ) - PetscINCREF(ds.obj) + CHKERR( PetscINCREF(ds.obj) ) return ds def setDS(self, DS ds): @@ -976,8 +976,8 @@ cdef class NEP(Object): cdef Mat F = Mat() cdef Mat P = Mat() CHKERR( NEPGetFunction(self.nep, &F.mat, &P.mat, NULL, NULL) ) - PetscINCREF(F.obj) - PetscINCREF(P.obj) + CHKERR( PetscINCREF(F.obj) ) + CHKERR( PetscINCREF(P.obj) ) cdef object function = self.get_attr('__function__') return (F, P, function) @@ -1016,7 +1016,7 @@ cdef class NEP(Object): """ cdef Mat J = Mat() CHKERR( NEPGetJacobian(self.nep, &J.mat, NULL, NULL) ) - PetscINCREF(J.obj) + CHKERR( PetscINCREF(J.obj) ) cdef object jacobian = self.get_attr('__jacobian__') return (J, jacobian) @@ -1073,8 +1073,8 @@ cdef class NEP(Object): cdef object functions = [] for i in range(n): CHKERR( NEPGetSplitOperatorTerm(self.nep, i, &mat, &fn) ) - A = Mat(); A.mat = mat; PetscINCREF(A.obj) - f = FN(); f.fn = fn; PetscINCREF(f.obj) + A = Mat(); A.mat = mat; CHKERR( PetscINCREF(A.obj) ) + f = FN(); f.fn = fn; CHKERR( PetscINCREF(f.obj) ) matrices.append(A) functions.append(f) return (matrices, functions, mstr) @@ -1120,7 +1120,7 @@ cdef class NEP(Object): cdef object matrices = [] for i in range(n): CHKERR( NEPGetSplitPreconditionerTerm(self.nep, i, &mat) ) - P = Mat(); P.mat = mat; PetscINCREF(P.obj) + P = Mat(); P.mat = mat; CHKERR( PetscINCREF(P.obj) ) matrices.append(P) return (matrices, mstr) @@ -1327,7 +1327,7 @@ cdef class NEP(Object): """ cdef KSP ksp = KSP() CHKERR( NEPRIIGetKSP(self.nep, &ksp.ksp) ) - PetscINCREF(ksp.obj) + CHKERR( PetscINCREF(ksp.obj) ) return ksp # @@ -1380,7 +1380,7 @@ cdef class NEP(Object): """ cdef EPS eps = EPS() CHKERR( NEPSLPGetEPS(self.nep, &eps.eps) ) - PetscINCREF(eps.obj) + CHKERR( PetscINCREF(eps.obj) ) return eps def setSLPEPSLeft(self, EPS eps): @@ -1406,7 +1406,7 @@ cdef class NEP(Object): """ cdef EPS eps = EPS() CHKERR( NEPSLPGetEPSLeft(self.nep, &eps.eps) ) - PetscINCREF(eps.obj) + CHKERR( PetscINCREF(eps.obj) ) return eps def setSLPKSP(self, KSP ksp): @@ -1431,7 +1431,7 @@ cdef class NEP(Object): """ cdef KSP ksp = KSP() CHKERR( NEPSLPGetKSP(self.nep, &ksp.ksp) ) - PetscINCREF(ksp.obj) + CHKERR( PetscINCREF(ksp.obj) ) return ksp # @@ -1458,7 +1458,7 @@ cdef class NEP(Object): """ cdef KSP ksp = KSP() CHKERR( NEPNArnoldiGetKSP(self.nep, &ksp.ksp) ) - PetscINCREF(ksp.obj) + CHKERR( PetscINCREF(ksp.obj) ) return ksp def setNArnoldiLagPreconditioner(self, lag): @@ -1517,7 +1517,7 @@ cdef class NEP(Object): """ cdef PEP pep = PEP() CHKERR( NEPInterpolGetPEP(self.nep, &pep.pep) ) - PetscINCREF(pep.obj) + CHKERR( PetscINCREF(pep.obj) ) return pep def setInterpolInterpolation(self, tol=None, deg=None): @@ -1704,7 +1704,7 @@ cdef class NEP(Object): """ cdef EPS eps = EPS() CHKERR( NEPNLEIGSGetEPS(self.nep, &eps.eps) ) - PetscINCREF(eps.obj) + CHKERR( PetscINCREF(eps.obj) ) return eps def setNLEIGSRKShifts(self, shifts): diff --git a/src/binding/slepc4py/src/slepc4py/SLEPc/PEP.pyx b/src/binding/slepc4py/src/slepc4py/SLEPc/PEP.pyx index 584daf56c..d23e20568 100644 --- a/src/binding/slepc4py/src/slepc4py/SLEPc/PEP.pyx +++ b/src/binding/slepc4py/src/slepc4py/SLEPc/PEP.pyx @@ -278,7 +278,7 @@ cdef class PEP(Object): cdef MPI_Comm ccomm = def_Comm(comm, SLEPC_COMM_DEFAULT()) cdef SlepcPEP newpep = NULL CHKERR( PEPCreate(ccomm, &newpep) ) - SlepcCLEAR(self.obj); self.pep = newpep + CHKERR( SlepcCLEAR(self.obj) ); self.pep = newpep return self def setType(self, pep_type): @@ -643,7 +643,7 @@ cdef class PEP(Object): """ cdef KSP ksp = KSP() CHKERR( PEPRefineGetKSP(self.pep, &ksp.ksp) ) - PetscINCREF(ksp.obj) + CHKERR( PetscINCREF(ksp.obj) ) return ksp def setExtract(self, extract): @@ -753,7 +753,7 @@ cdef class PEP(Object): """ cdef ST st = ST() CHKERR( PEPGetST(self.pep, &st.st) ) - PetscINCREF(st.obj) + CHKERR( PetscINCREF(st.obj) ) return st def setST(self, ST st): @@ -855,7 +855,7 @@ cdef class PEP(Object): """ cdef BV bv = BV() CHKERR( PEPGetBV(self.pep, &bv.bv) ) - PetscINCREF(bv.obj) + CHKERR( PetscINCREF(bv.obj) ) return bv def setBV(self, BV bv): @@ -880,7 +880,7 @@ cdef class PEP(Object): """ cdef RG rg = RG() CHKERR( PEPGetRG(self.pep, &rg.rg) ) - PetscINCREF(rg.obj) + CHKERR( PetscINCREF(rg.obj) ) return rg def setRG(self, RG rg): @@ -905,7 +905,7 @@ cdef class PEP(Object): """ cdef DS ds = DS() CHKERR( PEPGetDS(self.pep, &ds.ds) ) - PetscINCREF(ds.obj) + CHKERR( PetscINCREF(ds.obj) ) return ds def setDS(self, DS ds): @@ -935,7 +935,7 @@ cdef class PEP(Object): cdef object operators = [] for k from 0 <= k < n: CHKERR( PEPGetOperators(self.pep, k, &mat) ) - A = Mat(); A.mat = mat; PetscINCREF(A.obj) + A = Mat(); A.mat = mat; CHKERR( PetscINCREF(A.obj) ) operators.append(A) return tuple(operators) @@ -1234,7 +1234,7 @@ cdef class PEP(Object): """ cdef EPS eps = EPS() CHKERR( PEPLinearGetEPS(self.pep, &eps.eps) ) - PetscINCREF(eps.obj) + CHKERR( PetscINCREF(eps.obj) ) return eps def setLinearLinearization(self, alpha=1.0, beta=0.0): diff --git a/src/binding/slepc4py/src/slepc4py/SLEPc/RG.pyx b/src/binding/slepc4py/src/slepc4py/SLEPc/RG.pyx index 3724800ad..380e0d8ea 100644 --- a/src/binding/slepc4py/src/slepc4py/SLEPc/RG.pyx +++ b/src/binding/slepc4py/src/slepc4py/SLEPc/RG.pyx @@ -68,7 +68,7 @@ cdef class RG(Object): cdef MPI_Comm ccomm = def_Comm(comm, SLEPC_COMM_DEFAULT()) cdef SlepcRG newrg = NULL CHKERR( RGCreate(ccomm, &newrg) ) - SlepcCLEAR(self.obj); self.rg = newrg + CHKERR( SlepcCLEAR(self.obj) ); self.rg = newrg return self def setType(self, rg_type): diff --git a/src/binding/slepc4py/src/slepc4py/SLEPc/ST.pyx b/src/binding/slepc4py/src/slepc4py/SLEPc/ST.pyx index 9efa6ae17..056145ab5 100644 --- a/src/binding/slepc4py/src/slepc4py/SLEPc/ST.pyx +++ b/src/binding/slepc4py/src/slepc4py/SLEPc/ST.pyx @@ -86,7 +86,7 @@ cdef class ST(Object): cdef MPI_Comm ccomm = def_Comm(comm, SLEPC_COMM_DEFAULT()) cdef SlepcST newst = NULL CHKERR( STCreate(ccomm, &newst) ) - SlepcCLEAR(self.obj); self.st = newst + CHKERR( SlepcCLEAR(self.obj) ); self.st = newst return self def setType(self, st_type): @@ -323,7 +323,7 @@ cdef class ST(Object): cdef object operators = [] for k from 0 <= k < n: CHKERR( STGetMatrix(self.st, k, &mat) ) - A = Mat(); A.mat = mat; PetscINCREF(A.obj) + A = Mat(); A.mat = mat; CHKERR( PetscINCREF(A.obj) ) operators.append(A) return tuple(operators) @@ -395,7 +395,7 @@ cdef class ST(Object): """ cdef KSP ksp = KSP() CHKERR( STGetKSP(self.st, &ksp.ksp) ) - PetscINCREF(ksp.obj) + CHKERR( PetscINCREF(ksp.obj) ) return ksp def setPreconditionerMat(self, Mat P=None): @@ -421,7 +421,7 @@ cdef class ST(Object): """ cdef Mat P = Mat() CHKERR( STGetPreconditionerMat(self.st, &P.mat) ) - PetscINCREF(P.obj) + CHKERR( PetscINCREF(P.obj) ) return P # @@ -504,7 +504,7 @@ cdef class ST(Object): """ cdef Mat op = Mat() CHKERR( STGetOperator(self.st, &op.mat) ) - PetscINCREF(op.obj) + CHKERR( PetscINCREF(op.obj) ) return op def restoreOperator(self, Mat op): diff --git a/src/binding/slepc4py/src/slepc4py/SLEPc/SVD.pyx b/src/binding/slepc4py/src/slepc4py/SLEPc/SVD.pyx index c819a84eb..2c4b76f96 100644 --- a/src/binding/slepc4py/src/slepc4py/SLEPc/SVD.pyx +++ b/src/binding/slepc4py/src/slepc4py/SLEPc/SVD.pyx @@ -183,7 +183,7 @@ cdef class SVD(Object): cdef MPI_Comm ccomm = def_Comm(comm, SLEPC_COMM_DEFAULT()) cdef SlepcSVD newsvd = NULL CHKERR( SVDCreate(ccomm, &newsvd) ) - SlepcCLEAR(self.obj); self.svd = newsvd + CHKERR( SlepcCLEAR(self.obj) ); self.svd = newsvd return self def setType(self, svd_type): @@ -578,8 +578,8 @@ cdef class SVD(Object): cdef BV V = BV() cdef BV U = BV() CHKERR( SVDGetBV(self.svd, &V.bv, &U.bv) ) - PetscINCREF(V.obj) - PetscINCREF(U.obj) + CHKERR( PetscINCREF(V.obj) ) + CHKERR( PetscINCREF(U.obj) ) return (V,U) def setBV(self, BV V,BV U=None): @@ -608,7 +608,7 @@ cdef class SVD(Object): """ cdef DS ds = DS() CHKERR( SVDGetDS(self.svd, &ds.ds) ) - PetscINCREF(ds.obj) + CHKERR( PetscINCREF(ds.obj) ) return ds def setDS(self, DS ds): @@ -636,8 +636,8 @@ cdef class SVD(Object): cdef Mat A = Mat() cdef Mat B = Mat() CHKERR( SVDGetOperators(self.svd, &A.mat, &B.mat) ) - PetscINCREF(A.obj) - PetscINCREF(B.obj) + CHKERR( PetscINCREF(A.obj) ) + CHKERR( PetscINCREF(B.obj) ) return (A, B) def setOperators(self, Mat A, Mat B=None): @@ -669,7 +669,7 @@ cdef class SVD(Object): if (omega.vec == NULL): return None else: - PetscINCREF(omega.obj) + CHKERR( PetscINCREF(omega.obj) ) return omega def setSignature(self, Vec omega=None): @@ -1024,7 +1024,7 @@ cdef class SVD(Object): """ cdef EPS eps = EPS() CHKERR( SVDCrossGetEPS(self.svd, &eps.eps) ) - PetscINCREF(eps.obj) + CHKERR( PetscINCREF(eps.obj) ) return eps def setCrossExplicitMatrix(self, flag=True): @@ -1077,7 +1077,7 @@ cdef class SVD(Object): """ cdef EPS eps = EPS() CHKERR( SVDCyclicGetEPS(self.svd, &eps.eps) ) - PetscINCREF(eps.obj) + CHKERR( PetscINCREF(eps.obj) ) return eps def setCyclicExplicitMatrix(self, flag=True): @@ -1289,7 +1289,7 @@ cdef class SVD(Object): """ cdef KSP ksp = KSP() CHKERR( SVDTRLanczosGetKSP(self.svd, &ksp.ksp) ) - PetscINCREF(ksp.obj) + CHKERR( PetscINCREF(ksp.obj) ) return ksp def setTRLanczosExplicitMatrix(self, flag=True): diff --git a/src/binding/slepc4py/src/slepc4py/SLEPc/slepceps.pxi b/src/binding/slepc4py/src/slepc4py/SLEPc/slepceps.pxi index 68370b08c..3ca0be0c0 100644 --- a/src/binding/slepc4py/src/slepc4py/SLEPc/slepceps.pxi +++ b/src/binding/slepc4py/src/slepc4py/SLEPc/slepceps.pxi @@ -311,7 +311,7 @@ cdef extern from * nogil: cdef inline EPS ref_EPS(SlepcEPS eps): cdef EPS ob = EPS() ob.eps = eps - PetscINCREF(ob.obj) + CHKERR( PetscINCREF(ob.obj) ) return ob # ----------------------------------------------------------------------------- diff --git a/src/binding/slepc4py/src/slepc4py/SLEPc/slepcmfn.pxi b/src/binding/slepc4py/src/slepc4py/SLEPc/slepcmfn.pxi index 4bd362e2b..21fea3724 100644 --- a/src/binding/slepc4py/src/slepc4py/SLEPc/slepcmfn.pxi +++ b/src/binding/slepc4py/src/slepc4py/SLEPc/slepcmfn.pxi @@ -57,7 +57,7 @@ cdef extern from * nogil: cdef inline MFN ref_MFN(SlepcMFN mfn): cdef MFN ob = MFN() ob.mfn = mfn - PetscINCREF(ob.obj) + CHKERR( PetscINCREF(ob.obj) ) return ob # ----------------------------------------------------------------------------- diff --git a/src/binding/slepc4py/src/slepc4py/SLEPc/slepcnep.pxi b/src/binding/slepc4py/src/slepc4py/SLEPc/slepcnep.pxi index 928ae4a57..b694c26b1 100644 --- a/src/binding/slepc4py/src/slepc4py/SLEPc/slepcnep.pxi +++ b/src/binding/slepc4py/src/slepc4py/SLEPc/slepcnep.pxi @@ -229,7 +229,7 @@ cdef extern from * nogil: cdef inline NEP ref_NEP(SlepcNEP nep): cdef NEP ob = NEP() ob.nep = nep - PetscINCREF(ob.obj) + CHKERR( PetscINCREF(ob.obj) ) return ob # ----------------------------------------------------------------------------- diff --git a/src/binding/slepc4py/src/slepc4py/SLEPc/slepcpep.pxi b/src/binding/slepc4py/src/slepc4py/SLEPc/slepcpep.pxi index f54b3cc41..d1f6131bc 100644 --- a/src/binding/slepc4py/src/slepc4py/SLEPc/slepcpep.pxi +++ b/src/binding/slepc4py/src/slepc4py/SLEPc/slepcpep.pxi @@ -233,7 +233,7 @@ cdef extern from * nogil: cdef inline PEP ref_PEP(SlepcPEP pep): cdef PEP ob = PEP() ob.pep = pep - PetscINCREF(ob.obj) + CHKERR( PetscINCREF(ob.obj) ) return ob # ----------------------------------------------------------------------------- diff --git a/src/binding/slepc4py/src/slepc4py/SLEPc/slepcsvd.pxi b/src/binding/slepc4py/src/slepc4py/SLEPc/slepcsvd.pxi index 6c183d622..917c1e016 100644 --- a/src/binding/slepc4py/src/slepc4py/SLEPc/slepcsvd.pxi +++ b/src/binding/slepc4py/src/slepc4py/SLEPc/slepcsvd.pxi @@ -155,7 +155,7 @@ cdef extern from * nogil: cdef inline SVD ref_SVD(SlepcSVD svd): cdef SVD ob = SVD() ob.svd = svd - PetscINCREF(ob.obj) + CHKERR( PetscINCREF(ob.obj) ) return ob # ----------------------------------------------------------------------------- diff --git a/src/binding/slepc4py/src/slepc4py/SLEPc/slepcsys.pxi b/src/binding/slepc4py/src/slepc4py/SLEPc/slepcsys.pxi index 3f4ae88d7..cfa45c950 100644 --- a/src/binding/slepc4py/src/slepc4py/SLEPc/slepcsys.pxi +++ b/src/binding/slepc4py/src/slepc4py/SLEPc/slepcsys.pxi @@ -80,18 +80,18 @@ cdef inline PetscViewer def_Viewer(Viewer viewer): cdef inline KSP ref_KSP(PetscKSP ksp): cdef KSP ob = KSP() ob.ksp = ksp - PetscINCREF(ob.obj) + CHKERR( PetscINCREF(ob.obj) ) return ob cdef inline Mat ref_Mat(PetscMat mat): cdef Mat ob = Mat() ob.mat = mat - PetscINCREF(ob.obj) + CHKERR( PetscINCREF(ob.obj) ) return ob cdef inline Vec ref_Vec(PetscVec vec): cdef Vec ob = Vec() ob.vec = vec - PetscINCREF(ob.obj) + CHKERR( PetscINCREF(ob.obj) ) return ob From bd8dbe32439d9aedaafe5a9444ad8b6e278904e7 Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Sun, 23 Jul 2023 18:44:21 +0300 Subject: [PATCH 061/112] slepc4py: Update to Cython 3 --- src/binding/slepc4py/.gitignore | 1 + src/binding/slepc4py/MANIFEST.in | 8 ++-- src/binding/slepc4py/conf/confpetsc.py | 27 ++++++++++--- src/binding/slepc4py/makefile | 17 ++++---- src/binding/slepc4py/src/slepc4py/SLEPc.pyx | 6 +-- .../slepc4py/src/slepc4py/SLEPc/BV.pyx | 4 +- .../slepc4py/src/slepc4py/SLEPc/DS.pyx | 4 +- .../slepc4py/src/slepc4py/SLEPc/EPS.pyx | 6 +-- .../slepc4py/src/slepc4py/SLEPc/FN.pyx | 4 +- .../slepc4py/src/slepc4py/SLEPc/MFN.pyx | 6 +-- .../slepc4py/src/slepc4py/SLEPc/NEP.pyx | 6 +-- .../slepc4py/src/slepc4py/SLEPc/PEP.pyx | 6 +-- .../slepc4py/src/slepc4py/SLEPc/RG.pyx | 4 +- .../slepc4py/src/slepc4py/SLEPc/SLEPc.pyx | 40 ++++--------------- .../slepc4py/src/slepc4py/SLEPc/ST.pyx | 4 +- .../slepc4py/src/slepc4py/SLEPc/SVD.pyx | 6 +-- .../slepc4py/src/slepc4py/SLEPc/slepcsys.pxi | 2 +- src/binding/slepc4py/test/runtests.py | 1 - 18 files changed, 73 insertions(+), 79 deletions(-) diff --git a/src/binding/slepc4py/.gitignore b/src/binding/slepc4py/.gitignore index 556c6436a..131a274d9 100644 --- a/src/binding/slepc4py/.gitignore +++ b/src/binding/slepc4py/.gitignore @@ -17,3 +17,4 @@ __pycache__ src/slepc4py.egg-info src/slepc4py/SLEPc.c src/slepc4py/SLEPc*.h +src/slepc4py/lib/*/SLEPc.*.so diff --git a/src/binding/slepc4py/MANIFEST.in b/src/binding/slepc4py/MANIFEST.in index a627b9547..c2d63f718 100644 --- a/src/binding/slepc4py/MANIFEST.in +++ b/src/binding/slepc4py/MANIFEST.in @@ -15,6 +15,8 @@ include docs/*.pdf include docs/*.info include docs/*.[137] include docs/*.rst -recursive-include docs/usrman * -recursive-include docs/apiref * -recursive-include docs/source * +include docs/*.bib +graft docs/usrman +graft docs/apiref +graft docs/source +prune docs/source/_build diff --git a/src/binding/slepc4py/conf/confpetsc.py b/src/binding/slepc4py/conf/confpetsc.py index d1c69820d..5888c9dc4 100644 --- a/src/binding/slepc4py/conf/confpetsc.py +++ b/src/binding/slepc4py/conf/confpetsc.py @@ -68,7 +68,7 @@ def import_module(n): # Cython -CYTHON = '0.29.36' +CYTHON = '3.0.0' def cython_req(): return CYTHON @@ -100,8 +100,8 @@ def printer(*s): sys.stderr.write(" ".join(s)+"\n") return False REQUIRED = Version(VERSION) PROVIDED = Version(m.groups()[0]) - if PROVIDED != REQUIRED: - warn("You need Cython == {0} (you have version {1})" + if PROVIDED < REQUIRED: + warn("You need Cython >= {0} (you have version {1})" .format(VERSION, CYTHON_VERSION)) return False # @@ -130,7 +130,7 @@ def cython_run( return finally: os.chdir(cwd) - require = 'Cython == %s' % VERSION + require = 'Cython >= %s' % VERSION if setuptools and not cython_chk(VERSION, verbose=False): if sys.modules.get('Cython'): removed = getattr(sys.modules['Cython'], '__version__', '') @@ -518,15 +518,28 @@ def chk_petsc_arch(petsc_dir, petsc_arch): class build(_build): - user_options = _build.user_options + cmd_petsc_opts + user_options = _build.user_options + user_options += [( + 'inplace', + 'i', + "ignore build-lib and put compiled extensions into the source " + "directory alongside your pure Python modules", + )] + user_options += cmd_petsc_opts + + boolean_options = _build.boolean_options + boolean_options += ['inplace'] def initialize_options(self): _build.initialize_options(self) + self.inplace = None self.petsc_dir = None self.petsc_arch = None def finalize_options(self): _build.finalize_options(self) + if self.inplace is None: + self.inplace = False self.set_undefined_options('config', ('petsc_dir', 'petsc_dir'), ('petsc_arch', 'petsc_arch')) @@ -573,12 +586,14 @@ class build_ext(_build_ext): def initialize_options(self): _build_ext.initialize_options(self) + self.inplace = None self.petsc_dir = None self.petsc_arch = None self._outputs = [] def finalize_options(self): _build_ext.finalize_options(self) + self.set_undefined_options('build', ('inplace', 'inplace')) self.set_undefined_options('build', ('petsc_dir', 'petsc_dir'), ('petsc_arch', 'petsc_arch')) @@ -763,7 +778,7 @@ def setup(**attrs): version = cython_req() if not cython_chk(version, verbose=False): reqs = attrs.setdefault('setup_requires', []) - reqs += ['Cython=='+version] + reqs += ['Cython>='+version] return _setup(**attrs) # -------------------------------------------------------------------- diff --git a/src/binding/slepc4py/makefile b/src/binding/slepc4py/makefile index 316dfb7cc..e24e7fdff 100644 --- a/src/binding/slepc4py/makefile +++ b/src/binding/slepc4py/makefile @@ -1,5 +1,6 @@ .PHONY: default default: build +default: opt=--inplace package = slepc4py MODULE = SLEPc @@ -11,17 +12,17 @@ MPIEXEC = mpiexec .PHONY: config build test config: - ${PYTHON} setup.py config ${CONFIGOPT} ${opt} + ${PYTHON} setup.py config ${opt} build: - ${PYTHON} setup.py build ${BUILDOPT} ${opt} + ${PYTHON} setup.py build ${opt} test: - ${VALGRIND} ${PYTHON} ${PWD}/test/runtests.py ${TESTOPT} ${opt} + ${VALGRIND} ${PYTHON} ${PWD}/test/runtests.py ${opt} test-%: - ${MPIEXEC} -n $* ${VALGRIND} ${PYTHON} ${PWD}/test/runtests.py ${TESTOPT} ${opt} + ${MPIEXEC} -n $* ${VALGRIND} ${PYTHON} ${PWD}/test/runtests.py ${opt} .PHONY: srcbuild srcclean srcbuild: - ${PYTHON} setup.py build_src ${SRCOPT} ${opt} + ${PYTHON} setup.py build_src ${opt} srcclean: -${RM} src/${package}/${MODULE}.c -${RM} src/${package}/${MODULE}.h @@ -42,7 +43,7 @@ fullclean: distclean srcclean docsclean .PHONY: install uninstall install: build - ${PYTHON} setup.py install --prefix='' --user ${INSTALLOPT} + ${PYTHON} setup.py install --prefix='' --user ${opt} uninstall: -${RM} -r $(shell ${PYTHON} -m site --user-site)/${package} -${RM} -r $(shell ${PYTHON} -m site --user-site)/${package}-*-py*.egg-info @@ -113,7 +114,7 @@ docsclean: # ---- .PHONY: sdist -sdist: docs - ${PYTHON} setup.py sdist ${SDISTOPT} +sdist: + ${PYTHON} setup.py sdist ${opt} # ---- diff --git a/src/binding/slepc4py/src/slepc4py/SLEPc.pyx b/src/binding/slepc4py/src/slepc4py/SLEPc.pyx index 2fe336eb6..8592e7cf9 100644 --- a/src/binding/slepc4py/src/slepc4py/SLEPc.pyx +++ b/src/binding/slepc4py/src/slepc4py/SLEPc.pyx @@ -1,5 +1,6 @@ #cython: language_level=3str #cython: embedsignature=True +#cython: embedsignature.format=python #cython: annotation_typing=False #cython: cdivision=True #cython: auto_pickle=False @@ -8,10 +9,9 @@ #cython: autotestdict=False #cython: warn.multiple_declarators=False #cython: optimize.use_switch=False - #cython: binding=False -#from __future__ import annotations -from __future__ import absolute_import +#from __future__ import annotations cimport cython + include "SLEPc/SLEPc.pyx" diff --git a/src/binding/slepc4py/src/slepc4py/SLEPc/BV.pyx b/src/binding/slepc4py/src/slepc4py/SLEPc/BV.pyx index 743683eba..c3f675523 100644 --- a/src/binding/slepc4py/src/slepc4py/SLEPc/BV.pyx +++ b/src/binding/slepc4py/src/slepc4py/SLEPc/BV.pyx @@ -288,7 +288,7 @@ cdef class BV(Object): prefix name. The first character of all runtime options is AUTOMATICALLY the hyphen. """ - cdef const_char *cval = NULL + cdef const char *cval = NULL prefix = str2bytes(prefix, &cval) CHKERR( BVSetOptionsPrefix(self.bv, cval) ) @@ -302,7 +302,7 @@ cdef class BV(Object): prefix: string The prefix string set for this BV object. """ - cdef const_char *prefix = NULL + cdef const char *prefix = NULL CHKERR( BVGetOptionsPrefix(self.bv, &prefix) ) return bytes2str(prefix) diff --git a/src/binding/slepc4py/src/slepc4py/SLEPc/DS.pyx b/src/binding/slepc4py/src/slepc4py/SLEPc/DS.pyx index 914febaae..a9189ff25 100644 --- a/src/binding/slepc4py/src/slepc4py/SLEPc/DS.pyx +++ b/src/binding/slepc4py/src/slepc4py/SLEPc/DS.pyx @@ -175,7 +175,7 @@ cdef class DS(Object): prefix name. The first character of all runtime options is AUTOMATICALLY the hyphen. """ - cdef const_char *cval = NULL + cdef const char *cval = NULL prefix = str2bytes(prefix, &cval) CHKERR( DSSetOptionsPrefix(self.ds, cval) ) @@ -189,7 +189,7 @@ cdef class DS(Object): prefix: string The prefix string set for this DS object. """ - cdef const_char *prefix = NULL + cdef const char *prefix = NULL CHKERR( DSGetOptionsPrefix(self.ds, &prefix) ) return bytes2str(prefix) diff --git a/src/binding/slepc4py/src/slepc4py/SLEPc/EPS.pyx b/src/binding/slepc4py/src/slepc4py/SLEPc/EPS.pyx index 25c80f491..fb4dc8bdd 100644 --- a/src/binding/slepc4py/src/slepc4py/SLEPc/EPS.pyx +++ b/src/binding/slepc4py/src/slepc4py/SLEPc/EPS.pyx @@ -357,7 +357,7 @@ cdef class EPS(Object): prefix: string The prefix string set for this EPS object. """ - cdef const_char *prefix = NULL + cdef const char *prefix = NULL CHKERR( EPSGetOptionsPrefix(self.eps, &prefix) ) return bytes2str(prefix) @@ -384,7 +384,7 @@ cdef class EPS(Object): E1.setOptionsPrefix("eig1_") E2.setOptionsPrefix("eig2_") """ - cdef const_char *cval = NULL + cdef const char *cval = NULL prefix = str2bytes(prefix, &cval) CHKERR( EPSSetOptionsPrefix(self.eps, cval) ) @@ -398,7 +398,7 @@ cdef class EPS(Object): prefix: string The prefix string to prepend to all EPS option requests. """ - cdef const_char *cval = NULL + cdef const char *cval = NULL prefix = str2bytes(prefix, &cval) CHKERR( EPSAppendOptionsPrefix(self.eps, cval) ) diff --git a/src/binding/slepc4py/src/slepc4py/SLEPc/FN.pyx b/src/binding/slepc4py/src/slepc4py/SLEPc/FN.pyx index 9beb079da..0a7bbacb7 100644 --- a/src/binding/slepc4py/src/slepc4py/SLEPc/FN.pyx +++ b/src/binding/slepc4py/src/slepc4py/SLEPc/FN.pyx @@ -132,7 +132,7 @@ cdef class FN(Object): prefix name. The first character of all runtime options is AUTOMATICALLY the hyphen. """ - cdef const_char *cval = NULL + cdef const char *cval = NULL prefix = str2bytes(prefix, &cval) CHKERR( FNSetOptionsPrefix(self.fn, cval) ) @@ -146,7 +146,7 @@ cdef class FN(Object): prefix: string The prefix string set for this FN object. """ - cdef const_char *prefix = NULL + cdef const char *prefix = NULL CHKERR( FNGetOptionsPrefix(self.fn, &prefix) ) return bytes2str(prefix) diff --git a/src/binding/slepc4py/src/slepc4py/SLEPc/MFN.pyx b/src/binding/slepc4py/src/slepc4py/SLEPc/MFN.pyx index 594ac726c..2d32e1c2b 100644 --- a/src/binding/slepc4py/src/slepc4py/SLEPc/MFN.pyx +++ b/src/binding/slepc4py/src/slepc4py/SLEPc/MFN.pyx @@ -114,7 +114,7 @@ cdef class MFN(Object): prefix: string The prefix string set for this MFN object. """ - cdef const_char *prefix = NULL + cdef const char *prefix = NULL CHKERR( MFNGetOptionsPrefix(self.mfn, &prefix) ) return bytes2str(prefix) @@ -128,7 +128,7 @@ cdef class MFN(Object): prefix: string The prefix string to prepend to all MFN option requests. """ - cdef const_char *cval = NULL + cdef const char *cval = NULL prefix = str2bytes(prefix, &cval) CHKERR( MFNSetOptionsPrefix(self.mfn, cval) ) @@ -142,7 +142,7 @@ cdef class MFN(Object): prefix: string The prefix string to prepend to all MFN option requests. """ - cdef const_char *cval = NULL + cdef const char *cval = NULL prefix = str2bytes(prefix, &cval) CHKERR( MFNAppendOptionsPrefix(self.mfn, cval) ) diff --git a/src/binding/slepc4py/src/slepc4py/SLEPc/NEP.pyx b/src/binding/slepc4py/src/slepc4py/SLEPc/NEP.pyx index 14790770a..9e30d9c84 100644 --- a/src/binding/slepc4py/src/slepc4py/SLEPc/NEP.pyx +++ b/src/binding/slepc4py/src/slepc4py/SLEPc/NEP.pyx @@ -254,7 +254,7 @@ cdef class NEP(Object): prefix: string The prefix string set for this NEP object. """ - cdef const_char *prefix = NULL + cdef const char *prefix = NULL CHKERR( NEPGetOptionsPrefix(self.nep, &prefix) ) return bytes2str(prefix) @@ -268,7 +268,7 @@ cdef class NEP(Object): prefix: string The prefix string to prepend to all NEP option requests. """ - cdef const_char *cval = NULL + cdef const char *cval = NULL prefix = str2bytes(prefix, &cval) CHKERR( NEPSetOptionsPrefix(self.nep, cval) ) @@ -282,7 +282,7 @@ cdef class NEP(Object): prefix: string The prefix string to prepend to all NEP option requests. """ - cdef const_char *cval = NULL + cdef const char *cval = NULL prefix = str2bytes(prefix, &cval) CHKERR( NEPAppendOptionsPrefix(self.nep, cval) ) diff --git a/src/binding/slepc4py/src/slepc4py/SLEPc/PEP.pyx b/src/binding/slepc4py/src/slepc4py/SLEPc/PEP.pyx index d23e20568..3c0f797ee 100644 --- a/src/binding/slepc4py/src/slepc4py/SLEPc/PEP.pyx +++ b/src/binding/slepc4py/src/slepc4py/SLEPc/PEP.pyx @@ -317,7 +317,7 @@ cdef class PEP(Object): prefix: string The prefix string set for this PEP object. """ - cdef const_char *prefix = NULL + cdef const char *prefix = NULL CHKERR( PEPGetOptionsPrefix(self.pep, &prefix) ) return bytes2str(prefix) @@ -331,7 +331,7 @@ cdef class PEP(Object): prefix: string The prefix string to prepend to all PEP option requests. """ - cdef const_char *cval = NULL + cdef const char *cval = NULL prefix = str2bytes(prefix, &cval) CHKERR( PEPSetOptionsPrefix(self.pep, cval) ) @@ -345,7 +345,7 @@ cdef class PEP(Object): prefix: string The prefix string to prepend to all PEP option requests. """ - cdef const_char *cval = NULL + cdef const char *cval = NULL prefix = str2bytes(prefix, &cval) CHKERR( PEPAppendOptionsPrefix(self.pep, cval) ) diff --git a/src/binding/slepc4py/src/slepc4py/SLEPc/RG.pyx b/src/binding/slepc4py/src/slepc4py/SLEPc/RG.pyx index 380e0d8ea..84d6bb9e7 100644 --- a/src/binding/slepc4py/src/slepc4py/SLEPc/RG.pyx +++ b/src/binding/slepc4py/src/slepc4py/SLEPc/RG.pyx @@ -114,7 +114,7 @@ cdef class RG(Object): prefix name. The first character of all runtime options is AUTOMATICALLY the hyphen. """ - cdef const_char *cval = NULL + cdef const char *cval = NULL prefix = str2bytes(prefix, &cval) CHKERR( RGSetOptionsPrefix(self.rg, cval) ) @@ -128,7 +128,7 @@ cdef class RG(Object): prefix: string The prefix string set for this RG object. """ - cdef const_char *prefix = NULL + cdef const char *prefix = NULL CHKERR( RGGetOptionsPrefix(self.rg, &prefix) ) return bytes2str(prefix) diff --git a/src/binding/slepc4py/src/slepc4py/SLEPc/SLEPc.pyx b/src/binding/slepc4py/src/slepc4py/SLEPc/SLEPc.pyx index f36b93b9b..76f694f0f 100644 --- a/src/binding/slepc4py/src/slepc4py/SLEPc/SLEPc.pyx +++ b/src/binding/slepc4py/src/slepc4py/SLEPc/SLEPc.pyx @@ -31,10 +31,7 @@ from petsc4py.PETSc cimport KSP, PC # ----------------------------------------------------------------------------- -cdef extern from * nogil: - ctypedef char const_char "const char" - -cdef inline object bytes2str(const_char p[]): +cdef inline object bytes2str(const char p[]): if p == NULL: return None cdef bytes s = p @@ -43,16 +40,16 @@ cdef inline object bytes2str(const_char p[]): else: return s.decode() -cdef inline object str2bytes(object s, const_char *p[]): +cdef inline object str2bytes(object s, const char *p[]): if s is None: p[0] = NULL return None if not isinstance(s, bytes): s = s.encode() - p[0] = (s) + p[0] = (s) return s -cdef inline object S_(const_char p[]): +cdef inline object S_(const char p[]): if p == NULL: return None cdef object s = p return s if isinstance(s, str) else s.decode() @@ -61,31 +58,10 @@ include "allocate.pxi" # ----------------------------------------------------------------------------- -# Vile hack for raising a exception and not contaminating traceback - -cdef extern from * nogil: - void PyErr_SetObject(object, object) - void *PyExc_RuntimeError - -cdef object PetscError = PyExc_RuntimeError -from petsc4py.PETSc import Error as PetscError - -cdef inline PetscErrorCode SETERR(PetscErrorCode ierr) with gil: - if (PetscError) != NULL: - PyErr_SetObject(PetscError, ierr) - else: - PyErr_SetObject(PyExc_RuntimeError, ierr) - return ierr - -# ----------------------------------------------------------------------------- - cdef extern from * nogil: ctypedef long PetscInt ctypedef double PetscReal ctypedef double PetscScalar - ctypedef PetscInt const_PetscInt "const PetscInt" - ctypedef PetscReal const_PetscReal "const PetscReal" - ctypedef PetscScalar const_PetscScalar "const PetscScalar" cdef inline object toBool(PetscBool value): return True if value else False @@ -195,7 +171,7 @@ include "CAPI.pyx" # ----------------------------------------------------------------------------- cdef extern from "Python.h": - int Py_AtExit(void (*)()) + int Py_AtExit(void (*)() noexcept nogil) void PySys_WriteStderr(char*,...) cdef extern from "" nogil: @@ -230,7 +206,7 @@ cdef extern from * nogil: PetscClassId SLEPC_NEP_CLASSID "NEP_CLASSID" PetscClassId SLEPC_MFN_CLASSID "MFN_CLASSID" -cdef PetscErrorCode register(char path[]) except PETSC_ERR_PYTHON: +cdef PetscErrorCode register() except PETSC_ERR_PYTHON: # make sure all SLEPc packages are initialized CHKERR( SlepcInitializePackageAll() ) # register Python types @@ -246,7 +222,7 @@ cdef PetscErrorCode register(char path[]) except PETSC_ERR_PYTHON: PyPetscType_Register(SLEPC_MFN_CLASSID, MFN) return PETSC_SUCCESS -cdef void finalize() nogil: +cdef void finalize() noexcept nogil: cdef PetscErrorCode ierr = PETSC_SUCCESS # manage SLEPc finalization if not (SlepcInitializeCalled): return @@ -262,7 +238,7 @@ cdef void finalize() nogil: def _initialize(args=None): cdef int ready = initialize(args) - if ready: register(NULL) + if ready: register() def _finalize(): finalize() diff --git a/src/binding/slepc4py/src/slepc4py/SLEPc/ST.pyx b/src/binding/slepc4py/src/slepc4py/SLEPc/ST.pyx index 056145ab5..013b05f60 100644 --- a/src/binding/slepc4py/src/slepc4py/SLEPc/ST.pyx +++ b/src/binding/slepc4py/src/slepc4py/SLEPc/ST.pyx @@ -141,7 +141,7 @@ cdef class ST(Object): prefix name. The first character of all runtime options is AUTOMATICALLY the hyphen. """ - cdef const_char *cval = NULL + cdef const char *cval = NULL prefix = str2bytes(prefix, &cval) CHKERR( STSetOptionsPrefix(self.st, cval) ) @@ -155,7 +155,7 @@ cdef class ST(Object): prefix: string The prefix string set for this ST object. """ - cdef const_char *prefix = NULL + cdef const char *prefix = NULL CHKERR( STGetOptionsPrefix(self.st, &prefix) ) return bytes2str(prefix) diff --git a/src/binding/slepc4py/src/slepc4py/SLEPc/SVD.pyx b/src/binding/slepc4py/src/slepc4py/SLEPc/SVD.pyx index 6aea96ef9..2d5291aeb 100644 --- a/src/binding/slepc4py/src/slepc4py/SLEPc/SVD.pyx +++ b/src/binding/slepc4py/src/slepc4py/SLEPc/SVD.pyx @@ -233,7 +233,7 @@ cdef class SVD(Object): prefix: string The prefix string set for this SVD object. """ - cdef const_char *prefix = NULL + cdef const char *prefix = NULL CHKERR( SVDGetOptionsPrefix(self.svd, &prefix) ) return bytes2str(prefix) @@ -260,7 +260,7 @@ cdef class SVD(Object): S1.setOptionsPrefix("svd1_") S2.setOptionsPrefix("svd2_") """ - cdef const_char *cval = NULL + cdef const char *cval = NULL prefix = str2bytes(prefix, &cval) CHKERR( SVDSetOptionsPrefix(self.svd, cval) ) @@ -274,7 +274,7 @@ cdef class SVD(Object): prefix: string The prefix string to prepend to all SVD option requests. """ - cdef const_char *cval = NULL + cdef const char *cval = NULL prefix = str2bytes(prefix, &cval) CHKERR( SVDAppendOptionsPrefix(self.svd, cval) ) diff --git a/src/binding/slepc4py/src/slepc4py/SLEPc/slepcsys.pxi b/src/binding/slepc4py/src/slepc4py/SLEPc/slepcsys.pxi index cfa45c950..b2686337f 100644 --- a/src/binding/slepc4py/src/slepc4py/SLEPc/slepcsys.pxi +++ b/src/binding/slepc4py/src/slepc4py/SLEPc/slepcsys.pxi @@ -44,7 +44,7 @@ cdef extern from * nogil: PetscErrorCode MatGetLocalSize(PetscMat,PetscInt*,PetscInt*) cdef extern from * nogil: - const_char SLEPC_AUTHOR_INFO[] + const char SLEPC_AUTHOR_INFO[] PetscErrorCode SlepcGetVersion(char[],size_t) PetscErrorCode SlepcGetVersionNumber(PetscInt*,PetscInt*,PetscInt*,PetscInt*) diff --git a/src/binding/slepc4py/test/runtests.py b/src/binding/slepc4py/test/runtests.py index beb4a00ef..ab6a1f48a 100644 --- a/src/binding/slepc4py/test/runtests.py +++ b/src/binding/slepc4py/test/runtests.py @@ -143,7 +143,6 @@ def writeln(self, message=''): def import_package(options, pkgname): args = [sys.argv[0]] if options.memdebug: - args.append('-malloc') args.append('-malloc_debug') args.append('-malloc_dump') if options.summary: From 7d3b23cd8dcd7342d1b519bc9000f718d389dc39 Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Sun, 23 Jul 2023 18:44:21 +0300 Subject: [PATCH 062/112] Silence Clang warnings in Cython-generated C code --- src/binding/slepc4py/src/slepc4py/SLEPc/SLEPc.pyx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/binding/slepc4py/src/slepc4py/SLEPc/SLEPc.pyx b/src/binding/slepc4py/src/slepc4py/SLEPc/SLEPc.pyx index 76f694f0f..b5d3ac055 100644 --- a/src/binding/slepc4py/src/slepc4py/SLEPc/SLEPc.pyx +++ b/src/binding/slepc4py/src/slepc4py/SLEPc/SLEPc.pyx @@ -4,6 +4,17 @@ cdef extern from * nogil: """ #include "lib-slepc/compat.h" #include "lib-slepc/custom.h" + + /* Silence Clang warnings in Cython-generated C code */ + #if defined(__clang__) + #pragma clang diagnostic ignored "-Wextra-semi-stmt" + #pragma clang diagnostic ignored "-Wparentheses-equality" + #pragma clang diagnostic ignored "-Wunreachable-code-fallthrough" + #pragma clang diagnostic ignored "-Woverlength-strings" + #elif defined(__GNUC__) || defined(__GNUG__) + #pragma GCC diagnostic ignored "-Wstrict-aliasing" + #pragma GCC diagnostic ignored "-Wtype-limits" + #endif """ # ----------------------------------------------------------------------------- From 4d604e138a30da234a7a6b63991e2c5e7d9b3a9b Mon Sep 17 00:00:00 2001 From: Pierre Jolivet Date: Sun, 23 Jul 2023 21:49:04 +0200 Subject: [PATCH 063/112] configure: update HPDDM with new MatFilter() API --- config/packages/hpddm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/packages/hpddm.py b/config/packages/hpddm.py index f7852bdaa..f7d9aeb37 100644 --- a/config/packages/hpddm.py +++ b/config/packages/hpddm.py @@ -17,7 +17,7 @@ def __init__(self,argdb,log): package.Package.__init__(self,argdb,log) self.packagename = 'hpddm' self.downloadable = True - self.gitcommit = '52d9ca16756f3a13b088cd385d514acc459930af' + self.gitcommit = '9e5946e9a14082d76bb9982ac38aba78479dcb5d' # self.version = '2.2.3' obj = self.version if hasattr(self,'version') else self.gitcommit self.url = 'https://github.com/hpddm/hpddm/archive/'+('v'+obj if hasattr(self,'version') else obj)+'.tar.gz' From 6bac746a24be61c840b034b81eb47af1b71f4939 Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Mon, 17 Apr 2023 19:25:27 +0200 Subject: [PATCH 064/112] CI: do not upgrade pip to version 23.1 --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 606509c89..d4fc85cd0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -447,7 +447,7 @@ pip-install: if [ $(awk '/define SLEPC_VERSION_RELEASE/{print $3}' include/slepcversion.h) == 1 ]; then pip install --user .; pip install --user src/binding/slepc4py; - make -C src/binding/slepc4py/demo run_ex1; # run only one test until pip-petsc4py is patched + make -C src/binding/slepc4py/demo; else slepc=$PWD; cd ..; @@ -462,7 +462,7 @@ pip-install: python -m venv /tmp/env; source /tmp/env/bin/activate; set -x; - pip install -U pip; + python -m pip install -U pip==23.0.1 # pin version due to issue with pip 23.1 pip install numpy; pip install $petsc; pip install $petsc/src/binding/petsc4py; From 62f9415c3cd8e779af12dc45ba1e8011a79aeb1c Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Mon, 24 Apr 2023 09:03:59 +0200 Subject: [PATCH 065/112] python: update setup.py to be more similar to PETSc's --- setup.py | 39 ++++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/setup.py b/setup.py index 35ae9c9a2..c94ad8b85 100644 --- a/setup.py +++ b/setup.py @@ -16,9 +16,19 @@ To install ``PETSc``, ``SLEPc``, ``petsc4py``, and ``slepc4py`` (``mpi4py`` is optional but highly recommended) use:: - $ pip install numpy mpi4py - $ pip install petsc petsc4py - $ pip install slepc slepc4py + $ python -m pip install numpy mpi4py (or pip install numpy mpi4py) + $ python -m pip install petsc petsc4py (or pip install petsc petsc4py) + $ python -m pip install slepc slepc4py (or pip install slepc slepc4py) + +.. tip:: + + You can also install the in-development versions with:: + + $ python -m pip install Cython numpy mpi4py + $ python -m pip install --no-deps https://gitlab.com/petsc/petsc/-/archive/main/petsc-main.tar.gz + $ python -m pip install --no-deps https://gitlab.com/slepc/slepc/-/archive/main/slepc-main.tar.gz + + Provide any ``SLEPc`` ./configure options using the environmental variable ``SLEPC_CONFIGURE_OPTIONS``. """ @@ -51,34 +61,33 @@ def get_config(): CONFIGURE_OPTIONS = [] def bootstrap(): - from os.path import join, isdir, abspath # Set SLEPC_DIR - SLEPC_DIR = abspath(os.getcwd()) + SLEPC_DIR = os.path.abspath(os.getcwd()) os.environ['SLEPC_DIR'] = SLEPC_DIR # Check PETSC_DIR/PETSC_ARCH PETSC_DIR = os.environ.get('PETSC_DIR', "") PETSC_ARCH = os.environ.get('PETSC_ARCH', "") - if not (PETSC_DIR and isdir(PETSC_DIR)): + if not (PETSC_DIR and os.path.isdir(PETSC_DIR)): PETSC_DIR = None try: del os.environ['PETSC_DIR'] except KeyError: pass PETSC_ARCH = None try: del os.environ['PETSC_ARCH'] except KeyError: pass - elif not (PETSC_ARCH and isdir(join(PETSC_DIR, PETSC_ARCH))): + elif not (PETSC_ARCH and os.path.isdir(os.path.join(PETSC_DIR, PETSC_ARCH))): PETSC_ARCH = None try: del os.environ['PETSC_ARCH'] except KeyError: pass # Generate package __init__.py file from distutils.dir_util import mkpath - pkgdir = os.path.join(SLEPC_DIR, 'pypi') - pkgfile = os.path.join(pkgdir, '__init__.py') + pkgdir = os.path.join('config', 'pypi') if not os.path.exists(pkgdir): mkpath(pkgdir) - fh = open(pkgfile, 'wt') + pkgfile = os.path.join(pkgdir, '__init__.py') + fh = open(pkgfile, 'w') fh.write(init_py) fh.close() # Configure options - options = os.environ.get('PETSC_CONFIGURE_OPTIONS', '') + options = os.environ.get('SLEPC_CONFIGURE_OPTIONS', '') CONFIGURE_OPTIONS.extend(split_quoted(options)) # if not PETSC_DIR: @@ -116,8 +125,9 @@ def config(prefix, dry_run=False): # Run SLEPc configure if dry_run: return os.environ['PETSC_DIR'] = get_petsc_dir() + os.environ['PETSC_ARCH'] = get_petsc_arch() python = sys.executable - command = [python, './configure', '--prefix='+prefix] + command = [python, './configure'] + options status = os.system(" ".join(command)) if status != 0: raise RuntimeError(status) @@ -174,7 +184,6 @@ def run(self): root_dir = os.path.abspath(self.install_lib) prefix = os.path.join(root_dir, 'slepc') # - # ctx = context().enter() try: config(prefix, self.dry_run) @@ -246,7 +255,7 @@ def tarball(): description=description.pop(0), long_description='\n'.join(description), classifiers= classifiers.split('\n')[1:-1], - keywords = ['SLEPc','PETSc', 'MPI'], + keywords = ['SLEPc', 'PETSc', 'MPI'], platforms=['POSIX'], license='BSD', @@ -259,6 +268,6 @@ def tarball(): maintainer_email='dalcinl@gmail.com', packages = ['slepc'], - package_dir = {'slepc': 'pypi'}, + package_dir = {'slepc': 'config/pypi'}, cmdclass={'install': cmd_install}, **metadata) From 0137e6b999497d437a20455d0c63a98f6d5780d6 Mon Sep 17 00:00:00 2001 From: Satish Balay Date: Mon, 24 Jul 2023 20:26:00 -0500 Subject: [PATCH 066/112] build: fix 'make -j4 all' with make-4.3 gmake[3]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule. --- makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makefile b/makefile index ed323d181..22f5535d2 100644 --- a/makefile +++ b/makefile @@ -223,7 +223,7 @@ getincludedirs_slepc: -@${OMAKE} -f gmakefile gmakegetincludedirs_slepc info: - -@${OMAKE} -f gmakefile gmakeinfo + +@${OMAKE} -f gmakefile gmakeinfo check_usermakefile: -@echo "Testing compile with user makefile" From 3616d0d034fa6e718e2b66ab0a5ad8d77be3f980 Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Thu, 27 Jul 2023 08:48:57 +0200 Subject: [PATCH 067/112] makefile: delete -Xcompiler -fvisibility=hidden from Kokkos flags --- gmakefile.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gmakefile.test b/gmakefile.test index 32e4c09af..406f8f25f 100644 --- a/gmakefile.test +++ b/gmakefile.test @@ -158,7 +158,7 @@ endif # # The solution is not ideal in the sense we have to duplicate the same workaround to any external libraries # using C++17 inline static variables. We have to wait for GNU to clarify this issue. -PETSC_COMPILE.kokkos.cxx = $(filter-out -fvisibility=hidden,$(KOKKOS_COMPILE)) +PETSC_COMPILE.kokkos.cxx = $(filter-out -fvisibility=hidden,$(subst -Xcompiler -fvisibility=hidden ,,$(strip $(KOKKOS_COMPILE)))) ifneq ($(RAJA_USE_CUDA_COMPILER),) PETSC_COMPILE.raja.cxx = ${CUDAC} $(MPICXX_INCLUDES) ${CUDAC_FLAGS} -x cu -Xcudafe "--display_error_number" -c --compiler-options="${PETSC_CXXCPPFLAGS} ${PETSC_CC_INCLUDES} ${CUDA_CXXFLAGS}" --expt-extended-lambda --expt-relaxed-constexpr From a50fcb8b86f299799d0e15d7c7c5311a37671a4a Mon Sep 17 00:00:00 2001 From: Pierre Jolivet Date: Thu, 27 Jul 2023 16:04:14 +0200 Subject: [PATCH 068/112] SlepcCitationsInitialize(): fix typo Reported-by: @jeremyonscale Fix #76 --- src/sys/slepcinit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sys/slepcinit.c b/src/sys/slepcinit.c index 7d277dcef..51afff962 100644 --- a/src/sys/slepcinit.c +++ b/src/sys/slepcinit.c @@ -218,7 +218,7 @@ PetscErrorCode SlepcCitationsInitialize(void) " volume = \"31\",\n" " number = \"3\",\n" " pages = \"351--362\",\n" - " year = \"2005,\"\n" + " year = \"2005\",\n" " doi = \"https://doi.org/10.1145/1089014.1089019\"\n" "}\n",NULL)); PetscCall(PetscCitationsRegister("@TechReport{slepc-manual,\n" From 42e8c39a90a22ffe7c95f548aeb68e8c656981f9 Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Fri, 28 Jul 2023 12:54:13 +0200 Subject: [PATCH 069/112] Fix compilation of FEAST interface with 64-bit ints --- src/eps/impls/external/feast/feast.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/eps/impls/external/feast/feast.c b/src/eps/impls/external/feast/feast.c index 3af32e9af..acae47d28 100644 --- a/src/eps/impls/external/feast/feast.c +++ b/src/eps/impls/external/feast/feast.c @@ -123,7 +123,7 @@ PetscErrorCode EPSSolve_FEAST(EPS eps) FEAST_RCI(&ijob,&n,&Ze,SCALAR_CAST ctx->work1,ctx->work2,SCALAR_CAST ctx->Aq,SCALAR_CAST ctx->Bq,fpm,&epsout,&loop,&eps->inta,&eps->intb,&ncv,evals,SCALAR_CAST pV,&nconv,eps->errest,&info); - PetscCheck(ncv==eps->ncv,PetscObjectComm((PetscObject)eps),PETSC_ERR_LIB,"FEAST changed value of ncv to %d",ncv); + PetscCheck(ncv==eps->ncv,PetscObjectComm((PetscObject)eps),PETSC_ERR_LIB,"FEAST changed value of ncv to %d",(int)ncv); if (ijob == 10) { /* set new quadrature point */ PetscCall(STSetShift(eps->st,Ze.real)); @@ -167,7 +167,7 @@ PetscErrorCode EPSSolve_FEAST(EPS eps) PetscCall(VecResetArray(x)); PetscCall(VecResetArray(y)); } - } else PetscCheck(ijob==0 || ijob==-2,PetscObjectComm((PetscObject)eps),PETSC_ERR_LIB,"Internal error in FEAST reverse communication interface (ijob=%d)",ijob); + } else PetscCheck(ijob==0 || ijob==-2,PetscObjectComm((PetscObject)eps),PETSC_ERR_LIB,"Internal error in FEAST reverse communication interface (ijob=%d)",(int)ijob); } while (ijob); @@ -183,7 +183,7 @@ PetscErrorCode EPSSolve_FEAST(EPS eps) eps->reason = EPS_DIVERGED_ITS; break; default: - SETERRQ(PetscObjectComm((PetscObject)eps),PETSC_ERR_LIB,"Error reported by FEAST (%d)",info); + SETERRQ(PetscObjectComm((PetscObject)eps),PETSC_ERR_LIB,"Error reported by FEAST (%d)",(int)info); } } From 03a9ae0b439cd047766f84010ac889da6d7d0f20 Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Thu, 20 Jul 2023 12:25:29 +0200 Subject: [PATCH 070/112] CI: workaround 'misaligned address' error in CUDA jobs Enables jobs that were disabled in cb05ade3557fc6f3554bc7db65fb4e57abb2a80a This change does not fix the issue, it just modifies some tests so that the problem does not appear. The correct fix will come later, either by ensuring aligment during memory allocation in BVSVEC or by implementing BVMAT for CUDA --- .gitlab-ci.yml | 8 -------- src/eps/tests/makefile | 4 ++-- src/eps/tests/output/test10_1_ks_cuda.out | 7 +++++++ src/eps/tests/test13.c | 5 ++++- src/eps/tutorials/ex41.c | 3 ++- src/mfn/tests/output/test2_1.out | 4 ++-- src/mfn/tests/test2.c | 2 +- src/svd/tests/output/test3_1.out | 4 ++-- src/svd/tests/test3.c | 15 ++++++++------- src/svd/tutorials/cnetwork/embedgsvd.c | 2 +- src/svd/tutorials/ex52.c | 4 ++-- src/sys/classes/bv/tests/output/test7_1.out | 2 +- src/sys/classes/bv/tests/output/test7_2.out | 2 +- src/sys/classes/bv/tests/test7.c | 3 ++- 14 files changed, 35 insertions(+), 30 deletions(-) create mode 100644 src/eps/tests/output/test10_1_ks_cuda.out diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d4fc85cd0..9a0f69c5e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -370,7 +370,6 @@ gnu-c-cuda: variables: LOAD_MODULES: mpi PETSC_CONFIG_OPTS: --with-fortran-bindings=0 --with-cuda --download-mumps --download-scalapack --download-metis --download-parmetis --download-suitesparse --with-magma-dir=/usr/local/opt/magma-2.7.1 - DISABLE_TESTS: 1 clang-c: extends: @@ -487,7 +486,6 @@ gnu-c-cuda-complex: LOAD_MODULES: mpi PETSC_CONFIG_OPTS: --with-scalar-type=complex --with-cuda --with-magma-dir=/usr/local/opt/magma-2.7.1 TEST_OPTS: -j1 -l6 query=requires queryval=cuda - DISABLE_TESTS: 1 gnu-c-cuda-single: extends: @@ -499,7 +497,6 @@ gnu-c-cuda-single: LOAD_MODULES: mpi PETSC_CONFIG_OPTS: --with-precision=single --with-single-library=0 --with-cuda TEST_OPTS: -j1 -l6 query=requires queryval=cuda - DISABLE_TESTS: 1 gnu-c-multilib: extends: @@ -640,7 +637,6 @@ gnu-c-complex-coverage: PETSC_CONFIG_OPTS: --with-fortran-bindings=0 --with-scalar-type=complex --with-debugging=1 --with-coverage=1 SLEPC_CONFIG_OPTS: --DATAFILESPATH=/var/local --with-packages-download-dir=/var/local/downloads --with-arpack-dir=/usr/local/opt/arpack-ng-3.9.0 --with-primme-dir=/usr/local/opt/primme-3.2 --download-blopex --download-hpddm COVERAGE: 1 - DISABLE_TESTS: 1 intel-c-complex-int64-mkl: extends: @@ -664,7 +660,6 @@ nvidia-c-nompi: PETSC_CONFIG_OPTS: --with-cc=nvc --with-fc=nvfortran --with-cxx=nvc++ --with-mpi=0 --with-cuda --with-magma-dir=/usr/local/opt/magma-2.7.1 SLEPC_CONFIG_OPTS: --DATAFILESPATH=/var/local --with-packages-download-dir=/var/local/downloads --download-blopex --download-primme=/var/local/downloads/primme-3.2.tar.gz --download-arpack TEST_OPTS: -j4 -l12 - DISABLE_TESTS: 1 gnu-c-complex-valgrind: extends: @@ -698,7 +693,6 @@ nvidia-c-complex-nompi: PETSC_CONFIG_OPTS: --with-cc=nvc --with-fc=nvfortran --with-cxx=nvc++ --with-scalar-type=complex --with-mpi=0 --with-cuda --with-magma-dir=/usr/local/opt/magma-2.7.1 SLEPC_CONFIG_OPTS: --DATAFILESPATH=/var/local --with-packages-download-dir=/var/local/downloads --download-blopex --download-primme --download-arpack TEST_OPTS: -j4 -l12 - DISABLE_TESTS: 1 nvidia-cxx-mpi: extends: @@ -711,7 +705,6 @@ nvidia-cxx-mpi: PETSC_CONFIG_OPTS: --with-cc=mpicc --with-fc=mpifort --with-cxx=mpicxx --with-clanguage=c++ --with-cuda --with-magma-dir=/usr/local/opt/magma-2.7.1-nvidia SLEPC_CONFIG_OPTS: --DATAFILESPATH=/var/local --with-packages-download-dir=/var/local/downloads --download-blopex --download-primme --download-arpack TEST_OPTS: -j4 -l12 - DISABLE_TESTS: 1 intel-c-mkl-install: extends: @@ -756,7 +749,6 @@ gnu-c-cuda-int64: PETSC_CONFIG_OPTS: --with-cuda --with-64-bit-indices --with-magma-dir=/usr/local/opt/magma-2.7.1 TEST_OPTS: -j2 -l6 query=requires queryval=cuda MAKE_CUDAFLAGS: --compiler-options -Wall,-Wunused-parameter,-Wno-deprecated-declarations,-Werror - DISABLE_TESTS: 1 gnu-c-nocxx: extends: diff --git a/src/eps/tests/makefile b/src/eps/tests/makefile index 4193fa0e0..2b6371fca 100644 --- a/src/eps/tests/makefile +++ b/src/eps/tests/makefile @@ -67,8 +67,8 @@ testtest10_mpi: test10.PETSc ${RM} $${test}.tmp testtest10_cuda: test10.PETSc - @test=test10_1; check=test10_1_ks; \ - options="-eps_nev 4 -eps_ncv 14 -m 11 -eps_largest_magnitude -mat_type aijcusparse"; \ + @test=test10_1; check=test10_1_ks_cuda; \ + options="-eps_nev 4 -eps_ncv 14 -m 12 -eps_largest_magnitude -mat_type aijcusparse"; \ ${MPIEXEC} -n 1 ./test10 $${options} | ${SED} -e 's/30055/30054/' > $${test}.tmp 2>&1; \ if (${DIFF} output/$${check}.out $${test}.tmp > /dev/null 2>&1) then \ echo "C/C++ example src/eps/tests/test10 run successfully with CUDA"; \ diff --git a/src/eps/tests/output/test10_1_ks_cuda.out b/src/eps/tests/output/test10_1_ks_cuda.out new file mode 100644 index 000000000..90af27550 --- /dev/null +++ b/src/eps/tests/output/test10_1_ks_cuda.out @@ -0,0 +1,7 @@ + +Fiedler vector of a 2-D regular mesh, N=120 (10x12 grid) + + Number of requested eigenvalues: 4 + All requested eigenvalues computed up to the required tolerance: + 7.83396, 7.63416, 7.54989, 7.35008 + diff --git a/src/eps/tests/test13.c b/src/eps/tests/test13.c index c7c50f9d0..d401d3233 100644 --- a/src/eps/tests/test13.c +++ b/src/eps/tests/test13.c @@ -100,7 +100,10 @@ int main(int argc,char **argv) filter: sed -e "s/-1.98975/-1.98974/" test: suffix: 1 - args: -eps_type {{krylovschur gd jd}} + args: -eps_type {{krylovschur gd}} + test: + suffix: 1_jd + args: -eps_type jd -st_ksp_type gmres test: suffix: 1_gd2 args: -eps_type gd -eps_gd_double_expansion diff --git a/src/eps/tutorials/ex41.c b/src/eps/tutorials/ex41.c index 229fbb3e5..dfd3f2c06 100644 --- a/src/eps/tutorials/ex41.c +++ b/src/eps/tutorials/ex41.c @@ -283,6 +283,7 @@ PetscErrorCode ComputeResidualNorm(Mat A,PetscBool trans,PetscScalar kr,PetscSca args: -eps_type {{power krylovschur}} test: suffix: 1_balance - args: -eps_balance {{oneside twoside}} -eps_ncv 18 -eps_krylovschur_locking 0 + args: -eps_balance {{oneside twoside}} -eps_ncv 17 -eps_krylovschur_locking 0 + requires: !__float128 TEST*/ diff --git a/src/mfn/tests/output/test2_1.out b/src/mfn/tests/output/test2_1.out index c04db3a7e..569efc950 100644 --- a/src/mfn/tests/output/test2_1.out +++ b/src/mfn/tests/output/test2_1.out @@ -1,7 +1,7 @@ -Matrix exponential y=exp(t*A)*e, of the 2-D Laplacian, N=625 (25x25 grid) +Matrix exponential y=exp(t*A)*e, of the 2-D Laplacian, N=676 (26x26 grid) - Computed vector at time t=0.3 has norm 26.7835 + Computed vector at time t=0.3 has norm 27.7835 The norm of the difference is <100*eps diff --git a/src/mfn/tests/test2.c b/src/mfn/tests/test2.c index 222250e0d..9c21e7ee9 100644 --- a/src/mfn/tests/test2.c +++ b/src/mfn/tests/test2.c @@ -115,7 +115,7 @@ int main(int argc,char **argv) /*TEST testset: - args: -mfn_type {{krylov expokit}} + args: -n 26 -mfn_type {{krylov expokit}} output_file: output/test2_1.out test: suffix: 1 diff --git a/src/svd/tests/output/test3_1.out b/src/svd/tests/output/test3_1.out index aa15831e5..631ff0e92 100644 --- a/src/svd/tests/output/test3_1.out +++ b/src/svd/tests/output/test3_1.out @@ -1,7 +1,7 @@ -SVD of a rectangular Grcar matrix, 35x30 +SVD of a rectangular Grcar matrix, 36x32 All requested singular values computed up to the required tolerance: - 3.22175, 3.21797, 3.16825, 3.15128 + 3.22288, 3.22201, 3.17060, 3.16776 Level of orthogonality below the tolerance diff --git a/src/svd/tests/test3.c b/src/svd/tests/test3.c index 835b317e3..1ddbbab0a 100644 --- a/src/svd/tests/test3.c +++ b/src/svd/tests/test3.c @@ -34,7 +34,7 @@ int main(int argc,char **argv) SVD svd; /* singular value solver context */ Vec v0,w0; /* initial vectors */ Vec *U,*V; - PetscInt N=35,M=30,Istart,Iend,i,col[5],nconv; + PetscInt N=36,M=32,Istart,Iend,i,col[5],nconv; PetscScalar value[] = { -1, 1, 1, 1, 1 }; PetscReal lev1=0.0,lev2=0.0,tol=PETSC_SMALL; PetscBool skiporth=PETSC_FALSE; @@ -121,13 +121,13 @@ int main(int argc,char **argv) testset: args: -svd_nsv 4 output_file: output/test3_1.out - filter: sed -e "s/22176/22175/" | sed -e "s/21798/21797/" | sed -e "s/16826/16825/" | sed -e "s/15129/15128/" + filter: sed -e "s/22176/22175/" | sed -e "s/21798/21797/" | sed -e "s/16826/16825/" | sed -e "s/15129/15128/" | sed -e "s/22200/22201/" | sed -e "s/22289/22288/" | sed -e "s/17059/17060/" test: suffix: 1_lanczos - args: -svd_type lanczos + args: -svd_type lanczos -svd_ncv 16 test: suffix: 1_lanczos_one - args: -svd_type lanczos -svd_lanczos_oneside + args: -svd_type lanczos -svd_lanczos_oneside -svd_ncv 16 test: suffix: 1_trlanczos args: -svd_type trlanczos -svd_trlanczos_locking {{0 1}} @@ -168,7 +168,7 @@ int main(int argc,char **argv) testset: args: -svd_implicittranspose -svd_nsv 4 -svd_tol 1e-5 output_file: output/test3_1.out - filter: sed -e "s/22176/22175/" | sed -e "s/21798/21797/" | sed -e "s/16826/16825/" | sed -e "s/15129/15128/" + filter: sed -e "s/22176/22175/" | sed -e "s/21798/21797/" | sed -e "s/16826/16825/" | sed -e "s/15129/15128/" | sed -e "s/22200/22201/" | sed -e "s/22289/22288/" | sed -e "s/17059/17060/" test: suffix: 2_lanczos args: -svd_type lanczos -svd_conv_norm @@ -209,7 +209,7 @@ int main(int argc,char **argv) args: -svd_nsv 4 -mat_type aijcusparse requires: cuda output_file: output/test3_1.out - filter: sed -e "s/22176/22175/" | sed -e "s/21798/21797/" | sed -e "s/16826/16825/" | sed -e "s/15129/15128/" + filter: sed -e "s/22176/22175/" | sed -e "s/21798/21797/" | sed -e "s/16826/16825/" | sed -e "s/15129/15128/" | sed -e "s/22200/22201/" | sed -e "s/22289/22288/" | sed -e "s/17059/17060/" test: suffix: 3_cuda_lanczos args: -svd_type lanczos @@ -245,7 +245,7 @@ int main(int argc,char **argv) suffix: 4 args: -svd_type lapack -svd_nsv 4 output_file: output/test3_1.out - filter: sed -e "s/15129/15128/" + filter: sed -e "s/15129/15128/" | sed -e "s/22200/22201/" | sed -e "s/22289/22288/" | sed -e "s/17059/17060/" nsize: 2 test: @@ -253,5 +253,6 @@ int main(int argc,char **argv) args: -svd_nsv 4 -svd_view_values draw -svd_monitor draw::draw_lg requires: x output_file: output/test3_1.out + filter: sed -e "s/22200/22201/" | sed -e "s/22289/22288/" | sed -e "s/17059/17060/" TEST*/ diff --git a/src/svd/tutorials/cnetwork/embedgsvd.c b/src/svd/tutorials/cnetwork/embedgsvd.c index 7445ca0ed..3d2e65742 100644 --- a/src/svd/tutorials/cnetwork/embedgsvd.c +++ b/src/svd/tutorials/cnetwork/embedgsvd.c @@ -138,6 +138,6 @@ int main(int argc,char **argv) test: args: -graph ${SLEPC_DIR}/share/slepc/datafiles/graphs/out.moreno_taro_taro -svd_nsv 4 -terse - filter: sed -e 's/4.38031/4.38032/' + filter: sed -e 's/4.38031/4.38032/' | sed -e 's/3.75089/3.7509/' | sed -e 's/3.00071/3.00072/' TEST*/ diff --git a/src/svd/tutorials/ex52.c b/src/svd/tutorials/ex52.c index d47916196..58a25471f 100644 --- a/src/svd/tutorials/ex52.c +++ b/src/svd/tutorials/ex52.c @@ -175,7 +175,7 @@ int main(int argc,char **argv) args: -svd_type cross -svd_cross_explicitmatrix {{0 1}} -svd_implicittranspose {{0 1}} -svd_ncv 100 suffix: 2_cross test: - args: -svd_type cyclic -svd_cyclic_explicitmatrix {{0 1}} + args: -svd_type cyclic -svd_cyclic_explicitmatrix {{0 1}} -svd_ncv 25 suffix: 2_cyclic test: args: -svd_type trlanczos -svd_trlanczos_explicitmatrix {{0 1}} -svd_implicittranspose {{0 1}} @@ -190,7 +190,7 @@ int main(int argc,char **argv) args: -svd_type cross -svd_cross_explicitmatrix {{0 1}} suffix: 3_cross test: - args: -svd_type cyclic -svd_cyclic_explicitmatrix {{0 1}} -svd_cyclic_bv_definite_tol 1e-13 -svd_cyclic_st_ksp_type gmres -svd_cyclic_st_pc_type jacobi + args: -svd_type cyclic -svd_cyclic_explicitmatrix {{0 1}} -svd_cyclic_bv_definite_tol 1e-13 -svd_cyclic_st_ksp_type gmres -svd_cyclic_st_pc_type jacobi -svd_ncv 250 suffix: 3_cyclic test: args: -svd_type trlanczos -svd_trlanczos_explicitmatrix {{0 1}} -bv_definite_tol 1e-13 diff --git a/src/sys/classes/bv/tests/output/test7_1.out b/src/sys/classes/bv/tests/output/test7_1.out index 4da65bb3c..b63050eea 100644 --- a/src/sys/classes/bv/tests/output/test7_1.out +++ b/src/sys/classes/bv/tests/output/test7_1.out @@ -1,3 +1,3 @@ -Test BVMatMult (m=10, n=10, k=5). +Test BVMatMult (m=12, n=12, k=5). Norm of error: 0. Norm of error: 0. diff --git a/src/sys/classes/bv/tests/output/test7_2.out b/src/sys/classes/bv/tests/output/test7_2.out index bf88bc692..cd7a62849 100644 --- a/src/sys/classes/bv/tests/output/test7_2.out +++ b/src/sys/classes/bv/tests/output/test7_2.out @@ -1,2 +1,2 @@ -Test BVMatMult (m=34, n=38, k=9). +Test BVMatMult (m=40, n=44, k=9). Norm of error: 0. diff --git a/src/sys/classes/bv/tests/test7.c b/src/sys/classes/bv/tests/test7.c index a86c55010..a28e8e447 100644 --- a/src/sys/classes/bv/tests/test7.c +++ b/src/sys/classes/bv/tests/test7.c @@ -195,6 +195,7 @@ int main(int argc,char **argv) testset: output_file: output/test7_1.out filter: grep -v "Using method" + args: -m 12 test: suffix: 1 args: -bv_type {{vecs contiguous svec mat}shared output} -bv_matmult vecs @@ -209,7 +210,7 @@ int main(int argc,char **argv) testset: output_file: output/test7_2.out filter: grep -v "Using method" - args: -m 34 -n 38 -k 9 + args: -m 40 -n 44 -k 9 nsize: 2 test: suffix: 2 From 35fd638b32b6ab29d58d78118b96df26abd6d9cd Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Thu, 27 Jul 2023 20:31:14 +0200 Subject: [PATCH 071/112] gitlab-ci: relocate two jobs to a different runner --- .gitlab-ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9a0f69c5e..b4e308f0a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -690,7 +690,7 @@ nvidia-c-complex-nompi: - compiler:nvidia, name:hapy variables: LOAD_MODULES: nvhpc-nompi - PETSC_CONFIG_OPTS: --with-cc=nvc --with-fc=nvfortran --with-cxx=nvc++ --with-scalar-type=complex --with-mpi=0 --with-cuda --with-magma-dir=/usr/local/opt/magma-2.7.1 + PETSC_CONFIG_OPTS: --with-cc=nvc --with-fc=nvfortran --with-cxx=nvc++ --with-scalar-type=complex --with-mpi=0 --with-cuda --with-magma-dir=/usr/local/opt/magma-2.7.1-nvidia SLEPC_CONFIG_OPTS: --DATAFILESPATH=/var/local --with-packages-download-dir=/var/local/downloads --download-blopex --download-primme --download-arpack TEST_OPTS: -j4 -l12 @@ -765,7 +765,7 @@ gnu-c-complex128: - .stage-3 - .linux_test tags: - - linux-debian, name:sejmet + - name:hapy variables: PETSC_CONFIG_OPTS: --with-scalar-type=complex --download-f2cblaslapack --with-precision=__float128 --with-clanguage=c++ SLEPC_CONFIG_OPTS: --DATAFILESPATH=/var/local @@ -775,9 +775,9 @@ intel-c-int64-nompi-mkl: - .stage-3 - .linux_test_nofflags tags: - - compiler:intel, name:igai + - compiler:intel, name:jepri variables: - LOAD_MODULES: icc mpi mkl - PETSC_CONFIG_OPTS: --with-cc=icc --with-fc=ifort --with-cxx=icpc --with-blaslapack-dir=/opt/intel/oneapi/mkl/latest --with-64-bit-indices --with-64-bit-blas-indices --with-mpi=0 + LOAD_MODULES: compiler mpi mkl + PETSC_CONFIG_OPTS: --with-cc=icx --with-fc=ifx --with-cxx=icpx --with-blaslapack-dir=/opt/intel/oneapi/mkl/latest --with-64-bit-indices --with-64-bit-blas-indices --with-mpi=0 --COPTFLAGS='-O -g -fp-model=precise' --CXXOPTFLAGS='-O -g -fp-model=precise' --FOPTFLAGS='-O -g -fp-model=precise' SLEPC_CONFIG_OPTS: --DATAFILESPATH=/var/local --with-packages-download-dir=/var/local/downloads --download-primme --download-arpack From 8fc98d4594c169fc9e87108dc74a353365b4b46a Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Wed, 2 Aug 2023 10:51:09 +0200 Subject: [PATCH 072/112] Fortran: make sure Fortran modules use required lower-level modules --- src/eps/f90-mod/slepcepsmod.F90 | 7 ++++++- src/lme/f90-mod/slepclmemod.F90 | 2 -- src/mfn/f90-mod/slepcmfnmod.F90 | 1 - src/nep/f90-mod/slepcnepmod.F90 | 7 +------ src/pep/f90-mod/slepcpepmod.F90 | 5 ----- src/svd/f90-mod/slepcsvdmod.F90 | 3 --- src/sys/classes/bv/f90-mod/slepcbvmod.F90 | 3 ++- src/sys/classes/ds/f90-mod/slepcdsmod.F90 | 1 - src/sys/classes/fn/f90-mod/slepcfnmod.F90 | 3 ++- src/sys/classes/rg/f90-mod/slepcrgmod.F90 | 3 ++- src/sys/classes/st/f90-mod/slepcstmod.F90 | 5 +++-- src/sys/f90-mod/slepcsysmod.F90 | 4 +++- 12 files changed, 19 insertions(+), 25 deletions(-) diff --git a/src/eps/f90-mod/slepcepsmod.F90 b/src/eps/f90-mod/slepcepsmod.F90 index 98092465b..7d02fff65 100644 --- a/src/eps/f90-mod/slepcepsmod.F90 +++ b/src/eps/f90-mod/slepcepsmod.F90 @@ -8,7 +8,6 @@ ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ! module slepcepsdef - use slepcsys use slepcstdef use slepcbvdef use slepcrgdef @@ -20,6 +19,12 @@ module slepcepsdef module slepceps use slepcepsdef + use slepcst + use slepcbv + use slepcrg + use slepcds + use slepclme + use petscsnes #include <../src/eps/f90-mod/slepceps.h90> interface #include <../src/eps/f90-mod/ftn-auto-interfaces/slepceps.h90> diff --git a/src/lme/f90-mod/slepclmemod.F90 b/src/lme/f90-mod/slepclmemod.F90 index 46e23c29a..e8a2bab07 100644 --- a/src/lme/f90-mod/slepclmemod.F90 +++ b/src/lme/f90-mod/slepclmemod.F90 @@ -9,14 +9,12 @@ ! module slepclmedef use slepcbvdef - use petscmatdef #include <../src/lme/f90-mod/slepclme.h> end module module slepclme use slepclmedef use slepcbv - use petscmat #include <../src/lme/f90-mod/slepclme.h90> interface #include <../src/lme/f90-mod/ftn-auto-interfaces/slepclme.h90> diff --git a/src/mfn/f90-mod/slepcmfnmod.F90 b/src/mfn/f90-mod/slepcmfnmod.F90 index d3300a6c1..bd17dc83d 100644 --- a/src/mfn/f90-mod/slepcmfnmod.F90 +++ b/src/mfn/f90-mod/slepcmfnmod.F90 @@ -8,7 +8,6 @@ ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ! module slepcmfndef - use slepcsys use slepcbvdef use slepcfndef #include <../src/mfn/f90-mod/slepcmfn.h> diff --git a/src/nep/f90-mod/slepcnepmod.F90 b/src/nep/f90-mod/slepcnepmod.F90 index 8e50ad7bc..7d0630bb1 100644 --- a/src/nep/f90-mod/slepcnepmod.F90 +++ b/src/nep/f90-mod/slepcnepmod.F90 @@ -8,13 +8,8 @@ ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ! module slepcnepdef - use slepcsys - use slepcbvdef - use slepcrgdef - use slepcdsdef - use slepcfndef - use slepcepsdef use slepcpepdef + use slepcfndef #include <../src/nep/f90-mod/slepcnep.h> end module diff --git a/src/pep/f90-mod/slepcpepmod.F90 b/src/pep/f90-mod/slepcpepmod.F90 index 762541e19..be0a3be7d 100644 --- a/src/pep/f90-mod/slepcpepmod.F90 +++ b/src/pep/f90-mod/slepcpepmod.F90 @@ -8,11 +8,6 @@ ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ! module slepcpepdef - use slepcsys - use slepcstdef - use slepcbvdef - use slepcrgdef - use slepcdsdef use slepcepsdef #include <../src/pep/f90-mod/slepcpep.h> end module diff --git a/src/svd/f90-mod/slepcsvdmod.F90 b/src/svd/f90-mod/slepcsvdmod.F90 index 6abb2ff22..cea3d7049 100644 --- a/src/svd/f90-mod/slepcsvdmod.F90 +++ b/src/svd/f90-mod/slepcsvdmod.F90 @@ -8,9 +8,6 @@ ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ! module slepcsvddef - use slepcsys - use slepcbvdef - use slepcdsdef use slepcepsdef #include <../src/svd/f90-mod/slepcsvd.h> end module diff --git a/src/sys/classes/bv/f90-mod/slepcbvmod.F90 b/src/sys/classes/bv/f90-mod/slepcbvmod.F90 index 19ea7f5f8..a120b6766 100644 --- a/src/sys/classes/bv/f90-mod/slepcbvmod.F90 +++ b/src/sys/classes/bv/f90-mod/slepcbvmod.F90 @@ -8,12 +8,13 @@ ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ! module slepcbvdef - use slepcsys + use slepcsysdef #include <../src/sys/classes/bv/f90-mod/slepcbv.h> end module module slepcbv use slepcbvdef + use slepcsys #include <../src/sys/classes/bv/f90-mod/slepcbv.h90> interface #include <../src/sys/classes/bv/f90-mod/ftn-auto-interfaces/slepcbv.h90> diff --git a/src/sys/classes/ds/f90-mod/slepcdsmod.F90 b/src/sys/classes/ds/f90-mod/slepcdsmod.F90 index 20d8fd13b..9c8f925bb 100644 --- a/src/sys/classes/ds/f90-mod/slepcdsmod.F90 +++ b/src/sys/classes/ds/f90-mod/slepcdsmod.F90 @@ -10,7 +10,6 @@ module slepcdsdef use slepcfndef use slepcrgdef - use slepcsys #include <../src/sys/classes/ds/f90-mod/slepcds.h> end module diff --git a/src/sys/classes/fn/f90-mod/slepcfnmod.F90 b/src/sys/classes/fn/f90-mod/slepcfnmod.F90 index 97cd6852f..8465830ad 100644 --- a/src/sys/classes/fn/f90-mod/slepcfnmod.F90 +++ b/src/sys/classes/fn/f90-mod/slepcfnmod.F90 @@ -8,12 +8,13 @@ ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ! module slepcfndef - use slepcsys + use slepcsysdef #include <../src/sys/classes/fn/f90-mod/slepcfn.h> end module module slepcfn use slepcfndef + use slepcsys #include <../src/sys/classes/fn/f90-mod/slepcfn.h90> interface #include <../src/sys/classes/fn/f90-mod/ftn-auto-interfaces/slepcfn.h90> diff --git a/src/sys/classes/rg/f90-mod/slepcrgmod.F90 b/src/sys/classes/rg/f90-mod/slepcrgmod.F90 index c7f8aa054..327f06924 100644 --- a/src/sys/classes/rg/f90-mod/slepcrgmod.F90 +++ b/src/sys/classes/rg/f90-mod/slepcrgmod.F90 @@ -8,12 +8,13 @@ ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ! module slepcrgdef - use slepcsys + use slepcsysdef #include <../src/sys/classes/rg/f90-mod/slepcrg.h> end module module slepcrg use slepcrgdef + use slepcsys #include <../src/sys/classes/rg/f90-mod/slepcrg.h90> interface #include <../src/sys/classes/rg/f90-mod/ftn-auto-interfaces/slepcrg.h90> diff --git a/src/sys/classes/st/f90-mod/slepcstmod.F90 b/src/sys/classes/st/f90-mod/slepcstmod.F90 index 2cd34a815..f3e78d4e5 100644 --- a/src/sys/classes/st/f90-mod/slepcstmod.F90 +++ b/src/sys/classes/st/f90-mod/slepcstmod.F90 @@ -8,14 +8,15 @@ ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ! module slepcstdef - use petscksp - use slepcsys + use petsckspdef use slepcbvdef #include <../src/sys/classes/st/f90-mod/slepcst.h> end module module slepcst use slepcstdef + use petscksp + use slepcbv #include <../src/sys/classes/st/f90-mod/slepcst.h90> interface #include <../src/sys/classes/st/f90-mod/ftn-auto-interfaces/slepcst.h90> diff --git a/src/sys/f90-mod/slepcsysmod.F90 b/src/sys/f90-mod/slepcsysmod.F90 index 3280031ea..68570f7d5 100644 --- a/src/sys/f90-mod/slepcsysmod.F90 +++ b/src/sys/f90-mod/slepcsysmod.F90 @@ -8,14 +8,16 @@ ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ! module slepcsysdef + use petscsysdef use petscmatdef - use petscsys #include <../src/sys/f90-mod/slepcsys.h> end module module slepcsys use,intrinsic :: iso_c_binding use slepcsysdef + use petscsys + use petscmat #include <../src/sys/f90-mod/slepcsys.h90> interface #include <../src/sys/f90-mod/ftn-auto-interfaces/slepcsys.h90> From 4a9c59bbd231ace41eb4668a6cb35e6dd36d552e Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Wed, 2 Aug 2023 10:59:38 +0200 Subject: [PATCH 073/112] Fortran: add a Fortran module "slepc" that includes all modules --- src/nep/f90-mod/slepcnepmod.F90 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/nep/f90-mod/slepcnepmod.F90 b/src/nep/f90-mod/slepcnepmod.F90 index 7d0630bb1..e218da42e 100644 --- a/src/nep/f90-mod/slepcnepmod.F90 +++ b/src/nep/f90-mod/slepcnepmod.F90 @@ -23,3 +23,10 @@ module slepcnep end interface end module +! The following module imports all the functionality of SLEPc and PETSc + module slepc + use slepcnep + use slepcmfn + use petsc + end module + From f633d48db66390de475ea42c52f40b70a33e56f1 Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Tue, 1 Aug 2023 20:43:11 +0200 Subject: [PATCH 074/112] Update a few examples to avoid deprecated MatDenseGetArray() --- src/sys/classes/bv/tests/test1f.F90 | 16 ++++++++-------- src/sys/classes/ds/tests/test14f.F90 | 10 +++++----- src/sys/classes/fn/tests/test7f.F | 10 +++++----- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/sys/classes/bv/tests/test1f.F90 b/src/sys/classes/bv/tests/test1f.F90 index 12c7f372f..749085362 100644 --- a/src/sys/classes/bv/tests/test1f.F90 +++ b/src/sys/classes/bv/tests/test1f.F90 @@ -29,9 +29,9 @@ program main BV X,Y; PetscMPIInt rank PetscInt i,j,n,k,l,izero,ione - PetscScalar qq(1),z(KMAX),val + PetscScalar z(KMAX),val + PetscScalar, pointer :: qq(:,:) PetscScalar one,mone,two,zero - PetscOffset iq PetscReal nrm PetscBool flg PetscErrorCode ierr @@ -108,17 +108,17 @@ program main ! ** Create Mat call MatCreateSeqDense(PETSC_COMM_SELF,k,l,PETSC_NULL_SCALAR,Q,ierr);CHKERRA(ierr) - call MatDenseGetArray(Q,qq,iq,ierr);CHKERRA(ierr) - do i=0,k-1 - do j=0,l-1 + call MatDenseGetArrayF90(Q,qq,ierr);CHKERRA(ierr) + do i=1,k + do j=1,l if (i Date: Wed, 2 Aug 2023 12:06:22 +0200 Subject: [PATCH 075/112] gitlab-ci: fix one job --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b4e308f0a..857ab1010 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -767,6 +767,7 @@ gnu-c-complex128: tags: - name:hapy variables: + LOAD_MODULES: mpi PETSC_CONFIG_OPTS: --with-scalar-type=complex --download-f2cblaslapack --with-precision=__float128 --with-clanguage=c++ SLEPC_CONFIG_OPTS: --DATAFILESPATH=/var/local From 7039cf422b8fadefe26006b22384c9e74fd819d3 Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Thu, 3 Aug 2023 10:59:31 +0200 Subject: [PATCH 076/112] Fortran: add comparison operators for SLEPc objects --- src/eps/f90-mod/slepcepsmod.F90 | 34 ++++++++++++++++++++++- src/lme/f90-mod/slepclmemod.F90 | 34 ++++++++++++++++++++++- src/mfn/f90-mod/slepcmfnmod.F90 | 34 ++++++++++++++++++++++- src/nep/f90-mod/slepcnepmod.F90 | 34 ++++++++++++++++++++++- src/pep/f90-mod/slepcpepmod.F90 | 34 ++++++++++++++++++++++- src/svd/f90-mod/slepcsvdmod.F90 | 34 ++++++++++++++++++++++- src/sys/classes/bv/f90-mod/slepcbvmod.F90 | 34 ++++++++++++++++++++++- src/sys/classes/ds/f90-mod/slepcdsmod.F90 | 34 ++++++++++++++++++++++- src/sys/classes/fn/f90-mod/slepcfnmod.F90 | 34 ++++++++++++++++++++++- src/sys/classes/rg/f90-mod/slepcrgmod.F90 | 34 ++++++++++++++++++++++- src/sys/classes/st/f90-mod/slepcstmod.F90 | 34 ++++++++++++++++++++++- 11 files changed, 363 insertions(+), 11 deletions(-) diff --git a/src/eps/f90-mod/slepcepsmod.F90 b/src/eps/f90-mod/slepcepsmod.F90 index 7d02fff65..5d059ae5e 100644 --- a/src/eps/f90-mod/slepcepsmod.F90 +++ b/src/eps/f90-mod/slepcepsmod.F90 @@ -7,7 +7,7 @@ ! SLEPc is distributed under a 2-clause BSD license (see LICENSE). ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ! - module slepcepsdef + module slepcepsdefdummy use slepcstdef use slepcbvdef use slepcrgdef @@ -17,6 +17,38 @@ module slepcepsdef #include <../src/eps/f90-mod/slepceps.h> end module + module slepcepsdef + use slepcepsdefdummy + interface operator (.ne.) + function epsnotequal(A,B) + import tEPS + logical epsnotequal + type(tEPS), intent(in) :: A,B + end function + end interface operator (.ne.) + interface operator (.eq.) + function epsequals(A,B) + import tEPS + logical epsequals + type(tEPS), intent(in) :: A,B + end function + end interface operator (.eq.) + end module + + function epsnotequal(A,B) + use slepcepsdefdummy, only: tEPS + logical epsnotequal + type(tEPS), intent(in) :: A,B + epsnotequal = (A%v .ne. B%v) + end function + + function epsequals(A,B) + use slepcepsdefdummy, only: tEPS + logical epsequals + type(tEPS), intent(in) :: A,B + epsequals = (A%v .eq. B%v) + end function + module slepceps use slepcepsdef use slepcst diff --git a/src/lme/f90-mod/slepclmemod.F90 b/src/lme/f90-mod/slepclmemod.F90 index e8a2bab07..2a8ec968c 100644 --- a/src/lme/f90-mod/slepclmemod.F90 +++ b/src/lme/f90-mod/slepclmemod.F90 @@ -7,11 +7,43 @@ ! SLEPc is distributed under a 2-clause BSD license (see LICENSE). ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ! - module slepclmedef + module slepclmedefdummy use slepcbvdef #include <../src/lme/f90-mod/slepclme.h> end module + module slepclmedef + use slepclmedefdummy + interface operator (.ne.) + function lmenotequal(A,B) + import tLME + logical lmenotequal + type(tLME), intent(in) :: A,B + end function + end interface operator (.ne.) + interface operator (.eq.) + function lmeequals(A,B) + import tLME + logical lmeequals + type(tLME), intent(in) :: A,B + end function + end interface operator (.eq.) + end module + + function lmenotequal(A,B) + use slepclmedefdummy, only: tLME + logical lmenotequal + type(tLME), intent(in) :: A,B + lmenotequal = (A%v .ne. B%v) + end function + + function lmeequals(A,B) + use slepclmedefdummy, only: tLME + logical lmeequals + type(tLME), intent(in) :: A,B + lmeequals = (A%v .eq. B%v) + end function + module slepclme use slepclmedef use slepcbv diff --git a/src/mfn/f90-mod/slepcmfnmod.F90 b/src/mfn/f90-mod/slepcmfnmod.F90 index bd17dc83d..a49b3a9b1 100644 --- a/src/mfn/f90-mod/slepcmfnmod.F90 +++ b/src/mfn/f90-mod/slepcmfnmod.F90 @@ -7,12 +7,44 @@ ! SLEPc is distributed under a 2-clause BSD license (see LICENSE). ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ! - module slepcmfndef + module slepcmfndefdummy use slepcbvdef use slepcfndef #include <../src/mfn/f90-mod/slepcmfn.h> end module + module slepcmfndef + use slepcmfndefdummy + interface operator (.ne.) + function mfnnotequal(A,B) + import tMFN + logical mfnnotequal + type(tMFN), intent(in) :: A,B + end function + end interface operator (.ne.) + interface operator (.eq.) + function mfnequals(A,B) + import tMFN + logical mfnequals + type(tMFN), intent(in) :: A,B + end function + end interface operator (.eq.) + end module + + function mfnnotequal(A,B) + use slepcmfndefdummy, only: tMFN + logical mfnnotequal + type(tMFN), intent(in) :: A,B + mfnnotequal = (A%v .ne. B%v) + end function + + function mfnequals(A,B) + use slepcmfndefdummy, only: tMFN + logical mfnequals + type(tMFN), intent(in) :: A,B + mfnequals = (A%v .eq. B%v) + end function + module slepcmfn use slepcmfndef use slepcbv diff --git a/src/nep/f90-mod/slepcnepmod.F90 b/src/nep/f90-mod/slepcnepmod.F90 index e218da42e..09ed89944 100644 --- a/src/nep/f90-mod/slepcnepmod.F90 +++ b/src/nep/f90-mod/slepcnepmod.F90 @@ -7,12 +7,44 @@ ! SLEPc is distributed under a 2-clause BSD license (see LICENSE). ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ! - module slepcnepdef + module slepcnepdefdummy use slepcpepdef use slepcfndef #include <../src/nep/f90-mod/slepcnep.h> end module + module slepcnepdef + use slepcnepdefdummy + interface operator (.ne.) + function nepnotequal(A,B) + import tNEP + logical nepnotequal + type(tNEP), intent(in) :: A,B + end function + end interface operator (.ne.) + interface operator (.eq.) + function nepequals(A,B) + import tNEP + logical nepequals + type(tNEP), intent(in) :: A,B + end function + end interface operator (.eq.) + end module + + function nepnotequal(A,B) + use slepcnepdefdummy, only: tNEP + logical nepnotequal + type(tNEP), intent(in) :: A,B + nepnotequal = (A%v .ne. B%v) + end function + + function nepequals(A,B) + use slepcnepdefdummy, only: tNEP + logical nepequals + type(tNEP), intent(in) :: A,B + nepequals = (A%v .eq. B%v) + end function + module slepcnep use slepcnepdef use slepcpep diff --git a/src/pep/f90-mod/slepcpepmod.F90 b/src/pep/f90-mod/slepcpepmod.F90 index be0a3be7d..45ddd80bc 100644 --- a/src/pep/f90-mod/slepcpepmod.F90 +++ b/src/pep/f90-mod/slepcpepmod.F90 @@ -7,11 +7,43 @@ ! SLEPc is distributed under a 2-clause BSD license (see LICENSE). ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ! - module slepcpepdef + module slepcpepdefdummy use slepcepsdef #include <../src/pep/f90-mod/slepcpep.h> end module + module slepcpepdef + use slepcpepdefdummy + interface operator (.ne.) + function pepnotequal(A,B) + import tPEP + logical pepnotequal + type(tPEP), intent(in) :: A,B + end function + end interface operator (.ne.) + interface operator (.eq.) + function pepequals(A,B) + import tPEP + logical pepequals + type(tPEP), intent(in) :: A,B + end function + end interface operator (.eq.) + end module + + function pepnotequal(A,B) + use slepcpepdefdummy, only: tPEP + logical pepnotequal + type(tPEP), intent(in) :: A,B + pepnotequal = (A%v .ne. B%v) + end function + + function pepequals(A,B) + use slepcpepdefdummy, only: tPEP + logical pepequals + type(tPEP), intent(in) :: A,B + pepequals = (A%v .eq. B%v) + end function + module slepcpep use slepcpepdef use slepceps diff --git a/src/svd/f90-mod/slepcsvdmod.F90 b/src/svd/f90-mod/slepcsvdmod.F90 index cea3d7049..62d73284a 100644 --- a/src/svd/f90-mod/slepcsvdmod.F90 +++ b/src/svd/f90-mod/slepcsvdmod.F90 @@ -7,11 +7,43 @@ ! SLEPc is distributed under a 2-clause BSD license (see LICENSE). ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ! - module slepcsvddef + module slepcsvddefdummy use slepcepsdef #include <../src/svd/f90-mod/slepcsvd.h> end module + module slepcsvddef + use slepcsvddefdummy + interface operator (.ne.) + function svdnotequal(A,B) + import tSVD + logical svdnotequal + type(tSVD), intent(in) :: A,B + end function + end interface operator (.ne.) + interface operator (.eq.) + function svdequals(A,B) + import tSVD + logical svdequals + type(tSVD), intent(in) :: A,B + end function + end interface operator (.eq.) + end module + + function svdnotequal(A,B) + use slepcsvddefdummy, only: tSVD + logical svdnotequal + type(tSVD), intent(in) :: A,B + svdnotequal = (A%v .ne. B%v) + end function + + function svdequals(A,B) + use slepcsvddefdummy, only: tSVD + logical svdequals + type(tSVD), intent(in) :: A,B + svdequals = (A%v .eq. B%v) + end function + module slepcsvd use slepcsvddef use slepceps diff --git a/src/sys/classes/bv/f90-mod/slepcbvmod.F90 b/src/sys/classes/bv/f90-mod/slepcbvmod.F90 index a120b6766..2f18ee757 100644 --- a/src/sys/classes/bv/f90-mod/slepcbvmod.F90 +++ b/src/sys/classes/bv/f90-mod/slepcbvmod.F90 @@ -7,11 +7,43 @@ ! SLEPc is distributed under a 2-clause BSD license (see LICENSE). ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ! - module slepcbvdef + module slepcbvdefdummy use slepcsysdef #include <../src/sys/classes/bv/f90-mod/slepcbv.h> end module + module slepcbvdef + use slepcbvdefdummy + interface operator (.ne.) + function bvnotequal(A,B) + import tBV + logical bvnotequal + type(tBV), intent(in) :: A,B + end function + end interface operator (.ne.) + interface operator (.eq.) + function bvequals(A,B) + import tBV + logical bvequals + type(tBV), intent(in) :: A,B + end function + end interface operator (.eq.) + end module + + function bvnotequal(A,B) + use slepcbvdefdummy, only: tBV + logical bvnotequal + type(tBV), intent(in) :: A,B + bvnotequal = (A%v .ne. B%v) + end function + + function bvequals(A,B) + use slepcbvdefdummy, only: tBV + logical bvequals + type(tBV), intent(in) :: A,B + bvequals = (A%v .eq. B%v) + end function + module slepcbv use slepcbvdef use slepcsys diff --git a/src/sys/classes/ds/f90-mod/slepcdsmod.F90 b/src/sys/classes/ds/f90-mod/slepcdsmod.F90 index 9c8f925bb..a0d125b8c 100644 --- a/src/sys/classes/ds/f90-mod/slepcdsmod.F90 +++ b/src/sys/classes/ds/f90-mod/slepcdsmod.F90 @@ -7,12 +7,44 @@ ! SLEPc is distributed under a 2-clause BSD license (see LICENSE). ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ! - module slepcdsdef + module slepcdsdefdummy use slepcfndef use slepcrgdef #include <../src/sys/classes/ds/f90-mod/slepcds.h> end module + module slepcdsdef + use slepcdsdefdummy + interface operator (.ne.) + function dsnotequal(A,B) + import tDS + logical dsnotequal + type(tDS), intent(in) :: A,B + end function + end interface operator (.ne.) + interface operator (.eq.) + function dsequals(A,B) + import tDS + logical dsequals + type(tDS), intent(in) :: A,B + end function + end interface operator (.eq.) + end module + + function dsnotequal(A,B) + use slepcdsdefdummy, only: tDS + logical dsnotequal + type(tDS), intent(in) :: A,B + dsnotequal = (A%v .ne. B%v) + end function + + function dsequals(A,B) + use slepcdsdefdummy, only: tDS + logical dsequals + type(tDS), intent(in) :: A,B + dsequals = (A%v .eq. B%v) + end function + module slepcds use slepcdsdef use slepcfn diff --git a/src/sys/classes/fn/f90-mod/slepcfnmod.F90 b/src/sys/classes/fn/f90-mod/slepcfnmod.F90 index 8465830ad..941c0a576 100644 --- a/src/sys/classes/fn/f90-mod/slepcfnmod.F90 +++ b/src/sys/classes/fn/f90-mod/slepcfnmod.F90 @@ -7,11 +7,43 @@ ! SLEPc is distributed under a 2-clause BSD license (see LICENSE). ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ! - module slepcfndef + module slepcfndefdummy use slepcsysdef #include <../src/sys/classes/fn/f90-mod/slepcfn.h> end module + module slepcfndef + use slepcfndefdummy + interface operator (.ne.) + function fnnotequal(A,B) + import tFN + logical fnnotequal + type(tFN), intent(in) :: A,B + end function + end interface operator (.ne.) + interface operator (.eq.) + function fnequals(A,B) + import tFN + logical fnequals + type(tFN), intent(in) :: A,B + end function + end interface operator (.eq.) + end module + + function fnnotequal(A,B) + use slepcfndefdummy, only: tFN + logical fnnotequal + type(tFN), intent(in) :: A,B + fnnotequal = (A%v .ne. B%v) + end function + + function fnequals(A,B) + use slepcfndefdummy, only: tFN + logical fnequals + type(tFN), intent(in) :: A,B + fnequals = (A%v .eq. B%v) + end function + module slepcfn use slepcfndef use slepcsys diff --git a/src/sys/classes/rg/f90-mod/slepcrgmod.F90 b/src/sys/classes/rg/f90-mod/slepcrgmod.F90 index 327f06924..39bac7124 100644 --- a/src/sys/classes/rg/f90-mod/slepcrgmod.F90 +++ b/src/sys/classes/rg/f90-mod/slepcrgmod.F90 @@ -7,11 +7,43 @@ ! SLEPc is distributed under a 2-clause BSD license (see LICENSE). ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ! - module slepcrgdef + module slepcrgdefdummy use slepcsysdef #include <../src/sys/classes/rg/f90-mod/slepcrg.h> end module + module slepcrgdef + use slepcrgdefdummy + interface operator (.ne.) + function rgnotequal(A,B) + import tRG + logical rgnotequal + type(tRG), intent(in) :: A,B + end function + end interface operator (.ne.) + interface operator (.eq.) + function rgequals(A,B) + import tRG + logical rgequals + type(tRG), intent(in) :: A,B + end function + end interface operator (.eq.) + end module + + function rgnotequal(A,B) + use slepcrgdefdummy, only: tRG + logical rgnotequal + type(tRG), intent(in) :: A,B + rgnotequal = (A%v .ne. B%v) + end function + + function rgequals(A,B) + use slepcrgdefdummy, only: tRG + logical rgequals + type(tRG), intent(in) :: A,B + rgequals = (A%v .eq. B%v) + end function + module slepcrg use slepcrgdef use slepcsys diff --git a/src/sys/classes/st/f90-mod/slepcstmod.F90 b/src/sys/classes/st/f90-mod/slepcstmod.F90 index f3e78d4e5..f32448964 100644 --- a/src/sys/classes/st/f90-mod/slepcstmod.F90 +++ b/src/sys/classes/st/f90-mod/slepcstmod.F90 @@ -7,12 +7,44 @@ ! SLEPc is distributed under a 2-clause BSD license (see LICENSE). ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ! - module slepcstdef + module slepcstdefdummy use petsckspdef use slepcbvdef #include <../src/sys/classes/st/f90-mod/slepcst.h> end module + module slepcstdef + use slepcstdefdummy + interface operator (.ne.) + function stnotequal(A,B) + import tST + logical stnotequal + type(tST), intent(in) :: A,B + end function + end interface operator (.ne.) + interface operator (.eq.) + function stequals(A,B) + import tST + logical stequals + type(tST), intent(in) :: A,B + end function + end interface operator (.eq.) + end module + + function stnotequal(A,B) + use slepcstdefdummy, only: tST + logical stnotequal + type(tST), intent(in) :: A,B + stnotequal = (A%v .ne. B%v) + end function + + function stequals(A,B) + use slepcstdefdummy, only: tST + logical stequals + type(tST), intent(in) :: A,B + stequals = (A%v .eq. B%v) + end function + module slepcst use slepcstdef use petscksp From d83c1dd034a38745ce62e2755159c8b2e987d570 Mon Sep 17 00:00:00 2001 From: Alex Lindsay Date: Mon, 24 Jul 2023 17:43:30 -0700 Subject: [PATCH 077/112] Add ability to provide custom norm computation function --- src/eps/impls/power/power.c | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/src/eps/impls/power/power.c b/src/eps/impls/power/power.c index 43daf66d6..01c3c9add 100644 --- a/src/eps/impls/power/power.c +++ b/src/eps/impls/power/power.c @@ -50,6 +50,8 @@ typedef struct { PetscErrorCode (*formFunctionA)(SNES,Vec,Vec,void*); void *formFunctionActx; PetscErrorCode (*formFunctionAB)(SNES,Vec,Vec,Vec,void*); + PetscErrorCode (*formNorm)(SNES,Vec,PetscReal*,void*); + void *formNormCtx; PetscInt idx; /* index of the first nonzero entry in the iteration vector */ PetscMPIInt p; /* process id of the owner of idx */ PetscReal norm0; /* norm of initial vector */ @@ -76,6 +78,7 @@ PetscErrorCode EPSSetUp_Power(EPS eps) PetscContainer container; PetscErrorCode (*formFunctionA)(SNES,Vec,Vec,void*); PetscErrorCode (*formJacobianA)(SNES,Vec,Mat,Mat,void*); + PetscErrorCode (*formNorm)(SNES,Vec,PetscReal*,void*); void *ctx; PetscFunctionBegin; @@ -117,6 +120,7 @@ PetscErrorCode EPSSetUp_Power(EPS eps) PetscCall(EPSGetOperators(eps,&A,&B)); + /* form function */ PetscCall(PetscObjectQueryFunction((PetscObject)A,"formFunction",&formFunctionA)); PetscCheck(formFunctionA,PetscObjectComm((PetscObject)eps),PETSC_ERR_USER,"For nonlinear inverse iteration you must compose a callback function 'formFunction' in matrix A"); PetscCall(PetscObjectQuery((PetscObject)A,"formFunctionCtx",(PetscObject*)&container)); @@ -133,6 +137,7 @@ PetscErrorCode EPSSetUp_Power(EPS eps) else PetscCall(SNESSetFunction(power->snes,res,formFunctionA,ctx)); PetscCall(VecDestroy(&res)); + /* form Jacobian */ PetscCall(PetscObjectQueryFunction((PetscObject)A,"formJacobian",&formJacobianA)); PetscCheck(formJacobianA,PetscObjectComm((PetscObject)eps),PETSC_ERR_USER,"For nonlinear inverse iteration you must compose a callback function 'formJacobian' in matrix A"); PetscCall(PetscObjectQuery((PetscObject)A,"formJacobianCtx",(PetscObject*)&container)); @@ -146,6 +151,17 @@ PetscErrorCode EPSSetUp_Power(EPS eps) PetscCall(SNESSetJacobian(power->snes,A,P? P:A,formJacobianA,ctx)); PetscCall(SNESSetFromOptions(power->snes)); PetscCall(SNESSetUp(power->snes)); + + /* form norm */ + PetscCall(PetscObjectQueryFunction((PetscObject)A,"formNorm",&formNorm)); + if (formNorm) { + PetscCall(PetscObjectQuery((PetscObject)A,"formNormCtx",(PetscObject*)&container)); + if (container) PetscCall(PetscContainerGetPointer(container,&ctx)); + else ctx = NULL; + power->formNorm = formNorm; + power->formNormCtx = ctx; + } + if (B) { PetscCall(PetscObjectQueryFunction((PetscObject)B,"formFunction",&power->formFunctionB)); PetscCall(PetscObjectQuery((PetscObject)B,"formFunctionCtx",(PetscObject*)&container)); @@ -266,7 +282,8 @@ static PetscErrorCode EPSPowerFormFunction_Update(SNES snes,Vec x,Vec y,void *ct PetscCall(EPSPowerUpdateFunctionA(eps,x,y)); PetscCall(EPSPowerUpdateFunctionB(eps,x,Bx)); } - PetscCall(VecNorm(Bx,NORM_2,&bx)); + if (power->formNorm) PetscCall((*power->formNorm)(snes,Bx,&bx,power->formNormCtx)); + else PetscCall(VecNorm(Bx,NORM_2,&bx)); PetscCall(Normalize(Bx,bx,power->idx,power->p,&sign)); PetscCall(VecAXPY(y,-1.0,Bx)); /* Keep tracking eigenvalue update. It would be useful when we want to monitor solver progress via snes monitor. */ @@ -373,7 +390,8 @@ PetscErrorCode EPSSolve_Power(EPS eps) PetscCall(VecScale(v,power->norm0)); } PetscCall(EPSPowerUpdateFunctionB(eps,v,Bx)); - PetscCall(VecNorm(Bx,NORM_2,&norm)); + if (power->formNorm) PetscCall((*power->formNorm)(power->snes,Bx,&norm,power->formNormCtx)); + else PetscCall(VecNorm(Bx,NORM_2,&norm)); PetscCall(FirstNonzeroIdx(Bx,&power->idx,&power->p)); PetscCall(Normalize(Bx,norm,power->idx,power->p,NULL)); PetscCall(BVRestoreColumn(eps->V,0,&v)); @@ -399,7 +417,8 @@ PetscErrorCode EPSSolve_Power(EPS eps) */ if (!power->update) { PetscCall(EPSPowerUpdateFunctionB(eps,y,Bx)); - PetscCall(VecNorm(Bx,NORM_2,&norm)); + if (power->formNorm) PetscCall((*power->formNorm)(power->snes,Bx,&norm,power->formNormCtx)); + else PetscCall(VecNorm(Bx,NORM_2,&norm)); PetscCall(Normalize(Bx,norm,power->idx,power->p,&sign)); } } else { From 848416b2c2ab7ec4f3d81a7e9b90109bd9de294d Mon Sep 17 00:00:00 2001 From: Alex Lindsay Date: Thu, 27 Jul 2023 11:27:54 -0700 Subject: [PATCH 078/112] Associate formNorm callback with B mat --- src/eps/impls/power/power.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/eps/impls/power/power.c b/src/eps/impls/power/power.c index 01c3c9add..a281e8a2d 100644 --- a/src/eps/impls/power/power.c +++ b/src/eps/impls/power/power.c @@ -152,22 +152,23 @@ PetscErrorCode EPSSetUp_Power(EPS eps) PetscCall(SNESSetFromOptions(power->snes)); PetscCall(SNESSetUp(power->snes)); - /* form norm */ - PetscCall(PetscObjectQueryFunction((PetscObject)A,"formNorm",&formNorm)); - if (formNorm) { - PetscCall(PetscObjectQuery((PetscObject)A,"formNormCtx",(PetscObject*)&container)); - if (container) PetscCall(PetscContainerGetPointer(container,&ctx)); - else ctx = NULL; - power->formNorm = formNorm; - power->formNormCtx = ctx; - } - + ctx = NULL; + formNorm = NULL; if (B) { PetscCall(PetscObjectQueryFunction((PetscObject)B,"formFunction",&power->formFunctionB)); PetscCall(PetscObjectQuery((PetscObject)B,"formFunctionCtx",(PetscObject*)&container)); if (power->formFunctionB && container) PetscCall(PetscContainerGetPointer(container,&power->formFunctionBctx)); else power->formFunctionBctx = NULL; + + /* form norm */ + PetscCall(PetscObjectQueryFunction((PetscObject)B,"formNorm",&formNorm)); + if (formNorm) { + PetscCall(PetscObjectQuery((PetscObject)B,"formNormCtx",(PetscObject*)&container)); + if (container) PetscCall(PetscContainerGetPointer(container,&ctx)); + } } + power->formNorm = formNorm; + power->formNormCtx = ctx; } else { if (eps->twosided) PetscCall(EPSSetWorkVecs(eps,3)); else PetscCall(EPSSetWorkVecs(eps,2)); From 225ad6aafc7d40a83ee232994015f6e20f6f4376 Mon Sep 17 00:00:00 2001 From: Alex Lindsay Date: Thu, 27 Jul 2023 11:46:00 -0700 Subject: [PATCH 079/112] Add testing of custom norm capabilities --- src/eps/tutorials/ex34.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/src/eps/tutorials/ex34.c b/src/eps/tutorials/ex34.c index 73e501c5c..a39217e1b 100644 --- a/src/eps/tutorials/ex34.c +++ b/src/eps/tutorials/ex34.c @@ -36,6 +36,7 @@ PetscErrorCode FormFunctionB(SNES,Vec,Vec,void*); PetscErrorCode MatMult_B(Mat A,Vec x,Vec y); PetscErrorCode FormFunctionAB(SNES,Vec,Vec,Vec,void*); PetscErrorCode BoundaryGlobalIndex(DM,const char*,IS*); +PetscErrorCode FormNorm(SNES,Vec,PetscReal*,void*); typedef struct { IS bdis; /* global indices for boundary DoFs */ @@ -57,7 +58,7 @@ int main(int argc,char **argv) PetscBool nonlin,flg=PETSC_FALSE,update; SNES snes; PetscReal tol,relerr; - PetscBool use_shell_matrix=PETSC_FALSE,test_init_sol=PETSC_FALSE; + PetscBool use_shell_matrix=PETSC_FALSE,test_init_sol=PETSC_FALSE,use_custom_norm=PETSC_FALSE; PetscFunctionBeginUser; PetscCall(SlepcInitialize(&argc,&argv,(char*)0,help)); @@ -81,6 +82,8 @@ int main(int argc,char **argv) PetscCall(DMCreateMatrix(dm,&A)); PetscCall(MatDuplicate(A,MAT_COPY_VALUES,&B)); } + /* Check whether we should use a custom normalization */ + PetscCall(PetscOptionsGetBool(NULL,NULL,"-use_custom_norm",&use_custom_norm,NULL)); /* Compose callback functions and context that will be needed by the solver @@ -90,11 +93,13 @@ int main(int argc,char **argv) if (flg) PetscCall(PetscObjectComposeFunction((PetscObject)A,"formFunctionAB",FormFunctionAB)); PetscCall(PetscObjectComposeFunction((PetscObject)A,"formJacobian",FormJacobianA)); PetscCall(PetscObjectComposeFunction((PetscObject)B,"formFunction",FormFunctionB)); + if (use_custom_norm) PetscCall(PetscObjectComposeFunction((PetscObject)B,"formNorm",FormNorm)); PetscCall(PetscContainerCreate(comm,&container)); PetscCall(PetscContainerSetPointer(container,&user)); PetscCall(PetscObjectCompose((PetscObject)A,"formFunctionCtx",(PetscObject)container)); PetscCall(PetscObjectCompose((PetscObject)A,"formJacobianCtx",(PetscObject)container)); PetscCall(PetscObjectCompose((PetscObject)B,"formFunctionCtx",(PetscObject)container)); + if (use_custom_norm) PetscCall(PetscObjectCompose((PetscObject)B,"formNormCtx",(PetscObject)container)); PetscCall(PetscContainerDestroy(&container)); /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -176,7 +181,8 @@ int main(int argc,char **argv) PetscCall(FormFunctionB(snes,eigen,b,&user)); PetscCall(VecAXPY(a,-k,b)); PetscCall(VecNorm(a,NORM_2,&na)); - PetscCall(VecNorm(b,NORM_2,&nb)); + if (use_custom_norm) PetscCall(FormNorm(snes,b,&nb,&user)); + else PetscCall(VecNorm(b,NORM_2,&nb)); relerr = na/(nb*PetscAbsScalar(k)); if (relerr<10*tol) PetscCall(PetscPrintf(comm,"k: %g, relative error below tol\n",(double)PetscRealPart(k))); else PetscCall(PetscPrintf(comm,"k: %g, relative error: %g\n",(double)PetscRealPart(k),(double)relerr)); @@ -447,6 +453,18 @@ PetscErrorCode FormFunctionA(SNES snes,Vec X,Vec F,void *ctx) PetscFunctionReturn(PETSC_SUCCESS); } +PetscErrorCode FormNorm(SNES snes,Vec Bx,PetscReal* norm,void *ctx) +{ + AppCtx *userctx = (AppCtx *)ctx; + Vec u; + + PetscFunctionBegin; + PetscCheck(snes == userctx->snes,PetscObjectComm((PetscObject)snes),PETSC_ERR_ARG_WRONG,"SNES argument and application context's SNES should be the same"); + PetscCall(SNESGetSolution(snes,&u)); + PetscCall(VecNorm(u,NORM_2,norm)); + PetscFunctionReturn(PETSC_SUCCESS); +} + PetscErrorCode MatMult_A(Mat A,Vec x,Vec y) { AppCtx *userctx; @@ -528,4 +546,7 @@ PetscErrorCode MatMult_B(Mat B,Vec x,Vec y) args: -use_shell_matrix -eps_power_update -init_eps_power_snes_mf_operator 1 -eps_power_snes_mf_operator 1 -form_function_ab {{0 1}} -eps_monitor_all output_file: output/ex34_6.out filter: sed -e "s/\([+-].*i\)//g" -e "1,3s/[0-9]//g" -e "/[45] EPS/d" + test: + suffix: 7 + args: -use_custom_norm TEST*/ From eb65165e3f6748a73a04e63dd63a0718cc9f84b0 Mon Sep 17 00:00:00 2001 From: Alex Lindsay Date: Thu, 27 Jul 2023 11:28:42 -0700 Subject: [PATCH 080/112] No need for initial Normalize function call This fortuitously also helps in my test case where I evaluate norms from the snes solution norm. And in this location of the code that is not yet available, leading to a segmentation fault --- src/eps/impls/power/power.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/eps/impls/power/power.c b/src/eps/impls/power/power.c index a281e8a2d..13f9b9a0b 100644 --- a/src/eps/impls/power/power.c +++ b/src/eps/impls/power/power.c @@ -390,11 +390,9 @@ PetscErrorCode EPSSolve_Power(EPS eps) /* We scale the initial vector back if the initial vector was provided by users */ PetscCall(VecScale(v,power->norm0)); } + /* Determine the firxt non-zero index for Bx and the proc that owns it */ PetscCall(EPSPowerUpdateFunctionB(eps,v,Bx)); - if (power->formNorm) PetscCall((*power->formNorm)(power->snes,Bx,&norm,power->formNormCtx)); - else PetscCall(VecNorm(Bx,NORM_2,&norm)); PetscCall(FirstNonzeroIdx(Bx,&power->idx,&power->p)); - PetscCall(Normalize(Bx,norm,power->idx,power->p,NULL)); PetscCall(BVRestoreColumn(eps->V,0,&v)); } From ba142045c9c3e4ac9355c6b257fe63e34ec28d41 Mon Sep 17 00:00:00 2001 From: Alex Lindsay Date: Thu, 3 Aug 2023 08:33:57 -0700 Subject: [PATCH 081/112] Add normalize_with_sign option that defaults to true --- src/eps/impls/power/power.c | 30 ++++++++++++++++++------------ src/eps/tutorials/ex34.c | 2 +- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/eps/impls/power/power.c b/src/eps/impls/power/power.c index 13f9b9a0b..a2583c2e9 100644 --- a/src/eps/impls/power/power.c +++ b/src/eps/impls/power/power.c @@ -44,6 +44,7 @@ typedef struct { EPSPowerShiftType shift_type; PetscBool nonlinear; PetscBool update; + PetscBool normalize_with_sign; SNES snes; PetscErrorCode (*formFunctionB)(SNES,Vec,Vec,void*); void *formFunctionBctx; @@ -210,10 +211,10 @@ static PetscErrorCode FirstNonzeroIdx(Vec x,PetscInt *idx,PetscMPIInt *p) } /* - Normalize a vector x with respect to a given norm as well as the + Normalize a vector x with respect to a given norm as well as, optionally, the sign of the first nonzero entry (assumed to be idx in process p). */ -static PetscErrorCode Normalize(Vec x,PetscReal norm,PetscInt idx,PetscMPIInt p,PetscScalar *sign) +static PetscErrorCode Normalize(Vec x,PetscReal norm,PetscInt idx,PetscMPIInt p,PetscBool normalize_with_sign,PetscScalar *sign) { PetscScalar alpha=1.0; PetscInt first,last; @@ -221,14 +222,16 @@ static PetscErrorCode Normalize(Vec x,PetscReal norm,PetscInt idx,PetscMPIInt p, const PetscScalar *xx; PetscFunctionBegin; - PetscCall(VecGetOwnershipRange(x,&first,&last)); - if (idx>=first && idx10*PETSC_MACHINE_EPSILON) alpha = xx[idx-first]/absv; - PetscCall(VecRestoreArrayRead(x,&xx)); + if (normalize_with_sign) { + PetscCall(VecGetOwnershipRange(x,&first,&last)); + if (idx>=first && idx10*PETSC_MACHINE_EPSILON) alpha = xx[idx-first]/absv; + PetscCall(VecRestoreArrayRead(x,&xx)); + } + PetscCallMPI(MPI_Bcast(&alpha,1,MPIU_SCALAR,p,PetscObjectComm((PetscObject)x))); } - PetscCallMPI(MPI_Bcast(&alpha,1,MPIU_SCALAR,p,PetscObjectComm((PetscObject)x))); if (sign) *sign = alpha; alpha *= norm; PetscCall(VecScale(x,1.0/alpha)); @@ -285,7 +288,7 @@ static PetscErrorCode EPSPowerFormFunction_Update(SNES snes,Vec x,Vec y,void *ct } if (power->formNorm) PetscCall((*power->formNorm)(snes,Bx,&bx,power->formNormCtx)); else PetscCall(VecNorm(Bx,NORM_2,&bx)); - PetscCall(Normalize(Bx,bx,power->idx,power->p,&sign)); + PetscCall(Normalize(Bx,bx,power->idx,power->p,power->normalize_with_sign,&sign)); PetscCall(VecAXPY(y,-1.0,Bx)); /* Keep tracking eigenvalue update. It would be useful when we want to monitor solver progress via snes monitor. */ eps->eigr[(eps->nconv < eps->nev)? eps->nconv:(eps->nconv-1)] = 1.0/(bx*sign); @@ -418,7 +421,7 @@ PetscErrorCode EPSSolve_Power(EPS eps) PetscCall(EPSPowerUpdateFunctionB(eps,y,Bx)); if (power->formNorm) PetscCall((*power->formNorm)(power->snes,Bx,&norm,power->formNormCtx)); else PetscCall(VecNorm(Bx,NORM_2,&norm)); - PetscCall(Normalize(Bx,norm,power->idx,power->p,&sign)); + PetscCall(Normalize(Bx,norm,power->idx,power->p,power->normalize_with_sign,&sign)); } } else { PetscCall(DSGetArray(eps->ds,DS_MAT_A,&T)); @@ -520,7 +523,7 @@ PetscErrorCode EPSSolve_Power(EPS eps) eps->errest[eps->nconv] = relerr; /* normalize */ - if (!power->nonlinear) PetscCall(Normalize(y,norm,power->idx,power->p,NULL)); + if (!power->nonlinear) PetscCall(Normalize(y,norm,power->idx,power->p,power->normalize_with_sign,NULL)); PetscCall(BVInsertVec(eps->V,k,y)); if (PetscUnlikely(power->update)) { @@ -729,6 +732,9 @@ PetscErrorCode EPSSetFromOptions_Power(EPS eps,PetscOptionItems *PetscOptionsObj PetscCall(PetscOptionsBool("-eps_power_update","Update residual monolithically","EPSPowerSetUpdate",power->update,&val,&flg)); if (flg) PetscCall(EPSPowerSetUpdate(eps,val)); + power->normalize_with_sign = PETSC_TRUE; + PetscCall(PetscOptionsBool("-eps_power_normalize_with_sign","Normalize Bx with sign of first nonzero entry","None",power->normalize_with_sign,&power->normalize_with_sign,&flg)); + PetscOptionsHeadEnd(); PetscFunctionReturn(PETSC_SUCCESS); } diff --git a/src/eps/tutorials/ex34.c b/src/eps/tutorials/ex34.c index a39217e1b..66e70dbac 100644 --- a/src/eps/tutorials/ex34.c +++ b/src/eps/tutorials/ex34.c @@ -548,5 +548,5 @@ PetscErrorCode MatMult_B(Mat B,Vec x,Vec y) filter: sed -e "s/\([+-].*i\)//g" -e "1,3s/[0-9]//g" -e "/[45] EPS/d" test: suffix: 7 - args: -use_custom_norm + args: -use_custom_norm -eps_power_normalize_with_sign 0 -eps_tol 1e-9 TEST*/ From 7a8493a77b80a55273f97b2e499cc268942fbda9 Mon Sep 17 00:00:00 2001 From: Alex Lindsay Date: Thu, 3 Aug 2023 10:13:14 -0700 Subject: [PATCH 082/112] Add EPSPowerGet(Set)SignNormalization --- include/slepceps.h | 3 +- src/eps/impls/power/power.c | 96 +++++++++++++++++++++++++++++++++---- src/eps/tutorials/ex34.c | 11 ++++- 3 files changed, 99 insertions(+), 11 deletions(-) diff --git a/include/slepceps.h b/include/slepceps.h index 4e1c704c7..064afdbb0 100644 --- a/include/slepceps.h +++ b/include/slepceps.h @@ -329,6 +329,8 @@ SLEPC_EXTERN PetscErrorCode EPSPowerSetNonlinear(EPS,PetscBool); SLEPC_EXTERN PetscErrorCode EPSPowerGetNonlinear(EPS,PetscBool*); SLEPC_EXTERN PetscErrorCode EPSPowerSetUpdate(EPS,PetscBool); SLEPC_EXTERN PetscErrorCode EPSPowerGetUpdate(EPS,PetscBool*); +SLEPC_EXTERN PetscErrorCode EPSPowerSetSignNormalization(EPS,PetscBool); +SLEPC_EXTERN PetscErrorCode EPSPowerGetSignNormalization(EPS,PetscBool*); SLEPC_EXTERN PetscErrorCode EPSPowerSetSNES(EPS,SNES); SLEPC_EXTERN PetscErrorCode EPSPowerGetSNES(EPS,SNES*); @@ -522,4 +524,3 @@ SLEPC_EXTERN PetscErrorCode EPSFEASTSetNumPoints(EPS,PetscInt); SLEPC_EXTERN PetscErrorCode EPSFEASTGetNumPoints(EPS,PetscInt*); #endif - diff --git a/src/eps/impls/power/power.c b/src/eps/impls/power/power.c index a2583c2e9..2ce37465b 100644 --- a/src/eps/impls/power/power.c +++ b/src/eps/impls/power/power.c @@ -44,7 +44,7 @@ typedef struct { EPSPowerShiftType shift_type; PetscBool nonlinear; PetscBool update; - PetscBool normalize_with_sign; + PetscBool sign_normalization; SNES snes; PetscErrorCode (*formFunctionB)(SNES,Vec,Vec,void*); void *formFunctionBctx; @@ -214,7 +214,7 @@ static PetscErrorCode FirstNonzeroIdx(Vec x,PetscInt *idx,PetscMPIInt *p) Normalize a vector x with respect to a given norm as well as, optionally, the sign of the first nonzero entry (assumed to be idx in process p). */ -static PetscErrorCode Normalize(Vec x,PetscReal norm,PetscInt idx,PetscMPIInt p,PetscBool normalize_with_sign,PetscScalar *sign) +static PetscErrorCode Normalize(Vec x,PetscReal norm,PetscInt idx,PetscMPIInt p,PetscBool sign_normalization,PetscScalar *sign) { PetscScalar alpha=1.0; PetscInt first,last; @@ -222,7 +222,7 @@ static PetscErrorCode Normalize(Vec x,PetscReal norm,PetscInt idx,PetscMPIInt p, const PetscScalar *xx; PetscFunctionBegin; - if (normalize_with_sign) { + if (sign_normalization) { PetscCall(VecGetOwnershipRange(x,&first,&last)); if (idx>=first && idxformNorm) PetscCall((*power->formNorm)(snes,Bx,&bx,power->formNormCtx)); else PetscCall(VecNorm(Bx,NORM_2,&bx)); - PetscCall(Normalize(Bx,bx,power->idx,power->p,power->normalize_with_sign,&sign)); + PetscCall(Normalize(Bx,bx,power->idx,power->p,power->sign_normalization,&sign)); PetscCall(VecAXPY(y,-1.0,Bx)); /* Keep tracking eigenvalue update. It would be useful when we want to monitor solver progress via snes monitor. */ eps->eigr[(eps->nconv < eps->nev)? eps->nconv:(eps->nconv-1)] = 1.0/(bx*sign); @@ -421,7 +421,7 @@ PetscErrorCode EPSSolve_Power(EPS eps) PetscCall(EPSPowerUpdateFunctionB(eps,y,Bx)); if (power->formNorm) PetscCall((*power->formNorm)(power->snes,Bx,&norm,power->formNormCtx)); else PetscCall(VecNorm(Bx,NORM_2,&norm)); - PetscCall(Normalize(Bx,norm,power->idx,power->p,power->normalize_with_sign,&sign)); + PetscCall(Normalize(Bx,norm,power->idx,power->p,power->sign_normalization,&sign)); } } else { PetscCall(DSGetArray(eps->ds,DS_MAT_A,&T)); @@ -523,7 +523,7 @@ PetscErrorCode EPSSolve_Power(EPS eps) eps->errest[eps->nconv] = relerr; /* normalize */ - if (!power->nonlinear) PetscCall(Normalize(y,norm,power->idx,power->p,power->normalize_with_sign,NULL)); + if (!power->nonlinear) PetscCall(Normalize(y,norm,power->idx,power->p,power->sign_normalization,NULL)); PetscCall(BVInsertVec(eps->V,k,y)); if (PetscUnlikely(power->update)) { @@ -732,8 +732,8 @@ PetscErrorCode EPSSetFromOptions_Power(EPS eps,PetscOptionItems *PetscOptionsObj PetscCall(PetscOptionsBool("-eps_power_update","Update residual monolithically","EPSPowerSetUpdate",power->update,&val,&flg)); if (flg) PetscCall(EPSPowerSetUpdate(eps,val)); - power->normalize_with_sign = PETSC_TRUE; - PetscCall(PetscOptionsBool("-eps_power_normalize_with_sign","Normalize Bx with sign of first nonzero entry","None",power->normalize_with_sign,&power->normalize_with_sign,&flg)); + power->sign_normalization = PETSC_TRUE; + PetscCall(PetscOptionsBool("-eps_power_sign_normalization","Normalize Bx with sign of first nonzero entry","EPSPowerSetSignNormalization",power->sign_normalization,&power->sign_normalization,&flg)); PetscOptionsHeadEnd(); PetscFunctionReturn(PETSC_SUCCESS); @@ -987,6 +987,80 @@ PetscErrorCode EPSPowerGetUpdate(EPS eps,PetscBool *update) PetscFunctionReturn(PETSC_SUCCESS); } +static PetscErrorCode EPSPowerSetSignNormalization_Power(EPS eps,PetscBool sign_normalization) +{ + EPS_POWER *power = (EPS_POWER*)eps->data; + + PetscFunctionBegin; + power->sign_normalization = sign_normalization; + PetscFunctionReturn(PETSC_SUCCESS); +} + +/*@ + EPSPowerSetSignNormalization - Sets a flag to indicate whether the Bx vector + should be normalized by the sign of the first non-zero element in the vector. + E.g., if this is true, the post-normalization value of the first non-zero element + in the vector is guaranteed to be positive. + + Logically Collective + + Input Parameters: ++ eps - the eigenproblem solver context +- sign_normalization - whether Bx should be multiplied by the sign of the first non-zero + element when performing normalization steps + + Options Database Key: +. -eps_power_sign_normalization - Sets the sign normalization flag + + Level: advanced + +.seealso: EPSPowerGetSignNormalization() +@*/ +PetscErrorCode EPSPowerSetSignNormalization(EPS eps,PetscBool sign_normalization) +{ + PetscFunctionBegin; + PetscValidHeaderSpecific(eps,EPS_CLASSID,1); + PetscValidLogicalCollectiveBool(eps,sign_normalization,2); + PetscTryMethod(eps,"EPSPowerSetSignNormalization_C",(EPS,PetscBool),(eps,sign_normalization)); + PetscFunctionReturn(PETSC_SUCCESS); +} + +static PetscErrorCode EPSPowerGetSignNormalization_Power(EPS eps,PetscBool *sign_normalization) +{ + EPS_POWER *power = (EPS_POWER*)eps->data; + + PetscFunctionBegin; + *sign_normalization = power->sign_normalization; + PetscFunctionReturn(PETSC_SUCCESS); +} + +/*@ + EPSPowerGetSignNormalization - Returns a flag indicating whether the Bx vector + is normalized by the sign of the first non-zero element in the vector. E.g., + if this is true, the post-normalization value of the first non-zero element in + the vector is guaranteed to be positive. + + Not Collective + + Input Parameter: +. eps - the eigenproblem solver context + + Output Parameter: +. sign_normalization - the sign normalization flag + + Level: advanced + +.seealso: EPSPowerSetSignNormalization() +@*/ +PetscErrorCode EPSPowerGetSignNormalization(EPS eps,PetscBool *sign_normalization) +{ + PetscFunctionBegin; + PetscValidHeaderSpecific(eps,EPS_CLASSID,1); + PetscAssertPointer(sign_normalization,2); + PetscUseMethod(eps,"EPSPowerGetSignNormalization_C",(EPS,PetscBool*),(eps,sign_normalization)); + PetscFunctionReturn(PETSC_SUCCESS); +} + static PetscErrorCode EPSPowerSetSNES_Power(EPS eps,SNES snes) { EPS_POWER *power = (EPS_POWER*)eps->data; @@ -1086,6 +1160,8 @@ PetscErrorCode EPSDestroy_Power(EPS eps) PetscCall(PetscObjectComposeFunction((PetscObject)eps,"EPSPowerGetNonlinear_C",NULL)); PetscCall(PetscObjectComposeFunction((PetscObject)eps,"EPSPowerSetUpdate_C",NULL)); PetscCall(PetscObjectComposeFunction((PetscObject)eps,"EPSPowerGetUpdate_C",NULL)); + PetscCall(PetscObjectComposeFunction((PetscObject)eps,"EPSPowerSetSignNormalization_C",NULL)); + PetscCall(PetscObjectComposeFunction((PetscObject)eps,"EPSPowerGetSignNormalization_C",NULL)); PetscCall(PetscObjectComposeFunction((PetscObject)eps,"EPSPowerSetSNES_C",NULL)); PetscCall(PetscObjectComposeFunction((PetscObject)eps,"EPSPowerGetSNES_C",NULL)); PetscFunctionReturn(PETSC_SUCCESS); @@ -1099,6 +1175,8 @@ PetscErrorCode EPSView_Power(EPS eps,PetscViewer viewer) PetscFunctionBegin; PetscCall(PetscObjectTypeCompare((PetscObject)viewer,PETSCVIEWERASCII,&isascii)); if (isascii) { + if (power->sign_normalization) PetscCall(PetscViewerASCIIPrintf(viewer," normalizing Bx by the sign of the first nonzero element\n")); + else PetscCall(PetscViewerASCIIPrintf(viewer," not normalizing Bx by the sign of the first nonzero element\n")); if (power->nonlinear) { PetscCall(PetscViewerASCIIPrintf(viewer," using nonlinear inverse iteration\n")); if (power->update) PetscCall(PetscViewerASCIIPrintf(viewer," updating the residual monolithically\n")); @@ -1172,6 +1250,8 @@ SLEPC_EXTERN PetscErrorCode EPSCreate_Power(EPS eps) PetscCall(PetscObjectComposeFunction((PetscObject)eps,"EPSPowerGetNonlinear_C",EPSPowerGetNonlinear_Power)); PetscCall(PetscObjectComposeFunction((PetscObject)eps,"EPSPowerSetUpdate_C",EPSPowerSetUpdate_Power)); PetscCall(PetscObjectComposeFunction((PetscObject)eps,"EPSPowerGetUpdate_C",EPSPowerGetUpdate_Power)); + PetscCall(PetscObjectComposeFunction((PetscObject)eps,"EPSPowerSetSignNormalization_C",EPSPowerSetSignNormalization_Power)); + PetscCall(PetscObjectComposeFunction((PetscObject)eps,"EPSPowerGetSignNormalization_C",EPSPowerGetSignNormalization_Power)); PetscCall(PetscObjectComposeFunction((PetscObject)eps,"EPSPowerSetSNES_C",EPSPowerSetSNES_Power)); PetscCall(PetscObjectComposeFunction((PetscObject)eps,"EPSPowerGetSNES_C",EPSPowerGetSNES_Power)); PetscFunctionReturn(PETSC_SUCCESS); diff --git a/src/eps/tutorials/ex34.c b/src/eps/tutorials/ex34.c index 66e70dbac..32b71f62a 100644 --- a/src/eps/tutorials/ex34.c +++ b/src/eps/tutorials/ex34.c @@ -58,7 +58,7 @@ int main(int argc,char **argv) PetscBool nonlin,flg=PETSC_FALSE,update; SNES snes; PetscReal tol,relerr; - PetscBool use_shell_matrix=PETSC_FALSE,test_init_sol=PETSC_FALSE,use_custom_norm=PETSC_FALSE; + PetscBool use_shell_matrix=PETSC_FALSE,test_init_sol=PETSC_FALSE,use_custom_norm=PETSC_FALSE,sign_normalization=PETSC_TRUE; PetscFunctionBeginUser; PetscCall(SlepcInitialize(&argc,&argv,(char*)0,help)); @@ -84,6 +84,8 @@ int main(int argc,char **argv) } /* Check whether we should use a custom normalization */ PetscCall(PetscOptionsGetBool(NULL,NULL,"-use_custom_norm",&use_custom_norm,NULL)); + /* Check whether we should normalize Bx by the sign of its first nonzero element */ + PetscCall(PetscOptionsGetBool(NULL,NULL,"-sign_normalization",&sign_normalization,NULL)); /* Compose callback functions and context that will be needed by the solver @@ -114,6 +116,8 @@ int main(int argc,char **argv) */ PetscCall(EPSSetType(eps,EPSPOWER)); PetscCall(EPSPowerSetNonlinear(eps,PETSC_TRUE)); + /* Set the Bx sign normalization (or not) */ + PetscCall(EPSPowerSetSignNormalization(eps,sign_normalization)); /* Attach DM to SNES */ @@ -548,5 +552,8 @@ PetscErrorCode MatMult_B(Mat B,Vec x,Vec y) filter: sed -e "s/\([+-].*i\)//g" -e "1,3s/[0-9]//g" -e "/[45] EPS/d" test: suffix: 7 - args: -use_custom_norm -eps_power_normalize_with_sign 0 -eps_tol 1e-9 + args: -use_custom_norm -sign_normalization 0 -eps_tol 1e-9 + test: + suffix: 8 + args: -use_custom_norm -eps_tol 1e-9 TEST*/ From 9bdf0d0da55744b813368cbdf1774f148360dfef Mon Sep 17 00:00:00 2001 From: Alex Lindsay Date: Thu, 3 Aug 2023 22:38:06 -0700 Subject: [PATCH 083/112] Populate default value for sign_normalization at creation --- src/eps/impls/power/power.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/eps/impls/power/power.c b/src/eps/impls/power/power.c index 2ce37465b..384e62f99 100644 --- a/src/eps/impls/power/power.c +++ b/src/eps/impls/power/power.c @@ -732,7 +732,6 @@ PetscErrorCode EPSSetFromOptions_Power(EPS eps,PetscOptionItems *PetscOptionsObj PetscCall(PetscOptionsBool("-eps_power_update","Update residual monolithically","EPSPowerSetUpdate",power->update,&val,&flg)); if (flg) PetscCall(EPSPowerSetUpdate(eps,val)); - power->sign_normalization = PETSC_TRUE; PetscCall(PetscOptionsBool("-eps_power_sign_normalization","Normalize Bx with sign of first nonzero entry","EPSPowerSetSignNormalization",power->sign_normalization,&power->sign_normalization,&flg)); PetscOptionsHeadEnd(); @@ -1243,6 +1242,7 @@ SLEPC_EXTERN PetscErrorCode EPSCreate_Power(EPS eps) eps->ops->computevectors = EPSComputeVectors_Power; eps->ops->setdefaultst = EPSSetDefaultST_Power; eps->stopping = EPSStopping_Power; + ctx->sign_normalization = PETSC_TRUE; PetscCall(PetscObjectComposeFunction((PetscObject)eps,"EPSPowerSetShiftType_C",EPSPowerSetShiftType_Power)); PetscCall(PetscObjectComposeFunction((PetscObject)eps,"EPSPowerGetShiftType_C",EPSPowerGetShiftType_Power)); From 5f7ce29a3b3dee28d0a0057fe388f0c2fe8461d3 Mon Sep 17 00:00:00 2001 From: Alex Lindsay Date: Fri, 4 Aug 2023 13:30:40 -0700 Subject: [PATCH 084/112] Divide by the sign for theta for nonlinear --- src/eps/impls/power/power.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/eps/impls/power/power.c b/src/eps/impls/power/power.c index 384e62f99..6cab84b0a 100644 --- a/src/eps/impls/power/power.c +++ b/src/eps/impls/power/power.c @@ -441,7 +441,7 @@ PetscErrorCode EPSSolve_Power(EPS eps) * Assign eigenvalue to theta to make the rest of the code consistent */ if (power->update) theta = eps->eigr[eps->nconv]; - else if (power->nonlinear) theta = 1.0/norm*sign; /* Eigenvalue: 1/|Bx| */ + else if (power->nonlinear) theta = 1.0/(norm*sign); /* Eigenvalue: 1/|Bx| */ if (power->shift_type == EPS_POWER_SHIFT_CONSTANT) { /* direct & inverse iteration */ From 54bc4b92de445acbae7cbde9df2ff18c501cb49f Mon Sep 17 00:00:00 2001 From: Alex Lindsay Date: Fri, 4 Aug 2023 14:18:33 -0700 Subject: [PATCH 085/112] By default use same setting of sign normalization for initial guess --- src/eps/impls/power/power.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/eps/impls/power/power.c b/src/eps/impls/power/power.c index 6cab84b0a..40c0ec0eb 100644 --- a/src/eps/impls/power/power.c +++ b/src/eps/impls/power/power.c @@ -323,6 +323,7 @@ static PetscErrorCode EPSPowerComputeInitialGuess_Update(EPS eps) Vec v1,v2; SNES snes; DM dm,newdm; + PetscBool sign_normalization; PetscFunctionBegin; PetscCall(EPSCreate(PetscObjectComm((PetscObject)eps),&powereps)); @@ -346,6 +347,8 @@ static PetscErrorCode EPSPowerComputeInitialGuess_Update(EPS eps) PetscCall(DMCopyDMSNES(dm,newdm)); PetscCall(EPSPowerGetSNES(powereps,&snes)); PetscCall(SNESSetDM(snes,dm)); + PetscCall(EPSPowerGetSignNormalization(eps,&sign_normalization)); + PetscCall(EPSPowerSetSignNormalization(powereps,sign_normalization)); PetscCall(EPSSetFromOptions(powereps)); if (P) PetscCall(STSetPreconditionerMat(powereps->st,P)); PetscCall(EPSSolve(powereps)); From 0ca3ea59074e5f725d5e8121dadc2ef604d1eef9 Mon Sep 17 00:00:00 2001 From: Alex Lindsay Date: Fri, 4 Aug 2023 15:15:50 -0700 Subject: [PATCH 086/112] Perform initial scaling of Bx --- src/eps/impls/power/power.c | 12 +++++++++++- src/eps/tutorials/ex34.c | 12 +++++++++--- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/eps/impls/power/power.c b/src/eps/impls/power/power.c index 40c0ec0eb..1ff716cce 100644 --- a/src/eps/impls/power/power.c +++ b/src/eps/impls/power/power.c @@ -396,9 +396,19 @@ PetscErrorCode EPSSolve_Power(EPS eps) /* We scale the initial vector back if the initial vector was provided by users */ PetscCall(VecScale(v,power->norm0)); } - /* Determine the firxt non-zero index for Bx and the proc that owns it */ + /* Do a couple things: + * 1) Determine the first non-zero index for Bx and the proc that owns it. This will be + * used if performing normalization by the sign of the first nonzero element of Bx. + * 2) Scale Bx by its norm. For non-update power iterations, Bx (in code terms) is used + * as the RHS argument to SNESSolve. And recall that the formula for generalized + * inverse power iterations in this case is: (Ax)_n = (Bx)_{n-1}/|(Bx)_{n-1}| (in + * math terms) + */ PetscCall(EPSPowerUpdateFunctionB(eps,v,Bx)); + if (power->formNorm) PetscCall((*power->formNorm)(power->snes,Bx,&norm,power->formNormCtx)); + else PetscCall(VecNorm(Bx,NORM_2,&norm)); PetscCall(FirstNonzeroIdx(Bx,&power->idx,&power->p)); + PetscCall(Normalize(Bx,norm,power->idx,power->p,power->sign_normalization,NULL)); PetscCall(BVRestoreColumn(eps->V,0,&v)); } diff --git a/src/eps/tutorials/ex34.c b/src/eps/tutorials/ex34.c index 32b71f62a..184ec37ee 100644 --- a/src/eps/tutorials/ex34.c +++ b/src/eps/tutorials/ex34.c @@ -41,6 +41,7 @@ PetscErrorCode FormNorm(SNES,Vec,PetscReal*,void*); typedef struct { IS bdis; /* global indices for boundary DoFs */ SNES snes; + EPS eps; } AppCtx; int main(int argc,char **argv) @@ -111,6 +112,7 @@ int main(int argc,char **argv) PetscCall(EPSCreate(comm,&eps)); PetscCall(EPSSetOperators(eps,A,B)); PetscCall(EPSSetProblemType(eps,EPS_GNHEP)); + user.eps = eps; /* Use nonlinear inverse iteration */ @@ -457,14 +459,18 @@ PetscErrorCode FormFunctionA(SNES snes,Vec X,Vec F,void *ctx) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode FormNorm(SNES snes,Vec Bx,PetscReal* norm,void *ctx) +PetscErrorCode FormNorm(SNES snes,Vec Bx,PetscReal* norm,void* ctx) { - AppCtx *userctx = (AppCtx *)ctx; Vec u; + AppCtx* userctx = (AppCtx*)ctx; + BV V; PetscFunctionBegin; - PetscCheck(snes == userctx->snes,PetscObjectComm((PetscObject)snes),PETSC_ERR_ARG_WRONG,"SNES argument and application context's SNES should be the same"); PetscCall(SNESGetSolution(snes,&u)); + if (!u) { + PetscCall(EPSGetBV(userctx->eps, &V)); + PetscCall(BVGetColumn(V,0,&u)); + } PetscCall(VecNorm(u,NORM_2,norm)); PetscFunctionReturn(PETSC_SUCCESS); } From 9c1f45de755f719e51835444e9e39132dc83d4b7 Mon Sep 17 00:00:00 2001 From: Alex Lindsay Date: Fri, 4 Aug 2023 15:56:12 -0700 Subject: [PATCH 087/112] Add update tests --- src/eps/impls/power/power.c | 2 +- src/eps/tutorials/ex34.c | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/eps/impls/power/power.c b/src/eps/impls/power/power.c index 1ff716cce..f98508cff 100644 --- a/src/eps/impls/power/power.c +++ b/src/eps/impls/power/power.c @@ -405,11 +405,11 @@ PetscErrorCode EPSSolve_Power(EPS eps) * math terms) */ PetscCall(EPSPowerUpdateFunctionB(eps,v,Bx)); + PetscCall(BVRestoreColumn(eps->V,0,&v)); if (power->formNorm) PetscCall((*power->formNorm)(power->snes,Bx,&norm,power->formNormCtx)); else PetscCall(VecNorm(Bx,NORM_2,&norm)); PetscCall(FirstNonzeroIdx(Bx,&power->idx,&power->p)); PetscCall(Normalize(Bx,norm,power->idx,power->p,power->sign_normalization,NULL)); - PetscCall(BVRestoreColumn(eps->V,0,&v)); } PetscCall(STGetShift(eps->st,&sigma)); /* original shift */ diff --git a/src/eps/tutorials/ex34.c b/src/eps/tutorials/ex34.c index 184ec37ee..363fdc80f 100644 --- a/src/eps/tutorials/ex34.c +++ b/src/eps/tutorials/ex34.c @@ -467,11 +467,13 @@ PetscErrorCode FormNorm(SNES snes,Vec Bx,PetscReal* norm,void* ctx) PetscFunctionBegin; PetscCall(SNESGetSolution(snes,&u)); - if (!u) { + if (u) PetscCall(VecNorm(u,NORM_2,norm)); + else { PetscCall(EPSGetBV(userctx->eps, &V)); PetscCall(BVGetColumn(V,0,&u)); + PetscCall(VecNorm(u,NORM_2,norm)); + PetscCall(BVRestoreColumn(V,0,&u)); } - PetscCall(VecNorm(u,NORM_2,norm)); PetscFunctionReturn(PETSC_SUCCESS); } @@ -558,8 +560,9 @@ PetscErrorCode MatMult_B(Mat B,Vec x,Vec y) filter: sed -e "s/\([+-].*i\)//g" -e "1,3s/[0-9]//g" -e "/[45] EPS/d" test: suffix: 7 - args: -use_custom_norm -sign_normalization 0 -eps_tol 1e-9 + args: -use_custom_norm -sign_normalization {{0 1}} -eps_tol 1e-9 test: suffix: 8 - args: -use_custom_norm -eps_tol 1e-9 + args: -use_custom_norm -sign_normalization {{0 1}} -eps_tol 1e-9 -eps_power_update -form_function_ab {{0 1}} + filter: sed -e "s/ with monolithic update//" TEST*/ From a0c9e0ce1e2b183c089a365a4f81ec57c9eaa9bd Mon Sep 17 00:00:00 2001 From: Alex Lindsay Date: Fri, 4 Aug 2023 16:29:24 -0700 Subject: [PATCH 088/112] Uses matrix-free approximation of Jacobian --- src/eps/tutorials/ex34.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/eps/tutorials/ex34.c b/src/eps/tutorials/ex34.c index 363fdc80f..5357350b3 100644 --- a/src/eps/tutorials/ex34.c +++ b/src/eps/tutorials/ex34.c @@ -560,9 +560,9 @@ PetscErrorCode MatMult_B(Mat B,Vec x,Vec y) filter: sed -e "s/\([+-].*i\)//g" -e "1,3s/[0-9]//g" -e "/[45] EPS/d" test: suffix: 7 - args: -use_custom_norm -sign_normalization {{0 1}} -eps_tol 1e-9 + args: -use_custom_norm -sign_normalization {{0 1}} -eps_tol 1e-9 -eps_power_snes_mf_operator 1 test: suffix: 8 - args: -use_custom_norm -sign_normalization {{0 1}} -eps_tol 1e-9 -eps_power_update -form_function_ab {{0 1}} + args: -use_custom_norm -sign_normalization {{0 1}} -eps_tol 1e-9 -eps_power_update -form_function_ab {{0 1}} -eps_power_snes_mf_operator 1 -init_eps_power_snes_mf_operator 1 filter: sed -e "s/ with monolithic update//" TEST*/ From bddc2ed9cdb5e28fe6bc13bf3e9ef04b2fa73272 Mon Sep 17 00:00:00 2001 From: Alex Lindsay Date: Fri, 4 Aug 2023 18:11:04 -0700 Subject: [PATCH 089/112] Use a better norm in ex34 FormNorm The L2 norm of the current SNES solution just does not seem to produce stable solves. And what's more, when using PJFNK, we may be computing a Bx norm that doesn't even correspond to the current SNES solution, e.g. it is a perturbed vector. Purpose of this test is to make sure norm callbacks are working, not developing smart alternative Bx norms --- src/eps/tutorials/ex34.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/eps/tutorials/ex34.c b/src/eps/tutorials/ex34.c index 5357350b3..b4efde118 100644 --- a/src/eps/tutorials/ex34.c +++ b/src/eps/tutorials/ex34.c @@ -459,21 +459,10 @@ PetscErrorCode FormFunctionA(SNES snes,Vec X,Vec F,void *ctx) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode FormNorm(SNES snes,Vec Bx,PetscReal* norm,void* ctx) +PetscErrorCode FormNorm(SNES snes,Vec Bx,PetscReal *norm,void *ctx) { - Vec u; - AppCtx* userctx = (AppCtx*)ctx; - BV V; - PetscFunctionBegin; - PetscCall(SNESGetSolution(snes,&u)); - if (u) PetscCall(VecNorm(u,NORM_2,norm)); - else { - PetscCall(EPSGetBV(userctx->eps, &V)); - PetscCall(BVGetColumn(V,0,&u)); - PetscCall(VecNorm(u,NORM_2,norm)); - PetscCall(BVRestoreColumn(V,0,&u)); - } + PetscCall(VecNorm(Bx,NORM_2,norm)); PetscFunctionReturn(PETSC_SUCCESS); } From 6745a0dc6820f4428eb72fd722b5f1dee642951d Mon Sep 17 00:00:00 2001 From: Alex Lindsay Date: Fri, 4 Aug 2023 18:48:30 -0700 Subject: [PATCH 090/112] Use Richardson for power SNES solves when not normalizing by sign Newton seems to really struggle with complex systems at least when we are far from the root (which concept we already know) --- src/eps/tutorials/ex34.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/eps/tutorials/ex34.c b/src/eps/tutorials/ex34.c index b4efde118..feb7b86e4 100644 --- a/src/eps/tutorials/ex34.c +++ b/src/eps/tutorials/ex34.c @@ -549,9 +549,27 @@ PetscErrorCode MatMult_B(Mat B,Vec x,Vec y) filter: sed -e "s/\([+-].*i\)//g" -e "1,3s/[0-9]//g" -e "/[45] EPS/d" test: suffix: 7 - args: -use_custom_norm -sign_normalization {{0 1}} -eps_tol 1e-9 -eps_power_snes_mf_operator 1 + args: -use_custom_norm -sign_normalization 1 -eps_power_snes_mf_operator 1 test: suffix: 8 - args: -use_custom_norm -sign_normalization {{0 1}} -eps_tol 1e-9 -eps_power_update -form_function_ab {{0 1}} -eps_power_snes_mf_operator 1 -init_eps_power_snes_mf_operator 1 + args: -use_custom_norm -sign_normalization 1 -eps_power_update -form_function_ab {{0 1}} -eps_power_snes_mf_operator 1 -init_eps_power_snes_mf_operator 1 + filter: sed -e "s/ with monolithic update//" + test: + suffix: 9 + requires: !complex + args: -use_custom_norm {{0 1}} -sign_normalization 0 -eps_power_snes_mf_operator 1 + test: + suffix: 10 + requires: !complex + args: -use_custom_norm {{0 1}} -sign_normalization 0 -eps_power_update -form_function_ab {{0 1}} -eps_power_snes_mf_operator 1 -init_eps_power_snes_mf_operator 1 + filter: sed -e "s/ with monolithic update//" + test: + suffix: 11 + requires: complex + args: -use_custom_norm {{0 1}} -sign_normalization 0 -eps_power_snes_type nrichardson -eps_power_snes_atol 1e-12 + test: + suffix: 12 + requires: complex + args: -use_custom_norm {{0 1}} -sign_normalization 0 -eps_power_update -init_eps_power_snes_type nrichardson -init_eps_max_it 2 -eps_power_snes_mf_operator 1 filter: sed -e "s/ with monolithic update//" TEST*/ From d61344aa1dee18980eb6547e3ffa5cc113f7006a Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Tue, 8 Aug 2023 07:22:44 +0200 Subject: [PATCH 091/112] Sync with PETSc: update -help output --- src/sys/tests/output/test2_1.out | 1 + 1 file changed, 1 insertion(+) diff --git a/src/sys/tests/output/test2_1.out b/src/sys/tests/output/test2_1.out index 3380525eb..78f608f64 100644 --- a/src/sys/tests/output/test2_1.out +++ b/src/sys/tests/output/test2_1.out @@ -42,6 +42,7 @@ Options for all PETSc programs: -fp_trap: stop on floating point exceptions note on IBM RS6000 this slows run greatly -malloc_dump : dump list of unfreed memory at conclusion + -on_error_malloc_dump : dump list of unfreed memory on memory error -malloc_view : keeps log of all memory allocations, displays in PetscFinalize() -malloc_debug : enables or disables extended checking for memory corruption -options_view: dump list of options inputted From d823baaf77c07fe6c8aec2bc70113f6afa077351 Mon Sep 17 00:00:00 2001 From: Jacob Faibussowitsch Date: Mon, 7 Aug 2023 15:20:34 -0400 Subject: [PATCH 092/112] Bump slepclinter per upstream petsc changes --- lib/slepc/bin/maint/slepcClangLinter.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/slepc/bin/maint/slepcClangLinter.py b/lib/slepc/bin/maint/slepcClangLinter.py index 281d7c00c..eb315e609 100755 --- a/lib/slepc/bin/maint/slepcClangLinter.py +++ b/lib/slepc/bin/maint/slepcClangLinter.py @@ -54,6 +54,7 @@ def __prepare_ns_args(ns_args, parser): def command_line_main(): import argparse + import petsclinter.main slepc_classid_map = { '_p_BV *' : 'BV_CLASSID', @@ -70,7 +71,7 @@ def command_line_main(): } for struct_name, classid_name in slepc_classid_map.items(): - pl.register_classid(struct_name, classid_name) + pl.checks.register_classid(struct_name, classid_name) parser = argparse.ArgumentParser(prog='slepclinter', add_help=False) group_slepc = parser.add_argument_group(title='SLEPc location settings') From d281173fb2d920b6264ee255c80bbee80bf97fbd Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Tue, 8 Aug 2023 18:54:47 +0200 Subject: [PATCH 093/112] configure: generate SLEPC_EXTERNAL_LIB and SLEPC_CEXT_INCLUDES make variables Avoid duplicates in case that several packages are used --- config/configure.py | 13 +++++++++++++ config/package.py | 1 + config/packages/blopex.py | 12 ++++++++---- config/packages/evsl.py | 12 ++++++++---- config/packages/hpddm.py | 6 ++++-- config/packages/ksvd.py | 12 ++++++++---- config/packages/primme.py | 12 ++++++++---- lib/slepc/conf/slepc_variables | 3 --- 8 files changed, 50 insertions(+), 21 deletions(-) diff --git a/config/configure.py b/config/configure.py index 3262a55e6..60ec4e2bf 100755 --- a/config/configure.py +++ b/config/configure.py @@ -265,6 +265,19 @@ def fixLang(lang): for pkg in petscpackages + externalpackages: if hasattr(pkg,'havepackage') and pkg.havepackage: slepcconf.write(pkg.packagename+':') slepcconf.write('"\n#endif\n') + libflags = [] + includeflags = [] + for pkg in externalwithdeps: + if hasattr(pkg,'havepackage') and pkg.havepackage: + for entry in pkg.libflags.split(): + if entry not in libflags: + libflags.append(entry) + if hasattr(pkg,'includeflags'): + for entry in pkg.includeflags.split(): + if entry not in includeflags: + includeflags.append(entry) + slepcvars.write('SLEPC_EXTERNAL_LIB = '+' '.join(libflags)+'\n') + slepcvars.write('SLEPC_CEXT_INCLUDES = '+' '.join(includeflags)+'\n') log.NewSection('Writing various configuration files...') diff --git a/config/package.py b/config/package.py index 288d66241..86c82d84b 100644 --- a/config/package.py +++ b/config/package.py @@ -491,6 +491,7 @@ def FortranLib(self,slepcconf,slepcvars,dirs,libs,functions,callbacks = []): slepcconf.write('#define SLEPC_HAVE_' + name + ' 1\n#define SLEPC_' + name + '_HAVE_'+mangling+' 1\n') slepcvars.write(name + '_LIB = '+flags+'\n') + self.libflags = flags self.havepackage = True self.packageflags = flags diff --git a/config/packages/blopex.py b/config/packages/blopex.py index 972f5cbd8..6b1941848 100644 --- a/config/packages/blopex.py +++ b/config/packages/blopex.py @@ -64,9 +64,11 @@ def Check(self,slepcconf,slepcvars,petsc,archdir): f = ['-I' + includes[0]] (result, output) = self.Link([],[],' '.join(l+f),code,' '.join(f),petsc.language) if result: + self.libflags = ' '.join(l) + self.includeflags = ' '.join(f) slepcconf.write('#define SLEPC_HAVE_BLOPEX 1\n') - slepcvars.write('BLOPEX_LIB = ' + ' '.join(l) + '\n') - slepcvars.write('BLOPEX_INCLUDE = ' + ' '.join(f) + '\n') + slepcvars.write('BLOPEX_LIB = ' + self.libflags + '\n') + slepcvars.write('BLOPEX_INCLUDE = ' + self.includeflags + '\n') self.havepackage = True self.packageflags = ' '.join(l+f) return @@ -113,9 +115,11 @@ def DownloadAndInstall(self,slepcconf,slepcvars,slepc,petsc,archdir,prefixdir): self.log.Exit('Unable to link with downloaded BLOPEX') # Write configuration files + self.libflags = l + self.includeflags = f slepcconf.write('#define SLEPC_HAVE_BLOPEX 1\n') - slepcvars.write('BLOPEX_LIB = ' + l + '\n') - slepcvars.write('BLOPEX_INCLUDE = ' + f + '\n') + slepcvars.write('BLOPEX_LIB = ' + self.libflags + '\n') + slepcvars.write('BLOPEX_INCLUDE = ' + self.includeflags + '\n') self.havepackage = True self.packageflags = l+' '+f diff --git a/config/packages/evsl.py b/config/packages/evsl.py index 93c5dc28c..d821eb679 100644 --- a/config/packages/evsl.py +++ b/config/packages/evsl.py @@ -67,9 +67,11 @@ def Check(self,slepcconf,slepcvars,petsc,archdir): f = [] (result, output) = self.Link([],[],' '.join(l+f),code,' '.join(f),petsc.language) if result: + self.libflags = ' '.join(l) + self.includeflags = ' '.join(f) slepcconf.write('#define SLEPC_HAVE_EVSL 1\n') - slepcvars.write('EVSL_LIB = ' + ' '.join(l) + '\n') - slepcvars.write('EVSL_INCLUDE = ' + ' '.join(f) + '\n') + slepcvars.write('EVSL_LIB = ' + self.libflags + '\n') + slepcvars.write('EVSL_INCLUDE = ' + self.includeflags + '\n') self.havepackage = True self.packageflags = ' '.join(l+f) return @@ -107,9 +109,11 @@ def DownloadAndInstall(self,slepcconf,slepcvars,slepc,petsc,archdir,prefixdir): self.log.Exit('Unable to link with downloaded EVSL') # Write configuration files + self.libflags = l + self.includeflags = f slepcconf.write('#define SLEPC_HAVE_EVSL 1\n') - slepcvars.write('EVSL_LIB = ' + l + '\n') - slepcvars.write('EVSL_INCLUDE = ' + f + '\n') + slepcvars.write('EVSL_LIB = ' + self.libflags + '\n') + slepcvars.write('EVSL_INCLUDE = ' + self.includeflags + '\n') self.havepackage = True self.packageflags = l+' '+f diff --git a/config/packages/hpddm.py b/config/packages/hpddm.py index f7d9aeb37..c4d773eba 100644 --- a/config/packages/hpddm.py +++ b/config/packages/hpddm.py @@ -74,8 +74,10 @@ def DownloadAndInstall(self,slepcconf,slepcvars,slepc,petsc,archdir,prefixdir): l = self.slflag+d+' -L'+d+' -lhpddm_petsc' f = '-I'+incdir # Write configuration files + self.libflags = l + self.includeflags = f slepcconf.write('#define SLEPC_HAVE_HPDDM 1\n') - slepcvars.write('HPDDM_LIB = '+l+'\n') - slepcvars.write('HPDDM_INCLUDE = '+f+'\n') + slepcvars.write('HPDDM_LIB = '+self.libflags+'\n') + slepcvars.write('HPDDM_INCLUDE = '+self.includeflags+'\n') self.packageflags = l+' '+f self.havepackage = True diff --git a/config/packages/ksvd.py b/config/packages/ksvd.py index bf3f2ca64..293f9768b 100644 --- a/config/packages/ksvd.py +++ b/config/packages/ksvd.py @@ -72,9 +72,11 @@ def Check(self,slepcconf,slepcvars,petsc,archdir): f = [] (result, output) = self.Link([],[],' '.join(l+f+self.elpa.libflags+self.polar.libflags),code,' '.join(f+[self.elpa.includeflags]),petsc.language) if result: + self.libflags = ' '.join(l) + self.includeflags = ' '.join(f) slepcconf.write('#define SLEPC_HAVE_KSVD 1\n') - slepcvars.write('KSVD_LIB = ' + ' '.join(l) + '\n') - slepcvars.write('KSVD_INCLUDE = ' + ' '.join(f) + '\n') + slepcvars.write('KSVD_LIB = ' + self.libflags + '\n') + slepcvars.write('KSVD_INCLUDE = ' + self.includeflags + '\n') self.havepackage = True self.packageflags = ' '.join(l+f) return @@ -170,9 +172,11 @@ def DownloadAndInstall(self,slepcconf,slepcvars,slepc,petsc,archdir,prefixdir): self.log.Exit('Unable to link with downloaded KSVD') # Write configuration files + self.libflags = l + self.includeflags = f slepcconf.write('#define SLEPC_HAVE_KSVD 1\n') - slepcvars.write('KSVD_LIB = ' + l + '\n') - slepcvars.write('KSVD_INCLUDE = ' + f + '\n') + slepcvars.write('KSVD_LIB = ' + self.libflags + '\n') + slepcvars.write('KSVD_INCLUDE = ' + self.includeflags + '\n') self.havepackage = True self.packageflags = l+' '+f diff --git a/config/packages/primme.py b/config/packages/primme.py index 398562c7d..e36fe9230 100644 --- a/config/packages/primme.py +++ b/config/packages/primme.py @@ -86,9 +86,11 @@ def Check(self,slepcconf,slepcvars,petsc,archdir): f = [] (result, output) = self.Link([],[],' '.join(l+f),code,' '.join(f),petsc.language) if result: + self.libflags = ' '.join(l) + self.includeflags = ' '.join(f) slepcconf.write('#define SLEPC_HAVE_PRIMME 1\n') - slepcvars.write('PRIMME_LIB = ' + ' '.join(l) + '\n') - slepcvars.write('PRIMME_INCLUDE = ' + ' '.join(f) + '\n') + slepcvars.write('PRIMME_LIB = ' + self.libflags + '\n') + slepcvars.write('PRIMME_INCLUDE = ' + self.includeflags + '\n') self.havepackage = True self.packageflags = ' '.join(l+f) self.location = includes[0] if self.packageincludes else i @@ -151,9 +153,11 @@ def DownloadAndInstall(self,slepcconf,slepcvars,slepc,petsc,archdir,prefixdir): self.log.Exit('Unable to link with downloaded PRIMME') # Write configuration files + self.libflags = l + self.includeflags = f slepcconf.write('#define SLEPC_HAVE_PRIMME 1\n') - slepcvars.write('PRIMME_LIB = ' + l + '\n') - slepcvars.write('PRIMME_INCLUDE = ' + f + '\n') + slepcvars.write('PRIMME_LIB = ' + self.libflags + '\n') + slepcvars.write('PRIMME_INCLUDE = ' + self.includeflags + '\n') self.location = incdir self.havepackage = True diff --git a/lib/slepc/conf/slepc_variables b/lib/slepc/conf/slepc_variables index 685372bce..af6df48d9 100644 --- a/lib/slepc/conf/slepc_variables +++ b/lib/slepc/conf/slepc_variables @@ -15,7 +15,6 @@ SLEPC_LIB_DIR = ${SLEPC_DIR}/${PETSC_ARCH}/lib SLEPCCONF_H = ${SLEPC_DIR}/${PETSC_ARCH}/include/slepcconf.h SLEPC_INCLUDE = -I${SLEPC_DIR}/include -I${SLEPC_DIR}/${PETSC_ARCH}/include -SLEPC_CEXT_INCLUDES = ${BLOPEX_INCLUDE} ${ELPA_INCLUDE} ${EVSL_INCLUDE} ${HPDDM_INCLUDE} ${PRIMME_INCLUDE} ${POLAR_INCLUDE} ${KSVD_INCLUDE} SLEPC_CC_INCLUDES = ${SLEPC_INCLUDE} ${SLEPC_CEXT_INCLUDES} ${PETSC_CC_INCLUDES} SLEPC_FC_INCLUDES = ${SLEPC_INCLUDE} ${PETSC_FC_INCLUDES} @@ -52,8 +51,6 @@ SLEPC_PEP_LIB = ${SLEPC_C_SH_LIB_PATH} -L${SLEPC_LIB_DIR} ${SLEPC_PEP_LIB_BASI SLEPC_NEP_LIB = ${SLEPC_C_SH_LIB_PATH} -L${SLEPC_LIB_DIR} ${SLEPC_NEP_LIB_BASIC} ${SLEPC_EXTERNAL_LIB} ${PETSC_SNES_LIB} SLEPC_LIB = ${SLEPC_C_SH_LIB_PATH} -L${SLEPC_LIB_DIR} ${SLEPC_LIB_BASIC} ${SLEPC_EXTERNAL_LIB} ${PETSC_SNES_LIB} -SLEPC_EXTERNAL_LIB = ${ARPACK_LIB} ${BLOPEX_LIB} ${ELPA_LIB} ${EVSL_LIB} ${HPDDM_LIB} ${PRIMME_LIB} ${SLICOT_LIB} ${TRLAN_LIB} ${POLAR_LIB} ${KSVD_LIB} - # Redefine variable used to build shared libraries SHLIBS = libslepcsys libslepcmfn libslepclme libslepceps libslepcsvd libslepcpep libslepcnep From a732e04b535de47bc57feda4ad17d6ca62f462cc Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Tue, 8 Aug 2023 19:06:42 +0200 Subject: [PATCH 094/112] slepc4py: use SLEPC_EXTERNAL_LIB variable for external library dirs --- src/binding/slepc4py/conf/confslepc.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/binding/slepc4py/conf/confslepc.py b/src/binding/slepc4py/conf/confslepc.py index 55061c2bd..821633557 100644 --- a/src/binding/slepc4py/conf/confslepc.py +++ b/src/binding/slepc4py/conf/confslepc.py @@ -79,15 +79,10 @@ def _get_slepc_config(self, petsc_dir, slepc_dir): self.configdict['SLEPC_DIR'] = SLEPC_DIR self.configdict['SLEPC_LIB'] = slepc_confdict['SLEPC_LIB'] dirlist = [] - for external in [ - 'ARPACK_LIB', 'BLOPEX_LIB', 'ELPA_LIB', - 'EVSL_LIB', 'HPDDM_LIB', 'PRIMME_LIB', - 'SLICOT_LIB', 'TRLAN_LIB', - ]: - flags = split_quoted(slepc_confdict[external]) - for entry in [lib[2:] for lib in flags if lib.startswith('-L')]: - if entry not in dirlist: - dirlist.append(entry) + flags = split_quoted(slepc_confdict['SLEPC_EXTERNAL_LIB']) + for entry in [lib[2:] for lib in flags if lib.startswith('-L')]: + if entry not in dirlist: + dirlist.append(entry) self.configdict['SLEPC_EXTERNAL_LIB_DIR'] = dirlist def configure_extension(self, extension): From 4d1bf14d8c8085fcba80a66bba987ef8bb6acd15 Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Wed, 9 Aug 2023 16:07:39 +0200 Subject: [PATCH 095/112] makefile: rename SLEPC_CEXT_INCLUDES to SLEPC_EXTERNAL_INCLUDES --- config/configure.py | 2 +- lib/slepc/conf/slepc_variables | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/config/configure.py b/config/configure.py index 60ec4e2bf..0a1f5f043 100755 --- a/config/configure.py +++ b/config/configure.py @@ -277,7 +277,7 @@ def fixLang(lang): if entry not in includeflags: includeflags.append(entry) slepcvars.write('SLEPC_EXTERNAL_LIB = '+' '.join(libflags)+'\n') - slepcvars.write('SLEPC_CEXT_INCLUDES = '+' '.join(includeflags)+'\n') + slepcvars.write('SLEPC_EXTERNAL_INCLUDES = '+' '.join(includeflags)+'\n') log.NewSection('Writing various configuration files...') diff --git a/lib/slepc/conf/slepc_variables b/lib/slepc/conf/slepc_variables index af6df48d9..856221490 100644 --- a/lib/slepc/conf/slepc_variables +++ b/lib/slepc/conf/slepc_variables @@ -15,13 +15,13 @@ SLEPC_LIB_DIR = ${SLEPC_DIR}/${PETSC_ARCH}/lib SLEPCCONF_H = ${SLEPC_DIR}/${PETSC_ARCH}/include/slepcconf.h SLEPC_INCLUDE = -I${SLEPC_DIR}/include -I${SLEPC_DIR}/${PETSC_ARCH}/include -SLEPC_CC_INCLUDES = ${SLEPC_INCLUDE} ${SLEPC_CEXT_INCLUDES} ${PETSC_CC_INCLUDES} +SLEPC_CC_INCLUDES = ${SLEPC_INCLUDE} ${SLEPC_EXTERNAL_INCLUDES} ${PETSC_CC_INCLUDES} SLEPC_FC_INCLUDES = ${SLEPC_INCLUDE} ${PETSC_FC_INCLUDES} -SLEPC_CCPPFLAGS = ${SLEPC_INCLUDE} ${SLEPC_CEXT_INCLUDES} -SLEPC_CXXCPPFLAGS = ${SLEPC_INCLUDE} ${SLEPC_CEXT_INCLUDES} +SLEPC_CCPPFLAGS = ${SLEPC_INCLUDE} ${SLEPC_EXTERNAL_INCLUDES} +SLEPC_CXXCPPFLAGS = ${SLEPC_INCLUDE} ${SLEPC_EXTERNAL_INCLUDES} SLEPC_FCPPFLAGS = ${SLEPC_INCLUDE} -SLEPC_CUDACPPFLAGS = ${SLEPC_INCLUDE} ${SLEPC_CEXT_INCLUDES} +SLEPC_CUDACPPFLAGS = ${SLEPC_INCLUDE} ${SLEPC_EXTERNAL_INCLUDES} SLEPC_C_SH_LIB_PATH = ${CC_LINKER_SLFLAG}${SLEPC_LIB_DIR} SLEPC_F_SH_LIB_PATH = ${FC_LINKER_SLFLAG}${SLEPC_LIB_DIR} From 596feaefd9b8d3de2d29152e1691ec03887c06bf Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Tue, 15 Aug 2023 12:42:11 +0200 Subject: [PATCH 096/112] Make XXXFinalizePackage() public functions --- include/slepcbv.h | 1 + include/slepcds.h | 2 ++ include/slepceps.h | 1 + include/slepcfn.h | 2 ++ include/slepclme.h | 1 + include/slepcmfn.h | 1 + include/slepcnep.h | 1 + include/slepcpep.h | 1 + include/slepcrg.h | 1 + include/slepcst.h | 1 + include/slepcsvd.h | 1 + 11 files changed, 13 insertions(+) diff --git a/include/slepcbv.h b/include/slepcbv.h index 40b205ea9..234ec13f4 100644 --- a/include/slepcbv.h +++ b/include/slepcbv.h @@ -19,6 +19,7 @@ /* SUBMANSEC = BV */ SLEPC_EXTERN PetscErrorCode BVInitializePackage(void); +SLEPC_EXTERN PetscErrorCode BVFinalizePackage(void); /*S BV - Basis vectors, SLEPc object representing a collection of vectors diff --git a/include/slepcds.h b/include/slepcds.h index 3eafb6bcf..2561e2ed9 100644 --- a/include/slepcds.h +++ b/include/slepcds.h @@ -23,6 +23,8 @@ #define DS_MAX_SOLVE 6 SLEPC_EXTERN PetscErrorCode DSInitializePackage(void); +SLEPC_EXTERN PetscErrorCode DSFinalizePackage(void); + /*S DS - Direct solver (or dense system), to represent low-dimensional eigenproblems that must be solved within iterative solvers. This is an diff --git a/include/slepceps.h b/include/slepceps.h index 064afdbb0..471c5dd67 100644 --- a/include/slepceps.h +++ b/include/slepceps.h @@ -24,6 +24,7 @@ /* SUBMANSEC = EPS */ SLEPC_EXTERN PetscErrorCode EPSInitializePackage(void); +SLEPC_EXTERN PetscErrorCode EPSFinalizePackage(void); /*S EPS - Abstract SLEPc object that manages all the eigenvalue diff --git a/include/slepcfn.h b/include/slepcfn.h index fa0aa292b..42cb9c6f7 100644 --- a/include/slepcfn.h +++ b/include/slepcfn.h @@ -21,6 +21,8 @@ #define FN_MAX_SOLVE 16 SLEPC_EXTERN PetscErrorCode FNInitializePackage(void); +SLEPC_EXTERN PetscErrorCode FNFinalizePackage(void); + /*S FN - Abstraction of a mathematical function. diff --git a/include/slepclme.h b/include/slepclme.h index 5a8dda88c..0d88e5716 100644 --- a/include/slepclme.h +++ b/include/slepclme.h @@ -19,6 +19,7 @@ /* SUBMANSEC = LME */ SLEPC_EXTERN PetscErrorCode LMEInitializePackage(void); +SLEPC_EXTERN PetscErrorCode LMEFinalizePackage(void); /*S LME - SLEPc object that encapsulates functionality for linear matrix equations diff --git a/include/slepcmfn.h b/include/slepcmfn.h index 0f2385962..ca362daca 100644 --- a/include/slepcmfn.h +++ b/include/slepcmfn.h @@ -20,6 +20,7 @@ /* SUBMANSEC = MFN */ SLEPC_EXTERN PetscErrorCode MFNInitializePackage(void); +SLEPC_EXTERN PetscErrorCode MFNFinalizePackage(void); /*S MFN - SLEPc object that encapsulates functionality for matrix functions. diff --git a/include/slepcnep.h b/include/slepcnep.h index f61637347..013e921a1 100644 --- a/include/slepcnep.h +++ b/include/slepcnep.h @@ -21,6 +21,7 @@ /* SUBMANSEC = NEP */ SLEPC_EXTERN PetscErrorCode NEPInitializePackage(void); +SLEPC_EXTERN PetscErrorCode NEPFinalizePackage(void); /*S NEP - Abstract SLEPc object that manages all solvers for diff --git a/include/slepcpep.h b/include/slepcpep.h index 7cc70fff7..cb90b00ec 100644 --- a/include/slepcpep.h +++ b/include/slepcpep.h @@ -19,6 +19,7 @@ /* SUBMANSEC = PEP */ SLEPC_EXTERN PetscErrorCode PEPInitializePackage(void); +SLEPC_EXTERN PetscErrorCode PEPFinalizePackage(void); /*S PEP - Abstract SLEPc object that manages all the polynomial eigenvalue diff --git a/include/slepcrg.h b/include/slepcrg.h index 54152a592..9bde154dd 100644 --- a/include/slepcrg.h +++ b/include/slepcrg.h @@ -20,6 +20,7 @@ /* SUBMANSEC = RG */ SLEPC_EXTERN PetscErrorCode RGInitializePackage(void); +SLEPC_EXTERN PetscErrorCode RGFinalizePackage(void); /*J RGType - String with the name of the region. diff --git a/include/slepcst.h b/include/slepcst.h index d8b516e77..8f2fe1453 100644 --- a/include/slepcst.h +++ b/include/slepcst.h @@ -21,6 +21,7 @@ /* SUBMANSEC = ST */ SLEPC_EXTERN PetscErrorCode STInitializePackage(void); +SLEPC_EXTERN PetscErrorCode STFinalizePackage(void); /*S ST - Abstract SLEPc object that manages spectral transformations. diff --git a/include/slepcsvd.h b/include/slepcsvd.h index 8050364da..b4a4fb34e 100644 --- a/include/slepcsvd.h +++ b/include/slepcsvd.h @@ -21,6 +21,7 @@ /* SUBMANSEC = SVD */ SLEPC_EXTERN PetscErrorCode SVDInitializePackage(void); +SLEPC_EXTERN PetscErrorCode SVDFinalizePackage(void); /*S SVD - Abstract SLEPc object that manages all the singular value From 57314427b8e1379ae0f39d93a0d8f1d2716f16ad Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Tue, 15 Aug 2023 13:30:21 +0200 Subject: [PATCH 097/112] Fix visibility of BLOPEX interface functions --- src/eps/impls/external/blopex/blopex.h | 3 +- .../impls/external/blopex/petsc-interface.c | 21 ++++---- .../impls/external/blopex/petsc-interface.h | 53 +++---------------- 3 files changed, 20 insertions(+), 57 deletions(-) diff --git a/src/eps/impls/external/blopex/blopex.h b/src/eps/impls/external/blopex/blopex.h index c8f19b187..ba063cf40 100644 --- a/src/eps/impls/external/blopex/blopex.h +++ b/src/eps/impls/external/blopex/blopex.h @@ -16,8 +16,7 @@ SLEPC_INTERN PetscInt slepc_blopex_useconstr; -extern int -SLEPCSetupInterpreter(mv_InterfaceInterpreter *ii); +SLEPC_INTERN int SLEPCSetupInterpreter(mv_InterfaceInterpreter*); #endif diff --git a/src/eps/impls/external/blopex/petsc-interface.c b/src/eps/impls/external/blopex/petsc-interface.c index 3b3e5f0f4..bfe29350c 100644 --- a/src/eps/impls/external/blopex/petsc-interface.c +++ b/src/eps/impls/external/blopex/petsc-interface.c @@ -4,11 +4,12 @@ /* @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ */ /* This code was developed by Merico Argentati, Andrew Knyazev, Ilya Lashuk and Evgueni Ovtchinnikov */ -#include +#include #include #include #include #include +#include "petsc-interface.h" static PetscRandom LOBPCG_RandomContext = NULL; @@ -77,7 +78,7 @@ BlopexInt PETSC_zsygv_interface (BlopexInt *itype,char *jobz,char *uplo,BlopexIn } #endif -void *PETSC_MimicVector(void *vvector) +static void *PETSC_MimicVector(void *vvector) { Vec temp; @@ -85,7 +86,7 @@ void *PETSC_MimicVector(void *vvector) return (void*)temp; } -BlopexInt PETSC_DestroyVector(void *vvector) +static BlopexInt PETSC_DestroyVector(void *vvector) { Vec v = (Vec)vvector; @@ -93,28 +94,28 @@ BlopexInt PETSC_DestroyVector(void *vvector) return 0; } -BlopexInt PETSC_InnerProd(void *x,void *y,void *result) +static BlopexInt PETSC_InnerProd(void *x,void *y,void *result) { PetscCall(VecDot((Vec)x,(Vec)y,(PetscScalar*)result)); return 0; } -BlopexInt PETSC_CopyVector(void *x,void *y) +static BlopexInt PETSC_CopyVector(void *x,void *y) { PetscCall(VecCopy((Vec)x,(Vec)y)); return 0; } -BlopexInt PETSC_ClearVector(void *x) +static BlopexInt PETSC_ClearVector(void *x) { PetscCall(VecSet((Vec)x,0.0)); return 0; } -BlopexInt PETSC_SetRandomValues(void* v,BlopexInt seed) +static BlopexInt PETSC_SetRandomValues(void* v,BlopexInt seed) { /* note: without previous call to LOBPCG_InitRandomContext LOBPCG_RandomContext will be null, @@ -124,21 +125,21 @@ BlopexInt PETSC_SetRandomValues(void* v,BlopexInt seed) return 0; } -BlopexInt PETSC_ScaleVector(double alpha,void *x) +static BlopexInt PETSC_ScaleVector(double alpha,void *x) { PetscCall(VecScale((Vec)x,alpha)); return 0; } -BlopexInt PETSC_Axpy(void *alpha,void *x,void *y) +static BlopexInt PETSC_Axpy(void *alpha,void *x,void *y) { PetscCall(VecAXPY((Vec)y,*(PetscScalar*)alpha,(Vec)x)); return 0; } -BlopexInt PETSC_VectorSize(void *x) +static BlopexInt PETSC_VectorSize(void *x) { PetscInt N; (void)VecGetSize((Vec)x,&N); diff --git a/src/eps/impls/external/blopex/petsc-interface.h b/src/eps/impls/external/blopex/petsc-interface.h index 90e4573d3..9e3d51de7 100644 --- a/src/eps/impls/external/blopex/petsc-interface.h +++ b/src/eps/impls/external/blopex/petsc-interface.h @@ -9,53 +9,16 @@ #include #if !defined(PETSC_USE_COMPLEX) -BlopexInt PETSC_dpotrf_interface (char *uplo, BlopexInt *n, double *a, BlopexInt * lda, BlopexInt *info); -BlopexInt PETSC_dsygv_interface (BlopexInt *itype, char *jobz, char *uplo, BlopexInt * - n, double *a, BlopexInt *lda, double *b, BlopexInt *ldb, - double *w, double *work, BlopexInt *lwork, BlopexInt *info); +SLEPC_INTERN BlopexInt PETSC_dpotrf_interface(char*,BlopexInt*,double*,BlopexInt*,BlopexInt*); +SLEPC_INTERN BlopexInt PETSC_dsygv_interface(BlopexInt*,char*,char*,BlopexInt*,double*,BlopexInt*,double*,BlopexInt*,double*,double*,BlopexInt*,BlopexInt*); #else -BlopexInt PETSC_zpotrf_interface (char *uplo, BlopexInt *n, komplex *a, BlopexInt * lda, BlopexInt *info); -BlopexInt PETSC_zsygv_interface (BlopexInt *itype, char *jobz, char *uplo, BlopexInt * - n, komplex *a, BlopexInt *lda, komplex *b, BlopexInt *ldb, - double *w, komplex *work, BlopexInt *lwork, double *rwork, BlopexInt *info); +SLEPC_INTERN BlopexInt PETSC_zpotrf_interface(char*,BlopexInt*,komplex*,BlopexInt*,BlopexInt*); +SLEPC_INTERN BlopexInt PETSC_zsygv_interface(BlopexInt*,char*,char*,BlopexInt*,komplex*,BlopexInt*,komplex*,BlopexInt*,double*,komplex*,BlopexInt*,double*,BlopexInt*); #endif -void * -PETSC_MimicVector(void *vvector); - -BlopexInt -PETSC_DestroyVector(void *vvector); - -BlopexInt -PETSC_InnerProd(void *x, void *y, void *result); - -BlopexInt -PETSC_CopyVector(void *x, void *y); - -BlopexInt -PETSC_ClearVector(void *x); - -BlopexInt -PETSC_SetRandomValues(void* v, BlopexInt seed); - -BlopexInt -PETSC_ScaleVector(void *alpha, void *x); - -BlopexInt -PETSC_Axpy(void *alpha, - void *x, - void *y); - -int -LOBPCG_InitRandomContext(MPI_Comm,PetscRandom); - -int -LOBPCG_SetFromOptionsRandomContext(void); - -int -LOBPCG_DestroyRandomContext(void); - -int -PETSCSetupInterpreter(mv_InterfaceInterpreter *ii); +SLEPC_INTERN int LOBPCG_InitRandomContext(MPI_Comm,PetscRandom); +SLEPC_INTERN int LOBPCG_SetFromOptionsRandomContext(void); +SLEPC_INTERN int LOBPCG_DestroyRandomContext(void); +SLEPC_INTERN int PETSCSetupInterpreter(mv_InterfaceInterpreter*); #endif /* PETSC_INTERFACE_HEADER */ From d6e4e058964aad108cee759b9618cd8b950a5dcf Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Tue, 15 Aug 2023 13:10:11 +0200 Subject: [PATCH 098/112] Add static to internal functions --- src/eps/impls/cg/lobpcg/lobpcg.c | 12 ++--- src/eps/impls/cg/rqcg/rqcg.c | 14 ++--- src/eps/impls/ciss/ciss.c | 18 +++---- src/eps/impls/davidson/dvdimprovex.c | 2 +- src/eps/impls/davidson/gd/gd.c | 8 +-- src/eps/impls/davidson/jd/jd.c | 14 ++--- src/eps/impls/external/arpack/arpack.c | 10 ++-- src/eps/impls/external/blopex/blopex.c | 14 ++--- .../impls/external/elemental/elemental.cxx | 8 +-- src/eps/impls/external/elpa/elpa.c | 8 +-- src/eps/impls/external/evsl/evsl.c | 12 ++--- src/eps/impls/external/feast/feast.c | 14 ++--- src/eps/impls/external/primme/primme.c | 12 ++--- src/eps/impls/external/scalapack/scalapack.c | 8 +-- src/eps/impls/external/trlan/trlan.c | 8 +-- src/eps/impls/krylov/arnoldi/arnoldi.c | 10 ++-- src/eps/impls/krylov/epskrylov.c | 2 +- .../impls/krylov/krylovschur/krylovschur.c | 14 ++--- src/eps/impls/krylov/lanczos/lanczos.c | 12 ++--- src/eps/impls/lapack/lapack.c | 4 +- src/eps/impls/lyapii/lyapii.c | 14 ++--- src/eps/impls/power/power.c | 26 ++++----- src/eps/impls/subspace/subspace.c | 8 +-- src/eps/interface/epssetup.c | 2 +- src/lme/impls/krylov/lmekrylov.c | 6 +-- src/lme/interface/lmesolve.c | 2 +- src/mfn/impls/expokit/mfnexpokit.c | 4 +- src/mfn/impls/krylov/mfnkrylov.c | 4 +- src/nep/impls/ciss/nciss.c | 14 ++--- src/nep/impls/interpol/interpol.c | 12 ++--- src/nep/impls/narnoldi/narnoldi.c | 12 ++--- src/nep/impls/nepdefl.c | 4 +- src/nep/impls/nleigs/nleigs.c | 14 ++--- src/nep/impls/rii/rii.c | 12 ++--- src/nep/impls/slp/slp.c | 10 ++-- src/pep/impls/ciss/pciss.c | 14 ++--- src/pep/impls/jd/pjd.c | 36 ++++++------- src/pep/impls/krylov/qarnoldi/qarnoldi.c | 12 ++--- src/pep/impls/krylov/stoar/stoar.c | 10 ++-- src/pep/impls/krylov/toar/ptoar.c | 10 ++-- src/pep/impls/linear/linear.c | 14 ++--- src/svd/impls/cross/cross.c | 14 ++--- src/svd/impls/cyclic/cyclic.c | 16 +++--- .../impls/external/elemental/svdelemen.cxx | 8 +-- src/svd/impls/external/ksvd/svdksvd.c | 12 ++--- src/svd/impls/external/primme/svdprimme.c | 12 ++--- src/svd/impls/external/scalapack/svdscalap.c | 8 +-- src/svd/impls/lanczos/gklanczos.c | 10 ++-- src/svd/impls/lapack/svdlapack.c | 10 ++-- src/svd/impls/randomized/rsvd.c | 4 +- src/svd/impls/trlanczos/trlanczos.c | 26 ++++----- src/sys/classes/bv/impls/contiguous/contig.c | 42 +++++++-------- src/sys/classes/bv/impls/mat/bvmat.c | 46 ++++++++-------- src/sys/classes/bv/impls/svec/svec.c | 46 ++++++++-------- src/sys/classes/bv/impls/tensor/bvtensor.c | 18 +++---- src/sys/classes/bv/impls/vecs/vecs.c | 54 +++++++++---------- src/sys/classes/bv/interface/bvcontour.c | 6 +-- .../classes/bv/interface/cuda/bvorthogcuda.cu | 4 +- src/sys/classes/ds/impls/ghep/dsghep.c | 14 ++--- src/sys/classes/ds/impls/ghiep/dsghiep.c | 22 ++++---- src/sys/classes/ds/impls/gnhep/dsgnhep.c | 16 +++--- src/sys/classes/ds/impls/gsvd/dsgsvd.c | 22 ++++---- src/sys/classes/ds/impls/hep/dshep.c | 28 +++++----- src/sys/classes/ds/impls/hsvd/dshsvd.c | 22 ++++---- src/sys/classes/ds/impls/nep/dsnep.c | 18 +++---- src/sys/classes/ds/impls/nhep/dsnhep.c | 20 +++---- src/sys/classes/ds/impls/nhepts/dsnhepts.c | 22 ++++---- src/sys/classes/ds/impls/pep/dspep.c | 16 +++--- src/sys/classes/ds/impls/svd/dssvd.c | 20 +++---- src/sys/classes/fn/impls/combine/fncombine.c | 14 ++--- src/sys/classes/fn/impls/cuda/fnutilcuda.cu | 2 +- src/sys/classes/fn/impls/cuda/fnutilcuda.h | 1 - src/sys/classes/fn/impls/exp/fnexp.c | 10 ++-- src/sys/classes/fn/impls/invsqrt/fninvsqrt.c | 16 +++--- src/sys/classes/fn/impls/log/fnlog.c | 10 ++-- src/sys/classes/fn/impls/phi/fnphi.c | 14 ++--- .../classes/fn/impls/rational/fnrational.c | 16 +++--- src/sys/classes/fn/impls/sqrt/fnsqrt.c | 16 +++--- src/sys/classes/fn/interface/fnbasic.c | 2 +- src/sys/classes/rg/impls/ellipse/rgellipse.c | 18 +++---- .../classes/rg/impls/interval/rginterval.c | 18 +++---- src/sys/classes/rg/impls/polygon/rgpolygon.c | 16 +++--- src/sys/classes/rg/impls/ring/rgring.c | 18 +++---- src/sys/classes/st/impls/cayley/cayley.c | 18 +++---- src/sys/classes/st/impls/filter/filter.c | 12 ++--- src/sys/classes/st/impls/filter/filtlan.c | 4 +- src/sys/classes/st/impls/precond/precond.c | 10 ++-- src/sys/classes/st/impls/shell/shell.c | 8 +-- src/sys/classes/st/impls/shift/shift.c | 10 ++-- src/sys/classes/st/impls/sinvert/sinvert.c | 10 ++-- src/sys/vec/veccomp0.h | 10 ++-- 91 files changed, 626 insertions(+), 627 deletions(-) diff --git a/src/eps/impls/cg/lobpcg/lobpcg.c b/src/eps/impls/cg/lobpcg/lobpcg.c index 3a95a9d85..742f4dcff 100644 --- a/src/eps/impls/cg/lobpcg/lobpcg.c +++ b/src/eps/impls/cg/lobpcg/lobpcg.c @@ -37,7 +37,7 @@ typedef struct { PetscInt guard; /* number of guard vectors */ } EPS_LOBPCG; -PetscErrorCode EPSSetDimensions_LOBPCG(EPS eps,PetscInt nev,PetscInt *ncv,PetscInt *mpd) +static PetscErrorCode EPSSetDimensions_LOBPCG(EPS eps,PetscInt nev,PetscInt *ncv,PetscInt *mpd) { EPS_LOBPCG *ctx = (EPS_LOBPCG*)eps->data; PetscInt k; @@ -52,7 +52,7 @@ PetscErrorCode EPSSetDimensions_LOBPCG(EPS eps,PetscInt nev,PetscInt *ncv,PetscI PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSSetUp_LOBPCG(EPS eps) +static PetscErrorCode EPSSetUp_LOBPCG(EPS eps) { EPS_LOBPCG *ctx = (EPS_LOBPCG*)eps->data; @@ -81,7 +81,7 @@ PetscErrorCode EPSSetUp_LOBPCG(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSSolve_LOBPCG(EPS eps) +static PetscErrorCode EPSSolve_LOBPCG(EPS eps) { EPS_LOBPCG *ctx = (EPS_LOBPCG*)eps->data; PetscInt i,j,k,nv,ini,nmat,nc,nconv,locked,its,prev=0; @@ -617,7 +617,7 @@ PetscErrorCode EPSLOBPCGGetLocking(EPS eps,PetscBool *lock) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSView_LOBPCG(EPS eps,PetscViewer viewer) +static PetscErrorCode EPSView_LOBPCG(EPS eps,PetscViewer viewer) { EPS_LOBPCG *ctx = (EPS_LOBPCG*)eps->data; PetscBool isascii; @@ -632,7 +632,7 @@ PetscErrorCode EPSView_LOBPCG(EPS eps,PetscViewer viewer) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSSetFromOptions_LOBPCG(EPS eps,PetscOptionItems *PetscOptionsObject) +static PetscErrorCode EPSSetFromOptions_LOBPCG(EPS eps,PetscOptionItems *PetscOptionsObject) { PetscBool lock,flg; PetscInt bs; @@ -654,7 +654,7 @@ PetscErrorCode EPSSetFromOptions_LOBPCG(EPS eps,PetscOptionItems *PetscOptionsOb PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSDestroy_LOBPCG(EPS eps) +static PetscErrorCode EPSDestroy_LOBPCG(EPS eps) { PetscFunctionBegin; PetscCall(PetscFree(eps->data)); diff --git a/src/eps/impls/cg/rqcg/rqcg.c b/src/eps/impls/cg/rqcg/rqcg.c index 5d446c72b..dd1c92490 100644 --- a/src/eps/impls/cg/rqcg/rqcg.c +++ b/src/eps/impls/cg/rqcg/rqcg.c @@ -26,7 +26,7 @@ #include /*I "slepceps.h" I*/ -PetscErrorCode EPSSolve_RQCG(EPS); +static PetscErrorCode EPSSolve_RQCG(EPS); typedef struct { PetscInt nrest; /* user-provided reset parameter */ @@ -34,7 +34,7 @@ typedef struct { BV AV,W,P,G; } EPS_RQCG; -PetscErrorCode EPSSetUp_RQCG(EPS eps) +static PetscErrorCode EPSSetUp_RQCG(EPS eps) { PetscInt nmat; EPS_RQCG *ctx = (EPS_RQCG*)eps->data; @@ -73,7 +73,7 @@ PetscErrorCode EPSSetUp_RQCG(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSSolve_RQCG(EPS eps) +static PetscErrorCode EPSSolve_RQCG(EPS eps) { EPS_RQCG *ctx = (EPS_RQCG*)eps->data; PetscInt i,j,k,ld,nv,ncv = eps->ncv,kini,nmat; @@ -314,7 +314,7 @@ PetscErrorCode EPSRQCGGetReset(EPS eps,PetscInt *nrest) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSReset_RQCG(EPS eps) +static PetscErrorCode EPSReset_RQCG(EPS eps) { EPS_RQCG *ctx = (EPS_RQCG*)eps->data; @@ -327,7 +327,7 @@ PetscErrorCode EPSReset_RQCG(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSSetFromOptions_RQCG(EPS eps,PetscOptionItems *PetscOptionsObject) +static PetscErrorCode EPSSetFromOptions_RQCG(EPS eps,PetscOptionItems *PetscOptionsObject) { PetscBool flg; PetscInt nrest; @@ -342,7 +342,7 @@ PetscErrorCode EPSSetFromOptions_RQCG(EPS eps,PetscOptionItems *PetscOptionsObje PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSDestroy_RQCG(EPS eps) +static PetscErrorCode EPSDestroy_RQCG(EPS eps) { PetscFunctionBegin; PetscCall(PetscFree(eps->data)); @@ -351,7 +351,7 @@ PetscErrorCode EPSDestroy_RQCG(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSView_RQCG(EPS eps,PetscViewer viewer) +static PetscErrorCode EPSView_RQCG(EPS eps,PetscViewer viewer) { EPS_RQCG *ctx = (EPS_RQCG*)eps->data; PetscBool isascii; diff --git a/src/eps/impls/ciss/ciss.c b/src/eps/impls/ciss/ciss.c index 241a02f30..e9d5c7ffe 100644 --- a/src/eps/impls/ciss/ciss.c +++ b/src/eps/impls/ciss/ciss.c @@ -209,7 +209,7 @@ static PetscErrorCode rescale_eig(EPS eps,PetscInt nv) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSSetUp_CISS(EPS eps) +static PetscErrorCode EPSSetUp_CISS(EPS eps) { EPS_CISS *ctx = (EPS_CISS*)eps->data; SlepcContourData contour; @@ -351,7 +351,7 @@ PetscErrorCode EPSSetUp_CISS(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSSetUpSort_CISS(EPS eps) +static PetscErrorCode EPSSetUpSort_CISS(EPS eps) { SlepcSC sc; @@ -371,7 +371,7 @@ PetscErrorCode EPSSetUpSort_CISS(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSSolve_CISS(EPS eps) +static PetscErrorCode EPSSolve_CISS(EPS eps) { EPS_CISS *ctx = (EPS_CISS*)eps->data; SlepcContourData contour = ctx->contour; @@ -618,7 +618,7 @@ PetscErrorCode EPSSolve_CISS(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSComputeVectors_CISS(EPS eps) +static PetscErrorCode EPSComputeVectors_CISS(EPS eps) { EPS_CISS *ctx = (EPS_CISS*)eps->data; PetscInt n; @@ -1261,7 +1261,7 @@ PetscErrorCode EPSCISSGetKSPs(EPS eps,PetscInt *nsolve,KSP **ksp) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSReset_CISS(EPS eps) +static PetscErrorCode EPSReset_CISS(EPS eps) { EPS_CISS *ctx = (EPS_CISS*)eps->data; @@ -1274,7 +1274,7 @@ PetscErrorCode EPSReset_CISS(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSSetFromOptions_CISS(EPS eps,PetscOptionItems *PetscOptionsObject) +static PetscErrorCode EPSSetFromOptions_CISS(EPS eps,PetscOptionItems *PetscOptionsObject) { PetscReal r3,r4; PetscInt i,i1,i2,i3,i4,i5,i6,i7; @@ -1326,7 +1326,7 @@ PetscErrorCode EPSSetFromOptions_CISS(EPS eps,PetscOptionItems *PetscOptionsObje PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSDestroy_CISS(EPS eps) +static PetscErrorCode EPSDestroy_CISS(EPS eps) { EPS_CISS *ctx = (EPS_CISS*)eps->data; @@ -1350,7 +1350,7 @@ PetscErrorCode EPSDestroy_CISS(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSView_CISS(EPS eps,PetscViewer viewer) +static PetscErrorCode EPSView_CISS(EPS eps,PetscViewer viewer) { EPS_CISS *ctx = (EPS_CISS*)eps->data; PetscBool isascii; @@ -1385,7 +1385,7 @@ PetscErrorCode EPSView_CISS(EPS eps,PetscViewer viewer) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSSetDefaultST_CISS(EPS eps) +static PetscErrorCode EPSSetDefaultST_CISS(EPS eps) { EPS_CISS *ctx = (EPS_CISS*)eps->data; PetscBool usest = ctx->usest; diff --git a/src/eps/impls/davidson/dvdimprovex.c b/src/eps/impls/davidson/dvdimprovex.c index 2d0a251ba..5ae6d94e1 100644 --- a/src/eps/impls/davidson/dvdimprovex.c +++ b/src/eps/impls/davidson/dvdimprovex.c @@ -830,7 +830,7 @@ static inline PetscErrorCode dvd_compute_n_rr(PetscInt i_s,PetscInt n,PetscScala pX,pY, the right and left eigenvectors of the projected system ld, the leading dimension of pX and pY */ -PetscErrorCode dvd_improvex_jd_proj_uv_KZX(dvdDashboard *d,PetscInt i_s,PetscInt i_e,Vec *u,Vec *v,Vec *kr,PetscScalar *theta,PetscScalar *thetai,PetscScalar *pX,PetscScalar *pY,PetscInt ld) +static PetscErrorCode dvd_improvex_jd_proj_uv_KZX(dvdDashboard *d,PetscInt i_s,PetscInt i_e,Vec *u,Vec *v,Vec *kr,PetscScalar *theta,PetscScalar *thetai,PetscScalar *pX,PetscScalar *pY,PetscInt ld) { PetscInt n = i_e-i_s,i; PetscScalar *b; diff --git a/src/eps/impls/davidson/gd/gd.c b/src/eps/impls/davidson/gd/gd.c index 9fec73125..b9f67b665 100644 --- a/src/eps/impls/davidson/gd/gd.c +++ b/src/eps/impls/davidson/gd/gd.c @@ -30,7 +30,7 @@ #include /*I "slepceps.h" I*/ #include <../src/eps/impls/davidson/davidson.h> -PetscErrorCode EPSSetFromOptions_GD(EPS eps,PetscOptionItems *PetscOptionsObject) +static PetscErrorCode EPSSetFromOptions_GD(EPS eps,PetscOptionItems *PetscOptionsObject) { PetscBool flg,flg2,op,orth; PetscInt opi,opi0; @@ -66,7 +66,7 @@ PetscErrorCode EPSSetFromOptions_GD(EPS eps,PetscOptionItems *PetscOptionsObject PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSSetUp_GD(EPS eps) +static PetscErrorCode EPSSetUp_GD(EPS eps) { PetscBool t; KSP ksp; @@ -82,7 +82,7 @@ PetscErrorCode EPSSetUp_GD(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSView_GD(EPS eps,PetscViewer viewer) +static PetscErrorCode EPSView_GD(EPS eps,PetscViewer viewer) { PetscBool isascii,opb; PetscInt opi,opi0; @@ -108,7 +108,7 @@ PetscErrorCode EPSView_GD(EPS eps,PetscViewer viewer) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSDestroy_GD(EPS eps) +static PetscErrorCode EPSDestroy_GD(EPS eps) { PetscFunctionBegin; PetscCall(PetscFree(eps->data)); diff --git a/src/eps/impls/davidson/jd/jd.c b/src/eps/impls/davidson/jd/jd.c index 7e536a4c4..81a6cfb4f 100644 --- a/src/eps/impls/davidson/jd/jd.c +++ b/src/eps/impls/davidson/jd/jd.c @@ -31,7 +31,7 @@ #include /*I "slepceps.h" I*/ #include <../src/eps/impls/davidson/davidson.h> -PetscErrorCode EPSSetFromOptions_JD(EPS eps,PetscOptionItems *PetscOptionsObject) +static PetscErrorCode EPSSetFromOptions_JD(EPS eps,PetscOptionItems *PetscOptionsObject) { PetscBool flg,flg2,op,orth; PetscInt opi,opi0; @@ -73,7 +73,7 @@ PetscErrorCode EPSSetFromOptions_JD(EPS eps,PetscOptionItems *PetscOptionsObject PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSSetDefaultST_JD(EPS eps) +static PetscErrorCode EPSSetDefaultST_JD(EPS eps) { KSP ksp; @@ -90,7 +90,7 @@ PetscErrorCode EPSSetDefaultST_JD(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSSetUp_JD(EPS eps) +static PetscErrorCode EPSSetUp_JD(EPS eps) { PetscBool t; KSP ksp; @@ -106,7 +106,7 @@ PetscErrorCode EPSSetUp_JD(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSView_JD(EPS eps,PetscViewer viewer) +static PetscErrorCode EPSView_JD(EPS eps,PetscViewer viewer) { PetscBool isascii,opb; PetscReal opf; @@ -136,7 +136,7 @@ PetscErrorCode EPSView_JD(EPS eps,PetscViewer viewer) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSDestroy_JD(EPS eps) +static PetscErrorCode EPSDestroy_JD(EPS eps) { PetscFunctionBegin; PetscCall(PetscFree(eps->data)); @@ -380,7 +380,7 @@ PetscErrorCode EPSJDGetInitialSize(EPS eps,PetscInt *initialsize) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSJDSetFix_JD(EPS eps,PetscReal fix) +static PetscErrorCode EPSJDSetFix_JD(EPS eps,PetscReal fix) { EPS_DAVIDSON *data = (EPS_DAVIDSON*)eps->data; @@ -461,7 +461,7 @@ PetscErrorCode EPSJDGetFix(EPS eps,PetscReal *fix) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSJDSetConstCorrectionTol_JD(EPS eps,PetscBool constant) +static PetscErrorCode EPSJDSetConstCorrectionTol_JD(EPS eps,PetscBool constant) { EPS_DAVIDSON *data = (EPS_DAVIDSON*)eps->data; diff --git a/src/eps/impls/external/arpack/arpack.c b/src/eps/impls/external/arpack/arpack.c index d0f172743..de1bb8bd7 100644 --- a/src/eps/impls/external/arpack/arpack.c +++ b/src/eps/impls/external/arpack/arpack.c @@ -14,7 +14,7 @@ #include #include "arpack.h" -PetscErrorCode EPSSetUp_ARPACK(EPS eps) +static PetscErrorCode EPSSetUp_ARPACK(EPS eps) { PetscInt ncv; EPS_ARPACK *ar = (EPS_ARPACK*)eps->data; @@ -61,7 +61,7 @@ PetscErrorCode EPSSetUp_ARPACK(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSSolve_ARPACK(EPS eps) +static PetscErrorCode EPSSolve_ARPACK(EPS eps) { EPS_ARPACK *ar = (EPS_ARPACK*)eps->data; char bmat[1],howmny[] = "A"; @@ -240,7 +240,7 @@ PetscErrorCode EPSSolve_ARPACK(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSBackTransform_ARPACK(EPS eps) +static PetscErrorCode EPSBackTransform_ARPACK(EPS eps) { PetscBool isSinv; @@ -250,7 +250,7 @@ PetscErrorCode EPSBackTransform_ARPACK(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSReset_ARPACK(EPS eps) +static PetscErrorCode EPSReset_ARPACK(EPS eps) { EPS_ARPACK *ar = (EPS_ARPACK*)eps->data; @@ -265,7 +265,7 @@ PetscErrorCode EPSReset_ARPACK(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSDestroy_ARPACK(EPS eps) +static PetscErrorCode EPSDestroy_ARPACK(EPS eps) { PetscFunctionBegin; PetscCall(PetscFree(eps->data)); diff --git a/src/eps/impls/external/blopex/blopex.c b/src/eps/impls/external/blopex/blopex.c index 01afcc3a1..73e97f61d 100644 --- a/src/eps/impls/external/blopex/blopex.c +++ b/src/eps/impls/external/blopex/blopex.c @@ -102,7 +102,7 @@ static void OperatorBMultiVector(void *data,void *x,void *y) PetscFunctionReturnVoid(); } -PetscErrorCode EPSSetDimensions_BLOPEX(EPS eps,PetscInt nev,PetscInt *ncv,PetscInt *mpd) +static PetscErrorCode EPSSetDimensions_BLOPEX(EPS eps,PetscInt nev,PetscInt *ncv,PetscInt *mpd) { EPS_BLOPEX *ctx = (EPS_BLOPEX*)eps->data; PetscInt k; @@ -117,7 +117,7 @@ PetscErrorCode EPSSetDimensions_BLOPEX(EPS eps,PetscInt nev,PetscInt *ncv,PetscI PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSSetUp_BLOPEX(EPS eps) +static PetscErrorCode EPSSetUp_BLOPEX(EPS eps) { EPS_BLOPEX *blopex = (EPS_BLOPEX*)eps->data; PetscBool flg; @@ -169,7 +169,7 @@ PetscErrorCode EPSSetUp_BLOPEX(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSSolve_BLOPEX(EPS eps) +static PetscErrorCode EPSSolve_BLOPEX(EPS eps) { EPS_BLOPEX *blopex = (EPS_BLOPEX*)eps->data; PetscScalar sigma,*eigr=NULL; @@ -338,7 +338,7 @@ PetscErrorCode EPSBLOPEXGetBlockSize(EPS eps,PetscInt *bs) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSReset_BLOPEX(EPS eps) +static PetscErrorCode EPSReset_BLOPEX(EPS eps) { EPS_BLOPEX *blopex = (EPS_BLOPEX*)eps->data; @@ -347,7 +347,7 @@ PetscErrorCode EPSReset_BLOPEX(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSDestroy_BLOPEX(EPS eps) +static PetscErrorCode EPSDestroy_BLOPEX(EPS eps) { PetscFunctionBegin; LOBPCG_DestroyRandomContext(); @@ -357,7 +357,7 @@ PetscErrorCode EPSDestroy_BLOPEX(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSView_BLOPEX(EPS eps,PetscViewer viewer) +static PetscErrorCode EPSView_BLOPEX(EPS eps,PetscViewer viewer) { EPS_BLOPEX *ctx = (EPS_BLOPEX*)eps->data; PetscBool isascii; @@ -368,7 +368,7 @@ PetscErrorCode EPSView_BLOPEX(EPS eps,PetscViewer viewer) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSSetFromOptions_BLOPEX(EPS eps,PetscOptionItems *PetscOptionsObject) +static PetscErrorCode EPSSetFromOptions_BLOPEX(EPS eps,PetscOptionItems *PetscOptionsObject) { PetscBool flg; PetscInt bs; diff --git a/src/eps/impls/external/elemental/elemental.cxx b/src/eps/impls/external/elemental/elemental.cxx index 25fade498..ed7360379 100644 --- a/src/eps/impls/external/elemental/elemental.cxx +++ b/src/eps/impls/external/elemental/elemental.cxx @@ -18,7 +18,7 @@ typedef struct { Mat Ae,Be; /* converted matrices */ } EPS_Elemental; -PetscErrorCode EPSSetUp_Elemental(EPS eps) +static PetscErrorCode EPSSetUp_Elemental(EPS eps) { EPS_Elemental *ctx = (EPS_Elemental*)eps->data; Mat A,B; @@ -57,7 +57,7 @@ PetscErrorCode EPSSetUp_Elemental(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSSolve_Elemental(EPS eps) +static PetscErrorCode EPSSolve_Elemental(EPS eps) { EPS_Elemental *ctx = (EPS_Elemental*)eps->data; Mat A = ctx->Ae,B = ctx->Be,Q,V; @@ -90,14 +90,14 @@ PetscErrorCode EPSSolve_Elemental(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSDestroy_Elemental(EPS eps) +static PetscErrorCode EPSDestroy_Elemental(EPS eps) { PetscFunctionBegin; PetscCall(PetscFree(eps->data)); PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSReset_Elemental(EPS eps) +static PetscErrorCode EPSReset_Elemental(EPS eps) { EPS_Elemental *ctx = (EPS_Elemental*)eps->data; diff --git a/src/eps/impls/external/elpa/elpa.c b/src/eps/impls/external/elpa/elpa.c index 3d13f9c76..b06503380 100644 --- a/src/eps/impls/external/elpa/elpa.c +++ b/src/eps/impls/external/elpa/elpa.c @@ -42,7 +42,7 @@ typedef struct { Mat As,Bs; /* converted matrices */ } EPS_ELPA; -PetscErrorCode EPSSetUp_ELPA(EPS eps) +static PetscErrorCode EPSSetUp_ELPA(EPS eps) { EPS_ELPA *ctx = (EPS_ELPA*)eps->data; Mat A,B; @@ -81,7 +81,7 @@ PetscErrorCode EPSSetUp_ELPA(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSSolve_ELPA(EPS eps) +static PetscErrorCode EPSSolve_ELPA(EPS eps) { EPS_ELPA *ctx = (EPS_ELPA*)eps->data; Mat A = ctx->As,B = ctx->Bs,Q,V; @@ -139,14 +139,14 @@ PetscErrorCode EPSSolve_ELPA(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSDestroy_ELPA(EPS eps) +static PetscErrorCode EPSDestroy_ELPA(EPS eps) { PetscFunctionBegin; PetscCall(PetscFree(eps->data)); PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSReset_ELPA(EPS eps) +static PetscErrorCode EPSReset_ELPA(EPS eps) { EPS_ELPA *ctx = (EPS_ELPA*)eps->data; diff --git a/src/eps/impls/external/evsl/evsl.c b/src/eps/impls/external/evsl/evsl.c index 9bac5cd08..cd483e162 100644 --- a/src/eps/impls/external/evsl/evsl.c +++ b/src/eps/impls/external/evsl/evsl.c @@ -57,7 +57,7 @@ static void AMatvec_EVSL(double *xa,double *ya,void *data) PetscFunctionReturnVoid(); } -PetscErrorCode EPSSetUp_EVSL(EPS eps) +static PetscErrorCode EPSSetUp_EVSL(EPS eps) { EPS_EVSL *ctx = (EPS_EVSL*)eps->data; PetscMPIInt size,rank; @@ -159,7 +159,7 @@ PetscErrorCode EPSSetUp_EVSL(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSSolve_EVSL(EPS eps) +static PetscErrorCode EPSSolve_EVSL(EPS eps) { EPS_EVSL *ctx = (EPS_EVSL*)eps->data; PetscInt i,j,k=0,sl,mlan,nevout,*ind,nevmax,rstart,rend,*nevloc,*disp,N; @@ -697,7 +697,7 @@ PetscErrorCode EPSEVSLGetDamping(EPS eps,EPSEVSLDamping *damping) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSView_EVSL(EPS eps,PetscViewer viewer) +static PetscErrorCode EPSView_EVSL(EPS eps,PetscViewer viewer) { PetscBool isascii; EPS_EVSL *ctx = (EPS_EVSL*)eps->data; @@ -724,7 +724,7 @@ PetscErrorCode EPSView_EVSL(EPS eps,PetscViewer viewer) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSSetFromOptions_EVSL(EPS eps,PetscOptionItems *PetscOptionsObject) +static PetscErrorCode EPSSetFromOptions_EVSL(EPS eps,PetscOptionItems *PetscOptionsObject) { PetscReal array[2]={0,0},th; PetscInt k,i1,i2,i3,i4; @@ -769,7 +769,7 @@ PetscErrorCode EPSSetFromOptions_EVSL(EPS eps,PetscOptionItems *PetscOptionsObje PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSDestroy_EVSL(EPS eps) +static PetscErrorCode EPSDestroy_EVSL(EPS eps) { EPS_EVSL *ctx = (EPS_EVSL*)eps->data; @@ -791,7 +791,7 @@ PetscErrorCode EPSDestroy_EVSL(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSReset_EVSL(EPS eps) +static PetscErrorCode EPSReset_EVSL(EPS eps) { EPS_EVSL *ctx = (EPS_EVSL*)eps->data; diff --git a/src/eps/impls/external/feast/feast.c b/src/eps/impls/external/feast/feast.c index bd6e8bfc8..10f85e08e 100644 --- a/src/eps/impls/external/feast/feast.c +++ b/src/eps/impls/external/feast/feast.c @@ -45,7 +45,7 @@ typedef struct { #endif } EPS_FEAST; -PetscErrorCode EPSSetUp_FEAST(EPS eps) +static PetscErrorCode EPSSetUp_FEAST(EPS eps) { PetscInt ncv; EPS_FEAST *ctx = (EPS_FEAST*)eps->data; @@ -77,7 +77,7 @@ PetscErrorCode EPSSetUp_FEAST(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSSolve_FEAST(EPS eps) +static PetscErrorCode EPSSolve_FEAST(EPS eps) { EPS_FEAST *ctx = (EPS_FEAST*)eps->data; MKL_INT fpm[128],ijob,n,ncv,nconv,loop,info; @@ -196,7 +196,7 @@ PetscErrorCode EPSSolve_FEAST(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSReset_FEAST(EPS eps) +static PetscErrorCode EPSReset_FEAST(EPS eps) { EPS_FEAST *ctx = (EPS_FEAST*)eps->data; @@ -205,7 +205,7 @@ PetscErrorCode EPSReset_FEAST(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSDestroy_FEAST(EPS eps) +static PetscErrorCode EPSDestroy_FEAST(EPS eps) { PetscFunctionBegin; PetscCall(PetscFree(eps->data)); @@ -214,7 +214,7 @@ PetscErrorCode EPSDestroy_FEAST(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSSetFromOptions_FEAST(EPS eps,PetscOptionItems *PetscOptionsObject) +static PetscErrorCode EPSSetFromOptions_FEAST(EPS eps,PetscOptionItems *PetscOptionsObject) { EPS_FEAST *ctx = (EPS_FEAST*)eps->data; PetscInt n; @@ -231,7 +231,7 @@ PetscErrorCode EPSSetFromOptions_FEAST(EPS eps,PetscOptionItems *PetscOptionsObj PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSView_FEAST(EPS eps,PetscViewer viewer) +static PetscErrorCode EPSView_FEAST(EPS eps,PetscViewer viewer) { EPS_FEAST *ctx = (EPS_FEAST*)eps->data; PetscBool isascii; @@ -242,7 +242,7 @@ PetscErrorCode EPSView_FEAST(EPS eps,PetscViewer viewer) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSSetDefaultST_FEAST(EPS eps) +static PetscErrorCode EPSSetDefaultST_FEAST(EPS eps) { PetscFunctionBegin; if (!((PetscObject)eps->st)->type_name) PetscCall(STSetType(eps->st,STSINVERT)); diff --git a/src/eps/impls/external/primme/primme.c b/src/eps/impls/external/primme/primme.c index 687cd1688..05940694a 100644 --- a/src/eps/impls/external/primme/primme.c +++ b/src/eps/impls/external/primme/primme.c @@ -169,7 +169,7 @@ static void applyPreconditioner_PRIMME(void *xa,PRIMME_INT *ldx,void *ya,PRIMME_ PetscFunctionReturnVoid(); } -PetscErrorCode EPSSetUp_PRIMME(EPS eps) +static PetscErrorCode EPSSetUp_PRIMME(EPS eps) { PetscMPIInt numProcs,procID; EPS_PRIMME *ops = (EPS_PRIMME*)eps->data; @@ -306,7 +306,7 @@ PetscErrorCode EPSSetUp_PRIMME(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSSolve_PRIMME(EPS eps) +static PetscErrorCode EPSSolve_PRIMME(EPS eps) { EPS_PRIMME *ops = (EPS_PRIMME*)eps->data; PetscScalar *a; @@ -357,7 +357,7 @@ PetscErrorCode EPSSolve_PRIMME(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSReset_PRIMME(EPS eps) +static PetscErrorCode EPSReset_PRIMME(EPS eps) { EPS_PRIMME *ops = (EPS_PRIMME*)eps->data; @@ -368,7 +368,7 @@ PetscErrorCode EPSReset_PRIMME(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSDestroy_PRIMME(EPS eps) +static PetscErrorCode EPSDestroy_PRIMME(EPS eps) { PetscFunctionBegin; PetscCall(PetscFree(eps->data)); @@ -379,7 +379,7 @@ PetscErrorCode EPSDestroy_PRIMME(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSView_PRIMME(EPS eps,PetscViewer viewer) +static PetscErrorCode EPSView_PRIMME(EPS eps,PetscViewer viewer) { PetscBool isascii; EPS_PRIMME *ctx = (EPS_PRIMME*)eps->data; @@ -398,7 +398,7 @@ PetscErrorCode EPSView_PRIMME(EPS eps,PetscViewer viewer) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSSetFromOptions_PRIMME(EPS eps,PetscOptionItems *PetscOptionsObject) +static PetscErrorCode EPSSetFromOptions_PRIMME(EPS eps,PetscOptionItems *PetscOptionsObject) { EPS_PRIMME *ctx = (EPS_PRIMME*)eps->data; PetscInt bs; diff --git a/src/eps/impls/external/scalapack/scalapack.c b/src/eps/impls/external/scalapack/scalapack.c index a2777af7d..5ddbb2021 100644 --- a/src/eps/impls/external/scalapack/scalapack.c +++ b/src/eps/impls/external/scalapack/scalapack.c @@ -18,7 +18,7 @@ typedef struct { Mat As,Bs; /* converted matrices */ } EPS_ScaLAPACK; -PetscErrorCode EPSSetUp_ScaLAPACK(EPS eps) +static PetscErrorCode EPSSetUp_ScaLAPACK(EPS eps) { EPS_ScaLAPACK *ctx = (EPS_ScaLAPACK*)eps->data; Mat A,B; @@ -57,7 +57,7 @@ PetscErrorCode EPSSetUp_ScaLAPACK(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSSolve_ScaLAPACK(EPS eps) +static PetscErrorCode EPSSolve_ScaLAPACK(EPS eps) { EPS_ScaLAPACK *ctx = (EPS_ScaLAPACK*)eps->data; Mat A = ctx->As,B = ctx->Bs,Q,V; @@ -150,14 +150,14 @@ PetscErrorCode EPSSolve_ScaLAPACK(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSDestroy_ScaLAPACK(EPS eps) +static PetscErrorCode EPSDestroy_ScaLAPACK(EPS eps) { PetscFunctionBegin; PetscCall(PetscFree(eps->data)); PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSReset_ScaLAPACK(EPS eps) +static PetscErrorCode EPSReset_ScaLAPACK(EPS eps) { EPS_ScaLAPACK *ctx = (EPS_ScaLAPACK*)eps->data; diff --git a/src/eps/impls/external/trlan/trlan.c b/src/eps/impls/external/trlan/trlan.c index b310fd552..fe294440f 100644 --- a/src/eps/impls/external/trlan/trlan.c +++ b/src/eps/impls/external/trlan/trlan.c @@ -20,7 +20,7 @@ static struct { Vec x,y; } globaldata; -PetscErrorCode EPSSetUp_TRLAN(EPS eps) +static PetscErrorCode EPSSetUp_TRLAN(EPS eps) { EPS_TRLAN *tr = (EPS_TRLAN*)eps->data; @@ -67,7 +67,7 @@ static PetscBLASInt MatMult_TRLAN(PetscBLASInt *n,PetscBLASInt *m,PetscReal *xin PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSSolve_TRLAN(EPS eps) +static PetscErrorCode EPSSolve_TRLAN(EPS eps) { PetscInt i; PetscBLASInt ipar[32],n,lohi,stat,ncv; @@ -131,7 +131,7 @@ PetscErrorCode EPSSolve_TRLAN(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSReset_TRLAN(EPS eps) +static PetscErrorCode EPSReset_TRLAN(EPS eps) { EPS_TRLAN *tr = (EPS_TRLAN*)eps->data; @@ -140,7 +140,7 @@ PetscErrorCode EPSReset_TRLAN(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSDestroy_TRLAN(EPS eps) +static PetscErrorCode EPSDestroy_TRLAN(EPS eps) { PetscFunctionBegin; PetscCall(PetscFree(eps->data)); diff --git a/src/eps/impls/krylov/arnoldi/arnoldi.c b/src/eps/impls/krylov/arnoldi/arnoldi.c index b02807956..ae51b04ca 100644 --- a/src/eps/impls/krylov/arnoldi/arnoldi.c +++ b/src/eps/impls/krylov/arnoldi/arnoldi.c @@ -28,7 +28,7 @@ typedef struct { PetscBool delayed; } EPS_ARNOLDI; -PetscErrorCode EPSSetUp_Arnoldi(EPS eps) +static PetscErrorCode EPSSetUp_Arnoldi(EPS eps) { PetscFunctionBegin; EPSCheckDefinite(eps); @@ -48,7 +48,7 @@ PetscErrorCode EPSSetUp_Arnoldi(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSSolve_Arnoldi(EPS eps) +static PetscErrorCode EPSSolve_Arnoldi(EPS eps) { PetscInt k,nv,ld; Mat U,Op,H; @@ -129,7 +129,7 @@ PetscErrorCode EPSSolve_Arnoldi(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSSetFromOptions_Arnoldi(EPS eps,PetscOptionItems *PetscOptionsObject) +static PetscErrorCode EPSSetFromOptions_Arnoldi(EPS eps,PetscOptionItems *PetscOptionsObject) { PetscBool set,val; EPS_ARNOLDI *arnoldi = (EPS_ARNOLDI*)eps->data; @@ -218,7 +218,7 @@ PetscErrorCode EPSArnoldiGetDelayed(EPS eps,PetscBool *delayed) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSDestroy_Arnoldi(EPS eps) +static PetscErrorCode EPSDestroy_Arnoldi(EPS eps) { PetscFunctionBegin; PetscCall(PetscFree(eps->data)); @@ -227,7 +227,7 @@ PetscErrorCode EPSDestroy_Arnoldi(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSView_Arnoldi(EPS eps,PetscViewer viewer) +static PetscErrorCode EPSView_Arnoldi(EPS eps,PetscViewer viewer) { PetscBool isascii; EPS_ARNOLDI *arnoldi = (EPS_ARNOLDI*)eps->data; diff --git a/src/eps/impls/krylov/epskrylov.c b/src/eps/impls/krylov/epskrylov.c index 6c62ad5ed..1d2bbefde 100644 --- a/src/eps/impls/krylov/epskrylov.c +++ b/src/eps/impls/krylov/epskrylov.c @@ -157,7 +157,7 @@ PetscErrorCode EPSDelayedArnoldi1(EPS eps,PetscScalar *H,PetscInt ldh,PetscInt k /* EPSKrylovConvergence_Filter - Specialized version for STFILTER. */ -PetscErrorCode EPSKrylovConvergence_Filter(EPS eps,PetscBool getall,PetscInt kini,PetscInt nits,PetscReal beta,PetscReal gamma,PetscInt *kout) +static PetscErrorCode EPSKrylovConvergence_Filter(EPS eps,PetscBool getall,PetscInt kini,PetscInt nits,PetscReal beta,PetscReal gamma,PetscInt *kout) { PetscInt k,ninside,nconv; PetscScalar re,im; diff --git a/src/eps/impls/krylov/krylovschur/krylovschur.c b/src/eps/impls/krylov/krylovschur/krylovschur.c index 4d5d8f7cd..85208b5d7 100644 --- a/src/eps/impls/krylov/krylovschur/krylovschur.c +++ b/src/eps/impls/krylov/krylovschur/krylovschur.c @@ -90,7 +90,7 @@ static PetscErrorCode EPSSetUp_KrylovSchur_Filter(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSSetUp_KrylovSchur(EPS eps) +static PetscErrorCode EPSSetUp_KrylovSchur(EPS eps) { PetscReal eta; PetscBool isfilt=PETSC_FALSE; @@ -190,7 +190,7 @@ PetscErrorCode EPSSetUp_KrylovSchur(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSSetUpSort_KrylovSchur(EPS eps) +static PetscErrorCode EPSSetUpSort_KrylovSchur(EPS eps) { EPS_KRYLOVSCHUR *ctx = (EPS_KRYLOVSCHUR*)eps->data; SlepcSC sc; @@ -1344,7 +1344,7 @@ PetscErrorCode EPSKrylovSchurGetKSP(EPS eps,KSP *ksp) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSSetFromOptions_KrylovSchur(EPS eps,PetscOptionItems *PetscOptionsObject) +static PetscErrorCode EPSSetFromOptions_KrylovSchur(EPS eps,PetscOptionItems *PetscOptionsObject) { EPS_KRYLOVSCHUR *ctx = (EPS_KRYLOVSCHUR*)eps->data; PetscBool flg,lock,b,f1,f2,f3,isfilt; @@ -1392,7 +1392,7 @@ PetscErrorCode EPSSetFromOptions_KrylovSchur(EPS eps,PetscOptionItems *PetscOpti PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSView_KrylovSchur(EPS eps,PetscViewer viewer) +static PetscErrorCode EPSView_KrylovSchur(EPS eps,PetscViewer viewer) { EPS_KRYLOVSCHUR *ctx = (EPS_KRYLOVSCHUR*)eps->data; PetscBool isascii,isfilt; @@ -1432,7 +1432,7 @@ PetscErrorCode EPSView_KrylovSchur(EPS eps,PetscViewer viewer) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSDestroy_KrylovSchur(EPS eps) +static PetscErrorCode EPSDestroy_KrylovSchur(EPS eps) { PetscBool isfilt; @@ -1461,7 +1461,7 @@ PetscErrorCode EPSDestroy_KrylovSchur(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSReset_KrylovSchur(EPS eps) +static PetscErrorCode EPSReset_KrylovSchur(EPS eps) { PetscBool isfilt; @@ -1471,7 +1471,7 @@ PetscErrorCode EPSReset_KrylovSchur(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSSetDefaultST_KrylovSchur(EPS eps) +static PetscErrorCode EPSSetDefaultST_KrylovSchur(EPS eps) { PetscFunctionBegin; if (eps->which==EPS_ALL) { diff --git a/src/eps/impls/krylov/lanczos/lanczos.c b/src/eps/impls/krylov/lanczos/lanczos.c index 8ca13c4ca..e85b64bfa 100644 --- a/src/eps/impls/krylov/lanczos/lanczos.c +++ b/src/eps/impls/krylov/lanczos/lanczos.c @@ -33,7 +33,7 @@ typedef struct { BV AV; /* work BV used in selective reorthogonalization */ } EPS_LANCZOS; -PetscErrorCode EPSSetUp_Lanczos(EPS eps) +static PetscErrorCode EPSSetUp_Lanczos(EPS eps) { EPS_LANCZOS *lanczos = (EPS_LANCZOS*)eps->data; BVOrthogRefineType refine; @@ -514,7 +514,7 @@ static PetscErrorCode EPSBasicLanczos(EPS eps,PetscInt k,PetscInt *m,PetscReal * PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSSolve_Lanczos(EPS eps) +static PetscErrorCode EPSSolve_Lanczos(EPS eps) { EPS_LANCZOS *lanczos = (EPS_LANCZOS*)eps->data; PetscInt nconv,i,j,k,l,x,n,*perm,restart,ncv=eps->ncv,r,ld; @@ -695,7 +695,7 @@ PetscErrorCode EPSSolve_Lanczos(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSSetFromOptions_Lanczos(EPS eps,PetscOptionItems *PetscOptionsObject) +static PetscErrorCode EPSSetFromOptions_Lanczos(EPS eps,PetscOptionItems *PetscOptionsObject) { EPS_LANCZOS *lanczos = (EPS_LANCZOS*)eps->data; PetscBool flg; @@ -796,7 +796,7 @@ PetscErrorCode EPSLanczosGetReorthog(EPS eps,EPSLanczosReorthogType *reorthog) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSReset_Lanczos(EPS eps) +static PetscErrorCode EPSReset_Lanczos(EPS eps) { EPS_LANCZOS *lanczos = (EPS_LANCZOS*)eps->data; @@ -806,7 +806,7 @@ PetscErrorCode EPSReset_Lanczos(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSDestroy_Lanczos(EPS eps) +static PetscErrorCode EPSDestroy_Lanczos(EPS eps) { PetscFunctionBegin; PetscCall(PetscFree(eps->data)); @@ -815,7 +815,7 @@ PetscErrorCode EPSDestroy_Lanczos(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSView_Lanczos(EPS eps,PetscViewer viewer) +static PetscErrorCode EPSView_Lanczos(EPS eps,PetscViewer viewer) { EPS_LANCZOS *lanczos = (EPS_LANCZOS*)eps->data; PetscBool isascii; diff --git a/src/eps/impls/lapack/lapack.c b/src/eps/impls/lapack/lapack.c index fc8f6f9a5..8fdd1f3b5 100644 --- a/src/eps/impls/lapack/lapack.c +++ b/src/eps/impls/lapack/lapack.c @@ -14,7 +14,7 @@ #include -PetscErrorCode EPSSetUp_LAPACK(EPS eps) +static PetscErrorCode EPSSetUp_LAPACK(EPS eps) { int ierra,ierrb; PetscBool isshift,flg,denseok=PETSC_FALSE; @@ -112,7 +112,7 @@ PetscErrorCode EPSSetUp_LAPACK(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSSolve_LAPACK(EPS eps) +static PetscErrorCode EPSSolve_LAPACK(EPS eps) { PetscInt n=eps->n,i,low,high; PetscScalar *array,*pX,*pY; diff --git a/src/eps/impls/lyapii/lyapii.c b/src/eps/impls/lyapii/lyapii.c index a8ea31f86..2417ffdef 100644 --- a/src/eps/impls/lyapii/lyapii.c +++ b/src/eps/impls/lyapii/lyapii.c @@ -52,7 +52,7 @@ typedef struct { #endif } EPS_EIG_MATSHELL; -PetscErrorCode EPSSetUp_LyapII(EPS eps) +static PetscErrorCode EPSSetUp_LyapII(EPS eps) { PetscRandom rand; EPS_LYAPII *ctx = (EPS_LYAPII*)eps->data; @@ -308,7 +308,7 @@ static PetscErrorCode LyapIIBuildEigenMat(LME lme,Mat S,Mat *Op,Vec *v0) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSSolve_LyapII(EPS eps) +static PetscErrorCode EPSSolve_LyapII(EPS eps) { EPS_LYAPII *ctx = (EPS_LYAPII*)eps->data; PetscInt i,ldds,rk,nloc,mloc,nv,idx,k; @@ -524,7 +524,7 @@ PetscErrorCode EPSSolve_LyapII(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSSetFromOptions_LyapII(EPS eps,PetscOptionItems *PetscOptionsObject) +static PetscErrorCode EPSSetFromOptions_LyapII(EPS eps,PetscOptionItems *PetscOptionsObject) { EPS_LYAPII *ctx = (EPS_LYAPII*)eps->data; PetscInt k,array[2]={PETSC_DEFAULT,PETSC_DEFAULT}; @@ -708,7 +708,7 @@ PetscErrorCode EPSLyapIIGetLME(EPS eps,LME *lme) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSView_LyapII(EPS eps,PetscViewer viewer) +static PetscErrorCode EPSView_LyapII(EPS eps,PetscViewer viewer) { EPS_LYAPII *ctx = (EPS_LYAPII*)eps->data; PetscBool isascii; @@ -725,7 +725,7 @@ PetscErrorCode EPSView_LyapII(EPS eps,PetscViewer viewer) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSReset_LyapII(EPS eps) +static PetscErrorCode EPSReset_LyapII(EPS eps) { EPS_LYAPII *ctx = (EPS_LYAPII*)eps->data; @@ -734,7 +734,7 @@ PetscErrorCode EPSReset_LyapII(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSDestroy_LyapII(EPS eps) +static PetscErrorCode EPSDestroy_LyapII(EPS eps) { EPS_LYAPII *ctx = (EPS_LYAPII*)eps->data; @@ -749,7 +749,7 @@ PetscErrorCode EPSDestroy_LyapII(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSSetDefaultST_LyapII(EPS eps) +static PetscErrorCode EPSSetDefaultST_LyapII(EPS eps) { PetscFunctionBegin; if (!((PetscObject)eps->st)->type_name) PetscCall(STSetType(eps->st,STSINVERT)); diff --git a/src/eps/impls/power/power.c b/src/eps/impls/power/power.c index f98508cff..0f79e05f6 100644 --- a/src/eps/impls/power/power.c +++ b/src/eps/impls/power/power.c @@ -37,8 +37,8 @@ #include static PetscErrorCode EPSPowerFormFunction_Update(SNES,Vec,Vec,void*); -PetscErrorCode EPSSolve_Power(EPS); -PetscErrorCode EPSSolve_TS_Power(EPS); +static PetscErrorCode EPSSolve_Power(EPS); +static PetscErrorCode EPSSolve_TS_Power(EPS); typedef struct { EPSPowerShiftType shift_type; @@ -70,7 +70,7 @@ static PetscErrorCode SNESMonitor_PowerUpdate(SNES snes,PetscInt its,PetscReal f PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSSetUp_Power(EPS eps) +static PetscErrorCode EPSSetUp_Power(EPS eps) { EPS_POWER *power = (EPS_POWER*)eps->data; STMatMode mode; @@ -364,7 +364,7 @@ static PetscErrorCode EPSPowerComputeInitialGuess_Update(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSSolve_Power(EPS eps) +static PetscErrorCode EPSSolve_Power(EPS eps) { EPS_POWER *power = (EPS_POWER*)eps->data; PetscInt k,ld; @@ -573,7 +573,7 @@ PetscErrorCode EPSSolve_Power(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSSolve_TS_Power(EPS eps) +static PetscErrorCode EPSSolve_TS_Power(EPS eps) { EPS_POWER *power = (EPS_POWER*)eps->data; PetscInt k,ld; @@ -700,7 +700,7 @@ PetscErrorCode EPSSolve_TS_Power(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSStopping_Power(EPS eps,PetscInt its,PetscInt max_it,PetscInt nconv,PetscInt nev,EPSConvergedReason *reason,void *ctx) +static PetscErrorCode EPSStopping_Power(EPS eps,PetscInt its,PetscInt max_it,PetscInt nconv,PetscInt nev,EPSConvergedReason *reason,void *ctx) { EPS_POWER *power = (EPS_POWER*)eps->data; SNESConvergedReason snesreason; @@ -717,7 +717,7 @@ PetscErrorCode EPSStopping_Power(EPS eps,PetscInt its,PetscInt max_it,PetscInt n PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSBackTransform_Power(EPS eps) +static PetscErrorCode EPSBackTransform_Power(EPS eps) { EPS_POWER *power = (EPS_POWER*)eps->data; @@ -727,7 +727,7 @@ PetscErrorCode EPSBackTransform_Power(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSSetFromOptions_Power(EPS eps,PetscOptionItems *PetscOptionsObject) +static PetscErrorCode EPSSetFromOptions_Power(EPS eps,PetscOptionItems *PetscOptionsObject) { EPS_POWER *power = (EPS_POWER*)eps->data; PetscBool flg,val; @@ -1150,7 +1150,7 @@ PetscErrorCode EPSPowerGetSNES(EPS eps,SNES *snes) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSReset_Power(EPS eps) +static PetscErrorCode EPSReset_Power(EPS eps) { EPS_POWER *power = (EPS_POWER*)eps->data; @@ -1159,7 +1159,7 @@ PetscErrorCode EPSReset_Power(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSDestroy_Power(EPS eps) +static PetscErrorCode EPSDestroy_Power(EPS eps) { EPS_POWER *power = (EPS_POWER*)eps->data; @@ -1179,7 +1179,7 @@ PetscErrorCode EPSDestroy_Power(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSView_Power(EPS eps,PetscViewer viewer) +static PetscErrorCode EPSView_Power(EPS eps,PetscViewer viewer) { EPS_POWER *power = (EPS_POWER*)eps->data; PetscBool isascii; @@ -1201,7 +1201,7 @@ PetscErrorCode EPSView_Power(EPS eps,PetscViewer viewer) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSComputeVectors_Power(EPS eps) +static PetscErrorCode EPSComputeVectors_Power(EPS eps) { EPS_POWER *power = (EPS_POWER*)eps->data; @@ -1214,7 +1214,7 @@ PetscErrorCode EPSComputeVectors_Power(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSSetDefaultST_Power(EPS eps) +static PetscErrorCode EPSSetDefaultST_Power(EPS eps) { EPS_POWER *power = (EPS_POWER*)eps->data; KSP ksp; diff --git a/src/eps/impls/subspace/subspace.c b/src/eps/impls/subspace/subspace.c index f8a50008c..79dbb94e0 100644 --- a/src/eps/impls/subspace/subspace.c +++ b/src/eps/impls/subspace/subspace.c @@ -59,7 +59,7 @@ static PetscErrorCode EPSSetUp_Subspace_Filter(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSSetUp_Subspace(EPS eps) +static PetscErrorCode EPSSetUp_Subspace(EPS eps) { PetscBool isfilt; @@ -86,7 +86,7 @@ PetscErrorCode EPSSetUp_Subspace(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSSetUpSort_Subspace(EPS eps) +static PetscErrorCode EPSSetUpSort_Subspace(EPS eps) { SlepcSC sc; @@ -175,7 +175,7 @@ static PetscErrorCode EPSSubspaceResidualNorms(BV R,BV V,Mat T,PetscInt l,PetscI PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSSolve_Subspace(EPS eps) +static PetscErrorCode EPSSolve_Subspace(EPS eps) { Mat H,Q,S,T,B; BV AV,R; @@ -335,7 +335,7 @@ PetscErrorCode EPSSolve_Subspace(EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode EPSDestroy_Subspace(EPS eps) +static PetscErrorCode EPSDestroy_Subspace(EPS eps) { PetscFunctionBegin; PetscCall(PetscFree(eps->data)); diff --git a/src/eps/interface/epssetup.c b/src/eps/interface/epssetup.c index c820a03cb..2d272f25c 100644 --- a/src/eps/interface/epssetup.c +++ b/src/eps/interface/epssetup.c @@ -84,7 +84,7 @@ PetscErrorCode EPSSetDefaultST_NoFactor(EPS eps) /* Check that the ST selected by the user is compatible with the EPS solver and options */ -PetscErrorCode EPSCheckCompatibleST(EPS eps) +static PetscErrorCode EPSCheckCompatibleST(EPS eps) { PetscBool precond,shift,sinvert,cayley,lyapii; #if defined(PETSC_USE_COMPLEX) diff --git a/src/lme/impls/krylov/lmekrylov.c b/src/lme/impls/krylov/lmekrylov.c index 1e1d00d89..288be6361 100644 --- a/src/lme/impls/krylov/lmekrylov.c +++ b/src/lme/impls/krylov/lmekrylov.c @@ -33,7 +33,7 @@ #include #include -PetscErrorCode LMESetUp_Krylov(LME lme) +static PetscErrorCode LMESetUp_Krylov(LME lme) { PetscInt N; @@ -45,7 +45,7 @@ PetscErrorCode LMESetUp_Krylov(LME lme) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode LMESolve_Krylov_Lyapunov_Vec(LME lme,Vec b,PetscBool fixed,PetscInt rrank,BV C1,BV *X1,PetscInt *col,PetscBool *fail,PetscInt *totalits) +static PetscErrorCode LMESolve_Krylov_Lyapunov_Vec(LME lme,Vec b,PetscBool fixed,PetscInt rrank,BV C1,BV *X1,PetscInt *col,PetscBool *fail,PetscInt *totalits) { PetscInt n=0,m,ldh,ldg=0,i,j,rank=0,lrank,pass,nouter=0,its; PetscReal bnorm,beta,errest; @@ -157,7 +157,7 @@ PetscErrorCode LMESolve_Krylov_Lyapunov_Vec(LME lme,Vec b,PetscBool fixed,PetscI PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode LMESolve_Krylov_Lyapunov(LME lme) +static PetscErrorCode LMESolve_Krylov_Lyapunov(LME lme) { PetscBool fail,fixed = lme->X? PETSC_TRUE: PETSC_FALSE; PetscInt i,k,rank=0,col=0; diff --git a/src/lme/interface/lmesolve.c b/src/lme/interface/lmesolve.c index f7a35ecea..a048242b6 100644 --- a/src/lme/interface/lmesolve.c +++ b/src/lme/interface/lmesolve.c @@ -169,7 +169,7 @@ PetscErrorCode LMEGetErrorEstimate(LME lme,PetscReal *errest) LMEComputeResidualNorm_Lyapunov - Computes the Frobenius norm of the residual matrix associated with the Lyapunov equation. */ -PetscErrorCode LMEComputeResidualNorm_Lyapunov(LME lme,PetscReal *norm) +static PetscErrorCode LMEComputeResidualNorm_Lyapunov(LME lme,PetscReal *norm) { PetscInt j,n,N,k,l; PetscBLASInt n_,N_,k_,l_; diff --git a/src/mfn/impls/expokit/mfnexpokit.c b/src/mfn/impls/expokit/mfnexpokit.c index e09d15666..af5f25b49 100644 --- a/src/mfn/impls/expokit/mfnexpokit.c +++ b/src/mfn/impls/expokit/mfnexpokit.c @@ -25,7 +25,7 @@ #include -PetscErrorCode MFNSetUp_Expokit(MFN mfn) +static PetscErrorCode MFNSetUp_Expokit(MFN mfn) { PetscInt N; PetscBool isexp; @@ -41,7 +41,7 @@ PetscErrorCode MFNSetUp_Expokit(MFN mfn) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode MFNSolve_Expokit(MFN mfn,Vec b,Vec x) +static PetscErrorCode MFNSolve_Expokit(MFN mfn,Vec b,Vec x) { PetscInt mxstep,mxrej,m,mb,ld,i,j,ireject,mx,k1; Vec v,r; diff --git a/src/mfn/impls/krylov/mfnkrylov.c b/src/mfn/impls/krylov/mfnkrylov.c index 28fbd4332..50a98ee73 100644 --- a/src/mfn/impls/krylov/mfnkrylov.c +++ b/src/mfn/impls/krylov/mfnkrylov.c @@ -27,7 +27,7 @@ #include #include -PetscErrorCode MFNSetUp_Krylov(MFN mfn) +static PetscErrorCode MFNSetUp_Krylov(MFN mfn) { PetscInt N; @@ -39,7 +39,7 @@ PetscErrorCode MFNSetUp_Krylov(MFN mfn) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode MFNSolve_Krylov(MFN mfn,Vec b,Vec x) +static PetscErrorCode MFNSolve_Krylov(MFN mfn,Vec b,Vec x) { PetscInt n=0,m,ld,ldh,j; PetscBLASInt m_,inc=1; diff --git a/src/nep/impls/ciss/nciss.c b/src/nep/impls/ciss/nciss.c index 8de04fd68..b6d4c1adb 100644 --- a/src/nep/impls/ciss/nciss.c +++ b/src/nep/impls/ciss/nciss.c @@ -169,7 +169,7 @@ static PetscErrorCode NEPCISSSolve(NEP nep,Mat dT,BV V,PetscInt L_start,PetscInt PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode NEPSetUp_CISS(NEP nep) +static PetscErrorCode NEPSetUp_CISS(NEP nep) { NEP_CISS *ctx = (NEP_CISS*)nep->data; SlepcContourData contour; @@ -271,7 +271,7 @@ PetscErrorCode NEPSetUp_CISS(NEP nep) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode NEPSolve_CISS(NEP nep) +static PetscErrorCode NEPSolve_CISS(NEP nep) { NEP_CISS *ctx = (NEP_CISS*)nep->data; SlepcContourData contour = ctx->contour; @@ -958,7 +958,7 @@ PetscErrorCode NEPCISSGetKSPs(NEP nep,PetscInt *nsolve,KSP **ksp) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode NEPReset_CISS(NEP nep) +static PetscErrorCode NEPReset_CISS(NEP nep) { NEP_CISS *ctx = (NEP_CISS*)nep->data; @@ -973,7 +973,7 @@ PetscErrorCode NEPReset_CISS(NEP nep) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode NEPSetFromOptions_CISS(NEP nep,PetscOptionItems *PetscOptionsObject) +static PetscErrorCode NEPSetFromOptions_CISS(NEP nep,PetscOptionItems *PetscOptionsObject) { NEP_CISS *ctx = (NEP_CISS*)nep->data; PetscReal r1,r2; @@ -1017,7 +1017,7 @@ PetscErrorCode NEPSetFromOptions_CISS(NEP nep,PetscOptionItems *PetscOptionsObje PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode NEPDestroy_CISS(NEP nep) +static PetscErrorCode NEPDestroy_CISS(NEP nep) { NEP_CISS *ctx = (NEP_CISS*)nep->data; @@ -1037,7 +1037,7 @@ PetscErrorCode NEPDestroy_CISS(NEP nep) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode NEPView_CISS(NEP nep,PetscViewer viewer) +static PetscErrorCode NEPView_CISS(NEP nep,PetscViewer viewer) { NEP_CISS *ctx = (NEP_CISS*)nep->data; PetscBool isascii; @@ -1068,7 +1068,7 @@ PetscErrorCode NEPView_CISS(NEP nep,PetscViewer viewer) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode NEPSetDSType_CISS(NEP nep) +static PetscErrorCode NEPSetDSType_CISS(NEP nep) { NEP_CISS *ctx = (NEP_CISS*)nep->data; diff --git a/src/nep/impls/interpol/interpol.c b/src/nep/impls/interpol/interpol.c index c5782aa19..0760c2db8 100644 --- a/src/nep/impls/interpol/interpol.c +++ b/src/nep/impls/interpol/interpol.c @@ -32,7 +32,7 @@ typedef struct { PetscInt deg; /* actual degree of interpolation polynomial */ } NEP_INTERPOL; -PetscErrorCode NEPSetUp_Interpol(NEP nep) +static PetscErrorCode NEPSetUp_Interpol(NEP nep) { NEP_INTERPOL *ctx = (NEP_INTERPOL*)nep->data; ST st; @@ -112,7 +112,7 @@ static PetscErrorCode ChebyshevNodes(PetscInt d,PetscReal a,PetscReal b,PetscSca PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode NEPSolve_Interpol(NEP nep) +static PetscErrorCode NEPSolve_Interpol(NEP nep) { NEP_INTERPOL *ctx = (NEP_INTERPOL*)nep->data; Mat *A,*P; @@ -226,7 +226,7 @@ static PetscErrorCode PEPMonitor_Interpol(PEP pep,PetscInt its,PetscInt nconv,Pe PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode NEPSetFromOptions_Interpol(NEP nep,PetscOptionItems *PetscOptionsObject) +static PetscErrorCode NEPSetFromOptions_Interpol(NEP nep,PetscOptionItems *PetscOptionsObject) { NEP_INTERPOL *ctx = (NEP_INTERPOL*)nep->data; PetscInt i; @@ -421,7 +421,7 @@ PetscErrorCode NEPInterpolGetPEP(NEP nep,PEP *pep) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode NEPView_Interpol(NEP nep,PetscViewer viewer) +static PetscErrorCode NEPView_Interpol(NEP nep,PetscViewer viewer) { NEP_INTERPOL *ctx = (NEP_INTERPOL*)nep->data; PetscBool isascii; @@ -439,7 +439,7 @@ PetscErrorCode NEPView_Interpol(NEP nep,PetscViewer viewer) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode NEPReset_Interpol(NEP nep) +static PetscErrorCode NEPReset_Interpol(NEP nep) { NEP_INTERPOL *ctx = (NEP_INTERPOL*)nep->data; @@ -448,7 +448,7 @@ PetscErrorCode NEPReset_Interpol(NEP nep) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode NEPDestroy_Interpol(NEP nep) +static PetscErrorCode NEPDestroy_Interpol(NEP nep) { NEP_INTERPOL *ctx = (NEP_INTERPOL*)nep->data; diff --git a/src/nep/impls/narnoldi/narnoldi.c b/src/nep/impls/narnoldi/narnoldi.c index 8cbdae73a..578f37fd7 100644 --- a/src/nep/impls/narnoldi/narnoldi.c +++ b/src/nep/impls/narnoldi/narnoldi.c @@ -30,7 +30,7 @@ typedef struct { KSP ksp; /* linear solver object */ } NEP_NARNOLDI; -PetscErrorCode NEPSetUp_NArnoldi(NEP nep) +static PetscErrorCode NEPSetUp_NArnoldi(NEP nep) { PetscFunctionBegin; PetscCall(NEPSetDimensions_Default(nep,nep->nev,&nep->ncv,&nep->mpd)); @@ -44,7 +44,7 @@ PetscErrorCode NEPSetUp_NArnoldi(NEP nep) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode NEPSolve_NArnoldi(NEP nep) +static PetscErrorCode NEPSolve_NArnoldi(NEP nep) { NEP_NARNOLDI *ctx = (NEP_NARNOLDI*)nep->data; Mat T,H,A; @@ -280,7 +280,7 @@ PetscErrorCode NEPNArnoldiGetLagPreconditioner(NEP nep,PetscInt *lag) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode NEPSetFromOptions_NArnoldi(NEP nep,PetscOptionItems *PetscOptionsObject) +static PetscErrorCode NEPSetFromOptions_NArnoldi(NEP nep,PetscOptionItems *PetscOptionsObject) { PetscInt i; PetscBool flg; @@ -378,7 +378,7 @@ PetscErrorCode NEPNArnoldiGetKSP(NEP nep,KSP *ksp) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode NEPView_NArnoldi(NEP nep,PetscViewer viewer) +static PetscErrorCode NEPView_NArnoldi(NEP nep,PetscViewer viewer) { NEP_NARNOLDI *ctx = (NEP_NARNOLDI*)nep->data; PetscBool isascii; @@ -395,7 +395,7 @@ PetscErrorCode NEPView_NArnoldi(NEP nep,PetscViewer viewer) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode NEPReset_NArnoldi(NEP nep) +static PetscErrorCode NEPReset_NArnoldi(NEP nep) { NEP_NARNOLDI *ctx = (NEP_NARNOLDI*)nep->data; @@ -404,7 +404,7 @@ PetscErrorCode NEPReset_NArnoldi(NEP nep) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode NEPDestroy_NArnoldi(NEP nep) +static PetscErrorCode NEPDestroy_NArnoldi(NEP nep) { NEP_NARNOLDI *ctx = (NEP_NARNOLDI*)nep->data; diff --git a/src/nep/impls/nepdefl.c b/src/nep/impls/nepdefl.c index 672a9ac65..e4b87b84f 100644 --- a/src/nep/impls/nepdefl.c +++ b/src/nep/impls/nepdefl.c @@ -20,7 +20,7 @@ PetscErrorCode NEPDeflationGetInvariantPair(NEP_EXT_OP extop,BV *X,Mat *H) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode NEPDeflationExtendInvariantPair(NEP_EXT_OP extop,Vec u,PetscScalar lambda,PetscInt k) +static PetscErrorCode NEPDeflationExtendInvariantPair(NEP_EXT_OP extop,Vec u,PetscScalar lambda,PetscInt k) { Vec uu; PetscInt ld,i; @@ -747,7 +747,7 @@ PetscErrorCode NEPDeflationInitialize(NEP nep,BV X,KSP ksp,PetscBool sincfun,Pet PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode NEPDeflationDSNEPComputeMatrix(DS ds,PetscScalar lambda,PetscBool deriv,DSMatType mat,void *ctx) +static PetscErrorCode NEPDeflationDSNEPComputeMatrix(DS ds,PetscScalar lambda,PetscBool deriv,DSMatType mat,void *ctx) { Mat A,Ei; PetscScalar *T,*w1,*w2,*w=NULL,*ww,*hH,*hHprev,*pts; diff --git a/src/nep/impls/nleigs/nleigs.c b/src/nep/impls/nleigs/nleigs.c index f9968cad6..9de3c8251 100644 --- a/src/nep/impls/nleigs/nleigs.c +++ b/src/nep/impls/nleigs/nleigs.c @@ -819,7 +819,7 @@ static PetscErrorCode NEPNLEIGSDividedDifferences_callback(NEP nep) /* NEPKrylovConvergence - This is the analogue to EPSKrylovConvergence. */ -PetscErrorCode NEPNLEIGSKrylovConvergence(NEP nep,PetscBool getall,PetscInt kini,PetscInt nits,PetscReal betah,PetscScalar betak,PetscInt *kout,Vec *w) +static PetscErrorCode NEPNLEIGSKrylovConvergence(NEP nep,PetscBool getall,PetscInt kini,PetscInt nits,PetscReal betah,PetscScalar betak,PetscInt *kout,Vec *w) { PetscInt k,newk,marker,inside; PetscScalar re,im; @@ -858,7 +858,7 @@ PetscErrorCode NEPNLEIGSKrylovConvergence(NEP nep,PetscBool getall,PetscInt kini PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode NEPSetUp_NLEIGS(NEP nep) +static PetscErrorCode NEPSetUp_NLEIGS(NEP nep) { PetscInt k,in; PetscScalar zero=0.0; @@ -1066,7 +1066,7 @@ static PetscErrorCode NEPNLEIGS_RKcontinuation(NEP nep,PetscInt ini,PetscInt end /* Compute a run of Arnoldi iterations */ -PetscErrorCode NEPNLEIGSTOARrun(NEP nep,Mat MK,Mat MH,BV W,PetscInt k,PetscInt *M,PetscReal *betah,PetscScalar *betak,PetscBool *breakdown,Vec *t_) +static PetscErrorCode NEPNLEIGSTOARrun(NEP nep,Mat MK,Mat MH,BV W,PetscInt k,PetscInt *M,PetscReal *betah,PetscScalar *betak,PetscBool *breakdown,Vec *t_) { NEP_NLEIGS *ctx = (NEP_NLEIGS*)nep->data; PetscInt i,j,m=*M,lwa,deg=ctx->nmat-1,lds,nqt,ld,l,ldh; @@ -1861,7 +1861,7 @@ PetscErrorCode NEPNLEIGSGetFullBasis(NEP nep,PetscBool *fullbasis) #define SHIFTMAX 30 -PetscErrorCode NEPSetFromOptions_NLEIGS(NEP nep,PetscOptionItems *PetscOptionsObject) +static PetscErrorCode NEPSetFromOptions_NLEIGS(NEP nep,PetscOptionItems *PetscOptionsObject) { NEP_NLEIGS *ctx = (NEP_NLEIGS*)nep->data; PetscInt i=0,k; @@ -1904,7 +1904,7 @@ PetscErrorCode NEPSetFromOptions_NLEIGS(NEP nep,PetscOptionItems *PetscOptionsOb PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode NEPView_NLEIGS(NEP nep,PetscViewer viewer) +static PetscErrorCode NEPView_NLEIGS(NEP nep,PetscViewer viewer) { NEP_NLEIGS *ctx=(NEP_NLEIGS*)nep->data; PetscBool isascii; @@ -1943,7 +1943,7 @@ PetscErrorCode NEPView_NLEIGS(NEP nep,PetscViewer viewer) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode NEPReset_NLEIGS(NEP nep) +static PetscErrorCode NEPReset_NLEIGS(NEP nep) { PetscInt k; NEP_NLEIGS *ctx=(NEP_NLEIGS*)nep->data; @@ -1964,7 +1964,7 @@ PetscErrorCode NEPReset_NLEIGS(NEP nep) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode NEPDestroy_NLEIGS(NEP nep) +static PetscErrorCode NEPDestroy_NLEIGS(NEP nep) { PetscInt k; NEP_NLEIGS *ctx = (NEP_NLEIGS*)nep->data; diff --git a/src/nep/impls/rii/rii.c b/src/nep/impls/rii/rii.c index d6bd40939..c5188450f 100644 --- a/src/nep/impls/rii/rii.c +++ b/src/nep/impls/rii/rii.c @@ -34,7 +34,7 @@ typedef struct { KSP ksp; /* linear solver object */ } NEP_RII; -PetscErrorCode NEPSetUp_RII(NEP nep) +static PetscErrorCode NEPSetUp_RII(NEP nep) { PetscFunctionBegin; if (nep->ncv!=PETSC_DEFAULT) PetscCall(PetscInfo(nep,"Setting ncv = nev, ignoring user-provided value\n")); @@ -50,7 +50,7 @@ PetscErrorCode NEPSetUp_RII(NEP nep) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode NEPSolve_RII(NEP nep) +static PetscErrorCode NEPSolve_RII(NEP nep) { NEP_RII *ctx = (NEP_RII*)nep->data; Mat T,Tp,H,A; @@ -203,7 +203,7 @@ PetscErrorCode NEPSolve_RII(NEP nep) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode NEPSetFromOptions_RII(NEP nep,PetscOptionItems *PetscOptionsObject) +static PetscErrorCode NEPSetFromOptions_RII(NEP nep,PetscOptionItems *PetscOptionsObject) { NEP_RII *ctx = (NEP_RII*)nep->data; PetscBool flg; @@ -685,7 +685,7 @@ PetscErrorCode NEPRIIGetKSP(NEP nep,KSP *ksp) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode NEPView_RII(NEP nep,PetscViewer viewer) +static PetscErrorCode NEPView_RII(NEP nep,PetscViewer viewer) { NEP_RII *ctx = (NEP_RII*)nep->data; PetscBool isascii; @@ -706,7 +706,7 @@ PetscErrorCode NEPView_RII(NEP nep,PetscViewer viewer) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode NEPReset_RII(NEP nep) +static PetscErrorCode NEPReset_RII(NEP nep) { NEP_RII *ctx = (NEP_RII*)nep->data; @@ -715,7 +715,7 @@ PetscErrorCode NEPReset_RII(NEP nep) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode NEPDestroy_RII(NEP nep) +static PetscErrorCode NEPDestroy_RII(NEP nep) { NEP_RII *ctx = (NEP_RII*)nep->data; diff --git a/src/nep/impls/slp/slp.c b/src/nep/impls/slp/slp.c index 58607b551..c5d4dc34b 100644 --- a/src/nep/impls/slp/slp.c +++ b/src/nep/impls/slp/slp.c @@ -31,7 +31,7 @@ typedef struct { Vec w; } NEP_SLP_MATSHELL; -PetscErrorCode NEPSetUp_SLP(NEP nep) +static PetscErrorCode NEPSetUp_SLP(NEP nep) { NEP_SLP *ctx = (NEP_SLP*)nep->data; PetscBool flg; @@ -245,7 +245,7 @@ PetscErrorCode NEPSolve_SLP(NEP nep) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode NEPSetFromOptions_SLP(NEP nep,PetscOptionItems *PetscOptionsObject) +static PetscErrorCode NEPSetFromOptions_SLP(NEP nep,PetscOptionItems *PetscOptionsObject) { NEP_SLP *ctx = (NEP_SLP*)nep->data; PetscBool flg; @@ -588,7 +588,7 @@ PetscErrorCode NEPSLPGetKSP(NEP nep,KSP *ksp) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode NEPView_SLP(NEP nep,PetscViewer viewer) +static PetscErrorCode NEPView_SLP(NEP nep,PetscViewer viewer) { NEP_SLP *ctx = (NEP_SLP*)nep->data; PetscBool isascii; @@ -611,7 +611,7 @@ PetscErrorCode NEPView_SLP(NEP nep,PetscViewer viewer) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode NEPReset_SLP(NEP nep) +static PetscErrorCode NEPReset_SLP(NEP nep) { NEP_SLP *ctx = (NEP_SLP*)nep->data; @@ -622,7 +622,7 @@ PetscErrorCode NEPReset_SLP(NEP nep) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode NEPDestroy_SLP(NEP nep) +static PetscErrorCode NEPDestroy_SLP(NEP nep) { NEP_SLP *ctx = (NEP_SLP*)nep->data; diff --git a/src/pep/impls/ciss/pciss.c b/src/pep/impls/ciss/pciss.c index 3dec91c7c..1f50619d3 100644 --- a/src/pep/impls/ciss/pciss.c +++ b/src/pep/impls/ciss/pciss.c @@ -149,7 +149,7 @@ static PetscErrorCode PEPCISSSolve(PEP pep,Mat dT,BV V,PetscInt L_start,PetscInt PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode PEPSetUp_CISS(PEP pep) +static PetscErrorCode PEPSetUp_CISS(PEP pep) { PEP_CISS *ctx = (PEP_CISS*)pep->data; SlepcContourData contour; @@ -249,7 +249,7 @@ PetscErrorCode PEPSetUp_CISS(PEP pep) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode PEPSolve_CISS(PEP pep) +static PetscErrorCode PEPSolve_CISS(PEP pep) { PEP_CISS *ctx = (PEP_CISS*)pep->data; SlepcContourData contour = ctx->contour; @@ -925,7 +925,7 @@ PetscErrorCode PEPCISSGetKSPs(PEP pep,PetscInt *nsolve,KSP **ksp) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode PEPReset_CISS(PEP pep) +static PetscErrorCode PEPReset_CISS(PEP pep) { PEP_CISS *ctx = (PEP_CISS*)pep->data; @@ -940,7 +940,7 @@ PetscErrorCode PEPReset_CISS(PEP pep) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode PEPSetFromOptions_CISS(PEP pep,PetscOptionItems *PetscOptionsObject) +static PetscErrorCode PEPSetFromOptions_CISS(PEP pep,PetscOptionItems *PetscOptionsObject) { PEP_CISS *ctx = (PEP_CISS*)pep->data; PetscReal r1,r2; @@ -984,7 +984,7 @@ PetscErrorCode PEPSetFromOptions_CISS(PEP pep,PetscOptionItems *PetscOptionsObje PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode PEPDestroy_CISS(PEP pep) +static PetscErrorCode PEPDestroy_CISS(PEP pep) { PEP_CISS *ctx = (PEP_CISS*)pep->data; @@ -1004,7 +1004,7 @@ PetscErrorCode PEPDestroy_CISS(PEP pep) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode PEPView_CISS(PEP pep,PetscViewer viewer) +static PetscErrorCode PEPView_CISS(PEP pep,PetscViewer viewer) { PEP_CISS *ctx = (PEP_CISS*)pep->data; PetscBool isascii; @@ -1035,7 +1035,7 @@ PetscErrorCode PEPView_CISS(PEP pep,PetscViewer viewer) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode PEPSetDSType_CISS(PEP pep) +static PetscErrorCode PEPSetDSType_CISS(PEP pep) { PEP_CISS *ctx = (PEP_CISS*)pep->data; diff --git a/src/pep/impls/jd/pjd.c b/src/pep/impls/jd/pjd.c index 27f154d0f..5256b968c 100644 --- a/src/pep/impls/jd/pjd.c +++ b/src/pep/impls/jd/pjd.c @@ -121,7 +121,7 @@ static PetscErrorCode PEPJDDuplicateBasis(PEP pep,BV *basis) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode PEPSetUp_JD(PEP pep) +static PetscErrorCode PEPSetUp_JD(PEP pep) { PEP_JD *pjd = (PEP_JD*)pep->data; PetscBool isprecond,flg; @@ -1161,7 +1161,7 @@ static PetscErrorCode PEPJDLockConverged(PEP pep,PetscInt *nv,PetscInt sz) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode PEPJDSystemSetUp(PEP pep,PetscInt sz,PetscScalar *theta,Vec *u,Vec *p,Vec *ww) +static PetscErrorCode PEPJDSystemSetUp(PEP pep,PetscInt sz,PetscScalar *theta,Vec *u,Vec *p,Vec *ww) { PEP_JD *pjd = (PEP_JD*)pep->data; PEP_JD_PCSHELL *pcctx; @@ -1193,7 +1193,7 @@ PetscErrorCode PEPJDSystemSetUp(PEP pep,PetscInt sz,PetscScalar *theta,Vec *u,Ve PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode PEPSolve_JD(PEP pep) +static PetscErrorCode PEPSolve_JD(PEP pep) { PEP_JD *pjd = (PEP_JD*)pep->data; PetscInt k,nv,nvc,ld,minv,dim,bupdated=0,sz=1,kspsf=1,idx,off,maxits,nloc; @@ -1462,7 +1462,7 @@ PetscErrorCode PEPSolve_JD(PEP pep) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode PEPJDSetRestart_JD(PEP pep,PetscReal keep) +static PetscErrorCode PEPJDSetRestart_JD(PEP pep,PetscReal keep) { PEP_JD *pjd = (PEP_JD*)pep->data; @@ -1505,7 +1505,7 @@ PetscErrorCode PEPJDSetRestart(PEP pep,PetscReal keep) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode PEPJDGetRestart_JD(PEP pep,PetscReal *keep) +static PetscErrorCode PEPJDGetRestart_JD(PEP pep,PetscReal *keep) { PEP_JD *pjd = (PEP_JD*)pep->data; @@ -1538,7 +1538,7 @@ PetscErrorCode PEPJDGetRestart(PEP pep,PetscReal *keep) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode PEPJDSetFix_JD(PEP pep,PetscReal fix) +static PetscErrorCode PEPJDSetFix_JD(PEP pep,PetscReal fix) { PEP_JD *pjd = (PEP_JD*)pep->data; @@ -1582,7 +1582,7 @@ PetscErrorCode PEPJDSetFix(PEP pep,PetscReal fix) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode PEPJDGetFix_JD(PEP pep,PetscReal *fix) +static PetscErrorCode PEPJDGetFix_JD(PEP pep,PetscReal *fix) { PEP_JD *pjd = (PEP_JD*)pep->data; @@ -1621,7 +1621,7 @@ PetscErrorCode PEPJDGetFix(PEP pep,PetscReal *fix) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode PEPJDSetReusePreconditioner_JD(PEP pep,PetscBool reusepc) +static PetscErrorCode PEPJDSetReusePreconditioner_JD(PEP pep,PetscBool reusepc) { PEP_JD *pjd = (PEP_JD*)pep->data; @@ -1661,7 +1661,7 @@ PetscErrorCode PEPJDSetReusePreconditioner(PEP pep,PetscBool reusepc) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode PEPJDGetReusePreconditioner_JD(PEP pep,PetscBool *reusepc) +static PetscErrorCode PEPJDGetReusePreconditioner_JD(PEP pep,PetscBool *reusepc) { PEP_JD *pjd = (PEP_JD*)pep->data; @@ -1694,7 +1694,7 @@ PetscErrorCode PEPJDGetReusePreconditioner(PEP pep,PetscBool *reusepc) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode PEPJDSetMinimalityIndex_JD(PEP pep,PetscInt mmidx) +static PetscErrorCode PEPJDSetMinimalityIndex_JD(PEP pep,PetscInt mmidx) { PEP_JD *pjd = (PEP_JD*)pep->data; @@ -1739,7 +1739,7 @@ PetscErrorCode PEPJDSetMinimalityIndex(PEP pep,PetscInt mmidx) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode PEPJDGetMinimalityIndex_JD(PEP pep,PetscInt *mmidx) +static PetscErrorCode PEPJDGetMinimalityIndex_JD(PEP pep,PetscInt *mmidx) { PEP_JD *pjd = (PEP_JD*)pep->data; @@ -1773,7 +1773,7 @@ PetscErrorCode PEPJDGetMinimalityIndex(PEP pep,PetscInt *mmidx) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode PEPJDSetProjection_JD(PEP pep,PEPJDProjection proj) +static PetscErrorCode PEPJDSetProjection_JD(PEP pep,PEPJDProjection proj) { PEP_JD *pjd = (PEP_JD*)pep->data; @@ -1817,7 +1817,7 @@ PetscErrorCode PEPJDSetProjection(PEP pep,PEPJDProjection proj) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode PEPJDGetProjection_JD(PEP pep,PEPJDProjection *proj) +static PetscErrorCode PEPJDGetProjection_JD(PEP pep,PEPJDProjection *proj) { PEP_JD *pjd = (PEP_JD*)pep->data; @@ -1850,7 +1850,7 @@ PetscErrorCode PEPJDGetProjection(PEP pep,PEPJDProjection *proj) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode PEPSetFromOptions_JD(PEP pep,PetscOptionItems *PetscOptionsObject) +static PetscErrorCode PEPSetFromOptions_JD(PEP pep,PetscOptionItems *PetscOptionsObject) { PetscBool flg,b1; PetscReal r1; @@ -1879,7 +1879,7 @@ PetscErrorCode PEPSetFromOptions_JD(PEP pep,PetscOptionItems *PetscOptionsObject PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode PEPView_JD(PEP pep,PetscViewer viewer) +static PetscErrorCode PEPView_JD(PEP pep,PetscViewer viewer) { PEP_JD *pjd = (PEP_JD*)pep->data; PetscBool isascii; @@ -1896,7 +1896,7 @@ PetscErrorCode PEPView_JD(PEP pep,PetscViewer viewer) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode PEPSetDefaultST_JD(PEP pep) +static PetscErrorCode PEPSetDefaultST_JD(PEP pep) { KSP ksp; @@ -1914,7 +1914,7 @@ PetscErrorCode PEPSetDefaultST_JD(PEP pep) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode PEPReset_JD(PEP pep) +static PetscErrorCode PEPReset_JD(PEP pep) { PEP_JD *pjd = (PEP_JD*)pep->data; PetscInt i; @@ -1933,7 +1933,7 @@ PetscErrorCode PEPReset_JD(PEP pep) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode PEPDestroy_JD(PEP pep) +static PetscErrorCode PEPDestroy_JD(PEP pep) { PetscFunctionBegin; PetscCall(PetscFree(pep->data)); diff --git a/src/pep/impls/krylov/qarnoldi/qarnoldi.c b/src/pep/impls/krylov/qarnoldi/qarnoldi.c index 45b7d7947..0365218f2 100644 --- a/src/pep/impls/krylov/qarnoldi/qarnoldi.c +++ b/src/pep/impls/krylov/qarnoldi/qarnoldi.c @@ -31,7 +31,7 @@ typedef struct { PetscBool lock; /* locking/non-locking variant */ } PEP_QARNOLDI; -PetscErrorCode PEPSetUp_QArnoldi(PEP pep) +static PetscErrorCode PEPSetUp_QArnoldi(PEP pep) { PEP_QARNOLDI *ctx = (PEP_QARNOLDI*)pep->data; PetscBool flg; @@ -64,7 +64,7 @@ PetscErrorCode PEPSetUp_QArnoldi(PEP pep) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode PEPExtractVectors_QArnoldi(PEP pep) +static PetscErrorCode PEPExtractVectors_QArnoldi(PEP pep) { PetscInt k=pep->nconv; Mat X,X0; @@ -193,7 +193,7 @@ static PetscErrorCode PEPQArnoldi(PEP pep,Mat A,PetscInt k,PetscInt *M,Vec v,Vec PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode PEPSolve_QArnoldi(PEP pep) +static PetscErrorCode PEPSolve_QArnoldi(PEP pep) { PEP_QARNOLDI *ctx = (PEP_QARNOLDI*)pep->data; PetscInt j,k,l,lwork,nv,nconv; @@ -444,7 +444,7 @@ PetscErrorCode PEPQArnoldiGetLocking(PEP pep,PetscBool *lock) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode PEPSetFromOptions_QArnoldi(PEP pep,PetscOptionItems *PetscOptionsObject) +static PetscErrorCode PEPSetFromOptions_QArnoldi(PEP pep,PetscOptionItems *PetscOptionsObject) { PetscBool flg,lock; PetscReal keep; @@ -462,7 +462,7 @@ PetscErrorCode PEPSetFromOptions_QArnoldi(PEP pep,PetscOptionItems *PetscOptions PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode PEPView_QArnoldi(PEP pep,PetscViewer viewer) +static PetscErrorCode PEPView_QArnoldi(PEP pep,PetscViewer viewer) { PEP_QARNOLDI *ctx = (PEP_QARNOLDI*)pep->data; PetscBool isascii; @@ -476,7 +476,7 @@ PetscErrorCode PEPView_QArnoldi(PEP pep,PetscViewer viewer) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode PEPDestroy_QArnoldi(PEP pep) +static PetscErrorCode PEPDestroy_QArnoldi(PEP pep) { PetscFunctionBegin; PetscCall(PetscFree(pep->data)); diff --git a/src/pep/impls/krylov/stoar/stoar.c b/src/pep/impls/krylov/stoar/stoar.c index 4e76eef7e..6cf9c8967 100644 --- a/src/pep/impls/krylov/stoar/stoar.c +++ b/src/pep/impls/krylov/stoar/stoar.c @@ -110,7 +110,7 @@ PetscErrorCode PEPSTOARSetUpInnerMatrix(PEP pep,Mat *B) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode PEPSetUp_STOAR(PEP pep) +static PetscErrorCode PEPSetUp_STOAR(PEP pep) { PetscBool sinv,flg; PEP_STOAR *ctx = (PEP_STOAR*)pep->data; @@ -471,7 +471,7 @@ PetscErrorCode PEPSolve_STOAR(PEP pep) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode PEPSetFromOptions_STOAR(PEP pep,PetscOptionItems *PetscOptionsObject) +static PetscErrorCode PEPSetFromOptions_STOAR(PEP pep,PetscOptionItems *PetscOptionsObject) { PetscBool flg,lock,b,f1,f2,f3; PetscInt i,j,k; @@ -1006,7 +1006,7 @@ PetscErrorCode PEPSTOARGetCheckEigenvalueType(PEP pep,PetscBool *checket) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode PEPView_STOAR(PEP pep,PetscViewer viewer) +static PetscErrorCode PEPView_STOAR(PEP pep,PetscViewer viewer) { PEP_STOAR *ctx = (PEP_STOAR*)pep->data; PetscBool isascii; @@ -1021,14 +1021,14 @@ PetscErrorCode PEPView_STOAR(PEP pep,PetscViewer viewer) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode PEPReset_STOAR(PEP pep) +static PetscErrorCode PEPReset_STOAR(PEP pep) { PetscFunctionBegin; if (pep->which==PEP_ALL) PetscCall(PEPReset_STOAR_QSlice(pep)); PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode PEPDestroy_STOAR(PEP pep) +static PetscErrorCode PEPDestroy_STOAR(PEP pep) { PEP_STOAR *ctx = (PEP_STOAR*)pep->data; diff --git a/src/pep/impls/krylov/toar/ptoar.c b/src/pep/impls/krylov/toar/ptoar.c index ed331c025..cf1c0e023 100644 --- a/src/pep/impls/krylov/toar/ptoar.c +++ b/src/pep/impls/krylov/toar/ptoar.c @@ -47,7 +47,7 @@ static const char citation[] = " doi = \"https://doi.org/10.1137/15M1022458\"\n" "}\n"; -PetscErrorCode PEPSetUp_TOAR(PEP pep) +static PetscErrorCode PEPSetUp_TOAR(PEP pep) { PEP_TOAR *ctx = (PEP_TOAR*)pep->data; PetscBool sinv,flg; @@ -428,7 +428,7 @@ static PetscErrorCode PEPExtractInvariantPair(PEP pep,PetscScalar sigma,PetscInt PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode PEPSolve_TOAR(PEP pep) +static PetscErrorCode PEPSolve_TOAR(PEP pep) { PEP_TOAR *ctx = (PEP_TOAR*)pep->data; PetscInt i,j,k,l,nv=0,ld,lds,nq=0,nconv=0; @@ -754,7 +754,7 @@ PetscErrorCode PEPTOARGetLocking(PEP pep,PetscBool *lock) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode PEPSetFromOptions_TOAR(PEP pep,PetscOptionItems *PetscOptionsObject) +static PetscErrorCode PEPSetFromOptions_TOAR(PEP pep,PetscOptionItems *PetscOptionsObject) { PetscBool flg,lock; PetscReal keep; @@ -772,7 +772,7 @@ PetscErrorCode PEPSetFromOptions_TOAR(PEP pep,PetscOptionItems *PetscOptionsObje PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode PEPView_TOAR(PEP pep,PetscViewer viewer) +static PetscErrorCode PEPView_TOAR(PEP pep,PetscViewer viewer) { PEP_TOAR *ctx = (PEP_TOAR*)pep->data; PetscBool isascii; @@ -786,7 +786,7 @@ PetscErrorCode PEPView_TOAR(PEP pep,PetscViewer viewer) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode PEPDestroy_TOAR(PEP pep) +static PetscErrorCode PEPDestroy_TOAR(PEP pep) { PEP_TOAR *ctx = (PEP_TOAR*)pep->data; diff --git a/src/pep/impls/linear/linear.c b/src/pep/impls/linear/linear.c index f921c2786..fc76fe2ce 100644 --- a/src/pep/impls/linear/linear.c +++ b/src/pep/impls/linear/linear.c @@ -237,7 +237,7 @@ static PetscErrorCode Apply_Linear(ST st,Vec x,Vec y) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode PEPSetUp_Linear(PEP pep) +static PetscErrorCode PEPSetUp_Linear(PEP pep) { PEP_LINEAR *ctx = (PEP_LINEAR*)pep->data; ST st; @@ -629,7 +629,7 @@ static PetscErrorCode PEPLinearExtract_Norm(PEP pep,EPS eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode PEPExtractVectors_Linear(PEP pep) +static PetscErrorCode PEPExtractVectors_Linear(PEP pep) { PEP_LINEAR *ctx = (PEP_LINEAR*)pep->data; @@ -650,7 +650,7 @@ PetscErrorCode PEPExtractVectors_Linear(PEP pep) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode PEPSolve_Linear(PEP pep) +static PetscErrorCode PEPSolve_Linear(PEP pep) { PEP_LINEAR *ctx = (PEP_LINEAR*)pep->data; PetscScalar sigma; @@ -697,7 +697,7 @@ static PetscErrorCode EPSMonitor_Linear(EPS eps,PetscInt its,PetscInt nconv,Pets PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode PEPSetFromOptions_Linear(PEP pep,PetscOptionItems *PetscOptionsObject) +static PetscErrorCode PEPSetFromOptions_Linear(PEP pep,PetscOptionItems *PetscOptionsObject) { PetscBool set,val; PetscInt k; @@ -951,7 +951,7 @@ PetscErrorCode PEPLinearGetEPS(PEP pep,EPS *eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode PEPView_Linear(PEP pep,PetscViewer viewer) +static PetscErrorCode PEPView_Linear(PEP pep,PetscViewer viewer) { PEP_LINEAR *ctx = (PEP_LINEAR*)pep->data; PetscBool isascii; @@ -969,7 +969,7 @@ PetscErrorCode PEPView_Linear(PEP pep,PetscViewer viewer) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode PEPReset_Linear(PEP pep) +static PetscErrorCode PEPReset_Linear(PEP pep) { PEP_LINEAR *ctx = (PEP_LINEAR*)pep->data; @@ -986,7 +986,7 @@ PetscErrorCode PEPReset_Linear(PEP pep) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode PEPDestroy_Linear(PEP pep) +static PetscErrorCode PEPDestroy_Linear(PEP pep) { PEP_LINEAR *ctx = (PEP_LINEAR*)pep->data; diff --git a/src/svd/impls/cross/cross.c b/src/svd/impls/cross/cross.c index bf0e8c8ea..614a440b5 100644 --- a/src/svd/impls/cross/cross.c +++ b/src/svd/impls/cross/cross.c @@ -159,7 +159,7 @@ static PetscErrorCode EPSConv_Cross(EPS eps,PetscScalar eigr,PetscScalar eigi,Pe PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode SVDSetUp_Cross(SVD svd) +static PetscErrorCode SVDSetUp_Cross(SVD svd) { SVD_CROSS *cross = (SVD_CROSS*)svd->data; ST st; @@ -253,7 +253,7 @@ PetscErrorCode SVDSetUp_Cross(SVD svd) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode SVDSolve_Cross(SVD svd) +static PetscErrorCode SVDSolve_Cross(SVD svd) { SVD_CROSS *cross = (SVD_CROSS*)svd->data; PetscInt i; @@ -281,7 +281,7 @@ PetscErrorCode SVDSolve_Cross(SVD svd) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode SVDComputeVectors_Cross(SVD svd) +static PetscErrorCode SVDComputeVectors_Cross(SVD svd) { SVD_CROSS *cross = (SVD_CROSS*)svd->data; PetscInt i,mloc,ploc; @@ -373,7 +373,7 @@ static PetscErrorCode EPSMonitor_Cross(EPS eps,PetscInt its,PetscInt nconv,Petsc PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode SVDSetFromOptions_Cross(SVD svd,PetscOptionItems *PetscOptionsObject) +static PetscErrorCode SVDSetFromOptions_Cross(SVD svd,PetscOptionItems *PetscOptionsObject) { PetscBool set,val; SVD_CROSS *cross = (SVD_CROSS*)svd->data; @@ -548,7 +548,7 @@ PetscErrorCode SVDCrossGetEPS(SVD svd,EPS *eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode SVDView_Cross(SVD svd,PetscViewer viewer) +static PetscErrorCode SVDView_Cross(SVD svd,PetscViewer viewer) { SVD_CROSS *cross = (SVD_CROSS*)svd->data; PetscBool isascii; @@ -565,7 +565,7 @@ PetscErrorCode SVDView_Cross(SVD svd,PetscViewer viewer) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode SVDReset_Cross(SVD svd) +static PetscErrorCode SVDReset_Cross(SVD svd) { SVD_CROSS *cross = (SVD_CROSS*)svd->data; @@ -576,7 +576,7 @@ PetscErrorCode SVDReset_Cross(SVD svd) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode SVDDestroy_Cross(SVD svd) +static PetscErrorCode SVDDestroy_Cross(SVD svd) { SVD_CROSS *cross = (SVD_CROSS*)svd->data; diff --git a/src/svd/impls/cyclic/cyclic.c b/src/svd/impls/cyclic/cyclic.c index e3abc1a35..e87f77ef6 100644 --- a/src/svd/impls/cyclic/cyclic.c +++ b/src/svd/impls/cyclic/cyclic.c @@ -317,7 +317,7 @@ static PetscErrorCode EPSConv_Cyclic(EPS eps,PetscScalar eigr,PetscScalar eigi,P PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode SVDSetUp_Cyclic(SVD svd) +static PetscErrorCode SVDSetUp_Cyclic(SVD svd) { SVD_CYCLIC *cyclic = (SVD_CYCLIC*)svd->data; PetscInt M,N,m,n,p,k,i,isl,offset,nev,ncv,mpd,maxit; @@ -474,7 +474,7 @@ PetscErrorCode SVDSetUp_Cyclic(SVD svd) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode SVDCyclicCheckEigenvalue(SVD svd,PetscScalar er,PetscScalar ei,PetscReal *sigma,PetscBool *isreal) +static PetscErrorCode SVDCyclicCheckEigenvalue(SVD svd,PetscScalar er,PetscScalar ei,PetscReal *sigma,PetscBool *isreal) { PetscFunctionBegin; if (svd->ishyperbolic && PetscDefined(USE_COMPLEX) && PetscAbsReal(PetscImaginaryPart(er))>10*PetscAbsReal(PetscRealPart(er))) { @@ -490,7 +490,7 @@ PetscErrorCode SVDCyclicCheckEigenvalue(SVD svd,PetscScalar er,PetscScalar ei,Pe PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode SVDSolve_Cyclic(SVD svd) +static PetscErrorCode SVDSolve_Cyclic(SVD svd) { SVD_CYCLIC *cyclic = (SVD_CYCLIC*)svd->data; PetscInt i,j,nconv; @@ -758,7 +758,7 @@ static PetscErrorCode SVDComputeVectors_Cyclic_Hyperbolic(SVD svd) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode SVDComputeVectors_Cyclic(SVD svd) +static PetscErrorCode SVDComputeVectors_Cyclic(SVD svd) { PetscFunctionBegin; switch (svd->problem_type) { @@ -804,7 +804,7 @@ static PetscErrorCode EPSMonitor_Cyclic(EPS eps,PetscInt its,PetscInt nconv,Pets PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode SVDSetFromOptions_Cyclic(SVD svd,PetscOptionItems *PetscOptionsObject) +static PetscErrorCode SVDSetFromOptions_Cyclic(SVD svd,PetscOptionItems *PetscOptionsObject) { PetscBool set,val; SVD_CYCLIC *cyclic = (SVD_CYCLIC*)svd->data; @@ -979,7 +979,7 @@ PetscErrorCode SVDCyclicGetEPS(SVD svd,EPS *eps) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode SVDView_Cyclic(SVD svd,PetscViewer viewer) +static PetscErrorCode SVDView_Cyclic(SVD svd,PetscViewer viewer) { SVD_CYCLIC *cyclic = (SVD_CYCLIC*)svd->data; PetscBool isascii; @@ -996,7 +996,7 @@ PetscErrorCode SVDView_Cyclic(SVD svd,PetscViewer viewer) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode SVDReset_Cyclic(SVD svd) +static PetscErrorCode SVDReset_Cyclic(SVD svd) { SVD_CYCLIC *cyclic = (SVD_CYCLIC*)svd->data; @@ -1007,7 +1007,7 @@ PetscErrorCode SVDReset_Cyclic(SVD svd) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode SVDDestroy_Cyclic(SVD svd) +static PetscErrorCode SVDDestroy_Cyclic(SVD svd) { SVD_CYCLIC *cyclic = (SVD_CYCLIC*)svd->data; diff --git a/src/svd/impls/external/elemental/svdelemen.cxx b/src/svd/impls/external/elemental/svdelemen.cxx index 20d57aea2..f5b714a07 100644 --- a/src/svd/impls/external/elemental/svdelemen.cxx +++ b/src/svd/impls/external/elemental/svdelemen.cxx @@ -18,7 +18,7 @@ typedef struct { Mat Ae; /* converted matrix */ } SVD_Elemental; -PetscErrorCode SVDSetUp_Elemental(SVD svd) +static PetscErrorCode SVDSetUp_Elemental(SVD svd) { SVD_Elemental *ctx = (SVD_Elemental*)svd->data; PetscInt M,N; @@ -41,7 +41,7 @@ PetscErrorCode SVDSetUp_Elemental(SVD svd) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode SVDSolve_Elemental(SVD svd) +static PetscErrorCode SVDSolve_Elemental(SVD svd) { SVD_Elemental *ctx = (SVD_Elemental*)svd->data; Mat A = ctx->Ae,Z,Q,U,V; @@ -77,14 +77,14 @@ PetscErrorCode SVDSolve_Elemental(SVD svd) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode SVDDestroy_Elemental(SVD svd) +static PetscErrorCode SVDDestroy_Elemental(SVD svd) { PetscFunctionBegin; PetscCall(PetscFree(svd->data)); PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode SVDReset_Elemental(SVD svd) +static PetscErrorCode SVDReset_Elemental(SVD svd) { SVD_Elemental *ctx = (SVD_Elemental*)svd->data; diff --git a/src/svd/impls/external/ksvd/svdksvd.c b/src/svd/impls/external/ksvd/svdksvd.c index 50418cd72..04575842b 100644 --- a/src/svd/impls/external/ksvd/svdksvd.c +++ b/src/svd/impls/external/ksvd/svdksvd.c @@ -21,7 +21,7 @@ typedef struct { SVDKSVDPolarMethod polar; } SVD_KSVD; -PetscErrorCode SVDSetUp_KSVD(SVD svd) +static PetscErrorCode SVDSetUp_KSVD(SVD svd) { SVD_KSVD *ctx = (SVD_KSVD*)svd->data; PetscInt M,N; @@ -48,7 +48,7 @@ PetscErrorCode SVDSetUp_KSVD(SVD svd) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode SVDSolve_KSVD(SVD svd) +static PetscErrorCode SVDSolve_KSVD(SVD svd) { SVD_KSVD *ctx = (SVD_KSVD*)svd->data; Mat A = ctx->As,Z,Q,U,V; @@ -122,7 +122,7 @@ PetscErrorCode SVDSolve_KSVD(SVD svd) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode SVDDestroy_KSVD(SVD svd) +static PetscErrorCode SVDDestroy_KSVD(SVD svd) { PetscFunctionBegin; PetscCall(PetscFree(svd->data)); @@ -133,7 +133,7 @@ PetscErrorCode SVDDestroy_KSVD(SVD svd) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode SVDReset_KSVD(SVD svd) +static PetscErrorCode SVDReset_KSVD(SVD svd) { SVD_KSVD *ctx = (SVD_KSVD*)svd->data; @@ -142,7 +142,7 @@ PetscErrorCode SVDReset_KSVD(SVD svd) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode SVDView_KSVD(SVD svd,PetscViewer viewer) +static PetscErrorCode SVDView_KSVD(SVD svd,PetscViewer viewer) { PetscBool isascii; SVD_KSVD *ctx = (SVD_KSVD*)svd->data; @@ -157,7 +157,7 @@ PetscErrorCode SVDView_KSVD(SVD svd,PetscViewer viewer) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode SVDSetFromOptions_KSVD(SVD svd,PetscOptionItems *PetscOptionsObject) +static PetscErrorCode SVDSetFromOptions_KSVD(SVD svd,PetscOptionItems *PetscOptionsObject) { SVD_KSVD *ctx = (SVD_KSVD*)svd->data; SVDKSVDEigenMethod eigen; diff --git a/src/svd/impls/external/primme/svdprimme.c b/src/svd/impls/external/primme/svdprimme.c index 2c4790471..c54f3d6f2 100644 --- a/src/svd/impls/external/primme/svdprimme.c +++ b/src/svd/impls/external/primme/svdprimme.c @@ -144,7 +144,7 @@ static void multMatvec_PRIMME(void *xa,PRIMME_INT *ldx,void *ya,PRIMME_INT *ldy, PetscFunctionReturnVoid(); } -PetscErrorCode SVDSetUp_PRIMME(SVD svd) +static PetscErrorCode SVDSetUp_PRIMME(SVD svd) { PetscMPIInt numProcs,procID; PetscInt n,m,nloc,mloc; @@ -225,7 +225,7 @@ PetscErrorCode SVDSetUp_PRIMME(SVD svd) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode SVDSolve_PRIMME(SVD svd) +static PetscErrorCode SVDSolve_PRIMME(SVD svd) { SVD_PRIMME *ops = (SVD_PRIMME*)svd->data; PetscScalar *svecs, *a; @@ -283,7 +283,7 @@ PetscErrorCode SVDSolve_PRIMME(SVD svd) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode SVDReset_PRIMME(SVD svd) +static PetscErrorCode SVDReset_PRIMME(SVD svd) { SVD_PRIMME *ops = (SVD_PRIMME*)svd->data; @@ -294,7 +294,7 @@ PetscErrorCode SVDReset_PRIMME(SVD svd) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode SVDDestroy_PRIMME(SVD svd) +static PetscErrorCode SVDDestroy_PRIMME(SVD svd) { PetscFunctionBegin; PetscCall(PetscFree(svd->data)); @@ -305,7 +305,7 @@ PetscErrorCode SVDDestroy_PRIMME(SVD svd) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode SVDView_PRIMME(SVD svd,PetscViewer viewer) +static PetscErrorCode SVDView_PRIMME(SVD svd,PetscViewer viewer) { PetscBool isascii; SVD_PRIMME *ctx = (SVD_PRIMME*)svd->data; @@ -324,7 +324,7 @@ PetscErrorCode SVDView_PRIMME(SVD svd,PetscViewer viewer) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode SVDSetFromOptions_PRIMME(SVD svd,PetscOptionItems *PetscOptionsObject) +static PetscErrorCode SVDSetFromOptions_PRIMME(SVD svd,PetscOptionItems *PetscOptionsObject) { SVD_PRIMME *ctx = (SVD_PRIMME*)svd->data; PetscInt bs; diff --git a/src/svd/impls/external/scalapack/svdscalap.c b/src/svd/impls/external/scalapack/svdscalap.c index cbf135aae..214e856aa 100644 --- a/src/svd/impls/external/scalapack/svdscalap.c +++ b/src/svd/impls/external/scalapack/svdscalap.c @@ -18,7 +18,7 @@ typedef struct { Mat As; /* converted matrix */ } SVD_ScaLAPACK; -PetscErrorCode SVDSetUp_ScaLAPACK(SVD svd) +static PetscErrorCode SVDSetUp_ScaLAPACK(SVD svd) { SVD_ScaLAPACK *ctx = (SVD_ScaLAPACK*)svd->data; PetscInt M,N; @@ -40,7 +40,7 @@ PetscErrorCode SVDSetUp_ScaLAPACK(SVD svd) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode SVDSolve_ScaLAPACK(SVD svd) +static PetscErrorCode SVDSolve_ScaLAPACK(SVD svd) { SVD_ScaLAPACK *ctx = (SVD_ScaLAPACK*)svd->data; Mat A = ctx->As,Z,Q,QT,U,V; @@ -119,14 +119,14 @@ PetscErrorCode SVDSolve_ScaLAPACK(SVD svd) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode SVDDestroy_ScaLAPACK(SVD svd) +static PetscErrorCode SVDDestroy_ScaLAPACK(SVD svd) { PetscFunctionBegin; PetscCall(PetscFree(svd->data)); PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode SVDReset_ScaLAPACK(SVD svd) +static PetscErrorCode SVDReset_ScaLAPACK(SVD svd) { SVD_ScaLAPACK *ctx = (SVD_ScaLAPACK*)svd->data; diff --git a/src/svd/impls/lanczos/gklanczos.c b/src/svd/impls/lanczos/gklanczos.c index d3d0fb61b..832cfe3fd 100644 --- a/src/svd/impls/lanczos/gklanczos.c +++ b/src/svd/impls/lanczos/gklanczos.c @@ -34,7 +34,7 @@ typedef struct { PetscBool oneside; } SVD_LANCZOS; -PetscErrorCode SVDSetUp_Lanczos(SVD svd) +static PetscErrorCode SVDSetUp_Lanczos(SVD svd) { SVD_LANCZOS *lanczos = (SVD_LANCZOS*)svd->data; PetscInt N; @@ -217,7 +217,7 @@ PetscErrorCode SVDKrylovConvergence(SVD svd,PetscBool getall,PetscInt kini,Petsc PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode SVDSolve_Lanczos(SVD svd) +static PetscErrorCode SVDSolve_Lanczos(SVD svd) { SVD_LANCZOS *lanczos = (SVD_LANCZOS*)svd->data; PetscReal *alpha,*beta; @@ -309,7 +309,7 @@ PetscErrorCode SVDSolve_Lanczos(SVD svd) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode SVDSetFromOptions_Lanczos(SVD svd,PetscOptionItems *PetscOptionsObject) +static PetscErrorCode SVDSetFromOptions_Lanczos(SVD svd,PetscOptionItems *PetscOptionsObject) { PetscBool set,val; SVD_LANCZOS *lanczos = (SVD_LANCZOS*)svd->data; @@ -402,7 +402,7 @@ PetscErrorCode SVDLanczosGetOneSide(SVD svd,PetscBool *oneside) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode SVDDestroy_Lanczos(SVD svd) +static PetscErrorCode SVDDestroy_Lanczos(SVD svd) { PetscFunctionBegin; PetscCall(PetscFree(svd->data)); @@ -411,7 +411,7 @@ PetscErrorCode SVDDestroy_Lanczos(SVD svd) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode SVDView_Lanczos(SVD svd,PetscViewer viewer) +static PetscErrorCode SVDView_Lanczos(SVD svd,PetscViewer viewer) { SVD_LANCZOS *lanczos = (SVD_LANCZOS*)svd->data; PetscBool isascii; diff --git a/src/svd/impls/lapack/svdlapack.c b/src/svd/impls/lapack/svdlapack.c index 6b46eae13..81550cb00 100644 --- a/src/svd/impls/lapack/svdlapack.c +++ b/src/svd/impls/lapack/svdlapack.c @@ -14,7 +14,7 @@ #include #include -PetscErrorCode SVDSetUp_LAPACK(SVD svd) +static PetscErrorCode SVDSetUp_LAPACK(SVD svd) { PetscInt M,N,P=0; @@ -34,7 +34,7 @@ PetscErrorCode SVDSetUp_LAPACK(SVD svd) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode SVDSolve_LAPACK(SVD svd) +static PetscErrorCode SVDSolve_LAPACK(SVD svd) { PetscInt M,N,n,i,j,k,ld,lowu,lowv,highu,highv; Mat A,Ar,mat; @@ -97,7 +97,7 @@ PetscErrorCode SVDSolve_LAPACK(SVD svd) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode SVDSolve_LAPACK_GSVD(SVD svd) +static PetscErrorCode SVDSolve_LAPACK_GSVD(SVD svd) { PetscInt nsv,m,n,p,i,j,mlocal,plocal,ld,lowx,lowu,lowv,highx; Mat Ar,A,Ads,Br,B,Bds; @@ -168,7 +168,7 @@ PetscErrorCode SVDSolve_LAPACK_GSVD(SVD svd) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode SVDSolve_LAPACK_HSVD(SVD svd) +static PetscErrorCode SVDSolve_LAPACK_HSVD(SVD svd) { PetscInt M,N,n,i,j,k,ld,lowu,lowv,highu,highv; Mat A,Ar,mat,D; @@ -238,7 +238,7 @@ PetscErrorCode SVDSolve_LAPACK_HSVD(SVD svd) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode SVDSetDSType_LAPACK(SVD svd) +static PetscErrorCode SVDSetDSType_LAPACK(SVD svd) { PetscFunctionBegin; PetscCall(DSSetType(svd->ds,svd->OPb?DSGSVD:svd->omega?DSHSVD:DSSVD)); diff --git a/src/svd/impls/randomized/rsvd.c b/src/svd/impls/randomized/rsvd.c index ff9175ee3..01460641e 100644 --- a/src/svd/impls/randomized/rsvd.c +++ b/src/svd/impls/randomized/rsvd.c @@ -26,7 +26,7 @@ #include /*I "slepcsvd.h" I*/ -PetscErrorCode SVDSetUp_Randomized(SVD svd) +static PetscErrorCode SVDSetUp_Randomized(SVD svd) { PetscInt N; @@ -88,7 +88,7 @@ static PetscErrorCode BlockMatMult(BV V,Mat A,BV Y,Mat AT) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode SVDSolve_Randomized(SVD svd) +static PetscErrorCode SVDSolve_Randomized(SVD svd) { PetscScalar *w; PetscReal res=1.0; diff --git a/src/svd/impls/trlanczos/trlanczos.c b/src/svd/impls/trlanczos/trlanczos.c index a690c6d01..4b234e6e6 100644 --- a/src/svd/impls/trlanczos/trlanczos.c +++ b/src/svd/impls/trlanczos/trlanczos.c @@ -200,7 +200,7 @@ static PetscErrorCode MatCreateVecs_Z(Mat Z,Vec *right,Vec *left) #define SWAP(a,b,t) do {t=a;a=b;b=t;} while (0) -PetscErrorCode SVDSetUp_TRLanczos(SVD svd) +static PetscErrorCode SVDSetUp_TRLanczos(SVD svd) { PetscInt M,N,P,m,n,p; SVD_TRLANCZOS *lanczos = (SVD_TRLANCZOS*)svd->data; @@ -447,7 +447,7 @@ static PetscErrorCode SVDOneSideTRLanczosCGS(SVD svd,PetscReal *alpha,PetscReal PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode SVDSolve_TRLanczos(SVD svd) +static PetscErrorCode SVDSolve_TRLanczos(SVD svd) { SVD_TRLANCZOS *lanczos = (SVD_TRLANCZOS*)svd->data; PetscReal *alpha,*beta; @@ -550,7 +550,7 @@ PetscErrorCode SVDSolve_TRLanczos(SVD svd) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode SVDLanczosHSVD(SVD svd,PetscReal *alpha,PetscReal *beta,PetscReal *omega,Mat A,Mat AT,BV V,BV U,PetscInt k,PetscInt *n,PetscBool *breakdown) +static PetscErrorCode SVDLanczosHSVD(SVD svd,PetscReal *alpha,PetscReal *beta,PetscReal *omega,Mat A,Mat AT,BV V,BV U,PetscInt k,PetscInt *n,PetscBool *breakdown) { PetscInt i; Vec u,v,ou=svd->workl[0]; @@ -589,7 +589,7 @@ PetscErrorCode SVDLanczosHSVD(SVD svd,PetscReal *alpha,PetscReal *beta,PetscReal PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode SVDSolve_TRLanczos_HSVD(SVD svd) +static PetscErrorCode SVDSolve_TRLanczos_HSVD(SVD svd) { SVD_TRLANCZOS *lanczos = (SVD_TRLANCZOS*)svd->data; PetscReal *alpha,*beta,*omega; @@ -847,7 +847,7 @@ static PetscErrorCode SVDLanczosGSingle(SVD svd,PetscReal *alpha,PetscReal *beta } /* solve generalized problem with single bidiagonalization of Q_A */ -PetscErrorCode SVDSolve_TRLanczosGSingle(SVD svd,BV U1,BV V) +static PetscErrorCode SVDSolve_TRLanczosGSingle(SVD svd,BV U1,BV V) { SVD_TRLANCZOS *lanczos = (SVD_TRLANCZOS*)svd->data; PetscReal *alpha,*beta,normr,scaleth,sigma0,*sigma; @@ -1114,7 +1114,7 @@ static inline PetscErrorCode SVDInitialVectorGUpper(SVD svd,BV V,BV U1,PetscInt } /* solve generalized problem with joint upper-upper bidiagonalization */ -PetscErrorCode SVDSolve_TRLanczosGUpper(SVD svd,BV U1,BV U2,BV V) +static PetscErrorCode SVDSolve_TRLanczosGUpper(SVD svd,BV U1,BV U2,BV V) { SVD_TRLANCZOS *lanczos = (SVD_TRLANCZOS*)svd->data; PetscReal *alpha,*beta,*alphah,*betah,normr,sigma0,*sigma; @@ -1409,7 +1409,7 @@ static inline PetscErrorCode SVDInitialVectorGLower(SVD svd,BV V,BV U1,BV U2,Pet } /* solve generalized problem with joint lower-upper bidiagonalization */ -PetscErrorCode SVDSolve_TRLanczosGLower(SVD svd,BV U1,BV U2,BV V) +static PetscErrorCode SVDSolve_TRLanczosGLower(SVD svd,BV U1,BV U2,BV V) { SVD_TRLANCZOS *lanczos = (SVD_TRLANCZOS*)svd->data; PetscReal *alpha,*beta,*alphah,*betah,normr,scalef,*sigma,sigma0; @@ -1520,7 +1520,7 @@ PetscErrorCode SVDSolve_TRLanczosGLower(SVD svd,BV U1,BV U2,BV V) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode SVDSolve_TRLanczos_GSVD(SVD svd) +static PetscErrorCode SVDSolve_TRLanczos_GSVD(SVD svd) { SVD_TRLANCZOS *lanczos = (SVD_TRLANCZOS*)svd->data; PetscInt k,m,p; @@ -1614,7 +1614,7 @@ PetscErrorCode SVDSolve_TRLanczos_GSVD(SVD svd) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode SVDSetFromOptions_TRLanczos(SVD svd,PetscOptionItems *PetscOptionsObject) +static PetscErrorCode SVDSetFromOptions_TRLanczos(SVD svd,PetscOptionItems *PetscOptionsObject) { SVD_TRLANCZOS *lanczos = (SVD_TRLANCZOS*)svd->data; PetscBool flg,val,lock; @@ -2214,7 +2214,7 @@ PetscErrorCode SVDTRLanczosGetScale(SVD svd,PetscReal *scale) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode SVDReset_TRLanczos(SVD svd) +static PetscErrorCode SVDReset_TRLanczos(SVD svd) { SVD_TRLANCZOS *lanczos = (SVD_TRLANCZOS*)svd->data; @@ -2226,7 +2226,7 @@ PetscErrorCode SVDReset_TRLanczos(SVD svd) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode SVDDestroy_TRLanczos(SVD svd) +static PetscErrorCode SVDDestroy_TRLanczos(SVD svd) { SVD_TRLANCZOS *lanczos = (SVD_TRLANCZOS*)svd->data; @@ -2250,7 +2250,7 @@ PetscErrorCode SVDDestroy_TRLanczos(SVD svd) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode SVDView_TRLanczos(SVD svd,PetscViewer viewer) +static PetscErrorCode SVDView_TRLanczos(SVD svd,PetscViewer viewer) { SVD_TRLANCZOS *lanczos = (SVD_TRLANCZOS*)svd->data; PetscBool isascii; @@ -2281,7 +2281,7 @@ PetscErrorCode SVDView_TRLanczos(SVD svd,PetscViewer viewer) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode SVDSetDSType_TRLanczos(SVD svd) +static PetscErrorCode SVDSetDSType_TRLanczos(SVD svd) { SVD_TRLANCZOS *lanczos = (SVD_TRLANCZOS*)svd->data; DSType dstype; diff --git a/src/sys/classes/bv/impls/contiguous/contig.c b/src/sys/classes/bv/impls/contiguous/contig.c index 82e2cd22f..363adbe95 100644 --- a/src/sys/classes/bv/impls/contiguous/contig.c +++ b/src/sys/classes/bv/impls/contiguous/contig.c @@ -19,7 +19,7 @@ typedef struct { PetscBool mpi; } BV_CONTIGUOUS; -PetscErrorCode BVMult_Contiguous(BV Y,PetscScalar alpha,PetscScalar beta,BV X,Mat Q) +static PetscErrorCode BVMult_Contiguous(BV Y,PetscScalar alpha,PetscScalar beta,BV X,Mat Q) { BV_CONTIGUOUS *y = (BV_CONTIGUOUS*)Y->data,*x = (BV_CONTIGUOUS*)X->data; const PetscScalar *q; @@ -35,7 +35,7 @@ PetscErrorCode BVMult_Contiguous(BV Y,PetscScalar alpha,PetscScalar beta,BV X,Ma PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVMultVec_Contiguous(BV X,PetscScalar alpha,PetscScalar beta,Vec y,PetscScalar *q) +static PetscErrorCode BVMultVec_Contiguous(BV X,PetscScalar alpha,PetscScalar beta,Vec y,PetscScalar *q) { BV_CONTIGUOUS *x = (BV_CONTIGUOUS*)X->data; PetscScalar *py,*qq=q; @@ -49,7 +49,7 @@ PetscErrorCode BVMultVec_Contiguous(BV X,PetscScalar alpha,PetscScalar beta,Vec PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVMultInPlace_Contiguous(BV V,Mat Q,PetscInt s,PetscInt e) +static PetscErrorCode BVMultInPlace_Contiguous(BV V,Mat Q,PetscInt s,PetscInt e) { BV_CONTIGUOUS *ctx = (BV_CONTIGUOUS*)V->data; const PetscScalar *q; @@ -63,7 +63,7 @@ PetscErrorCode BVMultInPlace_Contiguous(BV V,Mat Q,PetscInt s,PetscInt e) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVMultInPlaceHermitianTranspose_Contiguous(BV V,Mat Q,PetscInt s,PetscInt e) +static PetscErrorCode BVMultInPlaceHermitianTranspose_Contiguous(BV V,Mat Q,PetscInt s,PetscInt e) { BV_CONTIGUOUS *ctx = (BV_CONTIGUOUS*)V->data; const PetscScalar *q; @@ -77,7 +77,7 @@ PetscErrorCode BVMultInPlaceHermitianTranspose_Contiguous(BV V,Mat Q,PetscInt s, PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVDot_Contiguous(BV X,BV Y,Mat M) +static PetscErrorCode BVDot_Contiguous(BV X,BV Y,Mat M) { BV_CONTIGUOUS *x = (BV_CONTIGUOUS*)X->data,*y = (BV_CONTIGUOUS*)Y->data; PetscScalar *m; @@ -91,7 +91,7 @@ PetscErrorCode BVDot_Contiguous(BV X,BV Y,Mat M) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVDotVec_Contiguous(BV X,Vec y,PetscScalar *q) +static PetscErrorCode BVDotVec_Contiguous(BV X,Vec y,PetscScalar *q) { BV_CONTIGUOUS *x = (BV_CONTIGUOUS*)X->data; const PetscScalar *py; @@ -111,7 +111,7 @@ PetscErrorCode BVDotVec_Contiguous(BV X,Vec y,PetscScalar *q) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVDotVec_Local_Contiguous(BV X,Vec y,PetscScalar *m) +static PetscErrorCode BVDotVec_Local_Contiguous(BV X,Vec y,PetscScalar *m) { BV_CONTIGUOUS *x = (BV_CONTIGUOUS*)X->data; PetscScalar *py; @@ -128,7 +128,7 @@ PetscErrorCode BVDotVec_Local_Contiguous(BV X,Vec y,PetscScalar *m) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVScale_Contiguous(BV bv,PetscInt j,PetscScalar alpha) +static PetscErrorCode BVScale_Contiguous(BV bv,PetscInt j,PetscScalar alpha) { BV_CONTIGUOUS *ctx = (BV_CONTIGUOUS*)bv->data; @@ -138,7 +138,7 @@ PetscErrorCode BVScale_Contiguous(BV bv,PetscInt j,PetscScalar alpha) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVNorm_Contiguous(BV bv,PetscInt j,NormType type,PetscReal *val) +static PetscErrorCode BVNorm_Contiguous(BV bv,PetscInt j,NormType type,PetscReal *val) { BV_CONTIGUOUS *ctx = (BV_CONTIGUOUS*)bv->data; @@ -148,7 +148,7 @@ PetscErrorCode BVNorm_Contiguous(BV bv,PetscInt j,NormType type,PetscReal *val) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVNorm_Local_Contiguous(BV bv,PetscInt j,NormType type,PetscReal *val) +static PetscErrorCode BVNorm_Local_Contiguous(BV bv,PetscInt j,NormType type,PetscReal *val) { BV_CONTIGUOUS *ctx = (BV_CONTIGUOUS*)bv->data; @@ -158,7 +158,7 @@ PetscErrorCode BVNorm_Local_Contiguous(BV bv,PetscInt j,NormType type,PetscReal PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVNormalize_Contiguous(BV bv,PetscScalar *eigi) +static PetscErrorCode BVNormalize_Contiguous(BV bv,PetscScalar *eigi) { BV_CONTIGUOUS *ctx = (BV_CONTIGUOUS*)bv->data; PetscScalar *wi=NULL; @@ -169,7 +169,7 @@ PetscErrorCode BVNormalize_Contiguous(BV bv,PetscScalar *eigi) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVMatMult_Contiguous(BV V,Mat A,BV W) +static PetscErrorCode BVMatMult_Contiguous(BV V,Mat A,BV W) { BV_CONTIGUOUS *v = (BV_CONTIGUOUS*)V->data,*w = (BV_CONTIGUOUS*)W->data; PetscInt j; @@ -193,7 +193,7 @@ PetscErrorCode BVMatMult_Contiguous(BV V,Mat A,BV W) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVCopy_Contiguous(BV V,BV W) +static PetscErrorCode BVCopy_Contiguous(BV V,BV W) { BV_CONTIGUOUS *v = (BV_CONTIGUOUS*)V->data,*w = (BV_CONTIGUOUS*)W->data; PetscScalar *pvc,*pwc; @@ -205,7 +205,7 @@ PetscErrorCode BVCopy_Contiguous(BV V,BV W) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVCopyColumn_Contiguous(BV V,PetscInt j,PetscInt i) +static PetscErrorCode BVCopyColumn_Contiguous(BV V,PetscInt j,PetscInt i) { BV_CONTIGUOUS *v = (BV_CONTIGUOUS*)V->data; @@ -214,7 +214,7 @@ PetscErrorCode BVCopyColumn_Contiguous(BV V,PetscInt j,PetscInt i) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVResize_Contiguous(BV bv,PetscInt m,PetscBool copy) +static PetscErrorCode BVResize_Contiguous(BV bv,PetscInt m,PetscBool copy) { BV_CONTIGUOUS *ctx = (BV_CONTIGUOUS*)bv->data; PetscInt j,bs; @@ -245,7 +245,7 @@ PetscErrorCode BVResize_Contiguous(BV bv,PetscInt m,PetscBool copy) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVGetColumn_Contiguous(BV bv,PetscInt j,Vec *v) +static PetscErrorCode BVGetColumn_Contiguous(BV bv,PetscInt j,Vec *v) { BV_CONTIGUOUS *ctx = (BV_CONTIGUOUS*)bv->data; PetscInt l; @@ -256,7 +256,7 @@ PetscErrorCode BVGetColumn_Contiguous(BV bv,PetscInt j,Vec *v) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVRestoreColumn_Contiguous(BV bv,PetscInt j,Vec *v) +static PetscErrorCode BVRestoreColumn_Contiguous(BV bv,PetscInt j,Vec *v) { PetscInt l; @@ -266,7 +266,7 @@ PetscErrorCode BVRestoreColumn_Contiguous(BV bv,PetscInt j,Vec *v) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVGetArray_Contiguous(BV bv,PetscScalar **a) +static PetscErrorCode BVGetArray_Contiguous(BV bv,PetscScalar **a) { BV_CONTIGUOUS *ctx = (BV_CONTIGUOUS*)bv->data; @@ -275,7 +275,7 @@ PetscErrorCode BVGetArray_Contiguous(BV bv,PetscScalar **a) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVGetArrayRead_Contiguous(BV bv,const PetscScalar **a) +static PetscErrorCode BVGetArrayRead_Contiguous(BV bv,const PetscScalar **a) { BV_CONTIGUOUS *ctx = (BV_CONTIGUOUS*)bv->data; @@ -284,7 +284,7 @@ PetscErrorCode BVGetArrayRead_Contiguous(BV bv,const PetscScalar **a) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVDestroy_Contiguous(BV bv) +static PetscErrorCode BVDestroy_Contiguous(BV bv) { BV_CONTIGUOUS *ctx = (BV_CONTIGUOUS*)bv->data; @@ -297,7 +297,7 @@ PetscErrorCode BVDestroy_Contiguous(BV bv) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVView_Contiguous(BV bv,PetscViewer viewer) +static PetscErrorCode BVView_Contiguous(BV bv,PetscViewer viewer) { PetscInt j; Vec v; diff --git a/src/sys/classes/bv/impls/mat/bvmat.c b/src/sys/classes/bv/impls/mat/bvmat.c index cfc008753..0295e6af9 100644 --- a/src/sys/classes/bv/impls/mat/bvmat.c +++ b/src/sys/classes/bv/impls/mat/bvmat.c @@ -18,7 +18,7 @@ typedef struct { PetscBool mpi; } BV_MAT; -PetscErrorCode BVMult_Mat(BV Y,PetscScalar alpha,PetscScalar beta,BV X,Mat Q) +static PetscErrorCode BVMult_Mat(BV Y,PetscScalar alpha,PetscScalar beta,BV X,Mat Q) { BV_MAT *y = (BV_MAT*)Y->data,*x = (BV_MAT*)X->data; PetscScalar *py; @@ -39,7 +39,7 @@ PetscErrorCode BVMult_Mat(BV Y,PetscScalar alpha,PetscScalar beta,BV X,Mat Q) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVMultVec_Mat(BV X,PetscScalar alpha,PetscScalar beta,Vec y,PetscScalar *q) +static PetscErrorCode BVMultVec_Mat(BV X,PetscScalar alpha,PetscScalar beta,Vec y,PetscScalar *q) { BV_MAT *x = (BV_MAT*)X->data; PetscScalar *py,*qq=q; @@ -56,7 +56,7 @@ PetscErrorCode BVMultVec_Mat(BV X,PetscScalar alpha,PetscScalar beta,Vec y,Petsc PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVMultInPlace_Mat(BV V,Mat Q,PetscInt s,PetscInt e) +static PetscErrorCode BVMultInPlace_Mat(BV V,Mat Q,PetscInt s,PetscInt e) { BV_MAT *ctx = (BV_MAT*)V->data; PetscScalar *pv; @@ -73,7 +73,7 @@ PetscErrorCode BVMultInPlace_Mat(BV V,Mat Q,PetscInt s,PetscInt e) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVMultInPlaceHermitianTranspose_Mat(BV V,Mat Q,PetscInt s,PetscInt e) +static PetscErrorCode BVMultInPlaceHermitianTranspose_Mat(BV V,Mat Q,PetscInt s,PetscInt e) { BV_MAT *ctx = (BV_MAT*)V->data; PetscScalar *pv; @@ -90,7 +90,7 @@ PetscErrorCode BVMultInPlaceHermitianTranspose_Mat(BV V,Mat Q,PetscInt s,PetscIn PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVDot_Mat(BV X,BV Y,Mat M) +static PetscErrorCode BVDot_Mat(BV X,BV Y,Mat M) { BV_MAT *x = (BV_MAT*)X->data,*y = (BV_MAT*)Y->data; PetscScalar *m; @@ -109,7 +109,7 @@ PetscErrorCode BVDot_Mat(BV X,BV Y,Mat M) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVDotVec_Mat(BV X,Vec y,PetscScalar *q) +static PetscErrorCode BVDotVec_Mat(BV X,Vec y,PetscScalar *q) { BV_MAT *x = (BV_MAT*)X->data; PetscScalar *qq=q; @@ -131,7 +131,7 @@ PetscErrorCode BVDotVec_Mat(BV X,Vec y,PetscScalar *q) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVDotVec_Local_Mat(BV X,Vec y,PetscScalar *m) +static PetscErrorCode BVDotVec_Local_Mat(BV X,Vec y,PetscScalar *m) { BV_MAT *x = (BV_MAT*)X->data; const PetscScalar *px,*py; @@ -150,7 +150,7 @@ PetscErrorCode BVDotVec_Local_Mat(BV X,Vec y,PetscScalar *m) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVScale_Mat(BV bv,PetscInt j,PetscScalar alpha) +static PetscErrorCode BVScale_Mat(BV bv,PetscInt j,PetscScalar alpha) { BV_MAT *ctx = (BV_MAT*)bv->data; PetscScalar *array; @@ -163,7 +163,7 @@ PetscErrorCode BVScale_Mat(BV bv,PetscInt j,PetscScalar alpha) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVNorm_Mat(BV bv,PetscInt j,NormType type,PetscReal *val) +static PetscErrorCode BVNorm_Mat(BV bv,PetscInt j,NormType type,PetscReal *val) { BV_MAT *ctx = (BV_MAT*)bv->data; const PetscScalar *array; @@ -176,7 +176,7 @@ PetscErrorCode BVNorm_Mat(BV bv,PetscInt j,NormType type,PetscReal *val) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVNorm_Local_Mat(BV bv,PetscInt j,NormType type,PetscReal *val) +static PetscErrorCode BVNorm_Local_Mat(BV bv,PetscInt j,NormType type,PetscReal *val) { BV_MAT *ctx = (BV_MAT*)bv->data; const PetscScalar *array; @@ -189,7 +189,7 @@ PetscErrorCode BVNorm_Local_Mat(BV bv,PetscInt j,NormType type,PetscReal *val) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVNormalize_Mat(BV bv,PetscScalar *eigi) +static PetscErrorCode BVNormalize_Mat(BV bv,PetscScalar *eigi) { BV_MAT *ctx = (BV_MAT*)bv->data; PetscScalar *array,*wi=NULL; @@ -202,7 +202,7 @@ PetscErrorCode BVNormalize_Mat(BV bv,PetscScalar *eigi) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVMatMult_Mat(BV V,Mat A,BV W) +static PetscErrorCode BVMatMult_Mat(BV V,Mat A,BV W) { PetscInt j; Mat Vmat,Wmat; @@ -232,7 +232,7 @@ PetscErrorCode BVMatMult_Mat(BV V,Mat A,BV W) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVCopy_Mat(BV V,BV W) +static PetscErrorCode BVCopy_Mat(BV V,BV W) { BV_MAT *v = (BV_MAT*)V->data,*w = (BV_MAT*)W->data; PetscScalar *pw,*pwc; @@ -249,7 +249,7 @@ PetscErrorCode BVCopy_Mat(BV V,BV W) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVCopyColumn_Mat(BV V,PetscInt j,PetscInt i) +static PetscErrorCode BVCopyColumn_Mat(BV V,PetscInt j,PetscInt i) { BV_MAT *v = (BV_MAT*)V->data; PetscScalar *pv; @@ -261,7 +261,7 @@ PetscErrorCode BVCopyColumn_Mat(BV V,PetscInt j,PetscInt i) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVResize_Mat(BV bv,PetscInt m,PetscBool copy) +static PetscErrorCode BVResize_Mat(BV bv,PetscInt m,PetscBool copy) { BV_MAT *ctx = (BV_MAT*)bv->data; PetscScalar *pnew; @@ -287,7 +287,7 @@ PetscErrorCode BVResize_Mat(BV bv,PetscInt m,PetscBool copy) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVGetColumn_Mat(BV bv,PetscInt j,Vec *v) +static PetscErrorCode BVGetColumn_Mat(BV bv,PetscInt j,Vec *v) { BV_MAT *ctx = (BV_MAT*)bv->data; PetscScalar *pA; @@ -300,7 +300,7 @@ PetscErrorCode BVGetColumn_Mat(BV bv,PetscInt j,Vec *v) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVRestoreColumn_Mat(BV bv,PetscInt j,Vec *v) +static PetscErrorCode BVRestoreColumn_Mat(BV bv,PetscInt j,Vec *v) { BV_MAT *ctx = (BV_MAT*)bv->data; PetscScalar *pA; @@ -313,7 +313,7 @@ PetscErrorCode BVRestoreColumn_Mat(BV bv,PetscInt j,Vec *v) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVGetArray_Mat(BV bv,PetscScalar **a) +static PetscErrorCode BVGetArray_Mat(BV bv,PetscScalar **a) { BV_MAT *ctx = (BV_MAT*)bv->data; @@ -322,7 +322,7 @@ PetscErrorCode BVGetArray_Mat(BV bv,PetscScalar **a) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVRestoreArray_Mat(BV bv,PetscScalar **a) +static PetscErrorCode BVRestoreArray_Mat(BV bv,PetscScalar **a) { BV_MAT *ctx = (BV_MAT*)bv->data; @@ -331,7 +331,7 @@ PetscErrorCode BVRestoreArray_Mat(BV bv,PetscScalar **a) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVGetArrayRead_Mat(BV bv,const PetscScalar **a) +static PetscErrorCode BVGetArrayRead_Mat(BV bv,const PetscScalar **a) { BV_MAT *ctx = (BV_MAT*)bv->data; @@ -340,7 +340,7 @@ PetscErrorCode BVGetArrayRead_Mat(BV bv,const PetscScalar **a) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVRestoreArrayRead_Mat(BV bv,const PetscScalar **a) +static PetscErrorCode BVRestoreArrayRead_Mat(BV bv,const PetscScalar **a) { BV_MAT *ctx = (BV_MAT*)bv->data; @@ -349,7 +349,7 @@ PetscErrorCode BVRestoreArrayRead_Mat(BV bv,const PetscScalar **a) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVView_Mat(BV bv,PetscViewer viewer) +static PetscErrorCode BVView_Mat(BV bv,PetscViewer viewer) { BV_MAT *ctx = (BV_MAT*)bv->data; PetscViewerFormat format; @@ -372,7 +372,7 @@ PetscErrorCode BVView_Mat(BV bv,PetscViewer viewer) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVDestroy_Mat(BV bv) +static PetscErrorCode BVDestroy_Mat(BV bv) { BV_MAT *ctx = (BV_MAT*)bv->data; diff --git a/src/sys/classes/bv/impls/svec/svec.c b/src/sys/classes/bv/impls/svec/svec.c index ab5b2df77..b228d15e5 100644 --- a/src/sys/classes/bv/impls/svec/svec.c +++ b/src/sys/classes/bv/impls/svec/svec.c @@ -14,7 +14,7 @@ #include #include "svec.h" -PetscErrorCode BVMult_Svec(BV Y,PetscScalar alpha,PetscScalar beta,BV X,Mat Q) +static PetscErrorCode BVMult_Svec(BV Y,PetscScalar alpha,PetscScalar beta,BV X,Mat Q) { BV_SVEC *y = (BV_SVEC*)Y->data,*x = (BV_SVEC*)X->data; const PetscScalar *px,*q; @@ -35,7 +35,7 @@ PetscErrorCode BVMult_Svec(BV Y,PetscScalar alpha,PetscScalar beta,BV X,Mat Q) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVMultVec_Svec(BV X,PetscScalar alpha,PetscScalar beta,Vec y,PetscScalar *q) +static PetscErrorCode BVMultVec_Svec(BV X,PetscScalar alpha,PetscScalar beta,Vec y,PetscScalar *q) { BV_SVEC *x = (BV_SVEC*)X->data; PetscScalar *px,*py,*qq=q; @@ -51,7 +51,7 @@ PetscErrorCode BVMultVec_Svec(BV X,PetscScalar alpha,PetscScalar beta,Vec y,Pets PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVMultInPlace_Svec(BV V,Mat Q,PetscInt s,PetscInt e) +static PetscErrorCode BVMultInPlace_Svec(BV V,Mat Q,PetscInt s,PetscInt e) { BV_SVEC *ctx = (BV_SVEC*)V->data; PetscScalar *pv; @@ -68,7 +68,7 @@ PetscErrorCode BVMultInPlace_Svec(BV V,Mat Q,PetscInt s,PetscInt e) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVMultInPlaceHermitianTranspose_Svec(BV V,Mat Q,PetscInt s,PetscInt e) +static PetscErrorCode BVMultInPlaceHermitianTranspose_Svec(BV V,Mat Q,PetscInt s,PetscInt e) { BV_SVEC *ctx = (BV_SVEC*)V->data; PetscScalar *pv; @@ -85,7 +85,7 @@ PetscErrorCode BVMultInPlaceHermitianTranspose_Svec(BV V,Mat Q,PetscInt s,PetscI PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVDot_Svec(BV X,BV Y,Mat M) +static PetscErrorCode BVDot_Svec(BV X,BV Y,Mat M) { BV_SVEC *x = (BV_SVEC*)X->data,*y = (BV_SVEC*)Y->data; const PetscScalar *px,*py; @@ -104,7 +104,7 @@ PetscErrorCode BVDot_Svec(BV X,BV Y,Mat M) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVDotVec_Svec(BV X,Vec y,PetscScalar *q) +static PetscErrorCode BVDotVec_Svec(BV X,Vec y,PetscScalar *q) { BV_SVEC *x = (BV_SVEC*)X->data; const PetscScalar *px,*py; @@ -126,7 +126,7 @@ PetscErrorCode BVDotVec_Svec(BV X,Vec y,PetscScalar *q) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVDotVec_Local_Svec(BV X,Vec y,PetscScalar *m) +static PetscErrorCode BVDotVec_Local_Svec(BV X,Vec y,PetscScalar *m) { BV_SVEC *x = (BV_SVEC*)X->data; PetscScalar *px,*py; @@ -145,7 +145,7 @@ PetscErrorCode BVDotVec_Local_Svec(BV X,Vec y,PetscScalar *m) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVScale_Svec(BV bv,PetscInt j,PetscScalar alpha) +static PetscErrorCode BVScale_Svec(BV bv,PetscInt j,PetscScalar alpha) { BV_SVEC *ctx = (BV_SVEC*)bv->data; PetscScalar *array; @@ -158,7 +158,7 @@ PetscErrorCode BVScale_Svec(BV bv,PetscInt j,PetscScalar alpha) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVNorm_Svec(BV bv,PetscInt j,NormType type,PetscReal *val) +static PetscErrorCode BVNorm_Svec(BV bv,PetscInt j,NormType type,PetscReal *val) { BV_SVEC *ctx = (BV_SVEC*)bv->data; PetscScalar *array; @@ -171,7 +171,7 @@ PetscErrorCode BVNorm_Svec(BV bv,PetscInt j,NormType type,PetscReal *val) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVNorm_Local_Svec(BV bv,PetscInt j,NormType type,PetscReal *val) +static PetscErrorCode BVNorm_Local_Svec(BV bv,PetscInt j,NormType type,PetscReal *val) { BV_SVEC *ctx = (BV_SVEC*)bv->data; PetscScalar *array; @@ -184,7 +184,7 @@ PetscErrorCode BVNorm_Local_Svec(BV bv,PetscInt j,NormType type,PetscReal *val) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVNormalize_Svec(BV bv,PetscScalar *eigi) +static PetscErrorCode BVNormalize_Svec(BV bv,PetscScalar *eigi) { BV_SVEC *ctx = (BV_SVEC*)bv->data; PetscScalar *array,*wi=NULL; @@ -197,7 +197,7 @@ PetscErrorCode BVNormalize_Svec(BV bv,PetscScalar *eigi) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVMatMult_Svec(BV V,Mat A,BV W) +static PetscErrorCode BVMatMult_Svec(BV V,Mat A,BV W) { PetscInt j; Mat Vmat,Wmat; @@ -227,7 +227,7 @@ PetscErrorCode BVMatMult_Svec(BV V,Mat A,BV W) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVCopy_Svec(BV V,BV W) +static PetscErrorCode BVCopy_Svec(BV V,BV W) { BV_SVEC *v = (BV_SVEC*)V->data,*w = (BV_SVEC*)W->data; PetscScalar *pv,*pw,*pvc,*pwc; @@ -243,7 +243,7 @@ PetscErrorCode BVCopy_Svec(BV V,BV W) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVCopyColumn_Svec(BV V,PetscInt j,PetscInt i) +static PetscErrorCode BVCopyColumn_Svec(BV V,PetscInt j,PetscInt i) { BV_SVEC *v = (BV_SVEC*)V->data; PetscScalar *pv; @@ -255,7 +255,7 @@ PetscErrorCode BVCopyColumn_Svec(BV V,PetscInt j,PetscInt i) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVResize_Svec(BV bv,PetscInt m,PetscBool copy) +static PetscErrorCode BVResize_Svec(BV bv,PetscInt m,PetscBool copy) { BV_SVEC *ctx = (BV_SVEC*)bv->data; PetscScalar *pnew; @@ -286,7 +286,7 @@ PetscErrorCode BVResize_Svec(BV bv,PetscInt m,PetscBool copy) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVGetColumn_Svec(BV bv,PetscInt j,Vec *v) +static PetscErrorCode BVGetColumn_Svec(BV bv,PetscInt j,Vec *v) { BV_SVEC *ctx = (BV_SVEC*)bv->data; PetscScalar *pv; @@ -299,7 +299,7 @@ PetscErrorCode BVGetColumn_Svec(BV bv,PetscInt j,Vec *v) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVRestoreColumn_Svec(BV bv,PetscInt j,Vec *v) +static PetscErrorCode BVRestoreColumn_Svec(BV bv,PetscInt j,Vec *v) { BV_SVEC *ctx = (BV_SVEC*)bv->data; PetscInt l; @@ -311,7 +311,7 @@ PetscErrorCode BVRestoreColumn_Svec(BV bv,PetscInt j,Vec *v) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVGetArray_Svec(BV bv,PetscScalar **a) +static PetscErrorCode BVGetArray_Svec(BV bv,PetscScalar **a) { BV_SVEC *ctx = (BV_SVEC*)bv->data; @@ -320,7 +320,7 @@ PetscErrorCode BVGetArray_Svec(BV bv,PetscScalar **a) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVRestoreArray_Svec(BV bv,PetscScalar **a) +static PetscErrorCode BVRestoreArray_Svec(BV bv,PetscScalar **a) { BV_SVEC *ctx = (BV_SVEC*)bv->data; @@ -329,7 +329,7 @@ PetscErrorCode BVRestoreArray_Svec(BV bv,PetscScalar **a) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVGetArrayRead_Svec(BV bv,const PetscScalar **a) +static PetscErrorCode BVGetArrayRead_Svec(BV bv,const PetscScalar **a) { BV_SVEC *ctx = (BV_SVEC*)bv->data; @@ -338,7 +338,7 @@ PetscErrorCode BVGetArrayRead_Svec(BV bv,const PetscScalar **a) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVRestoreArrayRead_Svec(BV bv,const PetscScalar **a) +static PetscErrorCode BVRestoreArrayRead_Svec(BV bv,const PetscScalar **a) { BV_SVEC *ctx = (BV_SVEC*)bv->data; @@ -347,7 +347,7 @@ PetscErrorCode BVRestoreArrayRead_Svec(BV bv,const PetscScalar **a) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVView_Svec(BV bv,PetscViewer viewer) +static PetscErrorCode BVView_Svec(BV bv,PetscViewer viewer) { BV_SVEC *ctx = (BV_SVEC*)bv->data; PetscViewerFormat format; @@ -370,7 +370,7 @@ PetscErrorCode BVView_Svec(BV bv,PetscViewer viewer) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVDestroy_Svec(BV bv) +static PetscErrorCode BVDestroy_Svec(BV bv) { BV_SVEC *ctx = (BV_SVEC*)bv->data; diff --git a/src/sys/classes/bv/impls/tensor/bvtensor.c b/src/sys/classes/bv/impls/tensor/bvtensor.c index 58ffaff15..c15858a72 100644 --- a/src/sys/classes/bv/impls/tensor/bvtensor.c +++ b/src/sys/classes/bv/impls/tensor/bvtensor.c @@ -25,7 +25,7 @@ typedef struct { Vec u; /* auxiliary work vector */ } BV_TENSOR; -PetscErrorCode BVMultInPlace_Tensor(BV V,Mat Q,PetscInt s,PetscInt e) +static PetscErrorCode BVMultInPlace_Tensor(BV V,Mat Q,PetscInt s,PetscInt e) { BV_TENSOR *ctx = (BV_TENSOR*)V->data; PetscScalar *pS; @@ -42,7 +42,7 @@ PetscErrorCode BVMultInPlace_Tensor(BV V,Mat Q,PetscInt s,PetscInt e) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVMultInPlaceHermitianTranspose_Tensor(BV V,Mat Q,PetscInt s,PetscInt e) +static PetscErrorCode BVMultInPlaceHermitianTranspose_Tensor(BV V,Mat Q,PetscInt s,PetscInt e) { BV_TENSOR *ctx = (BV_TENSOR*)V->data; PetscScalar *pS; @@ -59,7 +59,7 @@ PetscErrorCode BVMultInPlaceHermitianTranspose_Tensor(BV V,Mat Q,PetscInt s,Pets PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVDot_Tensor(BV X,BV Y,Mat M) +static PetscErrorCode BVDot_Tensor(BV X,BV Y,Mat M) { BV_TENSOR *x = (BV_TENSOR*)X->data,*y = (BV_TENSOR*)Y->data; PetscScalar *m; @@ -80,7 +80,7 @@ PetscErrorCode BVDot_Tensor(BV X,BV Y,Mat M) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVScale_Tensor(BV bv,PetscInt j,PetscScalar alpha) +static PetscErrorCode BVScale_Tensor(BV bv,PetscInt j,PetscScalar alpha) { BV_TENSOR *ctx = (BV_TENSOR*)bv->data; PetscScalar *pS; @@ -94,7 +94,7 @@ PetscErrorCode BVScale_Tensor(BV bv,PetscInt j,PetscScalar alpha) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVNorm_Tensor(BV bv,PetscInt j,NormType type,PetscReal *val) +static PetscErrorCode BVNorm_Tensor(BV bv,PetscInt j,NormType type,PetscReal *val) { BV_TENSOR *ctx = (BV_TENSOR*)bv->data; const PetscScalar *pS; @@ -108,7 +108,7 @@ PetscErrorCode BVNorm_Tensor(BV bv,PetscInt j,NormType type,PetscReal *val) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVCopyColumn_Tensor(BV V,PetscInt j,PetscInt i) +static PetscErrorCode BVCopyColumn_Tensor(BV V,PetscInt j,PetscInt i) { BV_TENSOR *ctx = (BV_TENSOR*)V->data; PetscScalar *pS; @@ -159,7 +159,7 @@ static PetscErrorCode BVTensorNormColumn(BV bv,PetscInt j,PetscReal *norm) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVOrthogonalizeGS1_Tensor(BV bv,PetscInt k,Vec v,PetscBool *which,PetscScalar *h,PetscScalar *c,PetscReal *onorm,PetscReal *norm) +static PetscErrorCode BVOrthogonalizeGS1_Tensor(BV bv,PetscInt k,Vec v,PetscBool *which,PetscScalar *h,PetscScalar *c,PetscReal *onorm,PetscReal *norm) { BV_TENSOR *ctx = (BV_TENSOR*)bv->data; PetscScalar *pS,*cc,*x,dot,sonem=-1.0,sone=1.0,szero=0.0; @@ -217,7 +217,7 @@ PetscErrorCode BVOrthogonalizeGS1_Tensor(BV bv,PetscInt k,Vec v,PetscBool *which PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVView_Tensor(BV bv,PetscViewer viewer) +static PetscErrorCode BVView_Tensor(BV bv,PetscViewer viewer) { BV_TENSOR *ctx = (BV_TENSOR*)bv->data; PetscViewerFormat format; @@ -692,7 +692,7 @@ PetscErrorCode BVTensorRestoreFactors(BV V,BV *U,Mat *S) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVDestroy_Tensor(BV bv) +static PetscErrorCode BVDestroy_Tensor(BV bv) { BV_TENSOR *ctx = (BV_TENSOR*)bv->data; diff --git a/src/sys/classes/bv/impls/vecs/vecs.c b/src/sys/classes/bv/impls/vecs/vecs.c index b9e6818cc..7ac689dba 100644 --- a/src/sys/classes/bv/impls/vecs/vecs.c +++ b/src/sys/classes/bv/impls/vecs/vecs.c @@ -20,7 +20,7 @@ typedef struct { 1: version that allocates (e-s) work vectors in every call (default in GPU) */ } BV_VECS; -PetscErrorCode BVMult_Vecs(BV Y,PetscScalar alpha,PetscScalar beta,BV X,Mat Q) +static PetscErrorCode BVMult_Vecs(BV Y,PetscScalar alpha,PetscScalar beta,BV X,Mat Q) { BV_VECS *y = (BV_VECS*)Y->data,*x = (BV_VECS*)X->data; PetscScalar *s=NULL; @@ -53,7 +53,7 @@ PetscErrorCode BVMult_Vecs(BV Y,PetscScalar alpha,PetscScalar beta,BV X,Mat Q) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVMultVec_Vecs(BV X,PetscScalar alpha,PetscScalar beta,Vec y,PetscScalar *q) +static PetscErrorCode BVMultVec_Vecs(BV X,PetscScalar alpha,PetscScalar beta,Vec y,PetscScalar *q) { BV_VECS *x = (BV_VECS*)X->data; PetscScalar *s=NULL,*qq=q; @@ -84,7 +84,7 @@ PetscErrorCode BVMultVec_Vecs(BV X,PetscScalar alpha,PetscScalar beta,Vec y,Pets corresponds to the columns s:e-1, the computation is done as V2 := V2*Q2 + V1*Q1 + V3*Q3 */ -PetscErrorCode BVMultInPlace_Vecs_ME(BV V,Mat Q,PetscInt s,PetscInt e) +static PetscErrorCode BVMultInPlace_Vecs_ME(BV V,Mat Q,PetscInt s,PetscInt e) { BV_VECS *ctx = (BV_VECS*)V->data; const PetscScalar *q; @@ -109,7 +109,7 @@ PetscErrorCode BVMultInPlace_Vecs_ME(BV V,Mat Q,PetscInt s,PetscInt e) Version that allocates (e-s) work vectors in every call (default in GPU) */ -PetscErrorCode BVMultInPlace_Vecs_Alloc(BV V,Mat Q,PetscInt s,PetscInt e) +static PetscErrorCode BVMultInPlace_Vecs_Alloc(BV V,Mat Q,PetscInt s,PetscInt e) { BV_VECS *ctx = (BV_VECS*)V->data; const PetscScalar *q; @@ -130,7 +130,7 @@ PetscErrorCode BVMultInPlace_Vecs_Alloc(BV V,Mat Q,PetscInt s,PetscInt e) /* BVMultInPlaceHermitianTranspose_Vecs - V(:,s:e-1) = V*Q'(:,s:e-1) for regular vectors. */ -PetscErrorCode BVMultInPlaceHermitianTranspose_Vecs(BV V,Mat Q,PetscInt s,PetscInt e) +static PetscErrorCode BVMultInPlaceHermitianTranspose_Vecs(BV V,Mat Q,PetscInt s,PetscInt e) { BV_VECS *ctx = (BV_VECS*)V->data; const PetscScalar *q; @@ -151,7 +151,7 @@ PetscErrorCode BVMultInPlaceHermitianTranspose_Vecs(BV V,Mat Q,PetscInt s,PetscI PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVDot_Vecs(BV X,BV Y,Mat M) +static PetscErrorCode BVDot_Vecs(BV X,BV Y,Mat M) { BV_VECS *x = (BV_VECS*)X->data,*y = (BV_VECS*)Y->data; PetscScalar *m; @@ -165,7 +165,7 @@ PetscErrorCode BVDot_Vecs(BV X,BV Y,Mat M) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVDotVec_Vecs(BV X,Vec y,PetscScalar *q) +static PetscErrorCode BVDotVec_Vecs(BV X,Vec y,PetscScalar *q) { BV_VECS *x = (BV_VECS*)X->data; Vec z = y; @@ -182,7 +182,7 @@ PetscErrorCode BVDotVec_Vecs(BV X,Vec y,PetscScalar *q) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVDotVec_Begin_Vecs(BV X,Vec y,PetscScalar *m) +static PetscErrorCode BVDotVec_Begin_Vecs(BV X,Vec y,PetscScalar *m) { BV_VECS *x = (BV_VECS*)X->data; Vec z = y; @@ -196,7 +196,7 @@ PetscErrorCode BVDotVec_Begin_Vecs(BV X,Vec y,PetscScalar *m) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVDotVec_End_Vecs(BV X,Vec y,PetscScalar *m) +static PetscErrorCode BVDotVec_End_Vecs(BV X,Vec y,PetscScalar *m) { BV_VECS *x = (BV_VECS*)X->data; @@ -205,7 +205,7 @@ PetscErrorCode BVDotVec_End_Vecs(BV X,Vec y,PetscScalar *m) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVScale_Vecs(BV bv,PetscInt j,PetscScalar alpha) +static PetscErrorCode BVScale_Vecs(BV bv,PetscInt j,PetscScalar alpha) { PetscInt i; BV_VECS *ctx = (BV_VECS*)bv->data; @@ -217,7 +217,7 @@ PetscErrorCode BVScale_Vecs(BV bv,PetscInt j,PetscScalar alpha) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVNorm_Vecs(BV bv,PetscInt j,NormType type,PetscReal *val) +static PetscErrorCode BVNorm_Vecs(BV bv,PetscInt j,NormType type,PetscReal *val) { PetscInt i; PetscReal nrm; @@ -236,7 +236,7 @@ PetscErrorCode BVNorm_Vecs(BV bv,PetscInt j,NormType type,PetscReal *val) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVNorm_Begin_Vecs(BV bv,PetscInt j,NormType type,PetscReal *val) +static PetscErrorCode BVNorm_Begin_Vecs(BV bv,PetscInt j,NormType type,PetscReal *val) { BV_VECS *ctx = (BV_VECS*)bv->data; @@ -246,7 +246,7 @@ PetscErrorCode BVNorm_Begin_Vecs(BV bv,PetscInt j,NormType type,PetscReal *val) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVNorm_End_Vecs(BV bv,PetscInt j,NormType type,PetscReal *val) +static PetscErrorCode BVNorm_End_Vecs(BV bv,PetscInt j,NormType type,PetscReal *val) { BV_VECS *ctx = (BV_VECS*)bv->data; @@ -256,7 +256,7 @@ PetscErrorCode BVNorm_End_Vecs(BV bv,PetscInt j,NormType type,PetscReal *val) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVNormalize_Vecs(BV bv,PetscScalar *eigi) +static PetscErrorCode BVNormalize_Vecs(BV bv,PetscScalar *eigi) { BV_VECS *ctx = (BV_VECS*)bv->data; PetscInt i; @@ -276,7 +276,7 @@ PetscErrorCode BVNormalize_Vecs(BV bv,PetscScalar *eigi) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVMatMult_Vecs(BV V,Mat A,BV W) +static PetscErrorCode BVMatMult_Vecs(BV V,Mat A,BV W) { BV_VECS *v = (BV_VECS*)V->data,*w = (BV_VECS*)W->data; PetscInt j; @@ -300,7 +300,7 @@ PetscErrorCode BVMatMult_Vecs(BV V,Mat A,BV W) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVCopy_Vecs(BV V,BV W) +static PetscErrorCode BVCopy_Vecs(BV V,BV W) { BV_VECS *v = (BV_VECS*)V->data,*w = (BV_VECS*)W->data; PetscInt j; @@ -310,7 +310,7 @@ PetscErrorCode BVCopy_Vecs(BV V,BV W) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVCopyColumn_Vecs(BV V,PetscInt j,PetscInt i) +static PetscErrorCode BVCopyColumn_Vecs(BV V,PetscInt j,PetscInt i) { BV_VECS *v = (BV_VECS*)V->data; @@ -319,7 +319,7 @@ PetscErrorCode BVCopyColumn_Vecs(BV V,PetscInt j,PetscInt i) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVResize_Vecs(BV bv,PetscInt m,PetscBool copy) +static PetscErrorCode BVResize_Vecs(BV bv,PetscInt m,PetscBool copy) { BV_VECS *ctx = (BV_VECS*)bv->data; Vec *newV; @@ -342,7 +342,7 @@ PetscErrorCode BVResize_Vecs(BV bv,PetscInt m,PetscBool copy) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVGetColumn_Vecs(BV bv,PetscInt j,Vec *v) +static PetscErrorCode BVGetColumn_Vecs(BV bv,PetscInt j,Vec *v) { BV_VECS *ctx = (BV_VECS*)bv->data; PetscInt l; @@ -353,7 +353,7 @@ PetscErrorCode BVGetColumn_Vecs(BV bv,PetscInt j,Vec *v) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVRestoreColumn_Vecs(BV bv,PetscInt j,Vec *v) +static PetscErrorCode BVRestoreColumn_Vecs(BV bv,PetscInt j,Vec *v) { PetscInt l; @@ -363,7 +363,7 @@ PetscErrorCode BVRestoreColumn_Vecs(BV bv,PetscInt j,Vec *v) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVGetArray_Vecs(BV bv,PetscScalar **a) +static PetscErrorCode BVGetArray_Vecs(BV bv,PetscScalar **a) { BV_VECS *ctx = (BV_VECS*)bv->data; PetscInt j; @@ -379,7 +379,7 @@ PetscErrorCode BVGetArray_Vecs(BV bv,PetscScalar **a) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVRestoreArray_Vecs(BV bv,PetscScalar **a) +static PetscErrorCode BVRestoreArray_Vecs(BV bv,PetscScalar **a) { BV_VECS *ctx = (BV_VECS*)bv->data; PetscInt j; @@ -395,7 +395,7 @@ PetscErrorCode BVRestoreArray_Vecs(BV bv,PetscScalar **a) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVGetArrayRead_Vecs(BV bv,const PetscScalar **a) +static PetscErrorCode BVGetArrayRead_Vecs(BV bv,const PetscScalar **a) { BV_VECS *ctx = (BV_VECS*)bv->data; PetscInt j; @@ -411,7 +411,7 @@ PetscErrorCode BVGetArrayRead_Vecs(BV bv,const PetscScalar **a) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVRestoreArrayRead_Vecs(BV bv,const PetscScalar **a) +static PetscErrorCode BVRestoreArrayRead_Vecs(BV bv,const PetscScalar **a) { PetscFunctionBegin; PetscCall(PetscFree(*a)); @@ -433,7 +433,7 @@ static inline PetscErrorCode BVVecsSetVmip(BV bv,PetscInt vmip) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVSetFromOptions_Vecs(BV bv,PetscOptionItems *PetscOptionsObject) +static PetscErrorCode BVSetFromOptions_Vecs(BV bv,PetscOptionItems *PetscOptionsObject) { BV_VECS *ctx = (BV_VECS*)bv->data; @@ -476,7 +476,7 @@ PetscErrorCode BVView_Vecs(BV bv,PetscViewer viewer) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVDestroy_Vecs(BV bv) +static PetscErrorCode BVDestroy_Vecs(BV bv) { BV_VECS *ctx = (BV_VECS*)bv->data; @@ -486,7 +486,7 @@ PetscErrorCode BVDestroy_Vecs(BV bv) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVDuplicate_Vecs(BV V,BV W) +static PetscErrorCode BVDuplicate_Vecs(BV V,BV W) { BV_VECS *ctx = (BV_VECS*)V->data; diff --git a/src/sys/classes/bv/interface/bvcontour.c b/src/sys/classes/bv/interface/bvcontour.c index 4cfcce5f7..ab9693601 100644 --- a/src/sys/classes/bv/interface/bvcontour.c +++ b/src/sys/classes/bv/interface/bvcontour.c @@ -305,7 +305,7 @@ PetscErrorCode BVTraceQuadrature(BV Y,BV V,PetscInt L,PetscInt L_max,PetscScalar PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVSVDAndRank_Refine(BV S,PetscReal delta,PetscScalar *pA,PetscReal *sigma,PetscInt *rank) +static PetscErrorCode BVSVDAndRank_Refine(BV S,PetscReal delta,PetscScalar *pA,PetscReal *sigma,PetscInt *rank) { PetscInt i,j,k,ml=S->k; PetscMPIInt len; @@ -395,7 +395,7 @@ PetscErrorCode BVSVDAndRank_Refine(BV S,PetscReal delta,PetscScalar *pA,PetscRea PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVSVDAndRank_QR(BV S,PetscReal delta,PetscScalar *pA,PetscReal *sigma,PetscInt *rank) +static PetscErrorCode BVSVDAndRank_QR(BV S,PetscReal delta,PetscScalar *pA,PetscReal *sigma,PetscInt *rank) { PetscInt i,n,ml=S->k; PetscBLASInt m,lda,lwork,info; @@ -443,7 +443,7 @@ PetscErrorCode BVSVDAndRank_QR(BV S,PetscReal delta,PetscScalar *pA,PetscReal *s PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode BVSVDAndRank_QR_CAA(BV S,PetscInt M,PetscInt L,PetscReal delta,PetscScalar *pA,PetscReal *sigma,PetscInt *rank) +static PetscErrorCode BVSVDAndRank_QR_CAA(BV S,PetscInt M,PetscInt L,PetscReal delta,PetscScalar *pA,PetscReal *sigma,PetscInt *rank) { PetscInt i,j,n,ml=S->k; PetscBLASInt m,k_,lda,lwork,info; diff --git a/src/sys/classes/bv/interface/cuda/bvorthogcuda.cu b/src/sys/classes/bv/interface/cuda/bvorthogcuda.cu index b92d442ef..425c4caf3 100644 --- a/src/sys/classes/bv/interface/cuda/bvorthogcuda.cu +++ b/src/sys/classes/bv/interface/cuda/bvorthogcuda.cu @@ -121,7 +121,7 @@ PetscErrorCode BV_SquareSum_CUDA(BV bv,PetscInt j,PetscScalar *h,PetscReal *sum) } /* pointwise multiplication */ -__global__ void PointwiseMult_kernel(PetscInt xcount,PetscScalar *a,const PetscScalar *b,PetscInt n) +static __global__ void PointwiseMult_kernel(PetscInt xcount,PetscScalar *a,const PetscScalar *b,PetscInt n) { PetscInt x; @@ -130,7 +130,7 @@ __global__ void PointwiseMult_kernel(PetscInt xcount,PetscScalar *a,const PetscS } /* pointwise division */ -__global__ void PointwiseDiv_kernel(PetscInt xcount,PetscScalar *a,const PetscScalar *b,PetscInt n) +static __global__ void PointwiseDiv_kernel(PetscInt xcount,PetscScalar *a,const PetscScalar *b,PetscInt n) { PetscInt x; diff --git a/src/sys/classes/ds/impls/ghep/dsghep.c b/src/sys/classes/ds/impls/ghep/dsghep.c index 64fb81025..514da3bca 100644 --- a/src/sys/classes/ds/impls/ghep/dsghep.c +++ b/src/sys/classes/ds/impls/ghep/dsghep.c @@ -11,7 +11,7 @@ #include #include -PetscErrorCode DSAllocate_GHEP(DS ds,PetscInt ld) +static PetscErrorCode DSAllocate_GHEP(DS ds,PetscInt ld) { PetscFunctionBegin; PetscCall(DSAllocateMat_Private(ds,DS_MAT_A)); @@ -22,7 +22,7 @@ PetscErrorCode DSAllocate_GHEP(DS ds,PetscInt ld) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSView_GHEP(DS ds,PetscViewer viewer) +static PetscErrorCode DSView_GHEP(DS ds,PetscViewer viewer) { PetscViewerFormat format; @@ -36,7 +36,7 @@ PetscErrorCode DSView_GHEP(DS ds,PetscViewer viewer) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSVectors_GHEP(DS ds,DSMatType mat,PetscInt *j,PetscReal *rnorm) +static PetscErrorCode DSVectors_GHEP(DS ds,DSMatType mat,PetscInt *j,PetscReal *rnorm) { PetscScalar *Z; const PetscScalar *Q; @@ -72,7 +72,7 @@ PetscErrorCode DSVectors_GHEP(DS ds,DSMatType mat,PetscInt *j,PetscReal *rnorm) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSSort_GHEP(DS ds,PetscScalar *wr,PetscScalar *wi,PetscScalar *rr,PetscScalar *ri,PetscInt *k) +static PetscErrorCode DSSort_GHEP(DS ds,PetscScalar *wr,PetscScalar *wi,PetscScalar *rr,PetscScalar *ri,PetscInt *k) { PetscInt n,l,i,*perm,ld=ds->ld; PetscScalar *A; @@ -93,7 +93,7 @@ PetscErrorCode DSSort_GHEP(DS ds,PetscScalar *wr,PetscScalar *wi,PetscScalar *rr PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSSolve_GHEP(DS ds,PetscScalar *wr,PetscScalar *wi) +static PetscErrorCode DSSolve_GHEP(DS ds,PetscScalar *wr,PetscScalar *wi) { PetscScalar *work,*A,*B,*Q; PetscBLASInt itype = 1,*iwork,info,n1,liwork,ld,lrwork=0,lwork; @@ -145,7 +145,7 @@ PetscErrorCode DSSolve_GHEP(DS ds,PetscScalar *wr,PetscScalar *wi) } #if !defined(PETSC_HAVE_MPIUNI) -PetscErrorCode DSSynchronize_GHEP(DS ds,PetscScalar eigr[],PetscScalar eigi[]) +static PetscErrorCode DSSynchronize_GHEP(DS ds,PetscScalar eigr[],PetscScalar eigi[]) { PetscScalar *A,*B,*Q; PetscInt ld=ds->ld,l=ds->l,k; @@ -183,7 +183,7 @@ PetscErrorCode DSSynchronize_GHEP(DS ds,PetscScalar eigr[],PetscScalar eigi[]) } #endif -PetscErrorCode DSHermitian_GHEP(DS ds,DSMatType m,PetscBool *flg) +static PetscErrorCode DSHermitian_GHEP(DS ds,DSMatType m,PetscBool *flg) { PetscFunctionBegin; if (m==DS_MAT_A || m==DS_MAT_B) *flg = PETSC_TRUE; diff --git a/src/sys/classes/ds/impls/ghiep/dsghiep.c b/src/sys/classes/ds/impls/ghiep/dsghiep.c index 929b9ec1e..63338d2df 100644 --- a/src/sys/classes/ds/impls/ghiep/dsghiep.c +++ b/src/sys/classes/ds/impls/ghiep/dsghiep.c @@ -11,7 +11,7 @@ #include #include -PetscErrorCode DSAllocate_GHIEP(DS ds,PetscInt ld) +static PetscErrorCode DSAllocate_GHIEP(DS ds,PetscInt ld) { PetscFunctionBegin; PetscCall(DSAllocateMat_Private(ds,DS_MAT_A)); @@ -75,7 +75,7 @@ PetscErrorCode DSSwitchFormat_GHIEP(DS ds,PetscBool tocompact) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSView_GHIEP(DS ds,PetscViewer viewer) +static PetscErrorCode DSView_GHIEP(DS ds,PetscViewer viewer) { PetscViewerFormat format; PetscInt i,j; @@ -260,7 +260,7 @@ static PetscErrorCode DSVectors_GHIEP_Eigen_Some(DS ds,PetscInt *idx,PetscReal * PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSVectors_GHIEP(DS ds,DSMatType mat,PetscInt *k,PetscReal *rnorm) +static PetscErrorCode DSVectors_GHIEP(DS ds,DSMatType mat,PetscInt *k,PetscReal *rnorm) { PetscScalar *Z; const PetscScalar *A,*Q; @@ -377,7 +377,7 @@ PetscErrorCode DSGHIEPComplexEigs(DS ds,PetscInt n0,PetscInt n1,PetscScalar *wr, PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSSort_GHIEP(DS ds,PetscScalar *wr,PetscScalar *wi,PetscScalar *rr,PetscScalar *ri,PetscInt *k) +static PetscErrorCode DSSort_GHIEP(DS ds,PetscScalar *wr,PetscScalar *wi,PetscScalar *rr,PetscScalar *ri,PetscInt *k) { PetscInt n,i,*perm; PetscReal *d,*e,*s; @@ -420,7 +420,7 @@ PetscErrorCode DSSort_GHIEP(DS ds,PetscScalar *wr,PetscScalar *wi,PetscScalar *r PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSUpdateExtraRow_GHIEP(DS ds) +static PetscErrorCode DSUpdateExtraRow_GHIEP(DS ds) { PetscInt i; PetscBLASInt n,ld,incx=1; @@ -665,7 +665,7 @@ PetscErrorCode DSGHIEPRealBlocks(DS ds) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSSolve_GHIEP_QR_II(DS ds,PetscScalar *wr,PetscScalar *wi) +static PetscErrorCode DSSolve_GHIEP_QR_II(DS ds,PetscScalar *wr,PetscScalar *wi) { PetscInt i,off; PetscBLASInt n1,ld,one=1,info,lwork; @@ -789,7 +789,7 @@ PetscErrorCode DSSolve_GHIEP_QR_II(DS ds,PetscScalar *wr,PetscScalar *wi) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSSolve_GHIEP_QR(DS ds,PetscScalar *wr,PetscScalar *wi) +static PetscErrorCode DSSolve_GHIEP_QR(DS ds,PetscScalar *wr,PetscScalar *wi) { PetscInt i,j,off,nwu=0,n,lw,lwr,nwru=0; PetscBLASInt n_,ld,info,lwork,ilo,ihi; @@ -931,7 +931,7 @@ PetscErrorCode DSSolve_GHIEP_QR(DS ds,PetscScalar *wr,PetscScalar *wi) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSGetTruncateSize_GHIEP(DS ds,PetscInt l,PetscInt n,PetscInt *k) +static PetscErrorCode DSGetTruncateSize_GHIEP(DS ds,PetscInt l,PetscInt n,PetscInt *k) { PetscReal *T; @@ -945,7 +945,7 @@ PetscErrorCode DSGetTruncateSize_GHIEP(DS ds,PetscInt l,PetscInt n,PetscInt *k) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSTruncate_GHIEP(DS ds,PetscInt n,PetscBool trim) +static PetscErrorCode DSTruncate_GHIEP(DS ds,PetscInt n,PetscBool trim) { PetscInt i,ld=ds->ld,l=ds->l; PetscScalar *A; @@ -997,7 +997,7 @@ PetscErrorCode DSTruncate_GHIEP(DS ds,PetscInt n,PetscBool trim) } #if !defined(PETSC_HAVE_MPIUNI) -PetscErrorCode DSSynchronize_GHIEP(DS ds,PetscScalar eigr[],PetscScalar eigi[]) +static PetscErrorCode DSSynchronize_GHIEP(DS ds,PetscScalar eigr[],PetscScalar eigi[]) { PetscScalar *A,*B,*Q; PetscReal *T,*D; @@ -1066,7 +1066,7 @@ PetscErrorCode DSSynchronize_GHIEP(DS ds,PetscScalar eigr[],PetscScalar eigi[]) } #endif -PetscErrorCode DSHermitian_GHIEP(DS ds,DSMatType m,PetscBool *flg) +static PetscErrorCode DSHermitian_GHIEP(DS ds,DSMatType m,PetscBool *flg) { PetscFunctionBegin; if ((m==DS_MAT_A && !ds->extrarow) || m==DS_MAT_B) *flg = PETSC_TRUE; diff --git a/src/sys/classes/ds/impls/gnhep/dsgnhep.c b/src/sys/classes/ds/impls/gnhep/dsgnhep.c index e9cd40fa5..a34f6fb70 100644 --- a/src/sys/classes/ds/impls/gnhep/dsgnhep.c +++ b/src/sys/classes/ds/impls/gnhep/dsgnhep.c @@ -29,7 +29,7 @@ static PetscErrorCode CleanDenseSchur(PetscInt n,PetscInt k,PetscScalar *S,PetscInt ldS,PetscScalar *T,PetscInt ldT,PetscScalar *X,PetscInt ldX,PetscScalar *Y,PetscInt ldY); -PetscErrorCode DSAllocate_GNHEP(DS ds,PetscInt ld) +static PetscErrorCode DSAllocate_GNHEP(DS ds,PetscInt ld) { PetscFunctionBegin; PetscCall(DSAllocateMat_Private(ds,DS_MAT_A)); @@ -41,7 +41,7 @@ PetscErrorCode DSAllocate_GNHEP(DS ds,PetscInt ld) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSView_GNHEP(DS ds,PetscViewer viewer) +static PetscErrorCode DSView_GNHEP(DS ds,PetscViewer viewer) { PetscViewerFormat format; @@ -211,7 +211,7 @@ static PetscErrorCode DSVectors_GNHEP_Eigen_All(DS ds,PetscBool left) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSVectors_GNHEP(DS ds,DSMatType mat,PetscInt *k,PetscReal *rnorm) +static PetscErrorCode DSVectors_GNHEP(DS ds,DSMatType mat,PetscInt *k,PetscReal *rnorm) { PetscFunctionBegin; switch (mat) { @@ -379,7 +379,7 @@ static PetscErrorCode DSSort_GNHEP_Total(DS ds,PetscScalar *wr,PetscScalar *wi) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSSort_GNHEP(DS ds,PetscScalar *wr,PetscScalar *wi,PetscScalar *rr,PetscScalar *ri,PetscInt *k) +static PetscErrorCode DSSort_GNHEP(DS ds,PetscScalar *wr,PetscScalar *wi,PetscScalar *rr,PetscScalar *ri,PetscInt *k) { PetscFunctionBegin; if (!rr || wr == rr) PetscCall(DSSort_GNHEP_Total(ds,wr,wi)); @@ -387,7 +387,7 @@ PetscErrorCode DSSort_GNHEP(DS ds,PetscScalar *wr,PetscScalar *wi,PetscScalar *r PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSUpdateExtraRow_GNHEP(DS ds) +static PetscErrorCode DSUpdateExtraRow_GNHEP(DS ds) { PetscInt i; PetscBLASInt n,ld,incx=1; @@ -495,7 +495,7 @@ static PetscErrorCode CleanDenseSchur(PetscInt n,PetscInt k,PetscScalar *S,Petsc PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSSolve_GNHEP(DS ds,PetscScalar *wr,PetscScalar *wi) +static PetscErrorCode DSSolve_GNHEP(DS ds,PetscScalar *wr,PetscScalar *wi) { PetscScalar *work,*beta,a; PetscInt i; @@ -549,7 +549,7 @@ PetscErrorCode DSSolve_GNHEP(DS ds,PetscScalar *wr,PetscScalar *wi) } #if !defined(PETSC_HAVE_MPIUNI) -PetscErrorCode DSSynchronize_GNHEP(DS ds,PetscScalar eigr[],PetscScalar eigi[]) +static PetscErrorCode DSSynchronize_GNHEP(DS ds,PetscScalar eigr[],PetscScalar eigi[]) { PetscInt ld=ds->ld,l=ds->l,k; PetscMPIInt n,rank,off=0,size,ldn; @@ -606,7 +606,7 @@ PetscErrorCode DSSynchronize_GNHEP(DS ds,PetscScalar eigr[],PetscScalar eigi[]) } #endif -PetscErrorCode DSTruncate_GNHEP(DS ds,PetscInt n,PetscBool trim) +static PetscErrorCode DSTruncate_GNHEP(DS ds,PetscInt n,PetscBool trim) { PetscInt i,ld=ds->ld,l=ds->l; PetscScalar *A,*B; diff --git a/src/sys/classes/ds/impls/gsvd/dsgsvd.c b/src/sys/classes/ds/impls/gsvd/dsgsvd.c index 5b1be3d18..c30c79a0e 100644 --- a/src/sys/classes/ds/impls/gsvd/dsgsvd.c +++ b/src/sys/classes/ds/impls/gsvd/dsgsvd.c @@ -17,7 +17,7 @@ typedef struct { PetscInt tp; /* number of rows of V after truncating */ } DS_GSVD; -PetscErrorCode DSAllocate_GSVD(DS ds,PetscInt ld) +static PetscErrorCode DSAllocate_GSVD(DS ds,PetscInt ld) { PetscFunctionBegin; PetscCall(DSAllocateMat_Private(ds,DS_MAT_A)); @@ -88,7 +88,7 @@ n-1 | x| n-1 | p-1 | x| ---------------------------------------- */ -PetscErrorCode DSView_GSVD(DS ds,PetscViewer viewer) +static PetscErrorCode DSView_GSVD(DS ds,PetscViewer viewer) { DS_GSVD *ctx = (DS_GSVD*)ds->data; PetscViewerFormat format; @@ -174,7 +174,7 @@ PetscErrorCode DSView_GSVD(DS ds,PetscViewer viewer) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSVectors_GSVD(DS ds,DSMatType mat,PetscInt *j,PetscReal *rnorm) +static PetscErrorCode DSVectors_GSVD(DS ds,DSMatType mat,PetscInt *j,PetscReal *rnorm) { PetscFunctionBegin; switch (mat) { @@ -190,7 +190,7 @@ PetscErrorCode DSVectors_GSVD(DS ds,DSMatType mat,PetscInt *j,PetscReal *rnorm) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSSort_GSVD(DS ds,PetscScalar *wr,PetscScalar *wi,PetscScalar *rr,PetscScalar *ri,PetscInt *k) +static PetscErrorCode DSSort_GSVD(DS ds,PetscScalar *wr,PetscScalar *wi,PetscScalar *rr,PetscScalar *ri,PetscInt *k) { DS_GSVD *ctx = (DS_GSVD*)ds->data; PetscInt t,l,ld=ds->ld,i,*perm,*perm2; @@ -240,7 +240,7 @@ PetscErrorCode DSSort_GSVD(DS ds,PetscScalar *wr,PetscScalar *wi,PetscScalar *rr PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSUpdateExtraRow_GSVD(DS ds) +static PetscErrorCode DSUpdateExtraRow_GSVD(DS ds) { DS_GSVD *ctx = (DS_GSVD*)ds->data; PetscInt i; @@ -282,7 +282,7 @@ PetscErrorCode DSUpdateExtraRow_GSVD(DS ds) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSTruncate_GSVD(DS ds,PetscInt n,PetscBool trim) +static PetscErrorCode DSTruncate_GSVD(DS ds,PetscInt n,PetscBool trim) { DS_GSVD *ctx = (DS_GSVD*)ds->data; PetscScalar *U; @@ -367,7 +367,7 @@ static PetscErrorCode DSSwitchFormat_GSVD(DS ds) Compact format is used when [A;B] has orthonormal columns. In this case R=I and the GSVD of (A,B) is the CS decomposition */ -PetscErrorCode DSSolve_GSVD(DS ds,PetscScalar *wr,PetscScalar *wi) +static PetscErrorCode DSSolve_GSVD(DS ds,PetscScalar *wr,PetscScalar *wi) { DS_GSVD *ctx = (DS_GSVD*)ds->data; PetscInt i,j; @@ -507,7 +507,7 @@ PetscErrorCode DSSolve_GSVD(DS ds,PetscScalar *wr,PetscScalar *wi) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSCond_GSVD(DS ds,PetscReal *cond) +static PetscErrorCode DSCond_GSVD(DS ds,PetscReal *cond) { DS_GSVD *ctx = (DS_GSVD*)ds->data; PetscBLASInt lwork,lrwork=0,info,m,n,p,ld; @@ -565,7 +565,7 @@ PetscErrorCode DSCond_GSVD(DS ds,PetscReal *cond) } #if !defined(PETSC_HAVE_MPIUNI) -PetscErrorCode DSSynchronize_GSVD(DS ds,PetscScalar eigr[],PetscScalar eigi[]) +static PetscErrorCode DSSynchronize_GSVD(DS ds,PetscScalar eigr[],PetscScalar eigi[]) { DS_GSVD *ctx = (DS_GSVD*)ds->data; PetscInt ld=ds->ld,l=ds->l,k=0,kr=0; @@ -623,7 +623,7 @@ PetscErrorCode DSSynchronize_GSVD(DS ds,PetscScalar eigr[],PetscScalar eigi[]) } #endif -PetscErrorCode DSMatGetSize_GSVD(DS ds,DSMatType t,PetscInt *rows,PetscInt *cols) +static PetscErrorCode DSMatGetSize_GSVD(DS ds,DSMatType t,PetscInt *rows,PetscInt *cols) { DS_GSVD *ctx = (DS_GSVD*)ds->data; @@ -748,7 +748,7 @@ PetscErrorCode DSGSVDGetDimensions(DS ds,PetscInt *m,PetscInt *p) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSDestroy_GSVD(DS ds) +static PetscErrorCode DSDestroy_GSVD(DS ds) { PetscFunctionBegin; PetscCall(PetscFree(ds->data)); diff --git a/src/sys/classes/ds/impls/hep/dshep.c b/src/sys/classes/ds/impls/hep/dshep.c index 9e7c1afc6..204d675f5 100644 --- a/src/sys/classes/ds/impls/hep/dshep.c +++ b/src/sys/classes/ds/impls/hep/dshep.c @@ -11,7 +11,7 @@ #include #include -PetscErrorCode DSAllocate_HEP(DS ds,PetscInt ld) +static PetscErrorCode DSAllocate_HEP(DS ds,PetscInt ld) { PetscFunctionBegin; PetscCall(DSAllocateMat_Private(ds,DS_MAT_A)); @@ -75,7 +75,7 @@ static PetscErrorCode DSSwitchFormat_HEP(DS ds) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSView_HEP(DS ds,PetscViewer viewer) +static PetscErrorCode DSView_HEP(DS ds,PetscViewer viewer) { PetscViewerFormat format; PetscInt i,j,r,c,rows; @@ -134,7 +134,7 @@ PetscErrorCode DSView_HEP(DS ds,PetscViewer viewer) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSVectors_HEP(DS ds,DSMatType mat,PetscInt *j,PetscReal *rnorm) +static PetscErrorCode DSVectors_HEP(DS ds,DSMatType mat,PetscInt *j,PetscReal *rnorm) { PetscScalar *Z; const PetscScalar *Q; @@ -321,7 +321,7 @@ static PetscErrorCode DSIntermediate_HEP(DS ds) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSSort_HEP(DS ds,PetscScalar *wr,PetscScalar *wi,PetscScalar *rr,PetscScalar *ri,PetscInt *k) +static PetscErrorCode DSSort_HEP(DS ds,PetscScalar *wr,PetscScalar *wi,PetscScalar *rr,PetscScalar *ri,PetscInt *k) { PetscInt n,l,i,*perm,ld=ds->ld; PetscScalar *A; @@ -347,7 +347,7 @@ PetscErrorCode DSSort_HEP(DS ds,PetscScalar *wr,PetscScalar *wi,PetscScalar *rr, PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSUpdateExtraRow_HEP(DS ds) +static PetscErrorCode DSUpdateExtraRow_HEP(DS ds) { PetscInt i; PetscBLASInt n,ld,incx=1; @@ -381,7 +381,7 @@ PetscErrorCode DSUpdateExtraRow_HEP(DS ds) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSSolve_HEP_QR(DS ds,PetscScalar *wr,PetscScalar *wi) +static PetscErrorCode DSSolve_HEP_QR(DS ds,PetscScalar *wr,PetscScalar *wi) { PetscInt i; PetscBLASInt n1,info,l = 0,n = 0,ld,off; @@ -426,7 +426,7 @@ PetscErrorCode DSSolve_HEP_QR(DS ds,PetscScalar *wr,PetscScalar *wi) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSSolve_HEP_MRRR(DS ds,PetscScalar *wr,PetscScalar *wi) +static PetscErrorCode DSSolve_HEP_MRRR(DS ds,PetscScalar *wr,PetscScalar *wi) { Mat At,Qt; /* trailing submatrices */ PetscInt i; @@ -513,7 +513,7 @@ PetscErrorCode DSSolve_HEP_MRRR(DS ds,PetscScalar *wr,PetscScalar *wi) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSSolve_HEP_DC(DS ds,PetscScalar *wr,PetscScalar *wi) +static PetscErrorCode DSSolve_HEP_DC(DS ds,PetscScalar *wr,PetscScalar *wi) { PetscInt i; PetscBLASInt n1,info,l = 0,ld,off,lrwork,liwork; @@ -573,7 +573,7 @@ PetscErrorCode DSSolve_HEP_DC(DS ds,PetscScalar *wr,PetscScalar *wi) } #if !defined(PETSC_USE_COMPLEX) -PetscErrorCode DSSolve_HEP_BDC(DS ds,PetscScalar *wr,PetscScalar *wi) +static PetscErrorCode DSSolve_HEP_BDC(DS ds,PetscScalar *wr,PetscScalar *wi) { PetscBLASInt i,j,k,m,n = 0,info,nblks,bs = 0,ld = 0,lde,lrwork,liwork,*ksizes,*iwork,mingapi; PetscScalar *Q,*A; @@ -640,7 +640,7 @@ PetscErrorCode DSSolve_HEP_BDC(DS ds,PetscScalar *wr,PetscScalar *wi) } #endif -PetscErrorCode DSTruncate_HEP(DS ds,PetscInt n,PetscBool trim) +static PetscErrorCode DSTruncate_HEP(DS ds,PetscInt n,PetscBool trim) { PetscInt i,ld=ds->ld,l=ds->l; PetscScalar *A; @@ -670,7 +670,7 @@ PetscErrorCode DSTruncate_HEP(DS ds,PetscInt n,PetscBool trim) } #if !defined(PETSC_HAVE_MPIUNI) -PetscErrorCode DSSynchronize_HEP(DS ds,PetscScalar eigr[],PetscScalar eigi[]) +static PetscErrorCode DSSynchronize_HEP(DS ds,PetscScalar eigr[],PetscScalar eigi[]) { PetscInt ld=ds->ld,l=ds->l,k=0,kr=0; PetscMPIInt n,rank,off=0,size,ldn,ld3; @@ -711,7 +711,7 @@ PetscErrorCode DSSynchronize_HEP(DS ds,PetscScalar eigr[],PetscScalar eigi[]) } #endif -PetscErrorCode DSCond_HEP(DS ds,PetscReal *cond) +static PetscErrorCode DSCond_HEP(DS ds,PetscReal *cond) { PetscScalar *work; PetscReal *rwork; @@ -750,7 +750,7 @@ PetscErrorCode DSCond_HEP(DS ds,PetscReal *cond) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSTranslateRKS_HEP(DS ds,PetscScalar alpha) +static PetscErrorCode DSTranslateRKS_HEP(DS ds,PetscScalar alpha) { PetscInt i,j,k=ds->k; PetscScalar *Q,*A,*R,*tau,*work; @@ -805,7 +805,7 @@ PetscErrorCode DSTranslateRKS_HEP(DS ds,PetscScalar alpha) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSHermitian_HEP(DS ds,DSMatType m,PetscBool *flg) +static PetscErrorCode DSHermitian_HEP(DS ds,DSMatType m,PetscBool *flg) { PetscFunctionBegin; if (m==DS_MAT_A && !ds->extrarow) *flg = PETSC_TRUE; diff --git a/src/sys/classes/ds/impls/hsvd/dshsvd.c b/src/sys/classes/ds/impls/hsvd/dshsvd.c index 933c59391..c7c7a9a7f 100644 --- a/src/sys/classes/ds/impls/hsvd/dshsvd.c +++ b/src/sys/classes/ds/impls/hsvd/dshsvd.c @@ -17,7 +17,7 @@ typedef struct { PetscBool reorth; /* reorthogonalize left vectors */ } DS_HSVD; -PetscErrorCode DSAllocate_HSVD(DS ds,PetscInt ld) +static PetscErrorCode DSAllocate_HSVD(DS ds,PetscInt ld) { PetscFunctionBegin; PetscCall(DSAllocateMat_Private(ds,DS_MAT_A)); @@ -55,7 +55,7 @@ n-1 | x| ----------------------------------------- */ -PetscErrorCode DSView_HSVD(DS ds,PetscViewer viewer) +static PetscErrorCode DSView_HSVD(DS ds,PetscViewer viewer) { DS_HSVD *ctx = (DS_HSVD*)ds->data; PetscViewerFormat format; @@ -136,7 +136,7 @@ PetscErrorCode DSView_HSVD(DS ds,PetscViewer viewer) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSVectors_HSVD(DS ds,DSMatType mat,PetscInt *j,PetscReal *rnorm) +static PetscErrorCode DSVectors_HSVD(DS ds,DSMatType mat,PetscInt *j,PetscReal *rnorm) { PetscFunctionBegin; switch (mat) { @@ -150,7 +150,7 @@ PetscErrorCode DSVectors_HSVD(DS ds,DSMatType mat,PetscInt *j,PetscReal *rnorm) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSSort_HSVD(DS ds,PetscScalar *wr,PetscScalar *wi,PetscScalar *rr,PetscScalar *ri,PetscInt *k) +static PetscErrorCode DSSort_HSVD(DS ds,PetscScalar *wr,PetscScalar *wi,PetscScalar *rr,PetscScalar *ri,PetscInt *k) { DS_HSVD *ctx = (DS_HSVD*)ds->data; PetscInt n,l,i,*perm,ld=ds->ld; @@ -183,7 +183,7 @@ PetscErrorCode DSSort_HSVD(DS ds,PetscScalar *wr,PetscScalar *wi,PetscScalar *rr PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSUpdateExtraRow_HSVD(DS ds) +static PetscErrorCode DSUpdateExtraRow_HSVD(DS ds) { DS_HSVD *ctx = (DS_HSVD*)ds->data; PetscInt i; @@ -211,7 +211,7 @@ PetscErrorCode DSUpdateExtraRow_HSVD(DS ds) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSTruncate_HSVD(DS ds,PetscInt n,PetscBool trim) +static PetscErrorCode DSTruncate_HSVD(DS ds,PetscInt n,PetscBool trim) { PetscInt i,ld=ds->ld,l=ds->l; PetscScalar *A; @@ -245,7 +245,7 @@ PetscErrorCode DSTruncate_HSVD(DS ds,PetscInt n,PetscBool trim) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSSolve_HSVD_CROSS(DS ds,PetscScalar *wr,PetscScalar *wi) +static PetscErrorCode DSSolve_HSVD_CROSS(DS ds,PetscScalar *wr,PetscScalar *wi) { DS_HSVD *ctx = (DS_HSVD*)ds->data; PetscInt i,j,k=ds->k,rwu=0,iwu=0,swu=0,nv; @@ -394,7 +394,7 @@ PetscErrorCode DSSolve_HSVD_CROSS(DS ds,PetscScalar *wr,PetscScalar *wi) } #if !defined(PETSC_HAVE_MPIUNI) -PetscErrorCode DSSynchronize_HSVD(DS ds,PetscScalar eigr[],PetscScalar eigi[]) +static PetscErrorCode DSSynchronize_HSVD(DS ds,PetscScalar eigr[],PetscScalar eigi[]) { PetscInt ld=ds->ld,l=ds->l,k=0,kr=0; PetscMPIInt n,rank,off=0,size,ldn,ld3,ld_; @@ -452,7 +452,7 @@ PetscErrorCode DSSynchronize_HSVD(DS ds,PetscScalar eigr[],PetscScalar eigi[]) } #endif -PetscErrorCode DSMatGetSize_HSVD(DS ds,DSMatType t,PetscInt *rows,PetscInt *cols) +static PetscErrorCode DSMatGetSize_HSVD(DS ds,DSMatType t,PetscInt *rows,PetscInt *cols) { DS_HSVD *ctx = (DS_HSVD*)ds->data; @@ -631,7 +631,7 @@ PetscErrorCode DSHSVDGetReorthogonalize(DS ds,PetscBool *reorth) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSSetFromOptions_HSVD(DS ds,PetscOptionItems *PetscOptionsObject) +static PetscErrorCode DSSetFromOptions_HSVD(DS ds,PetscOptionItems *PetscOptionsObject) { PetscBool flg,reorth; @@ -645,7 +645,7 @@ PetscErrorCode DSSetFromOptions_HSVD(DS ds,PetscOptionItems *PetscOptionsObject) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSDestroy_HSVD(DS ds) +static PetscErrorCode DSDestroy_HSVD(DS ds) { PetscFunctionBegin; PetscCall(PetscFree(ds->data)); diff --git a/src/sys/classes/ds/impls/nep/dsnep.c b/src/sys/classes/ds/impls/nep/dsnep.c index 5a8eaf058..9446c771b 100644 --- a/src/sys/classes/ds/impls/nep/dsnep.c +++ b/src/sys/classes/ds/impls/nep/dsnep.c @@ -60,7 +60,7 @@ static PetscErrorCode DSNEPComputeMatrix(DS ds,PetscScalar lambda,PetscBool deri PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSAllocate_NEP(DS ds,PetscInt ld) +static PetscErrorCode DSAllocate_NEP(DS ds,PetscInt ld) { DS_NEP *ctx = (DS_NEP*)ds->data; PetscInt i; @@ -73,7 +73,7 @@ PetscErrorCode DSAllocate_NEP(DS ds,PetscInt ld) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSView_NEP(DS ds,PetscViewer viewer) +static PetscErrorCode DSView_NEP(DS ds,PetscViewer viewer) { DS_NEP *ctx = (DS_NEP*)ds->data; PetscViewerFormat format; @@ -108,7 +108,7 @@ PetscErrorCode DSView_NEP(DS ds,PetscViewer viewer) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSVectors_NEP(DS ds,DSMatType mat,PetscInt *j,PetscReal *rnorm) +static PetscErrorCode DSVectors_NEP(DS ds,DSMatType mat,PetscInt *j,PetscReal *rnorm) { PetscFunctionBegin; PetscCheck(!rnorm,PetscObjectComm((PetscObject)ds),PETSC_ERR_SUP,"Not implemented yet"); @@ -123,7 +123,7 @@ PetscErrorCode DSVectors_NEP(DS ds,DSMatType mat,PetscInt *j,PetscReal *rnorm) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSSort_NEP(DS ds,PetscScalar *wr,PetscScalar *wi,PetscScalar *rr,PetscScalar *ri,PetscInt *dummy) +static PetscErrorCode DSSort_NEP(DS ds,PetscScalar *wr,PetscScalar *wi,PetscScalar *rr,PetscScalar *ri,PetscInt *dummy) { DS_NEP *ctx = (DS_NEP*)ds->data; PetscInt n,l,i,*perm,lds; @@ -148,7 +148,7 @@ PetscErrorCode DSSort_NEP(DS ds,PetscScalar *wr,PetscScalar *wi,PetscScalar *rr, PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSSolve_NEP_SLP(DS ds,PetscScalar *wr,PetscScalar *wi) +static PetscErrorCode DSSolve_NEP_SLP(DS ds,PetscScalar *wr,PetscScalar *wi) { PetscScalar *A,*B,*W,*X,*work,*alpha,*beta; PetscScalar sigma,lambda,mu,re,re2,sone=1.0,szero=0.0; @@ -528,7 +528,7 @@ PetscErrorCode DSSolve_NEP_Contour(DS ds,PetscScalar *wr,PetscScalar *wi) #endif #if !defined(PETSC_HAVE_MPIUNI) -PetscErrorCode DSSynchronize_NEP(DS ds,PetscScalar eigr[],PetscScalar eigi[]) +static PetscErrorCode DSSynchronize_NEP(DS ds,PetscScalar eigr[],PetscScalar eigi[]) { DS_NEP *ctx = (DS_NEP*)ds->data; PetscInt ld=ds->ld,k=0; @@ -1175,7 +1175,7 @@ PetscErrorCode DSNEPGetRG(DS ds,RG *rg) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSSetFromOptions_NEP(DS ds,PetscOptionItems *PetscOptionsObject) +static PetscErrorCode DSSetFromOptions_NEP(DS ds,PetscOptionItems *PetscOptionsObject) { PetscInt k; PetscBool flg; @@ -1214,7 +1214,7 @@ PetscErrorCode DSSetFromOptions_NEP(DS ds,PetscOptionItems *PetscOptionsObject) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSDestroy_NEP(DS ds) +static PetscErrorCode DSDestroy_NEP(DS ds) { DS_NEP *ctx = (DS_NEP*)ds->data; PetscInt i; @@ -1242,7 +1242,7 @@ PetscErrorCode DSDestroy_NEP(DS ds) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSMatGetSize_NEP(DS ds,DSMatType t,PetscInt *rows,PetscInt *cols) +static PetscErrorCode DSMatGetSize_NEP(DS ds,DSMatType t,PetscInt *rows,PetscInt *cols) { DS_NEP *ctx = (DS_NEP*)ds->data; diff --git a/src/sys/classes/ds/impls/nhep/dsnhep.c b/src/sys/classes/ds/impls/nhep/dsnhep.c index eea52f59a..0d55dac06 100644 --- a/src/sys/classes/ds/impls/nhep/dsnhep.c +++ b/src/sys/classes/ds/impls/nhep/dsnhep.c @@ -11,7 +11,7 @@ #include #include -PetscErrorCode DSAllocate_NHEP(DS ds,PetscInt ld) +static PetscErrorCode DSAllocate_NHEP(DS ds,PetscInt ld) { PetscFunctionBegin; PetscCall(DSAllocateMat_Private(ds,DS_MAT_A)); @@ -21,7 +21,7 @@ PetscErrorCode DSAllocate_NHEP(DS ds,PetscInt ld) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSView_NHEP(DS ds,PetscViewer viewer) +static PetscErrorCode DSView_NHEP(DS ds,PetscViewer viewer) { PetscViewerFormat format; @@ -225,7 +225,7 @@ static PetscErrorCode DSVectors_NHEP_Eigen_All(DS ds,PetscBool left) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSVectors_NHEP(DS ds,DSMatType mat,PetscInt *j,PetscReal *rnorm) +static PetscErrorCode DSVectors_NHEP(DS ds,DSMatType mat,PetscInt *j,PetscReal *rnorm) { PetscFunctionBegin; switch (mat) { @@ -300,7 +300,7 @@ static PetscErrorCode DSSort_NHEP_Arbitrary(DS ds,PetscScalar *wr,PetscScalar *w PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSSort_NHEP(DS ds,PetscScalar *wr,PetscScalar *wi,PetscScalar *rr,PetscScalar *ri,PetscInt *k) +static PetscErrorCode DSSort_NHEP(DS ds,PetscScalar *wr,PetscScalar *wi,PetscScalar *rr,PetscScalar *ri,PetscInt *k) { PetscFunctionBegin; if (!rr || wr == rr) PetscCall(DSSort_NHEP_Total(ds,DS_MAT_A,DS_MAT_Q,wr,wi)); @@ -315,7 +315,7 @@ static PetscErrorCode DSSortWithPermutation_NHEP(DS ds,PetscInt *perm,PetscScala PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSUpdateExtraRow_NHEP(DS ds) +static PetscErrorCode DSUpdateExtraRow_NHEP(DS ds) { PetscInt i; PetscBLASInt n,ld,incx=1; @@ -339,7 +339,7 @@ PetscErrorCode DSUpdateExtraRow_NHEP(DS ds) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSSolve_NHEP(DS ds,PetscScalar *wr,PetscScalar *wi) +static PetscErrorCode DSSolve_NHEP(DS ds,PetscScalar *wr,PetscScalar *wi) { PetscFunctionBegin; #if !defined(PETSC_USE_COMPLEX) @@ -350,7 +350,7 @@ PetscErrorCode DSSolve_NHEP(DS ds,PetscScalar *wr,PetscScalar *wi) } #if !defined(PETSC_HAVE_MPIUNI) -PetscErrorCode DSSynchronize_NHEP(DS ds,PetscScalar eigr[],PetscScalar eigi[]) +static PetscErrorCode DSSynchronize_NHEP(DS ds,PetscScalar eigr[],PetscScalar eigi[]) { PetscInt ld=ds->ld,l=ds->l,k; PetscMPIInt n,rank,off=0,size,ldn; @@ -391,7 +391,7 @@ PetscErrorCode DSSynchronize_NHEP(DS ds,PetscScalar eigr[],PetscScalar eigi[]) } #endif -PetscErrorCode DSTruncate_NHEP(DS ds,PetscInt n,PetscBool trim) +static PetscErrorCode DSTruncate_NHEP(DS ds,PetscInt n,PetscBool trim) { PetscInt i,ld=ds->ld,l=ds->l; PetscScalar *A; @@ -424,7 +424,7 @@ PetscErrorCode DSTruncate_NHEP(DS ds,PetscInt n,PetscBool trim) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSCond_NHEP(DS ds,PetscReal *cond) +static PetscErrorCode DSCond_NHEP(DS ds,PetscReal *cond) { PetscScalar *work; PetscReal *rwork; @@ -463,7 +463,7 @@ PetscErrorCode DSCond_NHEP(DS ds,PetscReal *cond) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSTranslateHarmonic_NHEP(DS ds,PetscScalar tau,PetscReal beta,PetscBool recover,PetscScalar *gin,PetscReal *gammaout) +static PetscErrorCode DSTranslateHarmonic_NHEP(DS ds,PetscScalar tau,PetscReal beta,PetscBool recover,PetscScalar *gin,PetscReal *gammaout) { PetscInt i,j; PetscBLASInt *ipiv,info,n,ld,one=1,ncol; diff --git a/src/sys/classes/ds/impls/nhepts/dsnhepts.c b/src/sys/classes/ds/impls/nhepts/dsnhepts.c index 8b8c2b290..0cb544836 100644 --- a/src/sys/classes/ds/impls/nhepts/dsnhepts.c +++ b/src/sys/classes/ds/impls/nhepts/dsnhepts.c @@ -15,7 +15,7 @@ typedef struct { PetscScalar *wr,*wi; /* eigenvalues of B */ } DS_NHEPTS; -PetscErrorCode DSAllocate_NHEPTS(DS ds,PetscInt ld) +static PetscErrorCode DSAllocate_NHEPTS(DS ds,PetscInt ld) { DS_NHEPTS *ctx = (DS_NHEPTS*)ds->data; @@ -33,7 +33,7 @@ PetscErrorCode DSAllocate_NHEPTS(DS ds,PetscInt ld) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSView_NHEPTS(DS ds,PetscViewer viewer) +static PetscErrorCode DSView_NHEPTS(DS ds,PetscViewer viewer) { PetscViewerFormat format; @@ -167,7 +167,7 @@ static PetscErrorCode DSVectors_NHEPTS_Eigen_All(DS ds,PetscBool left) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSVectors_NHEPTS(DS ds,DSMatType mat,PetscInt *j,PetscReal *rnorm) +static PetscErrorCode DSVectors_NHEPTS(DS ds,DSMatType mat,PetscInt *j,PetscReal *rnorm) { PetscFunctionBegin; switch (mat) { @@ -190,7 +190,7 @@ PetscErrorCode DSVectors_NHEPTS(DS ds,DSMatType mat,PetscInt *j,PetscReal *rnorm PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSSort_NHEPTS(DS ds,PetscScalar *wr,PetscScalar *wi,PetscScalar *rr,PetscScalar *ri,PetscInt *k) +static PetscErrorCode DSSort_NHEPTS(DS ds,PetscScalar *wr,PetscScalar *wi,PetscScalar *rr,PetscScalar *ri,PetscInt *k) { DS_NHEPTS *ctx = (DS_NHEPTS*)ds->data; PetscInt i,j,cont,id=0,*p,*idx,*idx2; @@ -241,7 +241,7 @@ PetscErrorCode DSSort_NHEPTS(DS ds,PetscScalar *wr,PetscScalar *wi,PetscScalar * PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSUpdateExtraRow_NHEPTS(DS ds) +static PetscErrorCode DSUpdateExtraRow_NHEPTS(DS ds) { PetscInt i; PetscBLASInt n,ld,incx=1; @@ -272,7 +272,7 @@ PetscErrorCode DSUpdateExtraRow_NHEPTS(DS ds) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSSolve_NHEPTS(DS ds,PetscScalar *wr,PetscScalar *wi) +static PetscErrorCode DSSolve_NHEPTS(DS ds,PetscScalar *wr,PetscScalar *wi) { DS_NHEPTS *ctx = (DS_NHEPTS*)ds->data; @@ -286,7 +286,7 @@ PetscErrorCode DSSolve_NHEPTS(DS ds,PetscScalar *wr,PetscScalar *wi) } #if !defined(PETSC_HAVE_MPIUNI) -PetscErrorCode DSSynchronize_NHEPTS(DS ds,PetscScalar eigr[],PetscScalar eigi[]) +static PetscErrorCode DSSynchronize_NHEPTS(DS ds,PetscScalar eigr[],PetscScalar eigi[]) { PetscInt ld=ds->ld,l=ds->l,k; PetscMPIInt n,rank,off=0,size,ldn; @@ -350,7 +350,7 @@ PetscErrorCode DSSynchronize_NHEPTS(DS ds,PetscScalar eigr[],PetscScalar eigi[]) } #endif -PetscErrorCode DSGetTruncateSize_NHEPTS(DS ds,PetscInt l,PetscInt n,PetscInt *k) +static PetscErrorCode DSGetTruncateSize_NHEPTS(DS ds,PetscInt l,PetscInt n,PetscInt *k) { #if !defined(PETSC_USE_COMPLEX) const PetscScalar *A,*B; @@ -370,7 +370,7 @@ PetscErrorCode DSGetTruncateSize_NHEPTS(DS ds,PetscInt l,PetscInt n,PetscInt *k) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSTruncate_NHEPTS(DS ds,PetscInt n,PetscBool trim) +static PetscErrorCode DSTruncate_NHEPTS(DS ds,PetscInt n,PetscBool trim) { PetscInt i,ld=ds->ld,l=ds->l; PetscScalar *A,*B; @@ -405,7 +405,7 @@ PetscErrorCode DSTruncate_NHEPTS(DS ds,PetscInt n,PetscBool trim) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSDestroy_NHEPTS(DS ds) +static PetscErrorCode DSDestroy_NHEPTS(DS ds) { DS_NHEPTS *ctx = (DS_NHEPTS*)ds->data; @@ -416,7 +416,7 @@ PetscErrorCode DSDestroy_NHEPTS(DS ds) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSMatGetSize_NHEPTS(DS ds,DSMatType t,PetscInt *rows,PetscInt *cols) +static PetscErrorCode DSMatGetSize_NHEPTS(DS ds,DSMatType t,PetscInt *rows,PetscInt *cols) { PetscFunctionBegin; *rows = ((t==DS_MAT_A || t==DS_MAT_B) && ds->extrarow)? ds->n+1: ds->n; diff --git a/src/sys/classes/ds/impls/pep/dspep.c b/src/sys/classes/ds/impls/pep/dspep.c index c5db62c9c..4c6900afc 100644 --- a/src/sys/classes/ds/impls/pep/dspep.c +++ b/src/sys/classes/ds/impls/pep/dspep.c @@ -16,7 +16,7 @@ typedef struct { PetscReal *pbc; /* polynomial basis coefficients */ } DS_PEP; -PetscErrorCode DSAllocate_PEP(DS ds,PetscInt ld) +static PetscErrorCode DSAllocate_PEP(DS ds,PetscInt ld) { DS_PEP *ctx = (DS_PEP*)ds->data; PetscInt i; @@ -31,7 +31,7 @@ PetscErrorCode DSAllocate_PEP(DS ds,PetscInt ld) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSView_PEP(DS ds,PetscViewer viewer) +static PetscErrorCode DSView_PEP(DS ds,PetscViewer viewer) { DS_PEP *ctx = (DS_PEP*)ds->data; PetscViewerFormat format; @@ -49,7 +49,7 @@ PetscErrorCode DSView_PEP(DS ds,PetscViewer viewer) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSVectors_PEP(DS ds,DSMatType mat,PetscInt *j,PetscReal *rnorm) +static PetscErrorCode DSVectors_PEP(DS ds,DSMatType mat,PetscInt *j,PetscReal *rnorm) { PetscFunctionBegin; PetscCheck(!rnorm,PetscObjectComm((PetscObject)ds),PETSC_ERR_SUP,"Not implemented yet"); @@ -64,7 +64,7 @@ PetscErrorCode DSVectors_PEP(DS ds,DSMatType mat,PetscInt *j,PetscReal *rnorm) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSSort_PEP(DS ds,PetscScalar *wr,PetscScalar *wi,PetscScalar *rr,PetscScalar *ri,PetscInt *kout) +static PetscErrorCode DSSort_PEP(DS ds,PetscScalar *wr,PetscScalar *wi,PetscScalar *rr,PetscScalar *ri,PetscInt *kout) { DS_PEP *ctx = (DS_PEP*)ds->data; PetscInt n,i,*perm,told; @@ -90,7 +90,7 @@ PetscErrorCode DSSort_PEP(DS ds,PetscScalar *wr,PetscScalar *wi,PetscScalar *rr, PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSSolve_PEP_QZ(DS ds,PetscScalar *wr,PetscScalar *wi) +static PetscErrorCode DSSolve_PEP_QZ(DS ds,PetscScalar *wr,PetscScalar *wi) { DS_PEP *ctx = (DS_PEP*)ds->data; PetscInt i,j,k,off; @@ -240,7 +240,7 @@ PetscErrorCode DSSolve_PEP_QZ(DS ds,PetscScalar *wr,PetscScalar *wi) } #if !defined(PETSC_HAVE_MPIUNI) -PetscErrorCode DSSynchronize_PEP(DS ds,PetscScalar eigr[],PetscScalar eigi[]) +static PetscErrorCode DSSynchronize_PEP(DS ds,PetscScalar eigr[],PetscScalar eigi[]) { DS_PEP *ctx = (DS_PEP*)ds->data; PetscInt ld=ds->ld,k=0; @@ -450,7 +450,7 @@ PetscErrorCode DSPEPGetCoefficients(DS ds,PetscReal **pbc) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSDestroy_PEP(DS ds) +static PetscErrorCode DSDestroy_PEP(DS ds) { DS_PEP *ctx = (DS_PEP*)ds->data; @@ -464,7 +464,7 @@ PetscErrorCode DSDestroy_PEP(DS ds) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSMatGetSize_PEP(DS ds,DSMatType t,PetscInt *rows,PetscInt *cols) +static PetscErrorCode DSMatGetSize_PEP(DS ds,DSMatType t,PetscInt *rows,PetscInt *cols) { DS_PEP *ctx = (DS_PEP*)ds->data; diff --git a/src/sys/classes/ds/impls/svd/dssvd.c b/src/sys/classes/ds/impls/svd/dssvd.c index 8036e0f17..55d265d81 100644 --- a/src/sys/classes/ds/impls/svd/dssvd.c +++ b/src/sys/classes/ds/impls/svd/dssvd.c @@ -16,7 +16,7 @@ typedef struct { PetscInt t; /* number of rows of V after truncating */ } DS_SVD; -PetscErrorCode DSAllocate_SVD(DS ds,PetscInt ld) +static PetscErrorCode DSAllocate_SVD(DS ds,PetscInt ld) { PetscFunctionBegin; PetscCall(DSAllocateMat_Private(ds,DS_MAT_A)); @@ -80,7 +80,7 @@ static PetscErrorCode DSSwitchFormat_SVD(DS ds) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSView_SVD(DS ds,PetscViewer viewer) +static PetscErrorCode DSView_SVD(DS ds,PetscViewer viewer) { DS_SVD *ctx = (DS_SVD*)ds->data; PetscViewerFormat format; @@ -134,7 +134,7 @@ PetscErrorCode DSView_SVD(DS ds,PetscViewer viewer) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSVectors_SVD(DS ds,DSMatType mat,PetscInt *j,PetscReal *rnorm) +static PetscErrorCode DSVectors_SVD(DS ds,DSMatType mat,PetscInt *j,PetscReal *rnorm) { PetscFunctionBegin; switch (mat) { @@ -148,7 +148,7 @@ PetscErrorCode DSVectors_SVD(DS ds,DSMatType mat,PetscInt *j,PetscReal *rnorm) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSSort_SVD(DS ds,PetscScalar *wr,PetscScalar *wi,PetscScalar *rr,PetscScalar *ri,PetscInt *k) +static PetscErrorCode DSSort_SVD(DS ds,PetscScalar *wr,PetscScalar *wi,PetscScalar *rr,PetscScalar *ri,PetscInt *k) { DS_SVD *ctx = (DS_SVD*)ds->data; PetscInt n,l,i,*perm,ld=ds->ld; @@ -176,7 +176,7 @@ PetscErrorCode DSSort_SVD(DS ds,PetscScalar *wr,PetscScalar *wi,PetscScalar *rr, PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSUpdateExtraRow_SVD(DS ds) +static PetscErrorCode DSUpdateExtraRow_SVD(DS ds) { DS_SVD *ctx = (DS_SVD*)ds->data; PetscInt i; @@ -213,7 +213,7 @@ PetscErrorCode DSUpdateExtraRow_SVD(DS ds) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSTruncate_SVD(DS ds,PetscInt n,PetscBool trim) +static PetscErrorCode DSTruncate_SVD(DS ds,PetscInt n,PetscBool trim) { PetscInt i,ld=ds->ld,l=ds->l; PetscScalar *A; @@ -247,7 +247,7 @@ PetscErrorCode DSTruncate_SVD(DS ds,PetscInt n,PetscBool trim) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSSolve_SVD_DC(DS ds,PetscScalar *wr,PetscScalar *wi) +static PetscErrorCode DSSolve_SVD_DC(DS ds,PetscScalar *wr,PetscScalar *wi) { DS_SVD *ctx = (DS_SVD*)ds->data; PetscInt i,j; @@ -341,7 +341,7 @@ PetscErrorCode DSSolve_SVD_DC(DS ds,PetscScalar *wr,PetscScalar *wi) } #if !defined(PETSC_HAVE_MPIUNI) -PetscErrorCode DSSynchronize_SVD(DS ds,PetscScalar eigr[],PetscScalar eigi[]) +static PetscErrorCode DSSynchronize_SVD(DS ds,PetscScalar eigr[],PetscScalar eigi[]) { PetscInt ld=ds->ld,l=ds->l,k=0,kr=0; PetscMPIInt n,rank,off=0,size,ldn,ld3; @@ -394,7 +394,7 @@ PetscErrorCode DSSynchronize_SVD(DS ds,PetscScalar eigr[],PetscScalar eigi[]) } #endif -PetscErrorCode DSMatGetSize_SVD(DS ds,DSMatType t,PetscInt *rows,PetscInt *cols) +static PetscErrorCode DSMatGetSize_SVD(DS ds,DSMatType t,PetscInt *rows,PetscInt *cols) { DS_SVD *ctx = (DS_SVD*)ds->data; @@ -497,7 +497,7 @@ PetscErrorCode DSSVDGetDimensions(DS ds,PetscInt *m) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode DSDestroy_SVD(DS ds) +static PetscErrorCode DSDestroy_SVD(DS ds) { PetscFunctionBegin; PetscCall(PetscFree(ds->data)); diff --git a/src/sys/classes/fn/impls/combine/fncombine.c b/src/sys/classes/fn/impls/combine/fncombine.c index cc8ac644b..2c4e49e64 100644 --- a/src/sys/classes/fn/impls/combine/fncombine.c +++ b/src/sys/classes/fn/impls/combine/fncombine.c @@ -24,7 +24,7 @@ typedef struct { FNCombineType comb; /* how the functions are combined */ } FN_COMBINE; -PetscErrorCode FNEvaluateFunction_Combine(FN fn,PetscScalar x,PetscScalar *y) +static PetscErrorCode FNEvaluateFunction_Combine(FN fn,PetscScalar x,PetscScalar *y) { FN_COMBINE *ctx = (FN_COMBINE*)fn->data; PetscScalar a,b; @@ -52,7 +52,7 @@ PetscErrorCode FNEvaluateFunction_Combine(FN fn,PetscScalar x,PetscScalar *y) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode FNEvaluateDerivative_Combine(FN fn,PetscScalar x,PetscScalar *yp) +static PetscErrorCode FNEvaluateDerivative_Combine(FN fn,PetscScalar x,PetscScalar *yp) { FN_COMBINE *ctx = (FN_COMBINE*)fn->data; PetscScalar a,b,ap,bp; @@ -89,7 +89,7 @@ PetscErrorCode FNEvaluateDerivative_Combine(FN fn,PetscScalar x,PetscScalar *yp) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode FNEvaluateFunctionMat_Combine(FN fn,Mat A,Mat B) +static PetscErrorCode FNEvaluateFunctionMat_Combine(FN fn,Mat A,Mat B) { FN_COMBINE *ctx = (FN_COMBINE*)fn->data; Mat W,Z,F; @@ -129,7 +129,7 @@ PetscErrorCode FNEvaluateFunctionMat_Combine(FN fn,Mat A,Mat B) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode FNEvaluateFunctionMatVec_Combine(FN fn,Mat A,Vec v) +static PetscErrorCode FNEvaluateFunctionMatVec_Combine(FN fn,Mat A,Vec v) { FN_COMBINE *ctx = (FN_COMBINE*)fn->data; PetscBool iscuda; @@ -178,7 +178,7 @@ PetscErrorCode FNEvaluateFunctionMatVec_Combine(FN fn,Mat A,Vec v) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode FNView_Combine(FN fn,PetscViewer viewer) +static PetscErrorCode FNView_Combine(FN fn,PetscViewer viewer) { FN_COMBINE *ctx = (FN_COMBINE*)fn->data; PetscBool isascii; @@ -293,7 +293,7 @@ PetscErrorCode FNCombineGetChildren(FN fn,FNCombineType *comb,FN *f1,FN *f2) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode FNDuplicate_Combine(FN fn,MPI_Comm comm,FN *newfn) +static PetscErrorCode FNDuplicate_Combine(FN fn,MPI_Comm comm,FN *newfn) { FN_COMBINE *ctx = (FN_COMBINE*)fn->data,*ctx2 = (FN_COMBINE*)(*newfn)->data; @@ -304,7 +304,7 @@ PetscErrorCode FNDuplicate_Combine(FN fn,MPI_Comm comm,FN *newfn) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode FNDestroy_Combine(FN fn) +static PetscErrorCode FNDestroy_Combine(FN fn) { FN_COMBINE *ctx = (FN_COMBINE*)fn->data; diff --git a/src/sys/classes/fn/impls/cuda/fnutilcuda.cu b/src/sys/classes/fn/impls/cuda/fnutilcuda.cu index 60a355151..8ac9dd419 100644 --- a/src/sys/classes/fn/impls/cuda/fnutilcuda.cu +++ b/src/sys/classes/fn/impls/cuda/fnutilcuda.cu @@ -13,7 +13,7 @@ #include "fnutilcuda.h" -__global__ void set_diagonal_kernel(PetscInt n,PetscScalar *d_pa,PetscInt ld,PetscScalar v,PetscInt xcount) +static __global__ void set_diagonal_kernel(PetscInt n,PetscScalar *d_pa,PetscInt ld,PetscScalar v,PetscInt xcount) { PetscInt x; x = xcount*gridDim.x*blockDim.x+blockIdx.x*blockDim.x+threadIdx.x; diff --git a/src/sys/classes/fn/impls/cuda/fnutilcuda.h b/src/sys/classes/fn/impls/cuda/fnutilcuda.h index 3196645b6..a5527686a 100644 --- a/src/sys/classes/fn/impls/cuda/fnutilcuda.h +++ b/src/sys/classes/fn/impls/cuda/fnutilcuda.h @@ -19,7 +19,6 @@ #if defined(PETSC_HAVE_CUDA) #include -__global__ void set_diagonal_kernel(PetscInt,PetscScalar*,PetscInt,PetscScalar,PetscInt); SLEPC_INTERN __host__ PetscErrorCode set_diagonal(PetscInt,PetscScalar*,PetscInt,PetscScalar); __global__ void set_Cdiagonal_kernel(PetscInt,PetscComplex*,PetscInt,PetscReal,PetscReal,PetscInt); SLEPC_INTERN __host__ PetscErrorCode set_Cdiagonal(PetscInt,PetscComplex*,PetscInt,PetscReal,PetscReal); diff --git a/src/sys/classes/fn/impls/exp/fnexp.c b/src/sys/classes/fn/impls/exp/fnexp.c index 7ecec9760..07483c575 100644 --- a/src/sys/classes/fn/impls/exp/fnexp.c +++ b/src/sys/classes/fn/impls/exp/fnexp.c @@ -14,14 +14,14 @@ #include /*I "slepcfn.h" I*/ #include -PetscErrorCode FNEvaluateFunction_Exp(FN fn,PetscScalar x,PetscScalar *y) +static PetscErrorCode FNEvaluateFunction_Exp(FN fn,PetscScalar x,PetscScalar *y) { PetscFunctionBegin; *y = PetscExpScalar(x); PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode FNEvaluateDerivative_Exp(FN fn,PetscScalar x,PetscScalar *y) +static PetscErrorCode FNEvaluateDerivative_Exp(FN fn,PetscScalar x,PetscScalar *y) { PetscFunctionBegin; *y = PetscExpScalar(x); @@ -31,7 +31,7 @@ PetscErrorCode FNEvaluateDerivative_Exp(FN fn,PetscScalar x,PetscScalar *y) #define MAX_PADE 6 #define SWAP(a,b,t) do {t=a;a=b;b=t;} while (0) -PetscErrorCode FNEvaluateFunctionMat_Exp_Pade(FN fn,Mat A,Mat B) +static PetscErrorCode FNEvaluateFunctionMat_Exp_Pade(FN fn,Mat A,Mat B) { PetscBLASInt n=0,ld,ld2,*ipiv,info,inc=1; PetscInt m,j,k,sexp; @@ -408,7 +408,7 @@ static PetscErrorCode getisreal(PetscInt n,PetscComplex *a,PetscBool *result) * SIAM J. Matrix Anal. Appl. 37(1):145-170, 2016. * https://doi.org/10.1137/15M1027553 */ -PetscErrorCode FNEvaluateFunctionMat_Exp_GuettelNakatsukasa(FN fn,Mat A,Mat B) +static PetscErrorCode FNEvaluateFunctionMat_Exp_GuettelNakatsukasa(FN fn,Mat A,Mat B) { #if !defined(PETSC_HAVE_COMPLEX) PetscFunctionBegin; @@ -1654,7 +1654,7 @@ PetscErrorCode FNEvaluateFunctionMat_Exp_GuettelNakatsukasa_CUDAm(FN fn,Mat A,Ma #endif /* PETSC_HAVE_MAGMA */ #endif /* PETSC_HAVE_CUDA */ -PetscErrorCode FNView_Exp(FN fn,PetscViewer viewer) +static PetscErrorCode FNView_Exp(FN fn,PetscViewer viewer) { PetscBool isascii; char str[50]; diff --git a/src/sys/classes/fn/impls/invsqrt/fninvsqrt.c b/src/sys/classes/fn/impls/invsqrt/fninvsqrt.c index 177c77aed..975119170 100644 --- a/src/sys/classes/fn/impls/invsqrt/fninvsqrt.c +++ b/src/sys/classes/fn/impls/invsqrt/fninvsqrt.c @@ -14,7 +14,7 @@ #include /*I "slepcfn.h" I*/ #include -PetscErrorCode FNEvaluateFunction_Invsqrt(FN fn,PetscScalar x,PetscScalar *y) +static PetscErrorCode FNEvaluateFunction_Invsqrt(FN fn,PetscScalar x,PetscScalar *y) { PetscFunctionBegin; PetscCheck(x!=0.0,PETSC_COMM_SELF,PETSC_ERR_ARG_OUTOFRANGE,"Function not defined in the requested value"); @@ -25,7 +25,7 @@ PetscErrorCode FNEvaluateFunction_Invsqrt(FN fn,PetscScalar x,PetscScalar *y) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode FNEvaluateDerivative_Invsqrt(FN fn,PetscScalar x,PetscScalar *y) +static PetscErrorCode FNEvaluateDerivative_Invsqrt(FN fn,PetscScalar x,PetscScalar *y) { PetscFunctionBegin; PetscCheck(x!=0.0,PETSC_COMM_SELF,PETSC_ERR_ARG_OUTOFRANGE,"Derivative not defined in the requested value"); @@ -36,7 +36,7 @@ PetscErrorCode FNEvaluateDerivative_Invsqrt(FN fn,PetscScalar x,PetscScalar *y) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode FNEvaluateFunctionMat_Invsqrt_Schur(FN fn,Mat A,Mat B) +static PetscErrorCode FNEvaluateFunctionMat_Invsqrt_Schur(FN fn,Mat A,Mat B) { PetscBLASInt n=0,ld,*ipiv,info; PetscScalar *Ba,*Wa; @@ -65,7 +65,7 @@ PetscErrorCode FNEvaluateFunctionMat_Invsqrt_Schur(FN fn,Mat A,Mat B) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode FNEvaluateFunctionMatVec_Invsqrt_Schur(FN fn,Mat A,Vec v) +static PetscErrorCode FNEvaluateFunctionMatVec_Invsqrt_Schur(FN fn,Mat A,Vec v) { PetscBLASInt n=0,ld,*ipiv,info,one=1; PetscScalar *Ba,*Wa; @@ -95,7 +95,7 @@ PetscErrorCode FNEvaluateFunctionMatVec_Invsqrt_Schur(FN fn,Mat A,Vec v) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode FNEvaluateFunctionMat_Invsqrt_DBP(FN fn,Mat A,Mat B) +static PetscErrorCode FNEvaluateFunctionMat_Invsqrt_DBP(FN fn,Mat A,Mat B) { PetscBLASInt n=0; PetscScalar *T; @@ -111,7 +111,7 @@ PetscErrorCode FNEvaluateFunctionMat_Invsqrt_DBP(FN fn,Mat A,Mat B) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode FNEvaluateFunctionMat_Invsqrt_NS(FN fn,Mat A,Mat B) +static PetscErrorCode FNEvaluateFunctionMat_Invsqrt_NS(FN fn,Mat A,Mat B) { PetscBLASInt n=0; PetscScalar *T; @@ -127,7 +127,7 @@ PetscErrorCode FNEvaluateFunctionMat_Invsqrt_NS(FN fn,Mat A,Mat B) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode FNEvaluateFunctionMat_Invsqrt_Sadeghi(FN fn,Mat A,Mat B) +static PetscErrorCode FNEvaluateFunctionMat_Invsqrt_Sadeghi(FN fn,Mat A,Mat B) { PetscBLASInt n=0,ld,*ipiv,info; PetscScalar *Ba,*Wa; @@ -223,7 +223,7 @@ PetscErrorCode FNEvaluateFunctionMat_Invsqrt_Sadeghi_CUDAm(FN fn,Mat A,Mat B) #endif /* PETSC_HAVE_MAGMA */ #endif /* PETSC_HAVE_CUDA */ -PetscErrorCode FNView_Invsqrt(FN fn,PetscViewer viewer) +static PetscErrorCode FNView_Invsqrt(FN fn,PetscViewer viewer) { PetscBool isascii; char str[50]; diff --git a/src/sys/classes/fn/impls/log/fnlog.c b/src/sys/classes/fn/impls/log/fnlog.c index 18a1c612d..70dd97d68 100644 --- a/src/sys/classes/fn/impls/log/fnlog.c +++ b/src/sys/classes/fn/impls/log/fnlog.c @@ -14,7 +14,7 @@ #include /*I "slepcfn.h" I*/ #include -PetscErrorCode FNEvaluateFunction_Log(FN fn,PetscScalar x,PetscScalar *y) +static PetscErrorCode FNEvaluateFunction_Log(FN fn,PetscScalar x,PetscScalar *y) { PetscFunctionBegin; #if !defined(PETSC_USE_COMPLEX) @@ -24,7 +24,7 @@ PetscErrorCode FNEvaluateFunction_Log(FN fn,PetscScalar x,PetscScalar *y) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode FNEvaluateDerivative_Log(FN fn,PetscScalar x,PetscScalar *y) +static PetscErrorCode FNEvaluateDerivative_Log(FN fn,PetscScalar x,PetscScalar *y) { PetscFunctionBegin; PetscCheck(x!=0.0,PETSC_COMM_SELF,PETSC_ERR_ARG_OUTOFRANGE,"Derivative not defined in the requested value"); @@ -604,7 +604,7 @@ static PetscErrorCode FNLogmPade(FN fn,PetscBLASInt n,PetscScalar *T,PetscBLASIn PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode FNEvaluateFunctionMat_Log_Higham(FN fn,Mat A,Mat B) +static PetscErrorCode FNEvaluateFunctionMat_Log_Higham(FN fn,Mat A,Mat B) { PetscBLASInt n = 0; PetscScalar *T; @@ -620,7 +620,7 @@ PetscErrorCode FNEvaluateFunctionMat_Log_Higham(FN fn,Mat A,Mat B) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode FNEvaluateFunctionMatVec_Log_Higham(FN fn,Mat A,Vec v) +static PetscErrorCode FNEvaluateFunctionMatVec_Log_Higham(FN fn,Mat A,Vec v) { PetscBLASInt n = 0; PetscScalar *T; @@ -639,7 +639,7 @@ PetscErrorCode FNEvaluateFunctionMatVec_Log_Higham(FN fn,Mat A,Vec v) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode FNView_Log(FN fn,PetscViewer viewer) +static PetscErrorCode FNView_Log(FN fn,PetscViewer viewer) { PetscBool isascii; char str[50]; diff --git a/src/sys/classes/fn/impls/phi/fnphi.c b/src/sys/classes/fn/impls/phi/fnphi.c index 3483a952f..ae519158b 100644 --- a/src/sys/classes/fn/impls/phi/fnphi.c +++ b/src/sys/classes/fn/impls/phi/fnphi.c @@ -26,7 +26,7 @@ typedef struct { static const PetscReal rfactorial[MAX_INDEX+2] = { 1, 1, 0.5, 1.0/6, 1.0/24, 1.0/120, 1.0/720, 1.0/5040, 1.0/40320, 1.0/362880, 1.0/3628800, 1.0/39916800 }; -PetscErrorCode FNEvaluateFunction_Phi(FN fn,PetscScalar x,PetscScalar *y) +static PetscErrorCode FNEvaluateFunction_Phi(FN fn,PetscScalar x,PetscScalar *y) { FN_PHI *ctx = (FN_PHI*)fn->data; PetscInt i; @@ -42,7 +42,7 @@ PetscErrorCode FNEvaluateFunction_Phi(FN fn,PetscScalar x,PetscScalar *y) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode FNEvaluateDerivative_Phi(FN fn,PetscScalar x,PetscScalar *y) +static PetscErrorCode FNEvaluateDerivative_Phi(FN fn,PetscScalar x,PetscScalar *y) { FN_PHI *ctx = (FN_PHI*)fn->data; PetscInt i; @@ -58,7 +58,7 @@ PetscErrorCode FNEvaluateDerivative_Phi(FN fn,PetscScalar x,PetscScalar *y) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode FNEvaluateFunctionMatVec_Phi(FN fn,Mat A,Vec v) +static PetscErrorCode FNEvaluateFunctionMatVec_Phi(FN fn,Mat A,Vec v) { FN_PHI *ctx = (FN_PHI*)fn->data; PetscInt i,j,m,n,nh; @@ -184,7 +184,7 @@ PetscErrorCode FNPhiGetIndex(FN fn,PetscInt *k) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode FNView_Phi(FN fn,PetscViewer viewer) +static PetscErrorCode FNView_Phi(FN fn,PetscViewer viewer) { FN_PHI *ctx = (FN_PHI*)fn->data; PetscBool isascii; @@ -212,7 +212,7 @@ PetscErrorCode FNView_Phi(FN fn,PetscViewer viewer) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode FNSetFromOptions_Phi(FN fn,PetscOptionItems *PetscOptionsObject) +static PetscErrorCode FNSetFromOptions_Phi(FN fn,PetscOptionItems *PetscOptionsObject) { FN_PHI *ctx = (FN_PHI*)fn->data; PetscInt k; @@ -228,7 +228,7 @@ PetscErrorCode FNSetFromOptions_Phi(FN fn,PetscOptionItems *PetscOptionsObject) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode FNDuplicate_Phi(FN fn,MPI_Comm comm,FN *newfn) +static PetscErrorCode FNDuplicate_Phi(FN fn,MPI_Comm comm,FN *newfn) { FN_PHI *ctx = (FN_PHI*)fn->data,*ctx2 = (FN_PHI*)(*newfn)->data; @@ -237,7 +237,7 @@ PetscErrorCode FNDuplicate_Phi(FN fn,MPI_Comm comm,FN *newfn) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode FNDestroy_Phi(FN fn) +static PetscErrorCode FNDestroy_Phi(FN fn) { FN_PHI *ctx = (FN_PHI*)fn->data; diff --git a/src/sys/classes/fn/impls/rational/fnrational.c b/src/sys/classes/fn/impls/rational/fnrational.c index bb3c0d637..9ce27088b 100644 --- a/src/sys/classes/fn/impls/rational/fnrational.c +++ b/src/sys/classes/fn/impls/rational/fnrational.c @@ -20,7 +20,7 @@ typedef struct { PetscInt nq; /* length of array qcoeff, q(x) has degree nq-1 */ } FN_RATIONAL; -PetscErrorCode FNEvaluateFunction_Rational(FN fn,PetscScalar x,PetscScalar *y) +static PetscErrorCode FNEvaluateFunction_Rational(FN fn,PetscScalar x,PetscScalar *y) { FN_RATIONAL *ctx = (FN_RATIONAL*)fn->data; PetscInt i; @@ -66,7 +66,7 @@ static PetscErrorCode EvaluatePoly(Mat A,Mat P,Mat W,PetscInt d,PetscScalar *coe PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode FNEvaluateFunctionMat_Rational(FN fn,Mat A,Mat B) +static PetscErrorCode FNEvaluateFunctionMat_Rational(FN fn,Mat A,Mat B) { FN_RATIONAL *ctx = (FN_RATIONAL*)fn->data; Mat P,Q,W,F; @@ -98,7 +98,7 @@ PetscErrorCode FNEvaluateFunctionMat_Rational(FN fn,Mat A,Mat B) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode FNEvaluateFunctionMatVec_Rational(FN fn,Mat A,Vec v) +static PetscErrorCode FNEvaluateFunctionMatVec_Rational(FN fn,Mat A,Vec v) { FN_RATIONAL *ctx = (FN_RATIONAL*)fn->data; Mat P,Q,W,F; @@ -130,7 +130,7 @@ PetscErrorCode FNEvaluateFunctionMatVec_Rational(FN fn,Mat A,Vec v) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode FNEvaluateDerivative_Rational(FN fn,PetscScalar x,PetscScalar *yp) +static PetscErrorCode FNEvaluateDerivative_Rational(FN fn,PetscScalar x,PetscScalar *yp) { FN_RATIONAL *ctx = (FN_RATIONAL*)fn->data; PetscInt i; @@ -162,7 +162,7 @@ PetscErrorCode FNEvaluateDerivative_Rational(FN fn,PetscScalar x,PetscScalar *yp PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode FNView_Rational(FN fn,PetscViewer viewer) +static PetscErrorCode FNView_Rational(FN fn,PetscViewer viewer) { FN_RATIONAL *ctx = (FN_RATIONAL*)fn->data; PetscBool isascii; @@ -421,7 +421,7 @@ PetscErrorCode FNRationalGetDenominator(FN fn,PetscInt *nq,PetscScalar *qcoeff[] PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode FNSetFromOptions_Rational(FN fn,PetscOptionItems *PetscOptionsObject) +static PetscErrorCode FNSetFromOptions_Rational(FN fn,PetscOptionItems *PetscOptionsObject) { #define PARMAX 10 PetscScalar array[PARMAX]; @@ -445,7 +445,7 @@ PetscErrorCode FNSetFromOptions_Rational(FN fn,PetscOptionItems *PetscOptionsObj PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode FNDuplicate_Rational(FN fn,MPI_Comm comm,FN *newfn) +static PetscErrorCode FNDuplicate_Rational(FN fn,MPI_Comm comm,FN *newfn) { FN_RATIONAL *ctx = (FN_RATIONAL*)fn->data,*ctx2 = (FN_RATIONAL*)(*newfn)->data; PetscInt i; @@ -464,7 +464,7 @@ PetscErrorCode FNDuplicate_Rational(FN fn,MPI_Comm comm,FN *newfn) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode FNDestroy_Rational(FN fn) +static PetscErrorCode FNDestroy_Rational(FN fn) { FN_RATIONAL *ctx = (FN_RATIONAL*)fn->data; diff --git a/src/sys/classes/fn/impls/sqrt/fnsqrt.c b/src/sys/classes/fn/impls/sqrt/fnsqrt.c index 95aa8244e..a0af91f49 100644 --- a/src/sys/classes/fn/impls/sqrt/fnsqrt.c +++ b/src/sys/classes/fn/impls/sqrt/fnsqrt.c @@ -14,7 +14,7 @@ #include /*I "slepcfn.h" I*/ #include -PetscErrorCode FNEvaluateFunction_Sqrt(FN fn,PetscScalar x,PetscScalar *y) +static PetscErrorCode FNEvaluateFunction_Sqrt(FN fn,PetscScalar x,PetscScalar *y) { PetscFunctionBegin; #if !defined(PETSC_USE_COMPLEX) @@ -24,7 +24,7 @@ PetscErrorCode FNEvaluateFunction_Sqrt(FN fn,PetscScalar x,PetscScalar *y) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode FNEvaluateDerivative_Sqrt(FN fn,PetscScalar x,PetscScalar *y) +static PetscErrorCode FNEvaluateDerivative_Sqrt(FN fn,PetscScalar x,PetscScalar *y) { PetscFunctionBegin; PetscCheck(x!=0.0,PETSC_COMM_SELF,PETSC_ERR_ARG_OUTOFRANGE,"Derivative not defined in the requested value"); @@ -35,7 +35,7 @@ PetscErrorCode FNEvaluateDerivative_Sqrt(FN fn,PetscScalar x,PetscScalar *y) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode FNEvaluateFunctionMat_Sqrt_Schur(FN fn,Mat A,Mat B) +static PetscErrorCode FNEvaluateFunctionMat_Sqrt_Schur(FN fn,Mat A,Mat B) { PetscBLASInt n=0; PetscScalar *T; @@ -51,7 +51,7 @@ PetscErrorCode FNEvaluateFunctionMat_Sqrt_Schur(FN fn,Mat A,Mat B) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode FNEvaluateFunctionMatVec_Sqrt_Schur(FN fn,Mat A,Vec v) +static PetscErrorCode FNEvaluateFunctionMatVec_Sqrt_Schur(FN fn,Mat A,Vec v) { PetscBLASInt n=0; PetscScalar *T; @@ -70,7 +70,7 @@ PetscErrorCode FNEvaluateFunctionMatVec_Sqrt_Schur(FN fn,Mat A,Vec v) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode FNEvaluateFunctionMat_Sqrt_DBP(FN fn,Mat A,Mat B) +static PetscErrorCode FNEvaluateFunctionMat_Sqrt_DBP(FN fn,Mat A,Mat B) { PetscBLASInt n=0; PetscScalar *T; @@ -86,7 +86,7 @@ PetscErrorCode FNEvaluateFunctionMat_Sqrt_DBP(FN fn,Mat A,Mat B) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode FNEvaluateFunctionMat_Sqrt_NS(FN fn,Mat A,Mat B) +static PetscErrorCode FNEvaluateFunctionMat_Sqrt_NS(FN fn,Mat A,Mat B) { PetscBLASInt n=0; PetscScalar *Ba; @@ -294,7 +294,7 @@ PetscErrorCode FNSqrtmSadeghi_CUDAm(FN fn,PetscBLASInt n,PetscScalar *d_A,PetscB #endif /* PETSC_HAVE_MAGMA */ #endif /* PETSC_HAVE_CUDA */ -PetscErrorCode FNEvaluateFunctionMat_Sqrt_Sadeghi(FN fn,Mat A,Mat B) +static PetscErrorCode FNEvaluateFunctionMat_Sqrt_Sadeghi(FN fn,Mat A,Mat B) { PetscBLASInt n=0; PetscScalar *Ba; @@ -362,7 +362,7 @@ PetscErrorCode FNEvaluateFunctionMat_Sqrt_Sadeghi_CUDAm(FN fn,Mat A,Mat B) #endif /* PETSC_HAVE_MAGMA */ #endif /* PETSC_HAVE_CUDA */ -PetscErrorCode FNView_Sqrt(FN fn,PetscViewer viewer) +static PetscErrorCode FNView_Sqrt(FN fn,PetscViewer viewer) { PetscBool isascii; char str[50]; diff --git a/src/sys/classes/fn/interface/fnbasic.c b/src/sys/classes/fn/interface/fnbasic.c index 955347105..9466e310f 100644 --- a/src/sys/classes/fn/interface/fnbasic.c +++ b/src/sys/classes/fn/interface/fnbasic.c @@ -589,7 +589,7 @@ static PetscErrorCode FNEvaluateFunctionMat_Sym_Default(FN fn,Mat A,Mat B) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode FNEvaluateFunctionMat_Basic(FN fn,Mat A,Mat F) +static PetscErrorCode FNEvaluateFunctionMat_Basic(FN fn,Mat A,Mat F) { PetscBool iscuda; diff --git a/src/sys/classes/rg/impls/ellipse/rgellipse.c b/src/sys/classes/rg/impls/ellipse/rgellipse.c index 224b0bbee..48cd354c0 100644 --- a/src/sys/classes/rg/impls/ellipse/rgellipse.c +++ b/src/sys/classes/rg/impls/ellipse/rgellipse.c @@ -111,7 +111,7 @@ PetscErrorCode RGEllipseGetParameters(RG rg,PetscScalar *center,PetscReal *radiu PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode RGView_Ellipse(RG rg,PetscViewer viewer) +static PetscErrorCode RGView_Ellipse(RG rg,PetscViewer viewer) { RG_ELLIPSE *ctx = (RG_ELLIPSE*)rg->data; PetscBool isdraw,isascii; @@ -154,7 +154,7 @@ PetscErrorCode RGView_Ellipse(RG rg,PetscViewer viewer) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode RGIsTrivial_Ellipse(RG rg,PetscBool *trivial) +static PetscErrorCode RGIsTrivial_Ellipse(RG rg,PetscBool *trivial) { RG_ELLIPSE *ctx = (RG_ELLIPSE*)rg->data; @@ -164,7 +164,7 @@ PetscErrorCode RGIsTrivial_Ellipse(RG rg,PetscBool *trivial) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode RGComputeContour_Ellipse(RG rg,PetscInt n,PetscScalar *cr,PetscScalar *ci) +static PetscErrorCode RGComputeContour_Ellipse(RG rg,PetscInt n,PetscScalar *cr,PetscScalar *ci) { RG_ELLIPSE *ctx = (RG_ELLIPSE*)rg->data; PetscReal theta; @@ -183,7 +183,7 @@ PetscErrorCode RGComputeContour_Ellipse(RG rg,PetscInt n,PetscScalar *cr,PetscSc PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode RGComputeBoundingBox_Ellipse(RG rg,PetscReal *a,PetscReal *b,PetscReal *c,PetscReal *d) +static PetscErrorCode RGComputeBoundingBox_Ellipse(RG rg,PetscReal *a,PetscReal *b,PetscReal *c,PetscReal *d) { RG_ELLIPSE *ctx = (RG_ELLIPSE*)rg->data; @@ -195,7 +195,7 @@ PetscErrorCode RGComputeBoundingBox_Ellipse(RG rg,PetscReal *a,PetscReal *b,Pets PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode RGComputeQuadrature_Ellipse(RG rg,RGQuadRule quad,PetscInt n,PetscScalar *z,PetscScalar *zn,PetscScalar *w) +static PetscErrorCode RGComputeQuadrature_Ellipse(RG rg,RGQuadRule quad,PetscInt n,PetscScalar *z,PetscScalar *zn,PetscScalar *w) { RG_ELLIPSE *ctx = (RG_ELLIPSE*)rg->data; PetscReal theta; @@ -217,7 +217,7 @@ PetscErrorCode RGComputeQuadrature_Ellipse(RG rg,RGQuadRule quad,PetscInt n,Pets PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode RGCheckInside_Ellipse(RG rg,PetscReal px,PetscReal py,PetscInt *inside) +static PetscErrorCode RGCheckInside_Ellipse(RG rg,PetscReal px,PetscReal py,PetscInt *inside) { RG_ELLIPSE *ctx = (RG_ELLIPSE*)rg->data; PetscReal dx,dy,r; @@ -235,7 +235,7 @@ PetscErrorCode RGCheckInside_Ellipse(RG rg,PetscReal px,PetscReal py,PetscInt *i PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode RGIsAxisymmetric_Ellipse(RG rg,PetscBool vertical,PetscBool *symm) +static PetscErrorCode RGIsAxisymmetric_Ellipse(RG rg,PetscBool vertical,PetscBool *symm) { RG_ELLIPSE *ctx = (RG_ELLIPSE*)rg->data; @@ -245,7 +245,7 @@ PetscErrorCode RGIsAxisymmetric_Ellipse(RG rg,PetscBool vertical,PetscBool *symm PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode RGSetFromOptions_Ellipse(RG rg,PetscOptionItems *PetscOptionsObject) +static PetscErrorCode RGSetFromOptions_Ellipse(RG rg,PetscOptionItems *PetscOptionsObject) { PetscScalar s; PetscReal r1,r2; @@ -264,7 +264,7 @@ PetscErrorCode RGSetFromOptions_Ellipse(RG rg,PetscOptionItems *PetscOptionsObje PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode RGDestroy_Ellipse(RG rg) +static PetscErrorCode RGDestroy_Ellipse(RG rg) { PetscFunctionBegin; PetscCall(PetscFree(rg->data)); diff --git a/src/sys/classes/rg/impls/interval/rginterval.c b/src/sys/classes/rg/impls/interval/rginterval.c index 27f32745b..6264914e9 100644 --- a/src/sys/classes/rg/impls/interval/rginterval.c +++ b/src/sys/classes/rg/impls/interval/rginterval.c @@ -117,7 +117,7 @@ PetscErrorCode RGIntervalGetEndpoints(RG rg,PetscReal *a,PetscReal *b,PetscReal PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode RGView_Interval(RG rg,PetscViewer viewer) +static PetscErrorCode RGView_Interval(RG rg,PetscViewer viewer) { RG_INTERVAL *ctx = (RG_INTERVAL*)rg->data; PetscBool isdraw,isascii; @@ -158,7 +158,7 @@ PetscErrorCode RGView_Interval(RG rg,PetscViewer viewer) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode RGIsTrivial_Interval(RG rg,PetscBool *trivial) +static PetscErrorCode RGIsTrivial_Interval(RG rg,PetscBool *trivial) { RG_INTERVAL *ctx = (RG_INTERVAL*)rg->data; @@ -168,7 +168,7 @@ PetscErrorCode RGIsTrivial_Interval(RG rg,PetscBool *trivial) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode RGComputeContour_Interval(RG rg,PetscInt n,PetscScalar *cr,PetscScalar *ci) +static PetscErrorCode RGComputeContour_Interval(RG rg,PetscInt n,PetscScalar *cr,PetscScalar *ci) { RG_INTERVAL *ctx = (RG_INTERVAL*)rg->data; PetscInt i,N,Nv,Nh,k1,k0; @@ -232,7 +232,7 @@ PetscErrorCode RGComputeContour_Interval(RG rg,PetscInt n,PetscScalar *cr,PetscS PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode RGComputeBoundingBox_Interval(RG rg,PetscReal *a,PetscReal *b,PetscReal *c,PetscReal *d) +static PetscErrorCode RGComputeBoundingBox_Interval(RG rg,PetscReal *a,PetscReal *b,PetscReal *c,PetscReal *d) { RG_INTERVAL *ctx = (RG_INTERVAL*)rg->data; @@ -244,7 +244,7 @@ PetscErrorCode RGComputeBoundingBox_Interval(RG rg,PetscReal *a,PetscReal *b,Pet PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode RGComputeQuadrature_Interval(RG rg,RGQuadRule quad,PetscInt n,PetscScalar *z,PetscScalar *zn,PetscScalar *w) +static PetscErrorCode RGComputeQuadrature_Interval(RG rg,RGQuadRule quad,PetscInt n,PetscScalar *z,PetscScalar *zn,PetscScalar *w) { RG_INTERVAL *ctx = (RG_INTERVAL*)rg->data; PetscReal theta,max_w=0.0,radius=1.0; @@ -289,7 +289,7 @@ PetscErrorCode RGComputeQuadrature_Interval(RG rg,RGQuadRule quad,PetscInt n,Pet PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode RGCheckInside_Interval(RG rg,PetscReal dx,PetscReal dy,PetscInt *inside) +static PetscErrorCode RGCheckInside_Interval(RG rg,PetscReal dx,PetscReal dy,PetscInt *inside) { RG_INTERVAL *ctx = (RG_INTERVAL*)rg->data; @@ -305,7 +305,7 @@ PetscErrorCode RGCheckInside_Interval(RG rg,PetscReal dx,PetscReal dy,PetscInt * PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode RGIsAxisymmetric_Interval(RG rg,PetscBool vertical,PetscBool *symm) +static PetscErrorCode RGIsAxisymmetric_Interval(RG rg,PetscBool vertical,PetscBool *symm) { RG_INTERVAL *ctx = (RG_INTERVAL*)rg->data; @@ -315,7 +315,7 @@ PetscErrorCode RGIsAxisymmetric_Interval(RG rg,PetscBool vertical,PetscBool *sym PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode RGSetFromOptions_Interval(RG rg,PetscOptionItems *PetscOptionsObject) +static PetscErrorCode RGSetFromOptions_Interval(RG rg,PetscOptionItems *PetscOptionsObject) { PetscBool flg; PetscInt k; @@ -335,7 +335,7 @@ PetscErrorCode RGSetFromOptions_Interval(RG rg,PetscOptionItems *PetscOptionsObj PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode RGDestroy_Interval(RG rg) +static PetscErrorCode RGDestroy_Interval(RG rg) { PetscFunctionBegin; PetscCall(PetscFree(rg->data)); diff --git a/src/sys/classes/rg/impls/polygon/rgpolygon.c b/src/sys/classes/rg/impls/polygon/rgpolygon.c index 8b9f88e0a..67e96dccb 100644 --- a/src/sys/classes/rg/impls/polygon/rgpolygon.c +++ b/src/sys/classes/rg/impls/polygon/rgpolygon.c @@ -21,7 +21,7 @@ typedef struct { PetscScalar *vr,*vi; /* array of vertices (vi not used in complex scalars) */ } RG_POLYGON; -PetscErrorCode RGComputeBoundingBox_Polygon(RG,PetscReal*,PetscReal*,PetscReal*,PetscReal*); +static PetscErrorCode RGComputeBoundingBox_Polygon(RG,PetscReal*,PetscReal*,PetscReal*,PetscReal*); #if !defined(PETSC_USE_COMPLEX) static PetscBool CheckSymmetry(PetscInt n,PetscScalar *vr,PetscScalar *vi) @@ -176,7 +176,7 @@ PetscErrorCode RGPolygonGetVertices(RG rg,PetscInt *n,PetscScalar **vr,PetscScal PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode RGView_Polygon(RG rg,PetscViewer viewer) +static PetscErrorCode RGView_Polygon(RG rg,PetscViewer viewer) { RG_POLYGON *ctx = (RG_POLYGON*)rg->data; PetscBool isdraw,isascii; @@ -250,7 +250,7 @@ PetscErrorCode RGView_Polygon(RG rg,PetscViewer viewer) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode RGIsTrivial_Polygon(RG rg,PetscBool *trivial) +static PetscErrorCode RGIsTrivial_Polygon(RG rg,PetscBool *trivial) { RG_POLYGON *ctx = (RG_POLYGON*)rg->data; @@ -259,7 +259,7 @@ PetscErrorCode RGIsTrivial_Polygon(RG rg,PetscBool *trivial) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode RGComputeContour_Polygon(RG rg,PetscInt n,PetscScalar *ucr,PetscScalar *uci) +static PetscErrorCode RGComputeContour_Polygon(RG rg,PetscInt n,PetscScalar *ucr,PetscScalar *uci) { RG_POLYGON *ctx = (RG_POLYGON*)rg->data; PetscReal length,h,d,rem=0.0; @@ -329,7 +329,7 @@ PetscErrorCode RGComputeContour_Polygon(RG rg,PetscInt n,PetscScalar *ucr,PetscS PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode RGComputeBoundingBox_Polygon(RG rg,PetscReal *a,PetscReal *b,PetscReal *c,PetscReal *d) +static PetscErrorCode RGComputeBoundingBox_Polygon(RG rg,PetscReal *a,PetscReal *b,PetscReal *c,PetscReal *d) { RG_POLYGON *ctx = (RG_POLYGON*)rg->data; PetscInt i; @@ -355,7 +355,7 @@ PetscErrorCode RGComputeBoundingBox_Polygon(RG rg,PetscReal *a,PetscReal *b,Pets PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode RGCheckInside_Polygon(RG rg,PetscReal px,PetscReal py,PetscInt *inout) +static PetscErrorCode RGCheckInside_Polygon(RG rg,PetscReal px,PetscReal py,PetscInt *inout) { RG_POLYGON *ctx = (RG_POLYGON*)rg->data; PetscReal val,x[VERTMAX],y[VERTMAX]; @@ -393,7 +393,7 @@ PetscErrorCode RGCheckInside_Polygon(RG rg,PetscReal px,PetscReal py,PetscInt *i PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode RGSetFromOptions_Polygon(RG rg,PetscOptionItems *PetscOptionsObject) +static PetscErrorCode RGSetFromOptions_Polygon(RG rg,PetscOptionItems *PetscOptionsObject) { PetscScalar array[VERTMAX]; PetscInt i,k; @@ -423,7 +423,7 @@ PetscErrorCode RGSetFromOptions_Polygon(RG rg,PetscOptionItems *PetscOptionsObje PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode RGDestroy_Polygon(RG rg) +static PetscErrorCode RGDestroy_Polygon(RG rg) { RG_POLYGON *ctx = (RG_POLYGON*)rg->data; diff --git a/src/sys/classes/rg/impls/ring/rgring.c b/src/sys/classes/rg/impls/ring/rgring.c index b3025f72f..d5e369549 100644 --- a/src/sys/classes/rg/impls/ring/rgring.c +++ b/src/sys/classes/rg/impls/ring/rgring.c @@ -166,7 +166,7 @@ PetscErrorCode RGRingGetParameters(RG rg,PetscScalar *center,PetscReal *radius,P PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode RGView_Ring(RG rg,PetscViewer viewer) +static PetscErrorCode RGView_Ring(RG rg,PetscViewer viewer) { RG_RING *ctx = (RG_RING*)rg->data; int winw,winh; @@ -229,7 +229,7 @@ PetscErrorCode RGView_Ring(RG rg,PetscViewer viewer) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode RGIsTrivial_Ring(RG rg,PetscBool *trivial) +static PetscErrorCode RGIsTrivial_Ring(RG rg,PetscBool *trivial) { RG_RING *ctx = (RG_RING*)rg->data; @@ -239,7 +239,7 @@ PetscErrorCode RGIsTrivial_Ring(RG rg,PetscBool *trivial) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode RGComputeContour_Ring(RG rg,PetscInt n,PetscScalar *cr,PetscScalar *ci) +static PetscErrorCode RGComputeContour_Ring(RG rg,PetscInt n,PetscScalar *cr,PetscScalar *ci) { RG_RING *ctx = (RG_RING*)rg->data; PetscReal theta,start_ang; @@ -269,7 +269,7 @@ PetscErrorCode RGComputeContour_Ring(RG rg,PetscInt n,PetscScalar *cr,PetscScala PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode RGComputeBoundingBox_Ring(RG rg,PetscReal *a,PetscReal *b,PetscReal *c,PetscReal *d) +static PetscErrorCode RGComputeBoundingBox_Ring(RG rg,PetscReal *a,PetscReal *b,PetscReal *c,PetscReal *d) { RG_RING *ctx = (RG_RING*)rg->data; @@ -282,7 +282,7 @@ PetscErrorCode RGComputeBoundingBox_Ring(RG rg,PetscReal *a,PetscReal *b,PetscRe PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode RGComputeQuadrature_Ring(RG rg,RGQuadRule quad,PetscInt n,PetscScalar *z,PetscScalar *zn,PetscScalar *w) +static PetscErrorCode RGComputeQuadrature_Ring(RG rg,RGQuadRule quad,PetscInt n,PetscScalar *z,PetscScalar *zn,PetscScalar *w) { RG_RING *ctx = (RG_RING*)rg->data; PetscReal max_w=0.0; @@ -319,7 +319,7 @@ PetscErrorCode RGComputeQuadrature_Ring(RG rg,RGQuadRule quad,PetscInt n,PetscSc PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode RGCheckInside_Ring(RG rg,PetscReal px,PetscReal py,PetscInt *inside) +static PetscErrorCode RGCheckInside_Ring(RG rg,PetscReal px,PetscReal py,PetscInt *inside) { RG_RING *ctx = (RG_RING*)rg->data; PetscReal dx,dy,r; @@ -371,7 +371,7 @@ PetscErrorCode RGCheckInside_Ring(RG rg,PetscReal px,PetscReal py,PetscInt *insi PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode RGIsAxisymmetric_Ring(RG rg,PetscBool vertical,PetscBool *symm) +static PetscErrorCode RGIsAxisymmetric_Ring(RG rg,PetscBool vertical,PetscBool *symm) { RG_RING *ctx = (RG_RING*)rg->data; @@ -381,7 +381,7 @@ PetscErrorCode RGIsAxisymmetric_Ring(RG rg,PetscBool vertical,PetscBool *symm) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode RGSetFromOptions_Ring(RG rg,PetscOptionItems *PetscOptionsObject) +static PetscErrorCode RGSetFromOptions_Ring(RG rg,PetscOptionItems *PetscOptionsObject) { PetscScalar s; PetscReal r1,r2,r3,r4,r5; @@ -403,7 +403,7 @@ PetscErrorCode RGSetFromOptions_Ring(RG rg,PetscOptionItems *PetscOptionsObject) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode RGDestroy_Ring(RG rg) +static PetscErrorCode RGDestroy_Ring(RG rg) { PetscFunctionBegin; PetscCall(PetscFree(rg->data)); diff --git a/src/sys/classes/st/impls/cayley/cayley.c b/src/sys/classes/st/impls/cayley/cayley.c index 747936490..595960b1c 100644 --- a/src/sys/classes/st/impls/cayley/cayley.c +++ b/src/sys/classes/st/impls/cayley/cayley.c @@ -71,7 +71,7 @@ static PetscErrorCode MatMultTranspose_Cayley(Mat B,Vec x,Vec y) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode STGetBilinearForm_Cayley(ST st,Mat *B) +static PetscErrorCode STGetBilinearForm_Cayley(ST st,Mat *B) { PetscFunctionBegin; PetscCall(STSetUp(st)); @@ -80,7 +80,7 @@ PetscErrorCode STGetBilinearForm_Cayley(ST st,Mat *B) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode STBackTransform_Cayley(ST st,PetscInt n,PetscScalar *eigr,PetscScalar *eigi) +static PetscErrorCode STBackTransform_Cayley(ST st,PetscInt n,PetscScalar *eigr,PetscScalar *eigi) { ST_CAYLEY *ctx = (ST_CAYLEY*)st->data; PetscInt j; @@ -110,7 +110,7 @@ PetscErrorCode STBackTransform_Cayley(ST st,PetscInt n,PetscScalar *eigr,PetscSc PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode STPostSolve_Cayley(ST st) +static PetscErrorCode STPostSolve_Cayley(ST st) { PetscFunctionBegin; if (st->matmode == ST_MATMODE_INPLACE) { @@ -129,7 +129,7 @@ PetscErrorCode STPostSolve_Cayley(ST st) if nmat=1: (A-sI)^-1 (A+tI) A-sI A+tI if nmat=2: (A-sB)^-1 (A+tB) A-sB A+tI */ -PetscErrorCode STComputeOperator_Cayley(ST st) +static PetscErrorCode STComputeOperator_Cayley(ST st) { PetscInt n,m; ST_CAYLEY *ctx = (ST_CAYLEY*)st->data; @@ -162,7 +162,7 @@ PetscErrorCode STComputeOperator_Cayley(ST st) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode STSetUp_Cayley(ST st) +static PetscErrorCode STSetUp_Cayley(ST st) { PetscFunctionBegin; PetscCheck(st->nmat<=2,PetscObjectComm((PetscObject)st),PETSC_ERR_SUP,"Cayley transform cannot be used in polynomial eigenproblems"); @@ -171,7 +171,7 @@ PetscErrorCode STSetUp_Cayley(ST st) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode STSetShift_Cayley(ST st,PetscScalar newshift) +static PetscErrorCode STSetShift_Cayley(ST st,PetscScalar newshift) { ST_CAYLEY *ctx = (ST_CAYLEY*)st->data; @@ -197,7 +197,7 @@ PetscErrorCode STSetShift_Cayley(ST st,PetscScalar newshift) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode STSetFromOptions_Cayley(ST st,PetscOptionItems *PetscOptionsObject) +static PetscErrorCode STSetFromOptions_Cayley(ST st,PetscOptionItems *PetscOptionsObject) { PetscScalar nu; PetscBool flg; @@ -292,7 +292,7 @@ PetscErrorCode STCayleyGetAntishift(ST st,PetscScalar *nu) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode STView_Cayley(ST st,PetscViewer viewer) +static PetscErrorCode STView_Cayley(ST st,PetscViewer viewer) { char str[50]; ST_CAYLEY *ctx = (ST_CAYLEY*)st->data; @@ -307,7 +307,7 @@ PetscErrorCode STView_Cayley(ST st,PetscViewer viewer) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode STDestroy_Cayley(ST st) +static PetscErrorCode STDestroy_Cayley(ST st) { PetscFunctionBegin; PetscCall(PetscFree(st->data)); diff --git a/src/sys/classes/st/impls/filter/filter.c b/src/sys/classes/st/impls/filter/filter.c index 39df7db22..d80c278df 100644 --- a/src/sys/classes/st/impls/filter/filter.c +++ b/src/sys/classes/st/impls/filter/filter.c @@ -19,7 +19,7 @@ Op P M if nmat=1: p(A) NULL p(A) */ -PetscErrorCode STComputeOperator_Filter(ST st) +static PetscErrorCode STComputeOperator_Filter(ST st) { ST_FILTER *ctx = (ST_FILTER*)st->data; @@ -39,14 +39,14 @@ PetscErrorCode STComputeOperator_Filter(ST st) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode STSetUp_Filter(ST st) +static PetscErrorCode STSetUp_Filter(ST st) { PetscFunctionBegin; PetscCall(STSetWorkVecs(st,4)); PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode STSetFromOptions_Filter(ST st,PetscOptionItems *PetscOptionsObject) +static PetscErrorCode STSetFromOptions_Filter(ST st,PetscOptionItems *PetscOptionsObject) { PetscReal array[2]={0,0}; PetscInt k; @@ -357,7 +357,7 @@ PetscErrorCode STFilterGetThreshold(ST st,PetscReal *gamma) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode STReset_Filter(ST st) +static PetscErrorCode STReset_Filter(ST st) { ST_FILTER *ctx = (ST_FILTER*)st->data; @@ -370,7 +370,7 @@ PetscErrorCode STReset_Filter(ST st) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode STView_Filter(ST st,PetscViewer viewer) +static PetscErrorCode STView_Filter(ST st,PetscViewer viewer) { ST_FILTER *ctx = (ST_FILTER*)st->data; PetscBool isascii; @@ -386,7 +386,7 @@ PetscErrorCode STView_Filter(ST st,PetscViewer viewer) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode STDestroy_Filter(ST st) +static PetscErrorCode STDestroy_Filter(ST st) { ST_FILTER *ctx = (ST_FILTER*)st->data; diff --git a/src/sys/classes/st/impls/filter/filtlan.c b/src/sys/classes/st/impls/filter/filtlan.c index ac44675d2..e7917b80c 100644 --- a/src/sys/classes/st/impls/filter/filtlan.c +++ b/src/sys/classes/st/impls/filter/filtlan.c @@ -955,7 +955,7 @@ static PetscErrorCode FILTLAN_FilteredConjugateResidualMatrixPolynomialVectorPro /* Gateway to FILTLAN for evaluating y=p(A)*x */ -PetscErrorCode MatMult_FILTLAN(Mat A,Vec x,Vec y) +static PetscErrorCode MatMult_FILTLAN(Mat A,Vec x,Vec y) { ST st; ST_FILTER *ctx; @@ -1049,7 +1049,7 @@ static PetscErrorCode FILTLAN_FilteredConjugateResidualMatrixPolynomialVectorPro /* Gateway to FILTLAN for evaluating C=p(A)*B */ -PetscErrorCode MatMatMult_FILTLAN(Mat A,Mat B,Mat C,void *pctx) +static PetscErrorCode MatMatMult_FILTLAN(Mat A,Mat B,Mat C,void *pctx) { ST st; ST_FILTER *ctx; diff --git a/src/sys/classes/st/impls/precond/precond.c b/src/sys/classes/st/impls/precond/precond.c index d267c55bf..e6f9e6899 100644 --- a/src/sys/classes/st/impls/precond/precond.c +++ b/src/sys/classes/st/impls/precond/precond.c @@ -39,7 +39,7 @@ static PetscErrorCode STSetDefaultKSP_Precond(ST st) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode STPostSolve_Precond(ST st) +static PetscErrorCode STPostSolve_Precond(ST st) { PetscFunctionBegin; if (st->matmode == ST_MATMODE_INPLACE && !(st->Pmat || (PetscAbsScalar(st->sigma)>=PETSC_MAX_REAL && st->nmat>1))) { @@ -58,7 +58,7 @@ PetscErrorCode STPostSolve_Precond(ST st) if nmat=1: --- A-sI NULL if nmat=2: --- A-sB NULL */ -PetscErrorCode STComputeOperator_Precond(ST st) +static PetscErrorCode STComputeOperator_Precond(ST st) { PetscFunctionBegin; /* if the user did not set the shift, use the target value */ @@ -97,7 +97,7 @@ PetscErrorCode STComputeOperator_Precond(ST st) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode STSetUp_Precond(ST st) +static PetscErrorCode STSetUp_Precond(ST st) { ST_PRECOND *ctx = (ST_PRECOND*)st->data; @@ -109,7 +109,7 @@ PetscErrorCode STSetUp_Precond(ST st) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode STSetShift_Precond(ST st,PetscScalar newshift) +static PetscErrorCode STSetShift_Precond(ST st,PetscScalar newshift) { ST_PRECOND *ctx = (ST_PRECOND*)st->data; @@ -205,7 +205,7 @@ PetscErrorCode STPrecondGetKSPHasMat(ST st,PetscBool *ksphasmat) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode STDestroy_Precond(ST st) +static PetscErrorCode STDestroy_Precond(ST st) { PetscFunctionBegin; PetscCall(PetscFree(st->data)); diff --git a/src/sys/classes/st/impls/shell/shell.c b/src/sys/classes/st/impls/shell/shell.c index 2832721dd..1fc5cac97 100644 --- a/src/sys/classes/st/impls/shell/shell.c +++ b/src/sys/classes/st/impls/shell/shell.c @@ -82,7 +82,7 @@ PetscErrorCode STShellSetContext(ST st,void *ctx) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode STApply_Shell(ST st,Vec x,Vec y) +static PetscErrorCode STApply_Shell(ST st,Vec x,Vec y) { ST_SHELL *shell = (ST_SHELL*)st->data; PetscObjectState instate,outstate; @@ -99,7 +99,7 @@ PetscErrorCode STApply_Shell(ST st,Vec x,Vec y) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode STApplyTranspose_Shell(ST st,Vec x,Vec y) +static PetscErrorCode STApplyTranspose_Shell(ST st,Vec x,Vec y) { ST_SHELL *shell = (ST_SHELL*)st->data; PetscObjectState instate,outstate; @@ -116,7 +116,7 @@ PetscErrorCode STApplyTranspose_Shell(ST st,Vec x,Vec y) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode STBackTransform_Shell(ST st,PetscInt n,PetscScalar *eigr,PetscScalar *eigi) +static PetscErrorCode STBackTransform_Shell(ST st,PetscInt n,PetscScalar *eigr,PetscScalar *eigi) { ST_SHELL *shell = (ST_SHELL*)st->data; @@ -137,7 +137,7 @@ PetscErrorCode STIsInjective_Shell(ST st,PetscBool* is) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode STDestroy_Shell(ST st) +static PetscErrorCode STDestroy_Shell(ST st) { PetscFunctionBegin; PetscCall(PetscFree(st->data)); diff --git a/src/sys/classes/st/impls/shift/shift.c b/src/sys/classes/st/impls/shift/shift.c index 666f90d6d..b2b42547e 100644 --- a/src/sys/classes/st/impls/shift/shift.c +++ b/src/sys/classes/st/impls/shift/shift.c @@ -14,7 +14,7 @@ #include -PetscErrorCode STBackTransform_Shift(ST st,PetscInt n,PetscScalar *eigr,PetscScalar *eigi) +static PetscErrorCode STBackTransform_Shift(ST st,PetscInt n,PetscScalar *eigr,PetscScalar *eigi) { PetscInt j; @@ -25,7 +25,7 @@ PetscErrorCode STBackTransform_Shift(ST st,PetscInt n,PetscScalar *eigr,PetscSca PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode STPostSolve_Shift(ST st) +static PetscErrorCode STPostSolve_Shift(ST st) { PetscFunctionBegin; if (st->matmode == ST_MATMODE_INPLACE) { @@ -44,7 +44,7 @@ PetscErrorCode STPostSolve_Shift(ST st) if nmat=1: A-sI NULL A-sI if nmat=2: B^-1 (A-sB) B A-sB */ -PetscErrorCode STComputeOperator_Shift(ST st) +static PetscErrorCode STComputeOperator_Shift(ST st) { PetscFunctionBegin; st->usesksp = (st->nmat>1)? PETSC_TRUE: PETSC_FALSE; @@ -64,7 +64,7 @@ PetscErrorCode STComputeOperator_Shift(ST st) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode STSetUp_Shift(ST st) +static PetscErrorCode STSetUp_Shift(ST st) { PetscInt k,nc,nmat=st->nmat; PetscScalar *coeffs=NULL; @@ -103,7 +103,7 @@ PetscErrorCode STSetUp_Shift(ST st) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode STSetShift_Shift(ST st,PetscScalar newshift) +static PetscErrorCode STSetShift_Shift(ST st,PetscScalar newshift) { PetscInt k,nc,nmat=PetscMax(st->nmat,2); PetscScalar *coeffs=NULL; diff --git a/src/sys/classes/st/impls/sinvert/sinvert.c b/src/sys/classes/st/impls/sinvert/sinvert.c index c39b49fb3..252e27aa1 100644 --- a/src/sys/classes/st/impls/sinvert/sinvert.c +++ b/src/sys/classes/st/impls/sinvert/sinvert.c @@ -13,7 +13,7 @@ #include -PetscErrorCode STBackTransform_Sinvert(ST st,PetscInt n,PetscScalar *eigr,PetscScalar *eigi) +static PetscErrorCode STBackTransform_Sinvert(ST st,PetscInt n,PetscScalar *eigr,PetscScalar *eigi) { PetscInt j; #if !defined(PETSC_USE_COMPLEX) @@ -38,7 +38,7 @@ PetscErrorCode STBackTransform_Sinvert(ST st,PetscInt n,PetscScalar *eigr,PetscS PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode STPostSolve_Sinvert(ST st) +static PetscErrorCode STPostSolve_Sinvert(ST st) { PetscFunctionBegin; if (st->matmode == ST_MATMODE_INPLACE) { @@ -57,7 +57,7 @@ PetscErrorCode STPostSolve_Sinvert(ST st) if nmat=1: (A-sI)^-1 A-sI NULL if nmat=2: (A-sB)^-1 B A-sB B */ -PetscErrorCode STComputeOperator_Sinvert(ST st) +static PetscErrorCode STComputeOperator_Sinvert(ST st) { PetscFunctionBegin; /* if the user did not set the shift, use the target value */ @@ -76,7 +76,7 @@ PetscErrorCode STComputeOperator_Sinvert(ST st) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode STSetUp_Sinvert(ST st) +static PetscErrorCode STSetUp_Sinvert(ST st) { PetscInt k,nc,nmat=st->nmat; PetscScalar *coeffs=NULL; @@ -117,7 +117,7 @@ PetscErrorCode STSetUp_Sinvert(ST st) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode STSetShift_Sinvert(ST st,PetscScalar newshift) +static PetscErrorCode STSetShift_Sinvert(ST st,PetscScalar newshift) { PetscInt nmat=PetscMax(st->nmat,2),k,nc; PetscScalar *coeffs=NULL; diff --git a/src/sys/vec/veccomp0.h b/src/sys/vec/veccomp0.h index 86bbefdbf..b7e713bb2 100644 --- a/src/sys/vec/veccomp0.h +++ b/src/sys/vec/veccomp0.h @@ -19,7 +19,7 @@ #define __QUOTEME(x) __QUOTEME_(x) #define __SUF_C__(A) __QUOTEME(__SUF__(A)) -PetscErrorCode __SUF__(VecDot_Comp)(Vec a,Vec b,PetscScalar *z) +static PetscErrorCode __SUF__(VecDot_Comp)(Vec a,Vec b,PetscScalar *z) { PetscScalar sum = 0.0,work; PetscInt i; @@ -47,7 +47,7 @@ PetscErrorCode __SUF__(VecDot_Comp)(Vec a,Vec b,PetscScalar *z) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode __SUF__(VecMDot_Comp)(Vec a,PetscInt n,const Vec b[],PetscScalar *z) +static PetscErrorCode __SUF__(VecMDot_Comp)(Vec a,PetscInt n,const Vec b[],PetscScalar *z) { PetscScalar *work,*work0,*r; Vec_Comp *as = (Vec_Comp*)a->data; @@ -95,7 +95,7 @@ PetscErrorCode __SUF__(VecMDot_Comp)(Vec a,PetscInt n,const Vec b[],PetscScalar PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode __SUF__(VecTDot_Comp)(Vec a,Vec b,PetscScalar *z) +static PetscErrorCode __SUF__(VecTDot_Comp)(Vec a,Vec b,PetscScalar *z) { PetscScalar sum = 0.0,work; PetscInt i; @@ -123,7 +123,7 @@ PetscErrorCode __SUF__(VecTDot_Comp)(Vec a,Vec b,PetscScalar *z) PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode __SUF__(VecMTDot_Comp)(Vec a,PetscInt n,const Vec b[],PetscScalar *z) +static PetscErrorCode __SUF__(VecMTDot_Comp)(Vec a,PetscInt n,const Vec b[],PetscScalar *z) { PetscScalar *work,*work0,*r; Vec_Comp *as = (Vec_Comp*)a->data; @@ -171,7 +171,7 @@ PetscErrorCode __SUF__(VecMTDot_Comp)(Vec a,PetscInt n,const Vec b[],PetscScalar PetscFunctionReturn(PETSC_SUCCESS); } -PetscErrorCode __SUF__(VecNorm_Comp)(Vec a,NormType t,PetscReal *norm) +static PetscErrorCode __SUF__(VecNorm_Comp)(Vec a,NormType t,PetscReal *norm) { PetscReal work[3],s=0.0; Vec_Comp *as = (Vec_Comp*)a->data; From f57be21c091d7a53ca52358adcc2035fc69ec640 Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Tue, 15 Aug 2023 17:01:56 +0200 Subject: [PATCH 099/112] Omit a couple of functions in linter --- src/sys/classes/bv/interface/bvfunc.c | 2 +- src/sys/slepcutil.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sys/classes/bv/interface/bvfunc.c b/src/sys/classes/bv/interface/bvfunc.c index b7cb8e448..709c3e9b1 100644 --- a/src/sys/classes/bv/interface/bvfunc.c +++ b/src/sys/classes/bv/interface/bvfunc.c @@ -657,7 +657,7 @@ PetscErrorCode BVAllocateWork_Private(BV bv,PetscInt s) PetscFunctionReturn(PETSC_SUCCESS); } -#if defined(PETSC_USE_DEBUG) +#if defined(PETSC_USE_DEBUG) && !defined(PETSC_CLANG_STATIC_ANALYZER) /* SlepcDebugBVView - partially view a BV object, to be used from within a debugger. diff --git a/src/sys/slepcutil.c b/src/sys/slepcutil.c index ab20219e4..0bada897d 100644 --- a/src/sys/slepcutil.c +++ b/src/sys/slepcutil.c @@ -192,7 +192,7 @@ PetscErrorCode SlepcDebugViewMatrix(PetscInt nrows,PetscInt ncols,PetscScalar *X /* SlepcDebugSetMatlabStdout - sets Matlab format in stdout, to be used from within a debugger. */ -#if defined(PETSC_USE_DEBUG) +#if defined(PETSC_USE_DEBUG) && !defined(PETSC_CLANG_STATIC_ANALYZER) PETSC_UNUSED PetscErrorCode SlepcDebugSetMatlabStdout(void) { PetscViewer viewer; From e6749ee7a18f73f2006bf7aaeb27894e4ff29e98 Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Wed, 16 Aug 2023 20:10:19 +0200 Subject: [PATCH 100/112] Prune internal function visibility using SLEPC_SINGLE_LIBRARY_INTERN --- include/slepc/private/slepccontour.h | 14 +++++++------- include/slepc/private/slepcimpl.h | 8 ++++---- include/slepc/private/vecimplslepc.h | 8 ++++---- include/slepcsys.h | 8 ++++++++ src/sys/vec/pool.c | 16 ++++++++-------- 5 files changed, 31 insertions(+), 23 deletions(-) diff --git a/include/slepc/private/slepccontour.h b/include/slepc/private/slepccontour.h index 4a0f086e6..92a3db4fd 100644 --- a/include/slepc/private/slepccontour.h +++ b/include/slepc/private/slepccontour.h @@ -29,8 +29,8 @@ static inline PetscErrorCode CISS_BlockHankel(PetscScalar *Mu,PetscInt s,PetscIn PetscFunctionReturn(PETSC_SUCCESS); } -SLEPC_EXTERN PetscErrorCode SlepcCISS_isGhost(Mat,PetscInt,PetscReal*,PetscReal,PetscBool*); -SLEPC_EXTERN PetscErrorCode SlepcCISS_BH_SVD(PetscScalar*,PetscInt,PetscReal,PetscReal*,PetscInt*); +SLEPC_SINGLE_LIBRARY_INTERN PetscErrorCode SlepcCISS_isGhost(Mat,PetscInt,PetscReal*,PetscReal,PetscBool*); +SLEPC_SINGLE_LIBRARY_INTERN PetscErrorCode SlepcCISS_BH_SVD(PetscScalar*,PetscInt,PetscReal,PetscReal*,PetscInt*); /* Data structures and functions for contour integral methods (used in several classes) */ struct _n_SlepcContourData { @@ -47,11 +47,11 @@ struct _n_SlepcContourData { }; typedef struct _n_SlepcContourData* SlepcContourData; -SLEPC_EXTERN PetscErrorCode SlepcContourDataCreate(PetscInt,PetscInt,PetscObject,SlepcContourData*); -SLEPC_EXTERN PetscErrorCode SlepcContourDataReset(SlepcContourData); -SLEPC_EXTERN PetscErrorCode SlepcContourDataDestroy(SlepcContourData*); +SLEPC_SINGLE_LIBRARY_INTERN PetscErrorCode SlepcContourDataCreate(PetscInt,PetscInt,PetscObject,SlepcContourData*); +SLEPC_SINGLE_LIBRARY_INTERN PetscErrorCode SlepcContourDataReset(SlepcContourData); +SLEPC_SINGLE_LIBRARY_INTERN PetscErrorCode SlepcContourDataDestroy(SlepcContourData*); -SLEPC_EXTERN PetscErrorCode SlepcContourRedundantMat(SlepcContourData,PetscInt,Mat*,Mat*); -SLEPC_EXTERN PetscErrorCode SlepcContourScatterCreate(SlepcContourData,Vec); +SLEPC_SINGLE_LIBRARY_INTERN PetscErrorCode SlepcContourRedundantMat(SlepcContourData,PetscInt,Mat*,Mat*); +SLEPC_SINGLE_LIBRARY_INTERN PetscErrorCode SlepcContourScatterCreate(SlepcContourData,Vec); #endif diff --git a/include/slepc/private/slepcimpl.h b/include/slepc/private/slepcimpl.h index cbc245cfd..c93a5735e 100644 --- a/include/slepc/private/slepcimpl.h +++ b/include/slepc/private/slepcimpl.h @@ -112,10 +112,10 @@ static inline PetscErrorCode SlepcViewEigenvector(PetscViewer viewer,Vec xr,Vec #endif /* Private functions that are shared by several classes */ -SLEPC_EXTERN PetscErrorCode SlepcBasisReference_Private(PetscInt,Vec*,PetscInt*,Vec**); -SLEPC_EXTERN PetscErrorCode SlepcBasisDestroy_Private(PetscInt*,Vec**); -SLEPC_EXTERN PetscErrorCode SlepcMonitorMakeKey_Internal(const char[],PetscViewerType,PetscViewerFormat,char[]); -SLEPC_EXTERN PetscErrorCode PetscViewerAndFormatCreate_Internal(PetscViewer,PetscViewerFormat,void*,PetscViewerAndFormat**); +SLEPC_SINGLE_LIBRARY_INTERN PetscErrorCode SlepcBasisReference_Private(PetscInt,Vec*,PetscInt*,Vec**); +SLEPC_SINGLE_LIBRARY_INTERN PetscErrorCode SlepcBasisDestroy_Private(PetscInt*,Vec**); +SLEPC_SINGLE_LIBRARY_INTERN PetscErrorCode SlepcMonitorMakeKey_Internal(const char[],PetscViewerType,PetscViewerFormat,char[]); +SLEPC_SINGLE_LIBRARY_INTERN PetscErrorCode PetscViewerAndFormatCreate_Internal(PetscViewer,PetscViewerFormat,void*,PetscViewerAndFormat**); SLEPC_INTERN PetscErrorCode SlepcCitationsInitialize(void); SLEPC_INTERN PetscErrorCode SlepcInitialize_DynamicLibraries(void); diff --git a/include/slepc/private/vecimplslepc.h b/include/slepc/private/vecimplslepc.h index 4b4f849a2..31fe86728 100644 --- a/include/slepc/private/vecimplslepc.h +++ b/include/slepc/private/vecimplslepc.h @@ -92,8 +92,8 @@ typedef struct VecPool_ { } VecPool_; typedef VecPool_* VecPool; -SLEPC_EXTERN PetscErrorCode SlepcVecPoolCreate(Vec,PetscInt,VecPool*); -SLEPC_EXTERN PetscErrorCode SlepcVecPoolDestroy(VecPool*); -SLEPC_EXTERN PetscErrorCode SlepcVecPoolGetVecs(VecPool,PetscInt,Vec**); -SLEPC_EXTERN PetscErrorCode SlepcVecPoolRestoreVecs(VecPool,PetscInt,Vec**); +SLEPC_SINGLE_LIBRARY_INTERN PetscErrorCode SlepcVecPoolCreate(Vec,PetscInt,VecPool*); +SLEPC_SINGLE_LIBRARY_INTERN PetscErrorCode SlepcVecPoolDestroy(VecPool*); +SLEPC_SINGLE_LIBRARY_INTERN PetscErrorCode SlepcVecPoolGetVecs(VecPool,PetscInt,Vec**); +SLEPC_SINGLE_LIBRARY_INTERN PetscErrorCode SlepcVecPoolRestoreVecs(VecPool,PetscInt,Vec**); #endif diff --git a/include/slepcsys.h b/include/slepcsys.h index 7dbf7d0b9..be2eb232c 100644 --- a/include/slepcsys.h +++ b/include/slepcsys.h @@ -39,6 +39,14 @@ #define SLEPC_INTERN extern SLEPC_VISIBILITY_INTERNAL #endif +#if defined(PETSC_USE_SINGLE_LIBRARY) + #define SLEPC_SINGLE_LIBRARY_VISIBILITY_INTERNAL SLEPC_VISIBILITY_INTERNAL + #define SLEPC_SINGLE_LIBRARY_INTERN SLEPC_INTERN +#else + #define SLEPC_SINGLE_LIBRARY_VISIBILITY_INTERNAL SLEPC_VISIBILITY_PUBLIC + #define SLEPC_SINGLE_LIBRARY_INTERN SLEPC_EXTERN +#endif + /* ========================================================================== */ /* slepcconf.h is created by the configure script and placed in ${PETSC_ARCH}/include. diff --git a/src/sys/vec/pool.c b/src/sys/vec/pool.c index 8379f83c6..c437e631c 100644 --- a/src/sys/vec/pool.c +++ b/src/sys/vec/pool.c @@ -13,7 +13,7 @@ #include /*I "slepcvec.h" I*/ -/*@C +/* SlepcVecPoolCreate - Create a pool of Vec. Collective @@ -28,7 +28,7 @@ Level: developer .seealso: SlepcVecPoolGetVecs(), SlepcVecPoolDestroy() -@*/ +*/ PetscErrorCode SlepcVecPoolCreate(Vec v,PetscInt init_size,VecPool *p) { VecPool_ *pool; @@ -46,7 +46,7 @@ PetscErrorCode SlepcVecPoolCreate(Vec v,PetscInt init_size,VecPool *p) PetscFunctionReturn(PETSC_SUCCESS); } -/*@C +/* SlepcVecPoolDestroy - Destroy the pool of Vec. Collective @@ -57,7 +57,7 @@ PetscErrorCode SlepcVecPoolCreate(Vec v,PetscInt init_size,VecPool *p) Level: developer .seealso: SlepcVecPoolGetVecs(), SlepcVecPoolCreate() -@*/ +*/ PetscErrorCode SlepcVecPoolDestroy(VecPool *p) { VecPool_ *pool = (VecPool_*)*p; @@ -75,7 +75,7 @@ PetscErrorCode SlepcVecPoolDestroy(VecPool *p) PetscFunctionReturn(PETSC_SUCCESS); } -/*@C +/* SlepcVecPoolGetVecs - Get an array of Vec from the pool. Collective @@ -90,7 +90,7 @@ PetscErrorCode SlepcVecPoolDestroy(VecPool *p) Level: developer .seealso: SlepcVecPoolRestoreVecs() -@*/ +*/ PetscErrorCode SlepcVecPoolGetVecs(VecPool p,PetscInt n,Vec **vecs) { VecPool_ *pool = (VecPool_*)p; @@ -115,7 +115,7 @@ PetscErrorCode SlepcVecPoolGetVecs(VecPool p,PetscInt n,Vec **vecs) PetscFunctionReturn(PETSC_SUCCESS); } -/*@C +/* SlepcVecPoolRestoreVecs - Get back an array of Vec previously returned by SlepcVecPoolGetVecs(). @@ -129,7 +129,7 @@ PetscErrorCode SlepcVecPoolGetVecs(VecPool p,PetscInt n,Vec **vecs) Level: developer .seealso: SlepcVecPoolGetVecs() -@*/ +*/ PetscErrorCode SlepcVecPoolRestoreVecs(VecPool p,PetscInt n,Vec **vecs) { VecPool_ *pool = (VecPool_*)p, *pool0 = pool; From 22e2183cbdfc8ebb7cf7e9cb35011e18b212ceac Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Sat, 19 Aug 2023 09:58:20 +0200 Subject: [PATCH 101/112] Convert all header guards to pragma once --- include/slepc.h | 2 ++ include/slepc/private/bvimpl.h | 5 +---- include/slepc/private/dsimpl.h | 5 +---- include/slepc/private/epsimpl.h | 5 +---- include/slepc/private/fnimpl.h | 5 +---- include/slepc/private/lmeimpl.h | 5 +---- include/slepc/private/mfnimpl.h | 5 +---- include/slepc/private/nepimpl.h | 5 +---- include/slepc/private/pepimpl.h | 5 +---- include/slepc/private/rgimpl.h | 5 +---- include/slepc/private/slepccontour.h | 5 +---- include/slepc/private/slepcimpl.h | 5 +---- include/slepc/private/slepcscalapack.h | 5 +---- include/slepc/private/stimpl.h | 5 +---- include/slepc/private/svdimpl.h | 5 +---- include/slepc/private/vecimplslepc.h | 4 +--- include/slepcblaslapack.h | 6 ++---- include/slepcblaslapack_mangle.h | 5 +---- include/slepcbv.h | 6 +----- include/slepccublas.h | 6 ++---- include/slepcds.h | 5 +---- include/slepceps.h | 5 +---- include/slepcfn.h | 5 +---- include/slepclme.h | 6 +----- include/slepcmagma.h | 4 +--- include/slepcmat.h | 5 +---- include/slepcmath.h | 5 +---- include/slepcmfn.h | 6 +----- include/slepcnep.h | 6 +----- include/slepcpep.h | 4 +--- include/slepcrg.h | 5 +---- include/slepcrgtypes.h | 5 +---- include/slepcsc.h | 5 +---- include/slepcst.h | 5 +---- include/slepcsvd.h | 5 +---- include/slepcsys.h | 5 +---- include/slepcvec.h | 6 +----- include/slepcversion.h | 3 +-- src/eps/impls/davidson/davidson.h | 2 ++ src/eps/impls/external/arpack/arpack.h | 6 +----- src/eps/impls/external/blopex/blopex.h | 6 +----- src/eps/impls/external/blopex/petsc-interface.h | 5 +---- src/eps/impls/external/trlan/trlan.h | 6 +----- src/eps/impls/krylov/krylovschur/krylovschur.h | 5 +---- src/nep/impls/nepdefl.h | 5 ++--- src/nep/impls/nleigs/nleigs.h | 5 +---- src/nep/impls/slp/slp.h | 5 +---- src/pep/impls/krylov/pepkrylov.h | 6 +----- src/pep/impls/linear/linear.h | 5 +---- src/svd/impls/cyclic/cyclic.h | 5 +---- src/svd/tutorials/cnetwork/network.h | 5 +---- src/sys/classes/bv/impls/svec/svec.h | 6 +----- src/sys/classes/fn/impls/cuda/fnutilcuda.h | 5 +---- src/sys/classes/st/impls/filter/filter.h | 6 +----- 54 files changed, 59 insertions(+), 213 deletions(-) diff --git a/include/slepc.h b/include/slepc.h index 08aef44ef..dd3dadfb2 100644 --- a/include/slepc.h +++ b/include/slepc.h @@ -11,6 +11,8 @@ Include all top-level SLEPc functionality */ +#pragma once + #include #include #include diff --git a/include/slepc/private/bvimpl.h b/include/slepc/private/bvimpl.h index edee53f12..2121d0210 100644 --- a/include/slepc/private/bvimpl.h +++ b/include/slepc/private/bvimpl.h @@ -8,8 +8,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ -#if !defined(SLEPCBVIMPL_H) -#define SLEPCBVIMPL_H +#pragma once #include #include @@ -477,5 +476,3 @@ SLEPC_INTERN PetscErrorCode BV_StoreCoefficients_CUDA(BV,PetscInt,PetscScalar*,P #define BV_SquareRoot(a,b,c,d) BV_SquareRoot_Default((a),(b),(c),(d)) #define BV_StoreCoefficients(a,b,c,d) BV_StoreCoefficients_Default((a),(b),(c),(d)) #endif /* PETSC_HAVE_CUDA */ - -#endif diff --git a/include/slepc/private/dsimpl.h b/include/slepc/private/dsimpl.h index ee28954bb..4cab6c3ce 100644 --- a/include/slepc/private/dsimpl.h +++ b/include/slepc/private/dsimpl.h @@ -8,8 +8,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ -#if !defined(SLEPCDSIMPL_H) -#define SLEPCDSIMPL_H +#pragma once #include #include @@ -136,5 +135,3 @@ SLEPC_INTERN PetscErrorCode BDC_dlaed3m_(const char*,const char*,PetscBLASInt,Pe SLEPC_INTERN PetscErrorCode BDC_dmerg2_(const char*,PetscBLASInt,PetscBLASInt,PetscReal*,PetscReal*,PetscBLASInt,PetscBLASInt*,PetscReal*,PetscReal*,PetscBLASInt,PetscReal*,PetscBLASInt,PetscBLASInt,PetscReal*,PetscBLASInt,PetscBLASInt*,PetscReal,PetscBLASInt*,PetscBLASInt); SLEPC_INTERN PetscErrorCode BDC_dsbtdc_(const char*,const char*,PetscBLASInt,PetscBLASInt,PetscBLASInt*,PetscReal*,PetscBLASInt,PetscBLASInt,PetscReal*,PetscBLASInt,PetscBLASInt,PetscReal,PetscReal,PetscReal,PetscReal*,PetscReal*,PetscBLASInt,PetscReal*,PetscBLASInt,PetscBLASInt*,PetscBLASInt,PetscReal*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt,PetscBLASInt); SLEPC_INTERN PetscErrorCode BDC_dsrtdf_(PetscBLASInt*,PetscBLASInt,PetscBLASInt,PetscReal*,PetscReal*,PetscBLASInt,PetscBLASInt*,PetscReal*,PetscReal*,PetscReal*,PetscReal*,PetscReal*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscReal,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*); - -#endif diff --git a/include/slepc/private/epsimpl.h b/include/slepc/private/epsimpl.h index a8f0522ab..9e3f1e102 100644 --- a/include/slepc/private/epsimpl.h +++ b/include/slepc/private/epsimpl.h @@ -8,8 +8,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ -#if !defined(SLEPCEPSIMPL_H) -#define SLEPCEPSIMPL_H +#pragma once #include #include @@ -349,5 +348,3 @@ SLEPC_INTERN PetscErrorCode EPSSetDefaultST_GMRES(EPS); SLEPC_INTERN PetscErrorCode EPSSetDefaultST_NoFactor(EPS); SLEPC_INTERN PetscErrorCode EPSSetUpSort_Basic(EPS); SLEPC_INTERN PetscErrorCode EPSSetUpSort_Default(EPS); - -#endif diff --git a/include/slepc/private/fnimpl.h b/include/slepc/private/fnimpl.h index 832efdaf3..9b5ca7e1e 100644 --- a/include/slepc/private/fnimpl.h +++ b/include/slepc/private/fnimpl.h @@ -8,8 +8,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ -#if !defined(SLEPCFNIMPL_H) -#define SLEPCFNIMPL_H +#pragma once #include #include @@ -109,5 +108,3 @@ SLEPC_INTERN PetscErrorCode FNSqrtmDenmanBeavers_CUDAm(FN,PetscBLASInt,PetscScal SLEPC_INTERN PetscErrorCode FNSqrtmNewtonSchulz_CUDA(FN,PetscBLASInt,PetscScalar*,PetscBLASInt,PetscBool); SLEPC_INTERN PetscErrorCode FNSqrtmSadeghi_CUDAm(FN,PetscBLASInt,PetscScalar*,PetscBLASInt); #endif - -#endif diff --git a/include/slepc/private/lmeimpl.h b/include/slepc/private/lmeimpl.h index 8d6b08828..b921a4f48 100644 --- a/include/slepc/private/lmeimpl.h +++ b/include/slepc/private/lmeimpl.h @@ -8,8 +8,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ -#if !defined(SLEPCLMEIMPL_H) -#define SLEPCLMEIMPL_H +#pragma once #include #include @@ -108,5 +107,3 @@ SLEPC_EXTERN void SLEPC_SLICOT(sb03od,SB03OD)(const char*,const char*,const char SLEPC_EXTERN void SLEPC_SLICOT(sb03md,SB03MD)(const char*,const char*,const char*,const char*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscReal*,PetscReal*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt,PetscBLASInt,PetscBLASInt,PetscBLASInt); #endif - -#endif diff --git a/include/slepc/private/mfnimpl.h b/include/slepc/private/mfnimpl.h index 494344bbe..91fcfb326 100644 --- a/include/slepc/private/mfnimpl.h +++ b/include/slepc/private/mfnimpl.h @@ -8,8 +8,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ -#if !defined(SLEPCMFNIMPL_H) -#define SLEPCMFNIMPL_H +#pragma once #include #include @@ -116,5 +115,3 @@ static inline PetscErrorCode MFN_CreateVec(PetscInt k,Vec *v) if (create) PetscCall(VecCreateSeq(PETSC_COMM_SELF,k,v)); PetscFunctionReturn(PETSC_SUCCESS); } - -#endif diff --git a/include/slepc/private/nepimpl.h b/include/slepc/private/nepimpl.h index f682a94c2..8d502825f 100644 --- a/include/slepc/private/nepimpl.h +++ b/include/slepc/private/nepimpl.h @@ -8,8 +8,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ -#if !defined(SLEPCNEPIMPL_H) -#define SLEPCNEPIMPL_H +#pragma once #include #include @@ -239,5 +238,3 @@ SLEPC_INTERN PetscErrorCode NEPGetDefaultShift(NEP,PetscScalar*); SLEPC_INTERN PetscErrorCode NEPComputeVectors_Schur(NEP); SLEPC_INTERN PetscErrorCode NEPComputeResidualNorm_Private(NEP,PetscBool,PetscScalar,Vec,Vec*,PetscReal*); SLEPC_INTERN PetscErrorCode NEPNewtonRefinementSimple(NEP,PetscInt*,PetscReal,PetscInt); - -#endif diff --git a/include/slepc/private/pepimpl.h b/include/slepc/private/pepimpl.h index 5358aa2e9..6c44d502a 100644 --- a/include/slepc/private/pepimpl.h +++ b/include/slepc/private/pepimpl.h @@ -8,8 +8,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ -#if !defined(SLEPCPEPIMPL_H) -#define SLEPCPEPIMPL_H +#pragma once #include #include @@ -271,5 +270,3 @@ SLEPC_INTERN PetscErrorCode PEPNewtonRefinement_TOAR(PEP,PetscScalar,PetscInt*,P SLEPC_INTERN PetscErrorCode PEPNewtonRefinementSimple(PEP,PetscInt*,PetscReal,PetscInt); SLEPC_INTERN PetscErrorCode PEPSetDefaultST(PEP); SLEPC_INTERN PetscErrorCode PEPSetDefaultST_Transform(PEP); - -#endif diff --git a/include/slepc/private/rgimpl.h b/include/slepc/private/rgimpl.h index d721ba197..039bc90e5 100644 --- a/include/slepc/private/rgimpl.h +++ b/include/slepc/private/rgimpl.h @@ -8,8 +8,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ -#if !defined(SLEPCRGIMPL_H) -#define SLEPCRGIMPL_H +#pragma once #include #include @@ -43,5 +42,3 @@ struct _p_RG { /* show an inf instead of PETSC_MAX_REAL */ #define RGShowReal(r) (double)((PetscAbsReal(r)>=PETSC_MAX_REAL)?10*(r):(r)) - -#endif diff --git a/include/slepc/private/slepccontour.h b/include/slepc/private/slepccontour.h index 92a3db4fd..d73492251 100644 --- a/include/slepc/private/slepccontour.h +++ b/include/slepc/private/slepccontour.h @@ -8,8 +8,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ -#if !defined(SLEPCCONTOUR_H) -#define SLEPCCONTOUR_H +#pragma once #include #include @@ -53,5 +52,3 @@ SLEPC_SINGLE_LIBRARY_INTERN PetscErrorCode SlepcContourDataDestroy(SlepcContourD SLEPC_SINGLE_LIBRARY_INTERN PetscErrorCode SlepcContourRedundantMat(SlepcContourData,PetscInt,Mat*,Mat*); SLEPC_SINGLE_LIBRARY_INTERN PetscErrorCode SlepcContourScatterCreate(SlepcContourData,Vec); - -#endif diff --git a/include/slepc/private/slepcimpl.h b/include/slepc/private/slepcimpl.h index c93a5735e..7a2e1af25 100644 --- a/include/slepc/private/slepcimpl.h +++ b/include/slepc/private/slepcimpl.h @@ -8,8 +8,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ -#if !defined(SLEPCIMPL_H) -#define SLEPCIMPL_H +#pragma once #include #include @@ -189,5 +188,3 @@ static inline PetscErrorCode SlepcKernelSetGrid2DTiles(PetscInt rows,PetscInt co #undef X_AXIS #undef Y_AXIS #endif - -#endif diff --git a/include/slepc/private/slepcscalapack.h b/include/slepc/private/slepcscalapack.h index 915f3ca49..40e6caa5a 100644 --- a/include/slepc/private/slepcscalapack.h +++ b/include/slepc/private/slepcscalapack.h @@ -8,8 +8,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ -#if !defined(SLEPCSCALAPACK_H) -#define SLEPCSCALAPACK_H +#pragma once #include #include @@ -33,5 +32,3 @@ BLAS_EXTERN PetscReal SCALAPACKgesvd_(const char*,const char*,PetscBLASInt*,Pets BLAS_EXTERN PetscReal SCALAPACKsyev_(const char*,const char*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscReal*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); BLAS_EXTERN PetscReal SCALAPACKsygvx_(PetscBLASInt*,const char*,const char*,const char*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscReal*,PetscReal*,PetscBLASInt*,PetscBLASInt*,PetscReal*,PetscBLASInt*,PetscBLASInt*,PetscReal*,PetscReal*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscReal*,PetscBLASInt*); #endif - -#endif diff --git a/include/slepc/private/stimpl.h b/include/slepc/private/stimpl.h index e1f26b2e9..978fff03f 100644 --- a/include/slepc/private/stimpl.h +++ b/include/slepc/private/stimpl.h @@ -8,8 +8,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ -#if !defined(SLEPCSTIMPL_H) -#define SLEPCSTIMPL_H +#pragma once #include #include @@ -143,5 +142,3 @@ static inline PetscErrorCode ST_KSPSetOperators(ST st,Mat A,Mat B) } PetscFunctionReturn(PETSC_SUCCESS); } - -#endif diff --git a/include/slepc/private/svdimpl.h b/include/slepc/private/svdimpl.h index a42f636c0..8b7f374fd 100644 --- a/include/slepc/private/svdimpl.h +++ b/include/slepc/private/svdimpl.h @@ -8,8 +8,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ -#if !defined(SLEPCSVDIMPL_H) -#define SLEPCSVDIMPL_H +#pragma once #include #include @@ -227,5 +226,3 @@ SLEPC_INTERN PetscErrorCode SVDTwoSideLanczos(SVD,PetscReal*,PetscReal*,BV,BV,Pe SLEPC_INTERN PetscErrorCode SVDSetDimensions_Default(SVD); SLEPC_INTERN PetscErrorCode SVDComputeVectors(SVD); SLEPC_INTERN PetscErrorCode SVDComputeVectors_Left(SVD); - -#endif diff --git a/include/slepc/private/vecimplslepc.h b/include/slepc/private/vecimplslepc.h index 31fe86728..73fb6b926 100644 --- a/include/slepc/private/vecimplslepc.h +++ b/include/slepc/private/vecimplslepc.h @@ -8,8 +8,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ -#if !defined(SLEPCVECIMPL_H) -#define SLEPCVECIMPL_H +#pragma once #include #include @@ -96,4 +95,3 @@ SLEPC_SINGLE_LIBRARY_INTERN PetscErrorCode SlepcVecPoolCreate(Vec,PetscInt,VecPo SLEPC_SINGLE_LIBRARY_INTERN PetscErrorCode SlepcVecPoolDestroy(VecPool*); SLEPC_SINGLE_LIBRARY_INTERN PetscErrorCode SlepcVecPoolGetVecs(VecPool,PetscInt,Vec**); SLEPC_SINGLE_LIBRARY_INTERN PetscErrorCode SlepcVecPoolRestoreVecs(VecPool,PetscInt,Vec**); -#endif diff --git a/include/slepcblaslapack.h b/include/slepcblaslapack.h index 99198f906..08c037a8a 100644 --- a/include/slepcblaslapack.h +++ b/include/slepcblaslapack.h @@ -11,8 +11,8 @@ Necessary routines in BLAS and LAPACK not included in petscblaslapack.h */ -#if !defined(SLEPCBLASLAPACK_H) -#define SLEPCBLASLAPACK_H +#pragma once + #include /* Macro to check nonzero info after LAPACK call */ @@ -283,5 +283,3 @@ BLAS_EXTERN void BLASCOMPLEXgemm_(const char*,const char*,const PetscBLASInt*,co BLAS_EXTERN void BLASCOMPLEXscal_(const PetscBLASInt*,const PetscComplex*,PetscComplex*,const PetscBLASInt*); BLAS_EXTERN void LAPACKCOMPLEXgesv_(const PetscBLASInt*,const PetscBLASInt*,PetscComplex*,const PetscBLASInt*,PetscBLASInt*,PetscComplex*,const PetscBLASInt*,PetscBLASInt*); #endif - -#endif diff --git a/include/slepcblaslapack_mangle.h b/include/slepcblaslapack_mangle.h index 6af328afe..818c55108 100644 --- a/include/slepcblaslapack_mangle.h +++ b/include/slepcblaslapack_mangle.h @@ -8,8 +8,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ -#if !defined(SLEPCBLASLAPACK_MANGLE_H) -#define SLEPCBLASLAPACK_MANGLE_H +#pragma once /* LAPACK functions without string parameters */ #define BLASrot_ PETSCBLAS(rot,ROT) @@ -135,5 +134,3 @@ #define BLASCOMPLEXscal_ PETSCBLASCOMPLEX(scal,SCAL) #define LAPACKCOMPLEXgesv_ PETSCBLASCOMPLEX(gesv,GESV) #endif - -#endif diff --git a/include/slepcbv.h b/include/slepcbv.h index 234ec13f4..314f0a5c0 100644 --- a/include/slepcbv.h +++ b/include/slepcbv.h @@ -11,8 +11,7 @@ User interface for the basis vectors object in SLEPc */ -#if !defined(SLEPCBV_H) -#define SLEPCBV_H +#pragma once #include @@ -251,6 +250,3 @@ SLEPC_EXTERN PetscErrorCode BVGetOptionsPrefix(BV,const char*[]); SLEPC_EXTERN PetscFunctionList BVList; SLEPC_EXTERN PetscErrorCode BVRegister(const char[],PetscErrorCode(*)(BV)); - -#endif - diff --git a/include/slepccublas.h b/include/slepccublas.h index a16a43a25..d9d612bb7 100644 --- a/include/slepccublas.h +++ b/include/slepccublas.h @@ -11,8 +11,8 @@ Macro definitions to use CUBLAS functionality */ -#if !defined(SLEPCCUBLAS_H) -#define SLEPCCUBLAS_H +#pragma once + #include /* complex single */ @@ -67,5 +67,3 @@ #define cublasXCgemm(a,b,c,d,e,f,g,h,i,j,k,l,m,n) cublasZgemm((a),(b),(c),(d),(e),(f),(const cuDoubleComplex *)(g),(const cuDoubleComplex *)(h),(i),(const cuDoubleComplex *)(j),(k),(const cuDoubleComplex *)(l),(cuDoubleComplex *)(m),(n)) #define cublasXCscal(a,b,c,d,e) cublasZscal((a),(b),(const cuDoubleComplex *)(c),(cuDoubleComplex *)(d),(e)) #endif /* COMPLEX */ - -#endif diff --git a/include/slepcds.h b/include/slepcds.h index 2561e2ed9..7c201bf4d 100644 --- a/include/slepcds.h +++ b/include/slepcds.h @@ -11,8 +11,7 @@ User interface for the direct solver object in SLEPc */ -#if !defined(SLEPCDS_H) -#define SLEPCDS_H +#pragma once #include #include @@ -252,5 +251,3 @@ SLEPC_EXTERN PetscErrorCode DSNEPGetComputeMatrixFunction(DS,PetscErrorCode (**) SLEPC_EXTERN PetscFunctionList DSList; SLEPC_EXTERN PetscErrorCode DSRegister(const char[],PetscErrorCode(*)(DS)); - -#endif diff --git a/include/slepceps.h b/include/slepceps.h index 471c5dd67..0b3430750 100644 --- a/include/slepceps.h +++ b/include/slepceps.h @@ -11,8 +11,7 @@ User interface for the SLEPc linear eigenvalue solvers */ -#if !defined(SLEPCEPS_H) -#define SLEPCEPS_H +#pragma once #include #include @@ -523,5 +522,3 @@ SLEPC_EXTERN PetscErrorCode EPSEVSLGetDamping(EPS,EPSEVSLDamping*); SLEPC_EXTERN PetscErrorCode EPSFEASTSetNumPoints(EPS,PetscInt); SLEPC_EXTERN PetscErrorCode EPSFEASTGetNumPoints(EPS,PetscInt*); - -#endif diff --git a/include/slepcfn.h b/include/slepcfn.h index 42cb9c6f7..dcf310392 100644 --- a/include/slepcfn.h +++ b/include/slepcfn.h @@ -11,8 +11,7 @@ User interface for the mathematical function object in SLEPc */ -#if !defined(SLEPCFN_H) -#define SLEPCFN_H +#pragma once #include @@ -113,5 +112,3 @@ SLEPC_EXTERN PetscErrorCode FNCombineGetChildren(FN,FNCombineType*,FN*,FN*); SLEPC_EXTERN PetscErrorCode FNPhiSetIndex(FN,PetscInt); SLEPC_EXTERN PetscErrorCode FNPhiGetIndex(FN,PetscInt*); - -#endif diff --git a/include/slepclme.h b/include/slepclme.h index 0d88e5716..fd1ce84a8 100644 --- a/include/slepclme.h +++ b/include/slepclme.h @@ -11,8 +11,7 @@ User interface for the SLEPc object for solving linear matrix equations */ -#if !defined(SLEPCLME_H) -#define SLEPCLME_H +#pragma once #include @@ -139,6 +138,3 @@ SLEPC_EXTERN PetscErrorCode LMERegister(const char[],PetscErrorCode(*)(LME)); SLEPC_EXTERN PetscErrorCode LMEMonitorRegister(const char[],PetscViewerType,PetscViewerFormat,PetscErrorCode(*)(LME,PetscInt,PetscReal,PetscViewerAndFormat*),PetscErrorCode(*)(PetscViewer,PetscViewerFormat,void*,PetscViewerAndFormat**),PetscErrorCode(*)(PetscViewerAndFormat**)); SLEPC_EXTERN PetscErrorCode LMEAllocateSolution(LME,PetscInt); - -#endif - diff --git a/include/slepcmagma.h b/include/slepcmagma.h index e0b6ef06e..69d2e845a 100644 --- a/include/slepcmagma.h +++ b/include/slepcmagma.h @@ -11,8 +11,7 @@ Macro definitions to use MAGMA functionality */ -#if !defined(SLEPCMAGMA_H) -#define SLEPCMAGMA_H +#pragma once #if defined(PETSC_HAVE_MAGMA) @@ -66,4 +65,3 @@ SLEPC_EXTERN PetscErrorCode SlepcMagmaInit(void); #endif #endif -#endif diff --git a/include/slepcmat.h b/include/slepcmat.h index 385d28c55..9ad0a8199 100644 --- a/include/slepcmat.h +++ b/include/slepcmat.h @@ -11,8 +11,7 @@ User interface for various matrix operations added in SLEPc */ -#if !defined(SLEPCMAT_H) -#define SLEPCMAT_H +#pragma once #include @@ -33,5 +32,3 @@ PETSC_DEPRECATED_FUNCTION(3, 6, 0, "MatCreateRedundantMatrix() followed by MatCo PetscFunctionReturn(PETSC_SUCCESS); } PETSC_DEPRECATED_FUNCTION(3, 8, 0, "MatCreateTile()", ) static inline PetscErrorCode SlepcMatTile(PetscScalar a,Mat A,PetscScalar b,Mat B,PetscScalar c,Mat C,PetscScalar d,Mat D,Mat *G) {return MatCreateTile(a,A,b,B,c,C,d,D,G);} - -#endif diff --git a/include/slepcmath.h b/include/slepcmath.h index 66be700bf..1a53f455f 100644 --- a/include/slepcmath.h +++ b/include/slepcmath.h @@ -12,8 +12,7 @@ This file is included by slepcsys.h and should not be used directly. */ -#if !defined(SLEPCMATH_H) -#define SLEPCMATH_H +#pragma once /* SUBMANSEC = sys */ @@ -92,8 +91,6 @@ M*/ #define SlepcAbsEigenvalue(x,y) PetscAbsScalar(x) #endif -#endif - /* SlepcSetFlushToZero - Set the FTZ flag in floating-point arithmetic. */ diff --git a/include/slepcmfn.h b/include/slepcmfn.h index ca362daca..cb6708bce 100644 --- a/include/slepcmfn.h +++ b/include/slepcmfn.h @@ -11,8 +11,7 @@ User interface for the SLEPc matrix function solver object */ -#if !defined(SLEPCMFN_H) -#define SLEPCMFN_H +#pragma once #include #include @@ -118,6 +117,3 @@ SLEPC_EXTERN PetscErrorCode MFNRegister(const char[],PetscErrorCode(*)(MFN)); SLEPC_EXTERN PetscErrorCode MFNMonitorRegister(const char[],PetscViewerType,PetscViewerFormat,PetscErrorCode(*)(MFN,PetscInt,PetscReal,PetscViewerAndFormat*),PetscErrorCode(*)(PetscViewer,PetscViewerFormat,void*,PetscViewerAndFormat**),PetscErrorCode(*)(PetscViewerAndFormat**)); SLEPC_EXTERN PetscErrorCode MFNAllocateSolution(MFN,PetscInt); - -#endif - diff --git a/include/slepcnep.h b/include/slepcnep.h index 013e921a1..8cd316a89 100644 --- a/include/slepcnep.h +++ b/include/slepcnep.h @@ -11,8 +11,7 @@ User interface for SLEPc's nonlinear eigenvalue solvers */ -#if !defined(SLEPCNEP_H) -#define SLEPCNEP_H +#pragma once #include #include @@ -375,6 +374,3 @@ SLEPC_EXTERN PetscErrorCode NEPNLEIGSSetFullBasis(NEP,PetscBool); SLEPC_EXTERN PetscErrorCode NEPNLEIGSGetFullBasis(NEP,PetscBool*); SLEPC_EXTERN PetscErrorCode NEPNLEIGSSetEPS(NEP,EPS); SLEPC_EXTERN PetscErrorCode NEPNLEIGSGetEPS(NEP,EPS*); - -#endif - diff --git a/include/slepcpep.h b/include/slepcpep.h index cb90b00ec..3be2ca4c2 100644 --- a/include/slepcpep.h +++ b/include/slepcpep.h @@ -11,8 +11,7 @@ User interface for SLEPc's polynomial eigenvalue solvers */ -#if !defined(SLEPCPEP_H) -#define SLEPCPEP_H +#pragma once #include @@ -408,4 +407,3 @@ static inline PetscErrorCode PEPCISSGetRefinement(PEP pep,PETSC_UNUSED PetscInt static inline PetscErrorCode PEPCISSGetKSPs(PEP pep,PETSC_UNUSED PetscInt *nsolve,PETSC_UNUSED KSP **ksp) {SlepcPEPCISSUnavailable(pep);} #undef SlepcPEPCISSUnavailable #endif -#endif diff --git a/include/slepcrg.h b/include/slepcrg.h index 9bde154dd..176c677f0 100644 --- a/include/slepcrg.h +++ b/include/slepcrg.h @@ -11,8 +11,7 @@ User interface for the region object in SLEPc */ -#if !defined(SLEPCRG_H) -#define SLEPCRG_H +#pragma once #include #include @@ -89,5 +88,3 @@ SLEPC_EXTERN PetscErrorCode RGPolygonGetVertices(RG,PetscInt*,PetscScalar**,Pets SLEPC_EXTERN PetscErrorCode RGRingSetParameters(RG,PetscScalar,PetscReal,PetscReal,PetscReal,PetscReal,PetscReal); SLEPC_EXTERN PetscErrorCode RGRingGetParameters(RG,PetscScalar*,PetscReal*,PetscReal*,PetscReal*,PetscReal*,PetscReal*); - -#endif diff --git a/include/slepcrgtypes.h b/include/slepcrgtypes.h index c0ac24dbb..79d700e2a 100644 --- a/include/slepcrgtypes.h +++ b/include/slepcrgtypes.h @@ -8,8 +8,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ -#if !defined(SLEPCRGTYPES_H) -#define SLEPCRGTYPES_H +#pragma once /* SUBMANSEC = RG */ @@ -21,5 +20,3 @@ .seealso: RGCreate() S*/ typedef struct _p_RG* RG; - -#endif diff --git a/include/slepcsc.h b/include/slepcsc.h index bc710ed8f..b23b1cdc1 100644 --- a/include/slepcsc.h +++ b/include/slepcsc.h @@ -11,8 +11,7 @@ Sorting criterion for various solvers */ -#if !defined(SLEPCSC_H) -#define SLEPCSC_H +#pragma once #include #include @@ -80,5 +79,3 @@ SLEPC_EXTERN PetscErrorCode SlepcCompareTargetReal(PetscScalar,PetscScalar,Petsc SLEPC_EXTERN PetscErrorCode SlepcCompareTargetImaginary(PetscScalar,PetscScalar,PetscScalar,PetscScalar,PetscInt*,void*); #endif SLEPC_EXTERN PetscErrorCode SlepcCompareSmallestPosReal(PetscScalar,PetscScalar,PetscScalar,PetscScalar,PetscInt*,void*); - -#endif diff --git a/include/slepcst.h b/include/slepcst.h index 8f2fe1453..c81559f5e 100644 --- a/include/slepcst.h +++ b/include/slepcst.h @@ -11,8 +11,7 @@ Spectral transformation module for eigenvalue problems */ -#if !defined(SLEPCST_H) -#define SLEPCST_H +#pragma once #include #include @@ -170,5 +169,3 @@ SLEPC_EXTERN PetscErrorCode STFilterGetRange(ST,PetscReal*,PetscReal*); SLEPC_EXTERN PetscErrorCode STFilterSetDegree(ST,PetscInt); SLEPC_EXTERN PetscErrorCode STFilterGetDegree(ST,PetscInt*); SLEPC_EXTERN PetscErrorCode STFilterGetThreshold(ST,PetscReal*); - -#endif diff --git a/include/slepcsvd.h b/include/slepcsvd.h index b4a4fb34e..aad80a587 100644 --- a/include/slepcsvd.h +++ b/include/slepcsvd.h @@ -11,8 +11,7 @@ User interface for SLEPc's singular value solvers */ -#if !defined(SLEPCSVD_H) -#define SLEPCSVD_H +#pragma once #include #include @@ -322,5 +321,3 @@ SLEPC_EXTERN PetscErrorCode SVDKSVDSetEigenMethod(SVD,SVDKSVDEigenMethod); SLEPC_EXTERN PetscErrorCode SVDKSVDGetEigenMethod(SVD,SVDKSVDEigenMethod*); SLEPC_EXTERN PetscErrorCode SVDKSVDSetPolarMethod(SVD,SVDKSVDPolarMethod); SLEPC_EXTERN PetscErrorCode SVDKSVDGetPolarMethod(SVD,SVDKSVDPolarMethod*); - -#endif diff --git a/include/slepcsys.h b/include/slepcsys.h index be2eb232c..4fbce03e7 100644 --- a/include/slepcsys.h +++ b/include/slepcsys.h @@ -12,8 +12,7 @@ by all other SLEPc include files. */ -#if !defined(SLEPCSYS_H) -#define SLEPCSYS_H +#pragma once #include @@ -120,5 +119,3 @@ SLEPC_EXTERN PetscBool SlepcFinalizeCalled; #if defined(PETSC_USE_DEBUG) SLEPC_EXTERN PetscErrorCode SlepcDebugViewMatrix(PetscInt,PetscInt,PetscScalar*,PetscScalar*,PetscInt,const char*,const char*); #endif -#endif - diff --git a/include/slepcvec.h b/include/slepcvec.h index 9c9fd5c74..4367e613b 100644 --- a/include/slepcvec.h +++ b/include/slepcvec.h @@ -11,8 +11,7 @@ User interface for various vector operations added in SLEPc */ -#if !defined(SLEPCVEC_H) -#define SLEPCVEC_H +#pragma once #include @@ -36,6 +35,3 @@ SLEPC_EXTERN PetscErrorCode VecSetRandomNormal(Vec,PetscRandom,Vec,Vec); /* Deprecated functions */ PETSC_DEPRECATED_FUNCTION(3, 8, 0, "VecNormalizeComplex()", ) static inline PetscErrorCode SlepcVecNormalize(Vec xr,Vec xi,PetscBool c,PetscReal *nrm) {return VecNormalizeComplex(xr,xi,c,nrm);} PETSC_DEPRECATED_FUNCTION(3, 8, 0, "VecCheckOrthogonality()", ) static inline PetscErrorCode SlepcCheckOrthogonality(Vec *V,PetscInt nv,Vec *W,PetscInt nw,Mat B,PetscViewer viewer,PetscReal *lev) {return VecCheckOrthogonality(V,nv,W,nw,B,viewer,lev);} - -#endif - diff --git a/include/slepcversion.h b/include/slepcversion.h index 636c92e68..eeec5e214 100644 --- a/include/slepcversion.h +++ b/include/slepcversion.h @@ -8,7 +8,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ -#if !defined(SLEPCVERSION_H) +#ifndef SLEPCVERSION_H #define SLEPCVERSION_H #define SLEPC_VERSION_RELEASE 0 @@ -53,4 +53,3 @@ (0 == SLEPC_VERSION_LT(MAJOR,MINOR,SUBMINOR)) #endif - diff --git a/src/eps/impls/davidson/davidson.h b/src/eps/impls/davidson/davidson.h index 7b38b8d1c..f05f311cf 100644 --- a/src/eps/impls/davidson/davidson.h +++ b/src/eps/impls/davidson/davidson.h @@ -15,6 +15,8 @@ 53:49-60, May 1989. */ +#pragma once + #include #include diff --git a/src/eps/impls/external/arpack/arpack.h b/src/eps/impls/external/arpack/arpack.h index 3608445c2..6c2c91157 100644 --- a/src/eps/impls/external/arpack/arpack.h +++ b/src/eps/impls/external/arpack/arpack.h @@ -11,8 +11,7 @@ Private data structure used by the ARPACK interface */ -#if !defined(SLEPC_ARPACK_H) -#define SLEPC_ARPACK_H +#pragma once typedef struct { PetscInt *select; @@ -181,6 +180,3 @@ SLEPC_EXTERN void SLEPC_ARPACK(neupd,NEUPD)(COMM_ARG PetscInt*,char*,PetscInt* SLEPC_EXTERN void SLEPC_ARPACK(naupd,NAUPD)(COMM_ARG PetscInt*,char*,PetscInt*,const char*,PetscInt*,PetscReal*,PetscScalar*,PetscInt*,PetscScalar*,PetscInt*,PetscInt*,PetscInt*,PetscScalar*,PetscScalar*,PetscInt*,PetscReal*,PetscInt*,int,int); SLEPC_EXTERN void SLEPC_ARPACK(neupd,NEUPD)(COMM_ARG PetscInt*,char*,PetscInt*,PetscScalar*,PetscScalar*,PetscInt*,PetscScalar*,PetscScalar*,char*,PetscInt*,const char*,PetscInt*,PetscReal*,PetscScalar*,PetscInt*,PetscScalar*,PetscInt*,PetscInt*,PetscInt*,PetscScalar*,PetscScalar*,PetscInt*,PetscReal*,PetscInt*,int,int,int); #endif - -#endif - diff --git a/src/eps/impls/external/blopex/blopex.h b/src/eps/impls/external/blopex/blopex.h index ba063cf40..50711437d 100644 --- a/src/eps/impls/external/blopex/blopex.h +++ b/src/eps/impls/external/blopex/blopex.h @@ -8,8 +8,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ -#if !defined(SLEPC_BLOPEX_H) -#define SLEPC_BLOPEX_H +#pragma once #include #include "petsc-interface.h" @@ -17,6 +16,3 @@ SLEPC_INTERN PetscInt slepc_blopex_useconstr; SLEPC_INTERN int SLEPCSetupInterpreter(mv_InterfaceInterpreter*); - -#endif - diff --git a/src/eps/impls/external/blopex/petsc-interface.h b/src/eps/impls/external/blopex/petsc-interface.h index 9e3d51de7..e1cab15dd 100644 --- a/src/eps/impls/external/blopex/petsc-interface.h +++ b/src/eps/impls/external/blopex/petsc-interface.h @@ -3,8 +3,7 @@ /* @@@ Copyright 2010 BLOPEX team https://github.com/lobpcg/blopex */ /* @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ */ -#if !defined(PETSC_INTERFACE_HEADER) -#define PETSC_INTERFACE_HEADER +#pragma once #include @@ -20,5 +19,3 @@ SLEPC_INTERN int LOBPCG_InitRandomContext(MPI_Comm,PetscRandom); SLEPC_INTERN int LOBPCG_SetFromOptionsRandomContext(void); SLEPC_INTERN int LOBPCG_DestroyRandomContext(void); SLEPC_INTERN int PETSCSetupInterpreter(mv_InterfaceInterpreter*); - -#endif /* PETSC_INTERFACE_HEADER */ diff --git a/src/eps/impls/external/trlan/trlan.h b/src/eps/impls/external/trlan/trlan.h index d471ad74e..12a289ed0 100644 --- a/src/eps/impls/external/trlan/trlan.h +++ b/src/eps/impls/external/trlan/trlan.h @@ -11,8 +11,7 @@ Private data structure used by the TRLAN interface */ -#if !defined(SLEPC_TRLAN_H) -#define SLEPC_TRLAN_H +#pragma once typedef struct { PetscBLASInt maxlan; @@ -35,6 +34,3 @@ typedef struct { #endif SLEPC_EXTERN void TRLan_(PetscBLASInt(*op)(PetscBLASInt*,PetscBLASInt*,PetscReal*,PetscBLASInt*,PetscReal*,PetscBLASInt*),PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscBLASInt*); - -#endif - diff --git a/src/eps/impls/krylov/krylovschur/krylovschur.h b/src/eps/impls/krylov/krylovschur/krylovschur.h index 6c7e5f298..f5dc09e2e 100644 --- a/src/eps/impls/krylov/krylovschur/krylovschur.h +++ b/src/eps/impls/krylov/krylovschur/krylovschur.h @@ -11,8 +11,7 @@ Private header for Krylov-Schur */ -#if !defined(SLEPC_KRYLOVSCHUR_H) -#define SLEPC_KRYLOVSCHUR_H +#pragma once SLEPC_INTERN PetscErrorCode EPSSolve_KrylovSchur_Default(EPS); SLEPC_INTERN PetscErrorCode EPSSolve_KrylovSchur_TwoSided(EPS); @@ -98,5 +97,3 @@ typedef struct { /* the following are used only in filter */ PetscBool estimatedrange; /* the filter range was not set by the user */ } EPS_KRYLOVSCHUR; - -#endif diff --git a/src/nep/impls/nepdefl.h b/src/nep/impls/nepdefl.h index eb5d33766..b55db1d86 100644 --- a/src/nep/impls/nepdefl.h +++ b/src/nep/impls/nepdefl.h @@ -10,8 +10,8 @@ /* Private header for Deflation in NEP */ -#if !defined(SLEPC_NEPDEFL_H) -#define SLEPC_NEPDEFL_H + +#pragma once # define MAX_MINIDX 1 @@ -98,7 +98,6 @@ typedef struct { PetscInt n; } NEP_DEF_PCSHELL; #endif -#endif SLEPC_INTERN PetscErrorCode NEPDeflationCopyToExtendedVec(NEP_EXT_OP,Vec,PetscScalar*,Vec,PetscBool); SLEPC_INTERN PetscErrorCode NEPDeflationReset(NEP_EXT_OP); diff --git a/src/nep/impls/nleigs/nleigs.h b/src/nep/impls/nleigs/nleigs.h index 53e0a37e8..948d6f489 100644 --- a/src/nep/impls/nleigs/nleigs.h +++ b/src/nep/impls/nleigs/nleigs.h @@ -11,8 +11,7 @@ Private header for NLEIGS */ -#if !defined(SLEPC_NLEIGS_H) -#define SLEPC_NLEIGS_H +#pragma once #define LBPOINTS 100 /* default value of the maximum number of Leja-Bagby points */ #define NDPOINTS 1e4 /* number of discretization points */ @@ -69,5 +68,3 @@ SLEPC_INTERN PetscErrorCode NEPNLEIGSBackTransform(PetscObject,PetscInt,PetscSca SLEPC_INTERN PetscErrorCode NEPNLEIGSEvalNRTFunct(NEP,PetscInt,PetscScalar,PetscScalar*); SLEPC_INTERN PetscErrorCode NEPSolve_NLEIGS_FullBasis(NEP); SLEPC_INTERN PetscErrorCode NEPSolve_NLEIGS(NEP); - -#endif diff --git a/src/nep/impls/slp/slp.h b/src/nep/impls/slp/slp.h index 706b0ae15..70091f9fb 100644 --- a/src/nep/impls/slp/slp.h +++ b/src/nep/impls/slp/slp.h @@ -11,8 +11,7 @@ Private header for SLP */ -#if !defined(SLEPC_SLP_H) -#define SLEPC_SLP_H +#pragma once typedef struct { EPS eps; /* linear eigensolver for T*z = mu*Tp*z */ @@ -23,5 +22,3 @@ typedef struct { SLEPC_INTERN PetscErrorCode NEPSolve_SLP(NEP); SLEPC_INTERN PetscErrorCode NEPSolve_SLP_Twosided(NEP); - -#endif diff --git a/src/pep/impls/krylov/pepkrylov.h b/src/pep/impls/krylov/pepkrylov.h index 558a9dd39..631cd143a 100644 --- a/src/pep/impls/krylov/pepkrylov.h +++ b/src/pep/impls/krylov/pepkrylov.h @@ -11,8 +11,7 @@ Private header for TOAR and STOAR */ -#if !defined(SLEPC_PEPKRYLOV_H) -#define SLEPC_PEPKRYLOV_H +#pragma once SLEPC_INTERN PetscErrorCode PEPExtractVectors_TOAR(PEP); SLEPC_INTERN PetscErrorCode PEPSTOARSetUpInnerMatrix(PEP,Mat*); @@ -103,6 +102,3 @@ typedef struct { PetscReal alpha,beta; /* coefficients defining the linearization */ PetscBool checket; /* check eigenvalue type during spectrum slicing */ } PEP_STOAR; - -#endif - diff --git a/src/pep/impls/linear/linear.h b/src/pep/impls/linear/linear.h index 9019882de..895b36bb4 100644 --- a/src/pep/impls/linear/linear.h +++ b/src/pep/impls/linear/linear.h @@ -11,8 +11,7 @@ Private header for PEPLINEAR */ -#if !defined(SLEPC_LINEAR_H) -#define SLEPC_LINEAR_H +#pragma once typedef struct { PetscBool explicitmatrix; @@ -41,5 +40,3 @@ SLEPC_INTERN PetscErrorCode MatCreateExplicit_Linear_SB(MPI_Comm,PEP_LINEAR*,Mat /* H */ SLEPC_INTERN PetscErrorCode MatCreateExplicit_Linear_HA(MPI_Comm,PEP_LINEAR*,Mat*); SLEPC_INTERN PetscErrorCode MatCreateExplicit_Linear_HB(MPI_Comm,PEP_LINEAR*,Mat*); - -#endif diff --git a/src/svd/impls/cyclic/cyclic.h b/src/svd/impls/cyclic/cyclic.h index 692b9ba64..2772fdf6b 100644 --- a/src/svd/impls/cyclic/cyclic.h +++ b/src/svd/impls/cyclic/cyclic.h @@ -8,8 +8,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ -#if !defined(SLEPC_CYCLIC_H) -#define SLEPC_CYCLIC_H +#pragma once typedef struct { PetscBool explicitmatrix; @@ -27,5 +26,3 @@ typedef struct { SLEPC_INTERN PetscErrorCode MatMult_Cyclic_CUDA(Mat,Vec,Vec); SLEPC_INTERN PetscErrorCode MatMult_ECross_CUDA(Mat,Vec,Vec); - -#endif diff --git a/src/svd/tutorials/cnetwork/network.h b/src/svd/tutorials/cnetwork/network.h index 76115fb3f..7eb7942cd 100644 --- a/src/svd/tutorials/cnetwork/network.h +++ b/src/svd/tutorials/cnetwork/network.h @@ -11,8 +11,7 @@ Utilities for loading a complex network file and represent it as a graph */ -#if !defined(NETWORK_H) -#define NETWORK_H +#pragma once #include @@ -47,5 +46,3 @@ SLEPC_EXTERN PetscErrorCode GraphDestroy(Graph*); SLEPC_EXTERN PetscErrorCode GraphPreload(Graph,char*); SLEPC_EXTERN PetscErrorCode GraphPreallocate(Graph,char*); SLEPC_EXTERN PetscErrorCode GraphLoadUnweighted(Graph,char*); - -#endif diff --git a/src/sys/classes/bv/impls/svec/svec.h b/src/sys/classes/bv/impls/svec/svec.h index 57aac8132..a70dbe628 100644 --- a/src/sys/classes/bv/impls/svec/svec.h +++ b/src/sys/classes/bv/impls/svec/svec.h @@ -8,8 +8,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ -#if !defined(SLEPC_SVEC_H) -#define SLEPC_SVEC_H +#pragma once typedef struct { Vec v; @@ -35,6 +34,3 @@ SLEPC_INTERN PetscErrorCode BVRestoreSplit_Svec_CUDA(BV,BV*,BV*); SLEPC_INTERN PetscErrorCode BVGetMat_Svec_CUDA(BV,Mat*); SLEPC_INTERN PetscErrorCode BVRestoreMat_Svec_CUDA(BV,Mat*); #endif - -#endif - diff --git a/src/sys/classes/fn/impls/cuda/fnutilcuda.h b/src/sys/classes/fn/impls/cuda/fnutilcuda.h index a5527686a..a84fba742 100644 --- a/src/sys/classes/fn/impls/cuda/fnutilcuda.h +++ b/src/sys/classes/fn/impls/cuda/fnutilcuda.h @@ -11,8 +11,7 @@ Utility subroutines common to several impls */ -#if !defined(__FNUTILCUDA_H) -#define __FNUTILCUDA_H +#pragma once #include @@ -38,5 +37,3 @@ __global__ void mult_diagonal_kernel(PetscInt,PetscScalar*,PetscInt,PetscScalar* SLEPC_INTERN __host__ PetscErrorCode mult_diagonal(PetscInt,PetscScalar*,PetscInt,PetscScalar*); #endif /* PETSC_HAVE_CUDA */ - -#endif /* __FNUTILCUDA_H */ diff --git a/src/sys/classes/st/impls/filter/filter.h b/src/sys/classes/st/impls/filter/filter.h index 77f3dcbec..b53a3c5ce 100644 --- a/src/sys/classes/st/impls/filter/filter.h +++ b/src/sys/classes/st/impls/filter/filter.h @@ -8,8 +8,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ -#if !defined(SLEPC_FILTER_H) -#define SLEPC_FILTER_H +#pragma once /* IntervalOptions structure used by GetIntervals */ struct _n_FILTLAN_IOP { @@ -73,6 +72,3 @@ typedef struct { SLEPC_INTERN PetscErrorCode STFilter_FILTLAN_Apply(ST,Vec,Vec); SLEPC_INTERN PetscErrorCode STFilter_FILTLAN_setFilter(ST,Mat*); - -#endif - From 765ef7e8e8a82db625bd243e82f11c1a2b0576df Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Mon, 21 Aug 2023 18:22:07 +0200 Subject: [PATCH 102/112] Bump HPDDM hash --- config/packages/hpddm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/packages/hpddm.py b/config/packages/hpddm.py index c4d773eba..f3fb5d468 100644 --- a/config/packages/hpddm.py +++ b/config/packages/hpddm.py @@ -17,7 +17,7 @@ def __init__(self,argdb,log): package.Package.__init__(self,argdb,log) self.packagename = 'hpddm' self.downloadable = True - self.gitcommit = '9e5946e9a14082d76bb9982ac38aba78479dcb5d' + self.gitcommit = 'fd9613717a7de3cc48a8d14f4a132d7c72532dd2' # self.version = '2.2.3' obj = self.version if hasattr(self,'version') else self.gitcommit self.url = 'https://github.com/hpddm/hpddm/archive/'+('v'+obj if hasattr(self,'version') else obj)+'.tar.gz' From 4a8352e7fef9fe1a543e5a2f06ce38b04cd17314 Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Sat, 26 Aug 2023 08:27:06 +0200 Subject: [PATCH 103/112] Remove blank lines at end of file --- include/slepc.h | 1 - include/slepcmath.h | 1 - 2 files changed, 2 deletions(-) diff --git a/include/slepc.h b/include/slepc.h index dd3dadfb2..8d31b7849 100644 --- a/include/slepc.h +++ b/include/slepc.h @@ -18,4 +18,3 @@ #include #include #include - diff --git a/include/slepcmath.h b/include/slepcmath.h index 1a53f455f..7c9891277 100644 --- a/include/slepcmath.h +++ b/include/slepcmath.h @@ -119,4 +119,3 @@ static inline PetscErrorCode SlepcResetFlushToZero(unsigned int *state) #endif PetscFunctionReturn(PETSC_SUCCESS); } - From 0d76be3393b658f20b7af918c331311b67ec927b Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Sun, 27 Aug 2023 10:35:30 +0300 Subject: [PATCH 104/112] slepc4py: Fix Cython except declarations --- .../slepc4py/src/slepc4py/SLEPc/slepcmpi.pxi | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/binding/slepc4py/src/slepc4py/SLEPc/slepcmpi.pxi b/src/binding/slepc4py/src/slepc4py/SLEPc/slepcmpi.pxi index 48307803b..ba0a912d4 100644 --- a/src/binding/slepc4py/src/slepc4py/SLEPc/slepcmpi.pxi +++ b/src/binding/slepc4py/src/slepc4py/SLEPc/slepcmpi.pxi @@ -1,9 +1,9 @@ # ----------------------------------------------------------------------------- cdef extern from * nogil: - MPI_Comm MPI_COMM_NULL - MPI_Comm MPI_COMM_SELF - MPI_Comm MPI_COMM_WORLD + const MPI_Comm MPI_COMM_NULL + const MPI_Comm MPI_COMM_SELF + const MPI_Comm MPI_COMM_WORLD cdef extern from * nogil: MPI_Comm PETSC_COMM_SELF @@ -12,11 +12,14 @@ cdef extern from * nogil: # ----------------------------------------------------------------------------- from petsc4py.PETSc cimport GetComm -cdef inline MPI_Comm def_Comm(object comm, MPI_Comm defv) except *: - return GetComm(comm, defv) +cdef inline MPI_Comm def_Comm( + object comm, + MPI_Comm defv, +) except? MPI_COMM_NULL: + return GetComm(comm, defv) from petsc4py.PETSc cimport GetCommDefault -cdef inline MPI_Comm SLEPC_COMM_DEFAULT(): - return GetCommDefault() +cdef inline MPI_Comm SLEPC_COMM_DEFAULT() except? MPI_COMM_NULL: + return GetCommDefault() # ----------------------------------------------------------------------------- From f3649f3cbd7c3136d1ef3fe29ec9e09c6025fcf0 Mon Sep 17 00:00:00 2001 From: Pierre Jolivet Date: Mon, 28 Aug 2023 07:35:02 +0900 Subject: [PATCH 105/112] Bump HPDDM hash --- config/packages/hpddm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/packages/hpddm.py b/config/packages/hpddm.py index f3fb5d468..70366f9af 100644 --- a/config/packages/hpddm.py +++ b/config/packages/hpddm.py @@ -17,7 +17,7 @@ def __init__(self,argdb,log): package.Package.__init__(self,argdb,log) self.packagename = 'hpddm' self.downloadable = True - self.gitcommit = 'fd9613717a7de3cc48a8d14f4a132d7c72532dd2' + self.gitcommit = '9f9b69c9534c037ffe15a593766e09b8d537d241' # self.version = '2.2.3' obj = self.version if hasattr(self,'version') else self.gitcommit self.url = 'https://github.com/hpddm/hpddm/archive/'+('v'+obj if hasattr(self,'version') else obj)+'.tar.gz' From 979b639223af2948544f4aa7f47f6e5dcbddc9a3 Mon Sep 17 00:00:00 2001 From: Pierre Jolivet Date: Wed, 30 Aug 2023 19:10:05 +0900 Subject: [PATCH 106/112] slepc4py: fix warnings --- src/binding/slepc4py/src/slepc4py/SLEPc/SLEPc.pyx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/binding/slepc4py/src/slepc4py/SLEPc/SLEPc.pyx b/src/binding/slepc4py/src/slepc4py/SLEPc/SLEPc.pyx index b5d3ac055..243717674 100644 --- a/src/binding/slepc4py/src/slepc4py/SLEPc/SLEPc.pyx +++ b/src/binding/slepc4py/src/slepc4py/SLEPc/SLEPc.pyx @@ -11,6 +11,8 @@ cdef extern from * nogil: #pragma clang diagnostic ignored "-Wparentheses-equality" #pragma clang diagnostic ignored "-Wunreachable-code-fallthrough" #pragma clang diagnostic ignored "-Woverlength-strings" + #pragma clang diagnostic ignored "-Wunreachable-code" + #pragma clang diagnostic ignored "-Wundef" #elif defined(__GNUC__) || defined(__GNUG__) #pragma GCC diagnostic ignored "-Wstrict-aliasing" #pragma GCC diagnostic ignored "-Wtype-limits" From 6ad75150b42d2661f33443da027a34f9ade79efc Mon Sep 17 00:00:00 2001 From: Pierre Jolivet Date: Mon, 4 Sep 2023 12:04:22 +0200 Subject: [PATCH 107/112] Fix -Wdouble-promotion /home/runner/work/hpddm/petsc/arch-ci/include/slepcmath.h:60:21: error: implicit conversion increases floating-point precision: 'PetscReal' (aka 'float') to 'double' [-Werror,-Wdouble-promotion] if (PetscUnlikely(z == 0.0)) return w; ^ ~~ /home/runner/work/hpddm/petsc/include/petscmacros.h:594:51: note: expanded from macro 'PetscUnlikely' #define PetscUnlikely(cond) __builtin_expect(!!(cond), 0) ^~~~ In file included from /home/runner/work/hpddm/hpddm/interface/hpddm_petsc.cpp:29: In file included from /home/runner/work/hpddm/petsc/arch-ci/include/slepc.h:16: In file included from /home/runner/work/hpddm/petsc/arch-ci/include/slepcsvd.h:16: In file included from /home/runner/work/hpddm/petsc/arch-ci/include/slepceps.h:16: In file included from /home/runner/work/hpddm/petsc/arch-ci/include/slepcst.h:16: In file included from /home/runner/work/hpddm/petsc/arch-ci/include/slepcsys.h:69: /home/runner/work/hpddm/petsc/arch-ci/include/slepcmath.h:62:31: error: implicit conversion increases floating-point precision: 'float' to 'double' [-Werror,-Wdouble-promotion] return w*PetscSqrtReal(1.0+t*t); ~~^~ /home/runner/work/hpddm/petsc/include/petscmath.h:30:41: note: expanded from macro 'PetscSqrtReal' #define PetscSqrtReal(a) sqrtf(a) --- include/slepcmath.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/slepcmath.h b/include/slepcmath.h index 7c9891277..280583a33 100644 --- a/include/slepcmath.h +++ b/include/slepcmath.h @@ -57,9 +57,9 @@ static inline PetscReal SlepcAbs(PetscReal x,PetscReal y) w = PetscMax(xabs,yabs); z = PetscMin(xabs,yabs); - if (PetscUnlikely(z == 0.0)) return w; + if (PetscUnlikely(z == (PetscReal)0.0)) return w; t = z/w; - return w*PetscSqrtReal(1.0+t*t); + return w*PetscSqrtReal((PetscReal)1.0+t*t); } /*MC From c67db60f2effbab9dfe42b8efe8693569a24dfaf Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Tue, 5 Sep 2023 12:12:04 +0200 Subject: [PATCH 108/112] Increase patchlevel to 3.19.2 --- include/slepcversion.h | 2 +- src/binding/slepc4py/CHANGES.rst | 6 ++++++ src/binding/slepc4py/src/slepc4py/__init__.py | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/include/slepcversion.h b/include/slepcversion.h index f161ee269..bb34efed7 100644 --- a/include/slepcversion.h +++ b/include/slepcversion.h @@ -14,7 +14,7 @@ #define SLEPC_VERSION_RELEASE 1 #define SLEPC_VERSION_MAJOR 3 #define SLEPC_VERSION_MINOR 19 -#define SLEPC_VERSION_SUBMINOR 1 +#define SLEPC_VERSION_SUBMINOR 2 #define SLEPC_RELEASE_DATE "March 31, 2023" #define SLEPC_VERSION_DATE "unknown" diff --git a/src/binding/slepc4py/CHANGES.rst b/src/binding/slepc4py/CHANGES.rst index 41b9eef75..3d9b278de 100644 --- a/src/binding/slepc4py/CHANGES.rst +++ b/src/binding/slepc4py/CHANGES.rst @@ -6,6 +6,12 @@ CHANGES: SLEPc for Python :Contact: dalcinl@gmail.com +Release 3.19.2 +============== + +- Update to SLEPc 3.19.2. + + Release 3.19.1 ============== diff --git a/src/binding/slepc4py/src/slepc4py/__init__.py b/src/binding/slepc4py/src/slepc4py/__init__.py index 3025b26b7..095c8d5c1 100644 --- a/src/binding/slepc4py/src/slepc4py/__init__.py +++ b/src/binding/slepc4py/src/slepc4py/__init__.py @@ -21,7 +21,7 @@ """ __author__ = 'Lisandro Dalcin' -__version__ = '3.19.1' +__version__ = '3.19.2' __credits__ = 'SLEPc Team ' # ----------------------------------------------------------------------------- From e1e7d5cd434903caf32b97f9feb241fe2656d667 Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Wed, 6 Sep 2023 15:10:03 +0200 Subject: [PATCH 109/112] Fix potential issue with pkg-config due to case-sensitive file name --- config/configure.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/config/configure.py b/config/configure.py index 3262a55e6..f850afe71 100755 --- a/config/configure.py +++ b/config/configure.py @@ -283,8 +283,9 @@ def fixLang(lang): # Write pkg-config configuration file pkgconfdir = slepc.CreateDir(libdir,'pkgconfig') log.write('pkg-config file in '+pkgconfdir) -with slepc.CreateFile(pkgconfdir,'slepc.pc') as pkgconfig: - WritePkgconfigFile(pkgconfig,slepc.lversion,petsc.version,slepc.dir,slepc.isinstall,slepc.prefixdir,petsc.singlelib) +for pkfile in ['SLEPc.pc','slepc.pc']: + with slepc.CreateFile(pkgconfdir,pkfile) as pkgconfig: + WritePkgconfigFile(pkgconfig,slepc.lversion,petsc.version,slepc.dir,slepc.isinstall,slepc.prefixdir,petsc.singlelib) # Write reconfigure file if not slepc.isinstall: From 43ae15e82faf73dfd85bb3a39c7e5b8524849e0e Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Wed, 6 Sep 2023 17:04:26 +0200 Subject: [PATCH 110/112] CI: fix some tests in single precision --- src/eps/tests/test4.c | 1 + src/eps/tutorials/ex10.c | 1 + src/eps/tutorials/ex10f90.F90 | 2 +- src/eps/tutorials/ex29.c | 1 + src/pep/tests/test11.c | 1 + src/pep/tutorials/nlevp/spring.c | 1 + src/svd/tests/test12.c | 1 + src/svd/tests/test13.c | 2 +- src/svd/tests/test3.c | 4 ++-- src/sys/classes/ds/tests/test18.c | 2 +- src/sys/classes/ds/tests/test4.c | 2 +- 11 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/eps/tests/test4.c b/src/eps/tests/test4.c index 8802015ec..fda93aa6e 100644 --- a/src/eps/tests/test4.c +++ b/src/eps/tests/test4.c @@ -106,6 +106,7 @@ int main(int argc,char **argv) /*TEST testset: + filter: sed -e "s/3.95905/3.95906/" output_file: output/test4_1.out test: suffix: 1 diff --git a/src/eps/tutorials/ex10.c b/src/eps/tutorials/ex10.c index 7f277dbd2..a5840a5d0 100644 --- a/src/eps/tutorials/ex10.c +++ b/src/eps/tutorials/ex10.c @@ -297,6 +297,7 @@ PetscErrorCode STDestroy_User(SampleShellST *shell) test: suffix: 1_sinvert args: -st_type sinvert + requires: !single test: suffix: 1_sinvert_twoside args: -st_type sinvert -eps_balance twoside diff --git a/src/eps/tutorials/ex10f90.F90 b/src/eps/tutorials/ex10f90.F90 index ebdfc22c8..62e249b76 100644 --- a/src/eps/tutorials/ex10f90.F90 +++ b/src/eps/tutorials/ex10f90.F90 @@ -295,12 +295,12 @@ subroutine STBackTransform_User(st,n,eigr,eigi,ierr) ! testset: ! args: -eps_nev 5 -eps_non_hermitian -terse ! output_file: output/ex10_1.out +! requires: !single ! test: ! suffix: 1_sinvert ! args: -st_type sinvert ! test: ! suffix: 1_shell ! args: -st_type shell -! requires: !single ! !TEST*/ diff --git a/src/eps/tutorials/ex29.c b/src/eps/tutorials/ex29.c index 83454a70a..563f52b44 100644 --- a/src/eps/tutorials/ex29.c +++ b/src/eps/tutorials/ex29.c @@ -177,5 +177,6 @@ PetscErrorCode MyStoppingTest(EPS eps,PetscInt its,PetscInt max_it,PetscInt ncon test: suffix: 1 args: -m 350 -seconds 0.6 + requires: !single TEST*/ diff --git a/src/pep/tests/test11.c b/src/pep/tests/test11.c index a9f0f9230..0ea3cfe4f 100644 --- a/src/pep/tests/test11.c +++ b/src/pep/tests/test11.c @@ -193,6 +193,7 @@ PetscErrorCode MyStoppingTest(PEP pep,PetscInt its,PetscInt max_it,PetscInt ncon test: args: -terse + requires: !single suffix: 1 TEST*/ diff --git a/src/pep/tutorials/nlevp/spring.c b/src/pep/tutorials/nlevp/spring.c index ebbdf6690..af49a6dd0 100644 --- a/src/pep/tutorials/nlevp/spring.c +++ b/src/pep/tutorials/nlevp/spring.c @@ -155,6 +155,7 @@ int main(int argc,char **argv) suffix: 3 args: -n 300 -pep_hermitian -pep_interval -10.1,-9.5 -pep_type stoar -st_type sinvert -st_pc_type cholesky -terse filter: sed -e "s/52565/52566/" | sed -e "s/90758/90759/" + requires: !single test: suffix: 4 diff --git a/src/svd/tests/test12.c b/src/svd/tests/test12.c index d2fecaf50..2dadeb267 100644 --- a/src/svd/tests/test12.c +++ b/src/svd/tests/test12.c @@ -134,5 +134,6 @@ int main(int argc,char **argv) test: suffix: 1 args: -m 750 -seconds 0.1 -svd_max_it 10000 + requires: !single TEST*/ diff --git a/src/svd/tests/test13.c b/src/svd/tests/test13.c index deba7873d..1aada438f 100644 --- a/src/svd/tests/test13.c +++ b/src/svd/tests/test13.c @@ -97,6 +97,6 @@ int main(int argc,char **argv) nsize: 2 args: -svd_nsv 4 requires: primme - filter: sed -e "s/2.99255/2.99254/" + filter: sed -e "s/2.99255/2.99254/" | sed -e "s/2.97024/2.97023/" TEST*/ diff --git a/src/svd/tests/test3.c b/src/svd/tests/test3.c index 1ddbbab0a..d0885d812 100644 --- a/src/svd/tests/test3.c +++ b/src/svd/tests/test3.c @@ -121,7 +121,7 @@ int main(int argc,char **argv) testset: args: -svd_nsv 4 output_file: output/test3_1.out - filter: sed -e "s/22176/22175/" | sed -e "s/21798/21797/" | sed -e "s/16826/16825/" | sed -e "s/15129/15128/" | sed -e "s/22200/22201/" | sed -e "s/22289/22288/" | sed -e "s/17059/17060/" + filter: sed -e "s/22176/22175/" | sed -e "s/21798/21797/" | sed -e "s/16826/16825/" | sed -e "s/15129/15128/" | sed -e "s/22200/22201/" | sed -e "s/22289/22288/" | sed -e "s/17059/17060/" | sed -e "s/16777/16776/" test: suffix: 1_lanczos args: -svd_type lanczos -svd_ncv 16 @@ -168,7 +168,7 @@ int main(int argc,char **argv) testset: args: -svd_implicittranspose -svd_nsv 4 -svd_tol 1e-5 output_file: output/test3_1.out - filter: sed -e "s/22176/22175/" | sed -e "s/21798/21797/" | sed -e "s/16826/16825/" | sed -e "s/15129/15128/" | sed -e "s/22200/22201/" | sed -e "s/22289/22288/" | sed -e "s/17059/17060/" + filter: sed -e "s/22176/22175/" | sed -e "s/21798/21797/" | sed -e "s/16826/16825/" | sed -e "s/15129/15128/" | sed -e "s/22200/22201/" | sed -e "s/22289/22288/" | sed -e "s/17059/17060/" | sed -e "s/16777/16776/" test: suffix: 2_lanczos args: -svd_type lanczos -svd_conv_norm diff --git a/src/sys/classes/ds/tests/test18.c b/src/sys/classes/ds/tests/test18.c index 4587f74c2..9f02f6e47 100644 --- a/src/sys/classes/ds/tests/test18.c +++ b/src/sys/classes/ds/tests/test18.c @@ -117,7 +117,7 @@ int main(int argc,char **argv) testset: nsize: {{1 2 3}} - filter: sed -e "s/[+-]\([0-9]\.[0-9]*i\)/+-\\1/" | sed -e "s/1.58254/1.58255/" | sed -e "s/1.75989/1.75988/" + filter: sed -e "s/[+-]\([0-9]\.[0-9]*i\)/+-\\1/" | sed -e "s/1.58254/1.58255/" | sed -e "s/1.75989/1.75988/" | sed -e "s/1.01945/1.01946/" output_file: output/test18_1.out test: suffix: 1 diff --git a/src/sys/classes/ds/tests/test4.c b/src/sys/classes/ds/tests/test4.c index 692744985..7a5487bbe 100644 --- a/src/sys/classes/ds/tests/test4.c +++ b/src/sys/classes/ds/tests/test4.c @@ -127,6 +127,6 @@ int main(int argc,char **argv) test: suffix: 1 - filter: sed -e "s/[+-]\([0-9]\.[0-9]*i\)/+-\\1/" | sed -e "s/+-0\.0*i//" + filter: sed -e "s/[+-]\([0-9]\.[0-9]*i\)/+-\\1/" | sed -e "s/+-0\.0*i//" | sed -e "s/1.29552/1.29551/" TEST*/ From a1d36dd18c7101bd3f39dbd8be6cb143587a0c61 Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Thu, 14 Sep 2023 19:16:07 +0200 Subject: [PATCH 111/112] Sync with PETSc: remove duplicate definition of LAPACK _trtri --- include/slepcblaslapack.h | 1 - include/slepcblaslapack_mangle.h | 1 - 2 files changed, 2 deletions(-) diff --git a/include/slepcblaslapack.h b/include/slepcblaslapack.h index 08c037a8a..5781b5a0b 100644 --- a/include/slepcblaslapack.h +++ b/include/slepcblaslapack.h @@ -149,7 +149,6 @@ BLAS_EXTERN void LAPACKtrsyl_(const char*,const char*,const PetscBLASInt*,co #else #define LAPACKtrsyl_(a,b,c,d,e,f,g,h,i,j,k,l,m) PetscMissingLapack("TRSYL",a,b,c,d,e,f,g,h,i,j,k,l,m); #endif -BLAS_EXTERN void LAPACKtrtri_(const char*,const char*,const PetscBLASInt*,PetscScalar*,const PetscBLASInt*,PetscBLASInt*); /* subroutines in which we use only the real version, do not care whether they have different name */ #if !defined(SLEPC_MISSING_LAPACK_STEVR) diff --git a/include/slepcblaslapack_mangle.h b/include/slepcblaslapack_mangle.h index 818c55108..6ac9f2478 100644 --- a/include/slepcblaslapack_mangle.h +++ b/include/slepcblaslapack_mangle.h @@ -65,7 +65,6 @@ #if !defined(SLEPC_MISSING_LAPACK_TRSYL) #define LAPACKtrsyl_ PETSCBLAS(trsyl,TRSYL) #endif -#define LAPACKtrtri_ PETSCBLAS(trtri,TRTRI) /* subroutines in which we use only the real version, do not care whether they have different name */ #if !defined(SLEPC_MISSING_LAPACK_STEVR) From f14e745231fe3f231f466b663a0a563e262cdfb5 Mon Sep 17 00:00:00 2001 From: Pierre Jolivet Date: Sun, 17 Sep 2023 15:48:41 +0200 Subject: [PATCH 112/112] configure: sync HPDDM with PETSc --- config/packages/hpddm.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/packages/hpddm.py b/config/packages/hpddm.py index 70366f9af..a1e15a2fb 100644 --- a/config/packages/hpddm.py +++ b/config/packages/hpddm.py @@ -17,8 +17,8 @@ def __init__(self,argdb,log): package.Package.__init__(self,argdb,log) self.packagename = 'hpddm' self.downloadable = True - self.gitcommit = '9f9b69c9534c037ffe15a593766e09b8d537d241' - # self.version = '2.2.3' + # self.gitcommit = '89a9ca805bd0c6abb287d1f1b017cbb2d9ac5293' + self.version = '2.2.4' obj = self.version if hasattr(self,'version') else self.gitcommit self.url = 'https://github.com/hpddm/hpddm/archive/'+('v'+obj if hasattr(self,'version') else obj)+'.tar.gz' self.archive = 'hpddm-'+obj+'.tar.gz'