From: Martin Kronbichler Date: Thu, 7 May 2009 14:09:29 +0000 (+0000) Subject: Remove Locks from ConstraintMatrix class. The responsibility is now to the user for... X-Git-Tag: v8.0.0~7708 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5aac6dc7c65192ed468b08917525878a42973086;p=dealii.git Remove Locks from ConstraintMatrix class. The responsibility is now to the user for thread-safety of the distribute_local_to_global functions. git-svn-id: https://svn.dealii.org/trunk@18821 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/lac/include/lac/constraint_matrix.h b/deal.II/lac/include/lac/constraint_matrix.h index 0d0027a4e2..e225a76fd4 100644 --- a/deal.II/lac/include/lac/constraint_matrix.h +++ b/deal.II/lac/include/lac/constraint_matrix.h @@ -18,7 +18,6 @@ #include #include #include -#include #include #include @@ -985,6 +984,11 @@ class ConstraintMatrix : public Subscriptor * matrix. Otherwise, this function * will not be able to correctly handle * inhomogeneities. + * + * Note: This function is not + * thread-safe, so you will need to + * make sure that only on process at a + * time calls this function. */ template void @@ -1054,6 +1058,11 @@ class ConstraintMatrix : public Subscriptor * call to the condense function after * the vectors and matrices are fully * assembled. + * + * Note: This function is not + * thread-safe, so you will need to + * make sure that only on process at a + * time calls this function. */ template void @@ -1069,6 +1078,11 @@ class ConstraintMatrix : public Subscriptor * ConstraintMatrix. This function can * correctly handle inhomogeneous * constraints as well. + * + * Note: This function is not + * thread-safe, so you will need to + * make sure that only on process at a + * time calls this function. */ template void @@ -1446,14 +1460,6 @@ class ConstraintMatrix : public Subscriptor */ static const Table<2,bool> default_empty_table; - /** - * A mutex that makes the function - * distribute_local_to_global() - * only accessible to one process at - * time. - */ - mutable Threads::ThreadMutex mutex; - /** * This function actually implements * the local_to_global function for diff --git a/deal.II/lac/include/lac/constraint_matrix.templates.h b/deal.II/lac/include/lac/constraint_matrix.templates.h index 1fca3f8776..b0ac3ed4f8 100644 --- a/deal.II/lac/include/lac/constraint_matrix.templates.h +++ b/deal.II/lac/include/lac/constraint_matrix.templates.h @@ -743,8 +743,6 @@ distribute_local_to_global (const Vector &local_vector, } const unsigned int n_local_dofs = local_vector.size(); - - Threads::ThreadMutex::ScopedLock lock(mutex); for (unsigned int i=0; i &local_matrix, } internals::list_shellsort (my_indices); - Threads::ThreadMutex::ScopedLock lock(mutex); - // now in the second step actually // resolve the constraints const unsigned int n_constrained_dofs = constraint_lines.size(); @@ -1626,8 +1622,6 @@ distribute_local_to_global (const FullMatrix &local_matrix, } internals::list_shellsort (my_indices); - Threads::ThreadMutex::ScopedLock lock(mutex); - const unsigned int n_constrained_dofs = constraint_lines.size(); for (unsigned int i=0; i &local_dof_indices, actual_dof_indices.resize (added_rows); std::sort (actual_dof_indices.begin(), actual_dof_indices.end()); - Threads::ThreadMutex::ScopedLock lock(mutex); - const unsigned int n_constrained_dofs = constraint_lines.size(); for (unsigned int i=0; i &local_dof_indices, } internals::list_shellsort (my_indices); - Threads::ThreadMutex::ScopedLock lock(mutex); - // now in the second step actually // resolve the constraints const unsigned int n_constrained_dofs = constraint_lines.size(); @@ -2220,8 +2210,6 @@ add_entries_local_to_global (const std::vector &local_dof_indices, actual_dof_indices.resize (added_rows); std::sort (actual_dof_indices.begin(), actual_dof_indices.end()); - Threads::ThreadMutex::ScopedLock lock(mutex); - const unsigned int n_constrained_dofs = constraint_lines.size(); for (unsigned int i=0; i &local_dof_indices, } internals::list_shellsort (my_indices); - Threads::ThreadMutex::ScopedLock lock(mutex); - // now in the second step actually // resolve the constraints const unsigned int n_constrained_dofs = constraint_lines.size();