[petsc-dev] PetscOptionsBegin etc all use global variables

Jed Brown jedbrown at mcs.anl.gov
Sun Nov 3 17:28:58 CST 2013


Barry Smith <bsmith at mcs.anl.gov> writes:
>    Whose thread local? OpenMP threads, pthreads, can this be done so
>    it is all independent of the thread model that user is using. For
>    example in this case the user is using OpenMP but PETSc doesn’t
>    even know about threads, which except for a bunch of damn globals
>    would be ok.

PetscStack is already thread local.  I would be in favor of putting all
the global variables into a single object, making all the internal
functions take that argument explicitly, and making the top-level user
interface grab the thread-local object before passing it to the internal
functions.  Yes, we would have to know whether they liked pthreads,
__thread, or OpenMP to declare the thread-local variable.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20131103/0c80cd5c/attachment.sig>


More information about the petsc-dev mailing list