Actual source code: plapack.c

  1: #define PETSC_DLL

 3:  #include petsc.h
  4: #ifdef PETSC_HAVE_PLAPACK
  6:   #include "PLA.h"
  8: #endif

 12: /*@C
 13:   PetscPLAPACKInitializePackage - This function initializes everything in the Petsc interface to PLAPACK. It is
 14:   called from PetscDLLibraryRegister() when using dynamic libraries, and on the call to PetscInitialize()
 15:   when using static libraries.

 17:   Input Parameter:
 18:   path - The dynamic library path, or PETSC_NULL

 20:   Level: developer

 22: .keywords: Petsc, initialize, package, PLAPACK
 23: .seealso: PetscInitializePackage(), PetscInitialize()
 24: @*/
 25: PetscErrorCode PETSC_DLLEXPORT PetscPLAPACKInitializePackage(char *path)
 26: {
 27: #ifdef PETSC_HAVE_PLAPACK
 28:   MPI_Comm comm;
 29:   int      initPLA;

 33:   PLA_Initialized(&initPLA);
 34:   if (!initPLA) {
 35:     PLA_Comm_1D_to_2D_ratio(PETSC_COMM_WORLD, 1.0, &comm);
 36:     PLA_Init(comm);
 37:   }
 38:   return(0);
 39: #else
 41:   return(0);
 42: #endif
 43: }

 47: /*@C
 48:   PetscPLAPACKFinalizePackage - This function destroys everything in the Petsc interface to PLAPACK. It is
 49:   called from PetscFinalize().

 51:   Level: developer

 53: .keywords: Petsc, destroy, package, PLAPACK
 54: .seealso: PetscFinalize()
 55: @*/
 56: PetscErrorCode PETSC_DLLEXPORT PetscPLAPACKFinalizePackage(void)
 57: {
 58: #ifdef PETSC_HAVE_PLAPACK

 62:   PLA_Finalize();
 63:   return(0);
 64: #else
 66:   return(0);
 67: #endif
 68: }