[petsc-users] Can I call PetscInitialize twice in a programm

Jed Brown jed at 59A2.org
Tue Aug 31 17:06:30 CDT 2010


On Tue, 31 Aug 2010 15:58:30 -0600, nan zhao <zhaonanavril at gmail.com> wrote:
> Hi,
> 
> I am now using petsc to develop some application which need to solve two
> physical systems. I want to use Petsc as the linear solver. but I am not
> sure if I can all PetscInitialize twice.

No, you can only call it once.

> becasue the two system are solving at the same time period. And also I
> want to use MPI to do parallel computing. Can I call MPI:INIT() before
> I call PetscInitialize?

You can, but it's usually not necessary since PetscInitialize will call
it for you otherwise (and then PetscFinalize will call MPI_Finalize).

Jed


More information about the petsc-users mailing list