]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Remove Locks from ConstraintMatrix class. The responsibility is now to the user for...
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Thu, 7 May 2009 14:09:29 +0000 (14:09 +0000)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Thu, 7 May 2009 14:09:29 +0000 (14:09 +0000)
git-svn-id: https://svn.dealii.org/trunk@18821 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/constraint_matrix.h
deal.II/lac/include/lac/constraint_matrix.templates.h

index 0d0027a4e2468784b7268c43102aa70a4aae323b..e225a76fd4628814b5c8a1112c96fbaae97e478a 100644 (file)
@@ -18,7 +18,6 @@
 #include <base/exceptions.h>
 #include <base/subscriptor.h>
 #include <base/table.h>
-#include <base/thread_management.h>
 #include <base/template_constraints.h>
 
 #include <vector>
@@ -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 <typename VectorType>
     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 <typename MatrixType>
     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 <typename MatrixType, typename VectorType>
     void
@@ -1446,14 +1460,6 @@ class ConstraintMatrix : public Subscriptor
                                      */
     static const Table<2,bool> default_empty_table;
 
-                                    /**
-                                     * A mutex that makes the function
-                                     * <tt>distribute_local_to_global()</tt>
-                                     * only accessible to one process at
-                                     * time.
-                                     */
-    mutable Threads::ThreadMutex mutex;
-
                                     /**
                                      * This function actually implements
                                      * the local_to_global function for
index 1fca3f87761a5c3f72a8e320f8ece374d3e76793..b0ac3ed4f80a2b2ef33ed06830eb09dfb2f2b830 100644 (file)
@@ -743,8 +743,6 @@ distribute_local_to_global (const Vector<double>            &local_vector,
     }
 
   const unsigned int n_local_dofs = local_vector.size();
-  
-  Threads::ThreadMutex::ScopedLock lock(mutex);
   for (unsigned int i=0; i<n_local_dofs; ++i)
     {
                                   // let's see if we can use the bool
@@ -1300,8 +1298,6 @@ distribute_local_to_global (const FullMatrix<double>        &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<double>        &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<n_constrained_dofs; ++i)
     {
@@ -1881,8 +1875,6 @@ add_entries_local_to_global (const std::vector<unsigned int> &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<n_constrained_dofs; ++i)
        {
@@ -1985,8 +1977,6 @@ add_entries_local_to_global (const std::vector<unsigned int> &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<unsigned int> &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<n_constrained_dofs; ++i)
        {
@@ -2343,8 +2331,6 @@ add_entries_local_to_global (const std::vector<unsigned int> &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();

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.