Gryllida <[email protected]> writes: > I have a parallel program which reads data and makes a call to a > subroutine that uses petsc. It only needs to read data once. Is it > possible to implement that using MPI and then initialise petsc in the > subroutine? Or do I need to initialise petsc first (and use MPI calls > with PETSC_COMM_WORLD)?
We recommend only calling PetscInitialize and PetscFinalize once, so you may want to lift it to an initialization function. You can call them inside the function, but if the function is called multiple times, the profiling and debugging functionality in PETSc will have to run each time, producing more output than you probably want when you turn those features on. Regardless of where you initialize PETSc, you can use MPI_COMM_WORLD or any other communicator.
pgprmT83J8332.pgp
Description: PGP signature
