Actual source code: slepcsys.h

  1: /*
  2:    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  3:    SLEPc - Scalable Library for Eigenvalue Problem Computations
  4:    Copyright (c) 2002-, Universitat Politecnica de Valencia, Spain

  6:    This file is part of SLEPc.
  7:    SLEPc is distributed under a 2-clause BSD license (see LICENSE).
  8:    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  9: */
 10: /*
 11:    This include file contains definitions of system functions. It is included
 12:    by all other SLEPc include files.
 13: */

 15: #pragma once

 17: #include <petscsys.h>

 19: /* SUBMANSEC = Sys */

 21: #if defined(slepc_EXPORTS)
 22: #define SLEPC_VISIBILITY_PUBLIC 
 23: #else
 24: #define SLEPC_VISIBILITY_PUBLIC PETSC_DLLIMPORT
 25: #endif
 26: #define SLEPC_VISIBILITY_INTERNAL PETSC_VISIBILITY_INTERNAL

 28: /*
 29:     Functions tagged with SLEPC_EXTERN in the header files are
 30:   always defined as extern "C" when compiled with C++ so they may be
 31:   used from C and are always visible in the shared libraries
 32: */
 33: #if defined(__cplusplus)
 34: #define SLEPC_EXTERN extern "C" SLEPC_VISIBILITY_PUBLIC
 35: #define SLEPC_INTERN extern "C" SLEPC_VISIBILITY_INTERNAL
 36: #else
 37: #define SLEPC_EXTERN extern SLEPC_VISIBILITY_PUBLIC
 38: #define SLEPC_INTERN extern SLEPC_VISIBILITY_INTERNAL
 39: #endif

 41: #if PetscDefined(USE_SINGLE_LIBRARY)
 42:   #define SLEPC_SINGLE_LIBRARY_VISIBILITY_INTERNAL SLEPC_VISIBILITY_INTERNAL
 43:   #define SLEPC_SINGLE_LIBRARY_INTERN              SLEPC_INTERN
 44: #else
 45:   #define SLEPC_SINGLE_LIBRARY_VISIBILITY_INTERNAL SLEPC_VISIBILITY_PUBLIC
 46:   #define SLEPC_SINGLE_LIBRARY_INTERN              SLEPC_EXTERN
 47: #endif

 49: /* ========================================================================== */
 50: /*
 51:    slepcconf.h is created by the configure script and placed in ${PETSC_ARCH}/include.
 52:    It contains macro definitions set at configure time.
 53: */
 54: #include <slepcconf.h>
 55: /*
 56:     slepcversion.h contains version info
 57: */
 58: #include <slepcversion.h>
 59: #define SLEPC_AUTHOR_INFO "       The SLEPc Team\n    slepc-maint@upv.es\n https://slepc.upv.es\n"

 61: /* ========================================================================== */
 62: /*
 63:    The PETSc include files.
 64: */
 65: #include <petscmat.h>
 66: /*
 67:     slepcmath.h contains definition of basic math functions
 68: */
 69: #include <slepcmath.h>
 70: /*
 71:     slepcsc.h contains definition of sorting criterion
 72: */
 73: #include <slepcsc.h>
 74: /*
 75:     slepcmat.h, slepcvec.h contain utilities related to Mat and Vec, extend functionality in PETSc
 76: */
 77: #include <slepcmat.h>
 78: #include <slepcvec.h>

 80: /*
 81:     Initialization of SLEPc and other system routines
 82: */
 83: SLEPC_EXTERN PetscErrorCode SlepcInitialize(int*,char***,const char[],const char[]);
 84: SLEPC_EXTERN PetscErrorCode SlepcInitializeNoPointers(int,char**,const char[],const char[]);
 85: SLEPC_EXTERN PetscErrorCode SlepcInitializeNoArguments(void);
 86: SLEPC_EXTERN PetscErrorCode SlepcFinalize(void);
 87: SLEPC_EXTERN PetscErrorCode SlepcInitializeFortran(void);
 88: SLEPC_EXTERN PetscErrorCode SlepcInitialized(PetscBool*);
 89: SLEPC_EXTERN PetscErrorCode SlepcFinalized(PetscBool*);
 90: SLEPC_EXTERN PetscErrorCode SlepcGetVersion(char[],size_t);
 91: SLEPC_EXTERN PetscErrorCode SlepcGetVersionNumber(PetscInt*,PetscInt*,PetscInt*,PetscInt*);
 92: PETSC_EXTERN PetscErrorCode SlepcGetConfiguration(const char *[]);
 93: SLEPC_EXTERN PetscErrorCode SlepcHasExternalPackage(const char[],PetscBool*);

 95: SLEPC_EXTERN PetscErrorCode SlepcSNPrintfScalar(char[],size_t,PetscScalar,PetscBool);

 97: SLEPC_EXTERN PetscBool SlepcInitializeCalled;
 98: SLEPC_EXTERN PetscBool SlepcFinalizeCalled;

100: /*MC
101:    SlepcLogFlopsComplex - Log how many flops are performed in a calculation.

103:    Synopsis:
104: #include <slepcsys.h>
105:    PetscReal SlepcLogFlopsComplex(PetscLogDouble n)

107:    Not Collective

109:    Input parameter:
110: .  n - the number of flops

112:    Note:
113:    Like `PetscLogFlops()` but will log correctly in the case of real scalar computations
114:    that explicitly use complex arithmetic.

116:    Level: developer

118: .seealso: `PetscLogFlops()`
119: M*/
120: #if PetscDefined(USE_COMPLEX)
121: #define SlepcLogFlopsComplex(a) PetscLogFlops((a))
122: #else
123: #define SlepcLogFlopsComplex(a) PetscLogFlops(4.0*(a))
124: #endif

126: /*MC
127:    SlepcLogGpuFlopsComplex - Log how many flops are performed in a calculation on the device.

129:    Synopsis:
130: #include <slepcsys.h>
131:    PetscReal SlepcLogGpuFlopsComplex(PetscLogDouble n)

133:    Not Collective

135:    Input parameter:
136: .  n - the number of flops

138:    Note:
139:    Like `PetscLogGpuFlops()` but will log correctly in the case of real scalar computations
140:    that explicitly use complex arithmetic.

142:    Level: developer

144: .seealso: `PetscLogGpuFlops()`
145: M*/
146: #if PetscDefined(USE_COMPLEX)
147: #define SlepcLogGpuFlopsComplex(a) PetscLogGpuFlops((a))
148: #else
149: #define SlepcLogGpuFlopsComplex(a) PetscLogGpuFlops(4.0*(a))
150: #endif

152: /*
153:     Developer routines to be used with a debugger
154: */
155: #if PetscDefined(USE_DEBUG)
156: SLEPC_EXTERN PetscErrorCode SlepcDebugViewMatrix(PetscInt,PetscInt,PetscScalar[],PetscScalar[],PetscInt,const char[],const char[]);
157: #endif