Actual source code: plapack.c
1: /*$Id: dlregispetsc.c,v 1.14 2001/03/23 23:20:05 balay Exp $*/
3: #include petsc.h
4: #ifdef PETSC_HAVE_PLAPACK
5: EXTERN_C_BEGIN
6: #include "PLA.h"
7: EXTERN_C_END
8: #endif
10: /*@C
11: PetscPLAPACKInitializePackage - This function initializes everything in the Petsc interface to PLAPACK. It is
12: called from PetscDLLibraryRegister() when using dynamic libraries, and on the call to PetscInitialize()
13: when using static libraries.
15: Input Parameter:
16: path - The dynamic library path, or PETSC_NULL
18: Level: developer
20: .keywords: Petsc, initialize, package, PLAPACK
21: .seealso: PetscInitializePackage(), PetscInitialize()
22: @*/
23: int PetscPLAPACKInitializePackage(char *path) {
24: #ifdef PETSC_HAVE_PLAPACK
25: MPI_Comm comm;
26: int initPLA;
27: int ierr;
30: PLA_Initialized(&initPLA);
31: if (!initPLA) {
32: PLA_Comm_1D_to_2D_ratio(PETSC_COMM_WORLD, 1.0, &comm);
33: PLA_Init(comm);
34: }
35: return(0);
36: #else
38: return(0);
39: #endif
40: }
42: /*@C
43: PetscPLAPACKFinalizePackage - This function destroys everything in the Petsc interface to PLAPACK. It is
44: called from PetscFinalize().
46: Level: developer
48: .keywords: Petsc, destroy, package, PLAPACK
49: .seealso: PetscFinalize()
50: @*/
51: int PetscPLAPACKFinalizePackage(void) {
52: #ifdef PETSC_HAVE_PLAPACK
56: PLA_Finalize();
57: return(0);
58: #else
60: return(0);
61: #endif
62: }