GCC Code Coverage Report


Directory: ./
File: src/eps/interface/dlregiseps.c
Date: 2026-01-12 03:57:26
Exec Total Coverage
Lines: 35 35 100.0%
Functions: 3 3 100.0%
Branches: 97 156 62.2%

Line Branch Exec Source
1 /*
2 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
3 SLEPc - Scalable Library for Eigenvalue Problem Computations
4 Copyright (c) 2002-, Universitat Politecnica de Valencia, Spain
5
6 This file is part of SLEPc.
7 SLEPc is distributed under a 2-clause BSD license (see LICENSE).
8 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
9 */
10
11 #include <slepc/private/epsimpl.h>
12
13 static PetscBool EPSPackageInitialized = PETSC_FALSE;
14
15 const char *EPSBalanceTypes[] = {"NONE","ONESIDE","TWOSIDE","USER","EPSBalance","EPS_BALANCE_",NULL};
16 const char *EPSErrorTypes[] = {"ABSOLUTE","RELATIVE","BACKWARD","EPSErrorType","EPS_ERROR_",NULL};
17 const char *EPSPowerShiftTypes[] = {"CONSTANT","RAYLEIGH","WILKINSON","EPSPowerShiftType","EPS_POWER_SHIFT_",NULL};
18 const char *EPSKrylovSchurBSETypes[] = {"SHAO","GRUNING","PROJECTEDBSE","EPSKrylovSchurBSEType","EPS_KRYLOVSCHUR_BSE_",NULL};
19 const char *EPSLanczosReorthogTypes[] = {"LOCAL","FULL","SELECTIVE","PERIODIC","PARTIAL","DELAYED","EPSLanczosReorthogType","EPS_LANCZOS_REORTHOG_",NULL};
20 const char *EPSPRIMMEMethods[] = {"","DYNAMIC","DEFAULT_MIN_TIME","DEFAULT_MIN_MATVECS","ARNOLDI","GD","GD_PLUSK","GD_OLSEN_PLUSK","JD_OLSEN_PLUSK","RQI","JDQR","JDQMR","JDQMR_ETOL","SUBSPACE_ITERATION","LOBPCG_ORTHOBASIS","LOBPCG_ORTHOBASISW","EPSPRIMMEMethod","EPS_PRIMME_",NULL};
21 const char *EPSCISSQuadRules[] = {"(not set yet)","TRAPEZOIDAL","CHEBYSHEV","EPSCISSQuadRule","EPS_CISS_QUADRULE_",NULL};
22 const char *EPSCISSExtractions[] = {"RITZ","HANKEL","EPSCISSExtraction","EPS_CISS_EXTRACTION_",NULL};
23 const char *EPSEVSLDOSMethods[] = {"KPM","LANCZOS","EPSEVSLDOSMethod","EPS_EVSL_DOS_",NULL};
24 const char *EPSEVSLDampings[] = {"NONE","JACKSON","SIGMA","EPSEVSLDamping","EPS_EVSL_DAMPING_",NULL};
25 const char *const EPSConvergedReasons_Shifted[] = {"","DIVERGED_SYMMETRY_LOST","DIVERGED_BREAKDOWN","DIVERGED_ITS","CONVERGED_ITERATING","CONVERGED_TOL","CONVERGED_USER","EPSConvergedReason","EPS_",NULL};
26 const char *const*EPSConvergedReasons = EPSConvergedReasons_Shifted + 4;
27
28 /*@C
29 EPSFinalizePackage - This function destroys everything in the SLEPc interface
30 to the `EPS` package. It is called from `SlepcFinalize()`.
31
32 Level: developer
33
34 .seealso: [](ch:eps), `SlepcFinalize()`, `EPSInitializePackage()`
35 @*/
36 6353 PetscErrorCode EPSFinalizePackage(void)
37 {
38
1/2
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
6353 PetscFunctionBegin;
39
4/6
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 8 times.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
6353 PetscCall(PetscFunctionListDestroy(&EPSList));
40
4/6
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 8 times.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
6353 PetscCall(PetscFunctionListDestroy(&EPSMonitorList));
41
4/6
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 8 times.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
6353 PetscCall(PetscFunctionListDestroy(&EPSMonitorCreateList));
42
4/6
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 8 times.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
6353 PetscCall(PetscFunctionListDestroy(&EPSMonitorDestroyList));
43 6353 EPSPackageInitialized = PETSC_FALSE;
44 6353 EPSRegisterAllCalled = PETSC_FALSE;
45 6353 EPSMonitorRegisterAllCalled = PETSC_FALSE;
46
6/12
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 2 times.
✓ Branch 4 taken 2 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 2 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 2 times.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✓ Branch 11 taken 2 times.
6353 PetscFunctionReturn(PETSC_SUCCESS);
47 }
48
49 /*@C
50 EPSInitializePackage - This function initializes everything in the `EPS` package.
51 It is called from `PetscDLLibraryRegister_slepceps()` when using dynamic libraries, and
52 on the first call to `EPSCreate()` when using shared or static libraries.
53
54 Note:
55 This function never needs to be called by SLEPc users.
56
57 Level: developer
58
59 .seealso: [](ch:eps), `EPS`, `SlepcInitialize()`, `EPSFinalizePackage()`
60 @*/
61 139452 PetscErrorCode EPSInitializePackage(void)
62 {
63 139452 char logList[256];
64 139452 PetscBool opt,pkg;
65 139452 PetscClassId classids[1];
66
67
1/2
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
139452 PetscFunctionBegin;
68
8/14
✓ Branch 0 taken 10 times.
✓ Branch 1 taken 10 times.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
✓ Branch 6 taken 2 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 2 times.
✗ Branch 9 not taken.
✓ Branch 10 taken 2 times.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✓ Branch 13 taken 2 times.
139452 if (EPSPackageInitialized) PetscFunctionReturn(PETSC_SUCCESS);
69 6353 EPSPackageInitialized = PETSC_TRUE;
70 /* Register Classes */
71
4/6
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 8 times.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
6353 PetscCall(PetscClassIdRegister("EPS Solver",&EPS_CLASSID));
72 /* Register Constructors */
73
4/6
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 8 times.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
6353 PetscCall(EPSRegisterAll());
74 /* Register Monitors */
75
4/6
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 8 times.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
6353 PetscCall(EPSMonitorRegisterAll());
76 /* Register Events */
77
4/6
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 8 times.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
6353 PetscCall(PetscLogEventRegister("EPSSetUp",EPS_CLASSID,&EPS_SetUp));
78
4/6
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 8 times.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
6353 PetscCall(PetscLogEventRegister("EPSSolve",EPS_CLASSID,&EPS_Solve));
79
4/6
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 8 times.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
6353 PetscCall(PetscLogEventRegister("EPSCISS_SVD",EPS_CLASSID,&EPS_CISS_SVD));
80 /* Process Info */
81 6353 classids[0] = EPS_CLASSID;
82
4/6
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 8 times.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
6353 PetscCall(PetscInfoProcessClass("eps",1,&classids[0]));
83 /* Process summary exclusions */
84
4/6
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 8 times.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
6353 PetscCall(PetscOptionsGetString(NULL,NULL,"-log_exclude",logList,sizeof(logList),&opt));
85
2/2
✓ Branch 0 taken 10 times.
✓ Branch 1 taken 10 times.
6353 if (opt) {
86
4/6
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 8 times.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
44 PetscCall(PetscStrInList("eps",logList,',',&pkg));
87
6/8
✓ Branch 0 taken 10 times.
✓ Branch 1 taken 10 times.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 8 times.
✓ Branch 4 taken 2 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✓ Branch 7 taken 2 times.
44 if (pkg) PetscCall(PetscLogEventDeactivateClass(EPS_CLASSID));
88 }
89 /* Register package finalizer */
90
4/6
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 8 times.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
6353 PetscCall(PetscRegisterFinalize(EPSFinalizePackage));
91
6/12
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 2 times.
✓ Branch 4 taken 2 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 2 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 2 times.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✓ Branch 11 taken 2 times.
1253 PetscFunctionReturn(PETSC_SUCCESS);
92 }
93
94 #if defined(PETSC_HAVE_DYNAMIC_LIBRARIES)
95 /*
96 PetscDLLibraryRegister - This function is called when the dynamic library
97 it is in is opened.
98
99 This one registers all the EPS methods that are in the basic SLEPc libslepceps
100 library.
101 */
102 10 SLEPC_EXTERN PetscErrorCode PetscDLLibraryRegister_slepceps(void)
103 {
104
1/2
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
10 PetscFunctionBegin;
105
4/6
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 8 times.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
10 PetscCall(EPSInitializePackage());
106
6/12
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 2 times.
✓ Branch 4 taken 2 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 2 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 2 times.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✓ Branch 11 taken 2 times.
2 PetscFunctionReturn(PETSC_SUCCESS);
107 }
108 #endif /* PETSC_HAVE_DYNAMIC_LIBRARIES */
109