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: #undef __FUNCT__  
 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: int PetscPLAPACKInitializePackage(char *path) {
 26: #ifdef PETSC_HAVE_PLAPACK
 27:   MPI_Comm comm;
 28:   int      initPLA;
 29:   int      ierr;

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

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

 50:   Level: developer

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

 60:   PLA_Finalize();
 61:   return(0);
 62: #else
 64:   return(0);
 65: #endif
 66: }