GCC Code Coverage Report


Directory: ./
File: src/lme/interface/dlregislme.c
Date: 2025-10-04 04:19:13
Exec Total Coverage
Lines: 35 35 100.0%
Functions: 3 3 100.0%
Branches: 96 156 61.5%

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/lmeimpl.h>
12
13 static PetscBool LMEPackageInitialized = PETSC_FALSE;
14
15 const char *LMEProblemTypes[] = {"LYAPUNOV","SYLVESTER","GEN_LYAPUNOV","GEN_SYLVESTER","DT_LYAPUNOV","STEIN","LMEProblemType","LME_",NULL};
16 const char *const LMEConvergedReasons_Shifted[] = {"DIVERGED_BREAKDOWN","DIVERGED_ITS","CONVERGED_ITERATING","CONVERGED_TOL","LMEConvergedReason","LME_",NULL};
17 const char *const*LMEConvergedReasons = LMEConvergedReasons_Shifted + 2;
18
19 /*@C
20 LMEFinalizePackage - This function destroys everything in the SLEPc interface
21 to the LME package. It is called from SlepcFinalize().
22
23 Level: developer
24
25 .seealso: SlepcFinalize()
26 @*/
27 138 PetscErrorCode LMEFinalizePackage(void)
28 {
29
1/2
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
138 PetscFunctionBegin;
30
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.
138 PetscCall(PetscFunctionListDestroy(&LMEList));
31
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.
138 PetscCall(PetscFunctionListDestroy(&LMEMonitorList));
32
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.
138 PetscCall(PetscFunctionListDestroy(&LMEMonitorCreateList));
33
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.
138 PetscCall(PetscFunctionListDestroy(&LMEMonitorDestroyList));
34 138 LMEPackageInitialized = PETSC_FALSE;
35 138 LMERegisterAllCalled = PETSC_FALSE;
36 138 LMEMonitorRegisterAllCalled = PETSC_FALSE;
37
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.
138 PetscFunctionReturn(PETSC_SUCCESS);
38 }
39
40 /*@C
41 LMEInitializePackage - This function initializes everything in the LME package.
42 It is called from PetscDLLibraryRegister() when using dynamic libraries, and
43 on the first call to LMECreate() when using static libraries.
44
45 Level: developer
46
47 .seealso: SlepcInitialize()
48 @*/
49 694 PetscErrorCode LMEInitializePackage(void)
50 {
51 694 char logList[256];
52 694 PetscBool opt,pkg;
53 694 PetscClassId classids[1];
54
55
1/2
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
694 PetscFunctionBegin;
56
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.
694 if (LMEPackageInitialized) PetscFunctionReturn(PETSC_SUCCESS);
57 138 LMEPackageInitialized = PETSC_TRUE;
58 /* Register Classes */
59
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.
138 PetscCall(PetscClassIdRegister("Lin. Matrix Equation",&LME_CLASSID));
60 /* Register Constructors */
61
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.
138 PetscCall(LMERegisterAll());
62 /* Register Monitors */
63
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.
138 PetscCall(LMEMonitorRegisterAll());
64 /* Register Events */
65
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.
138 PetscCall(PetscLogEventRegister("LMESetUp",LME_CLASSID,&LME_SetUp));
66
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.
138 PetscCall(PetscLogEventRegister("LMESolve",LME_CLASSID,&LME_Solve));
67
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.
138 PetscCall(PetscLogEventRegister("LMEComputeError",LME_CLASSID,&LME_ComputeError));
68 /* Process Info */
69 138 classids[0] = LME_CLASSID;
70
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.
138 PetscCall(PetscInfoProcessClass("lme",1,&classids[0]));
71 /* Process summary exclusions */
72
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.
138 PetscCall(PetscOptionsGetString(NULL,NULL,"-log_exclude",logList,sizeof(logList),&opt));
73
2/2
✓ Branch 0 taken 10 times.
✓ Branch 1 taken 10 times.
138 if (opt) {
74
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(PetscStrInList("lme",logList,',',&pkg));
75
5/8
✓ Branch 0 taken 10 times.
✗ Branch 1 not taken.
✓ 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.
10 if (pkg) PetscCall(PetscLogEventDeactivateClass(LME_CLASSID));
76 }
77 /* Register package finalizer */
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.
138 PetscCall(PetscRegisterFinalize(LMEFinalizePackage));
79
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.
20 PetscFunctionReturn(PETSC_SUCCESS);
80 }
81
82 #if defined(PETSC_HAVE_DYNAMIC_LIBRARIES)
83 /*
84 PetscDLLibraryRegister - This function is called when the dynamic library
85 it is in is opened.
86
87 This one registers all the LME methods that are in the basic SLEPc libslepclme
88 library.
89 */
90 10 SLEPC_EXTERN PetscErrorCode PetscDLLibraryRegister_slepclme(void)
91 {
92
1/2
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
10 PetscFunctionBegin;
93
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(LMEInitializePackage());
94
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);
95 }
96 #endif /* PETSC_HAVE_DYNAMIC_LIBRARIES */
97