-
Notifications
You must be signed in to change notification settings - Fork 0
Initializing the TDycore Library
Because the TDycore library uses MPI, PETSc, and other subsystems, we have defined a function to initialize these various subsystems at the beginning of any TDycore-based driver/program:
PetscErrorCode TDyInit(int argc, char* argv[]);
Call this function where you would ordinarily call MPI_Init
or PetscInitialize
. It has no effect on subsequent calls. You can check whether the library has been initialized with a call to
PetscBool TDyInitialized(void);
Similarly, we have defined a finalization function to be called at the end of a TDycore-based program:
PetscErrorCode TDyFinalize(void);
Use this instead of MPI_Finalize
or PetscFinalize
. This ensures that all TDycore subsystems properly free their resources.
We offer two equivalent subroutines for Fortran 90, similar to their PETSc counterparts:
TDyInit(ierr)
TDyFinalize(ierr)
Both accept an integer that stores an error code if these subroutines encounter an issue.