It looks like the recent changes which Cody made to threading in MOOSE
definitely reduced the number of errors reported by helgrind for our
simple_diffusion test.

There might be a threading issue remaining with the Singleton class.  Below
is the helgrind output I'm currently seeing, and trying to interpret, but
wanted to get other people's thoughts on...the stack traces below look OK
to me: the RemoteElem is only created/destroyed on one thread as I believe
is intended.

If you read the helgrind documentation on inconsistent lock orderings [0]
it makes sense in that simple context, but I don't see exactly how it
applies to the Singleton.




[0]: http://valgrind.org/docs/manual/hg-manual.html#hg-manual.lock-orders

-- 
John


==32216== ---Thread-Announcement------------------------------------------
==32216==
==32216== Thread #1 is the program's root thread
==32216==
==32216== ----------------------------------------------------------------
==32216==
==32216== Thread #1: lock order "0xABACD10 before 0xABAA364" violated
==32216==
==32216== Observed (incorrect) order is: acquisition of lock at 0xABAA364
==32216==    at 0x4C2ED8D: pthread_spin_lock (in
/usr/lib/valgrind/vgpreload_helgrind-amd64-linux.so)
==32216==    by 0x427295: libMesh::Threads::spin_mutex::lock()
(threads.h:373)
==32216==    by 0x4272DB:
libMesh::Threads::spin_mutex::scoped_lock::scoped_lock(libMesh::Threads::spin_mutex&)
(threads.h:380)
==32216==    by 0x943D641: libMesh::Singleton::cleanup()
(libmesh_singleton.C:98)
==32216==    by 0x9419E4B: libMesh::LibMeshInit::~LibMeshInit()
(libmesh.C:629)
==32216==    by 0x6E44D9F: MooseInit::~MooseInit() (MooseInit.C:49)
==32216==    by 0x422468: main (main.C:39)
==32216==
==32216==  followed by a later acquisition of lock at 0xABACD10
==32216==    at 0x4C2ED8D: pthread_spin_lock (in
/usr/lib/valgrind/vgpreload_helgrind-amd64-linux.so)
==32216==    by 0x427295: libMesh::Threads::spin_mutex::lock()
(threads.h:373)
==32216==    by 0x4272DB:
libMesh::Threads::spin_mutex::scoped_lock::scoped_lock(libMesh::Threads::spin_mutex&)
(threads.h:380)
==32216==    by 0x9789A3F: libMesh::RemoteElem::~RemoteElem()
(remote_elem.C:62)
==32216==    by 0x9789AFB: libMesh::RemoteElem::~RemoteElem()
(remote_elem.C:65)
==32216==    by 0x943D74E: libMesh::Singleton::cleanup()
(libmesh_singleton.C:106)
==32216==    by 0x9419E4B: libMesh::LibMeshInit::~LibMeshInit()
(libmesh.C:629)
==32216==    by 0x6E44D9F: MooseInit::~MooseInit() (MooseInit.C:49)
==32216==    by 0x422468: main (main.C:39)
==32216==
==32216== Required order was established by acquisition of lock at 0xABACD10
==32216==    at 0x4C2ED8D: pthread_spin_lock (in
/usr/lib/valgrind/vgpreload_helgrind-amd64-linux.so)
==32216==    by 0x427295: libMesh::Threads::spin_mutex::lock()
(threads.h:373)
==32216==    by 0x4272DB:
libMesh::Threads::spin_mutex::scoped_lock::scoped_lock(libMesh::Threads::spin_mutex&)
(threads.h:380)
==32216==    by 0x9789B59: libMesh::RemoteElem::create() (remote_elem.C:74)
==32216==    by 0x97899C6: (anonymous namespace)::RemoteElemSetup::setup()
(remote_elem.C:45)
==32216==    by 0x943D56D: libMesh::Singleton::setup()
(libmesh_singleton.C:90)
==32216==    by 0x941895D: libMesh::LibMeshInit::LibMeshInit(int, char
const* const*, ompi_communicator_t*) (libmesh.C:376)
==32216==    by 0x6E44D2C: MooseInit::MooseInit(int, char**,
ompi_communicator_t*) (MooseInit.C:32)
==32216==    by 0x4223C0: main (main.C:25)
==32216==
==32216==  followed by a later acquisition of lock at 0xABAA364
==32216==    at 0x4C2ED8D: pthread_spin_lock (in
/usr/lib/valgrind/vgpreload_helgrind-amd64-linux.so)
==32216==    by 0x427295: libMesh::Threads::spin_mutex::lock()
(threads.h:373)
==32216==    by 0x4272DB:
libMesh::Threads::spin_mutex::scoped_lock::scoped_lock(libMesh::Threads::spin_mutex&)
(threads.h:380)
==32216==    by 0x943D3C1: libMesh::Singleton::Singleton()
(libmesh_singleton.C:66)
==32216==    by 0x9789E40: libMesh::RemoteElem::RemoteElem()
(remote_elem.h:62)
==32216==    by 0x9789B91: libMesh::RemoteElem::create() (remote_elem.C:79)
==32216==    by 0x97899C6: (anonymous namespace)::RemoteElemSetup::setup()
(remote_elem.C:45)
==32216==    by 0x943D56D: libMesh::Singleton::setup()
(libmesh_singleton.C:90)
==32216==    by 0x941895D: libMesh::LibMeshInit::LibMeshInit(int, char
const* const*, ompi_communicator_t*) (libmesh.C:376)
==32216==    by 0x6E44D2C: MooseInit::MooseInit(int, char**,
ompi_communicator_t*) (MooseInit.C:32)
==32216==    by 0x4223C0: main (main.C:25)
==32216==
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
Libmesh-devel mailing list
Libmesh-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-devel

Reply via email to