Thoughts?  Right now we only call Parallel:: functions from thread 0,
so we should be safe even on non-thread-safe MPI stacks.

But should that change?  And what should users be allowed to do?

Most of the Parallel:: functions would break right now if called from
more than one thread at once.  It would be possible in theory to
change that - e.g. Parallel::max() would first take the max over all
threads, then take the max over all ranks, then distribute the max
back to all threads - but it would be pretty difficult in practice,
particularly since it's somewhat contrary to the task-based paradigm
in TBB.

I'd like to instead just "enforce" the current restrictions - set a
Threads::_now_multithreaded bool to true at the start of and false at
the end of any Threads::parallel_* call, and then do a
assert(!Threads::now_multithreaded()) in every Parallel:: call.

Thoughts?
---
Roy

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Libmesh-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-devel

Reply via email to