On Mon, 4 Jun 2012, John Peterson wrote:

> BTW, since Metis is using OpenMP (no raw pthreads that I can see) the
> proper TLS mechanism is probably something like
>
> #pragma omp threadprivate(var)

OpenMP uses pthreads under the hood on POSIX systems, IIRC, so
thread local storage variables ought to work fine as well.  Probably
safer for the corner cases to use consistent idioms, though.

> I feel like my patch (which effectively makes those variables global)
> will potentially break anyone actually running libmesh with
> OMP_NUM_THREADS > 1.

Almost certainly.

> Not sure how much work this would be to fix and test.

To fix?  Your pragma (suitably replicated and made specific) will
probably do it.

To test?  We can't and shouldn't try to test that unmodified Metis is
thread-safe, but it might be easy enough to write fprintf debugging
code that makes sure the different threads are still getting openmp
compatible tls variables after our patch.

> Should we just notify the Metis developers?

Check and see if the unmodified parmetis (which includes the metis
files we upgraded to) works on Mac?  They might have some hack in
their build system, which I ignored and threw away.  If unmodified
parmetis doesn't build on Mac either, then definitely notify them.

Thanks,
---
Roy

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Libmesh-devel mailing list
Libmesh-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-devel

Reply via email to