[petsc-dev] de-global variablelizing PETSc

Karl Rupp rupp at mcs.anl.gov
Sun Nov 10 15:49:22 CST 2013


Hi,

 >         2) We need a way for initializing all the packages in
>     PetscInitialize() instead of as needed. In master I see
>
>
> I really do not like this since then we are creating circular
> dependencies, and people who would like to "use
> only a part" will be upset. What about having the user who wants
> completely threadsafe stuff call *Initialize(),
> and then have this cascade all the way down (I think it should anyway).

As a recent example to what Matt said, the cudaSetDevice() function is 
something that is part of the current initialization, but should not be 
called upfront, as the user might want to provide her own context. The 
consequence of a full PetscInitialize() right at the beginning is that 
we either
  a) do not allow user customizations for anything that goes into 
PetscInitialize(), or
  b) require all user customizations *before* calling PetscInitialize(), 
so PetscInitialize() is no longer the first PETSc function to be called.

Both a) and b) don't seem attractive to me, so I'd rather *not* 
initialize everything in there.

Best regards,
Karli



More information about the petsc-dev mailing list