GCC Code Coverage Report


Directory: ./
File: src/mfn/interface/dlregismfn.c
Date: 2025-10-03 04:28:47
Exec Total Coverage
Lines: 34 34 100.0%
Functions: 3 3 100.0%
Branches: 92 150 61.3%

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/mfnimpl.h>
12
13 static PetscBool MFNPackageInitialized = PETSC_FALSE;
14
15 const char *const MFNConvergedReasons_Shifted[] = {"DIVERGED_BREAKDOWN","DIVERGED_ITS","CONVERGED_ITERATING","CONVERGED_TOL","CONVERGED_ITS","MFNConvergedReason","MFN_",NULL};
16 const char *const*MFNConvergedReasons = MFNConvergedReasons_Shifted + 2;
17
18 /*@C
19 MFNFinalizePackage - This function destroys everything in the SLEPc interface
20 to the MFN package. It is called from SlepcFinalize().
21
22 Level: developer
23
24 .seealso: SlepcFinalize()
25 @*/
26 213 PetscErrorCode MFNFinalizePackage(void)
27 {
28
1/2
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
213 PetscFunctionBegin;
29
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.
213 PetscCall(PetscFunctionListDestroy(&MFNList));
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.
213 PetscCall(PetscFunctionListDestroy(&MFNMonitorList));
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.
213 PetscCall(PetscFunctionListDestroy(&MFNMonitorCreateList));
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.
213 PetscCall(PetscFunctionListDestroy(&MFNMonitorDestroyList));
33 213 MFNPackageInitialized = PETSC_FALSE;
34 213 MFNRegisterAllCalled = PETSC_FALSE;
35 213 MFNMonitorRegisterAllCalled = PETSC_FALSE;
36
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.
213 PetscFunctionReturn(PETSC_SUCCESS);
37 }
38
39 /*@C
40 MFNInitializePackage - This function initializes everything in the MFN package.
41 It is called from PetscDLLibraryRegister() when using dynamic libraries, and
42 on the first call to MFNCreate() when using static libraries.
43
44 Level: developer
45
46 .seealso: SlepcInitialize()
47 @*/
48 1192 PetscErrorCode MFNInitializePackage(void)
49 {
50 1192 char logList[256];
51 1192 PetscBool opt,pkg;
52 1192 PetscClassId classids[1];
53
54
1/2
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
1192 PetscFunctionBegin;
55
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.
1192 if (MFNPackageInitialized) PetscFunctionReturn(PETSC_SUCCESS);
56 213 MFNPackageInitialized = PETSC_TRUE;
57 /* Register Classes */
58
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.
213 PetscCall(PetscClassIdRegister("Matrix Function",&MFN_CLASSID));
59 /* Register Constructors */
60
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.
213 PetscCall(MFNRegisterAll());
61 /* Register Monitors */
62
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.
213 PetscCall(MFNMonitorRegisterAll());
63 /* Register Events */
64
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.
213 PetscCall(PetscLogEventRegister("MFNSetUp",MFN_CLASSID,&MFN_SetUp));
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.
213 PetscCall(PetscLogEventRegister("MFNSolve",MFN_CLASSID,&MFN_Solve));
66 /* Process Info */
67 213 classids[0] = MFN_CLASSID;
68
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.
213 PetscCall(PetscInfoProcessClass("mfn",1,&classids[0]));
69 /* Process summary exclusions */
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.
213 PetscCall(PetscOptionsGetString(NULL,NULL,"-log_exclude",logList,sizeof(logList),&opt));
71
2/2
✓ Branch 0 taken 10 times.
✓ Branch 1 taken 10 times.
213 if (opt) {
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.
24 PetscCall(PetscStrInList("mfn",logList,',',&pkg));
73
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.
24 if (pkg) PetscCall(PetscLogEventDeactivateClass(MFN_CLASSID));
74 }
75 /* Register package finalizer */
76
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.
213 PetscCall(PetscRegisterFinalize(MFNFinalizePackage));
77
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.
33 PetscFunctionReturn(PETSC_SUCCESS);
78 }
79
80 #if defined(PETSC_HAVE_DYNAMIC_LIBRARIES)
81 /*
82 PetscDLLibraryRegister - This function is called when the dynamic library
83 it is in is opened.
84
85 This one registers all the MFN methods that are in the basic SLEPc libslepcmfn
86 library.
87 */
88 10 SLEPC_EXTERN PetscErrorCode PetscDLLibraryRegister_slepcmfn(void)
89 {
90
1/2
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
10 PetscFunctionBegin;
91
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(MFNInitializePackage());
92
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);
93 }
94 #endif /* PETSC_HAVE_DYNAMIC_LIBRARIES */
95