]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix Cuthill-McKee renumbering on large processor counts 2497/head
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Mon, 11 Apr 2016 09:58:04 +0000 (11:58 +0200)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Mon, 11 Apr 2016 10:45:29 +0000 (12:45 +0200)
doc/news/changes.h
source/dofs/dof_renumbering.cc
source/dofs/dof_tools.inst.in

index fadcb84bdda5511d6de3c3a17c371db5149ed52b..1df3d429ec149093e290c615443cf6de4957b7fa 100644 (file)
@@ -171,6 +171,15 @@ inconvenience this causes.
 <h3>Specific improvements</h3>
 
 <ol>
+ <li> Improved: DoFRenumbering::compute_Cuthill_McKee when used with
+ distributed triangulations contained parts that scaled as the global problem
+ size, rather than the processor-local size. This prevented its use with more
+ than a few hundred cores when hanging node constraints were activated. This
+ has been fixed.
+ <br>
+ (Martin Kronbichler, 2016/04/11)
+ </li>
+
  <li> New: added hessenberg_signal and krylov_space_signal to SolverGMRES.
  These signals allow to retrieve the Hessenberg matrix and the basis vectors
  generated by the Arnoldi algorithm.
index ae35017783c86383710972867a73c6ad63633e50..e076b8ada5df31a3ab9a01b96e7984ee4c17ca86 100644 (file)
@@ -392,7 +392,12 @@ namespace DoFRenumbering
     // object will be empty and nothing happens
     ConstraintMatrix constraints;
     if (use_constraints)
-      DoFTools::make_hanging_node_constraints (dof_handler, constraints);
+      {
+        IndexSet relevant_dofs;
+        DoFTools::extract_locally_relevant_dofs(dof_handler, relevant_dofs);
+        constraints.reinit(relevant_dofs);
+        DoFTools::make_hanging_node_constraints (dof_handler, constraints);
+      }
     constraints.close ();
 
     const IndexSet locally_owned = dof_handler.locally_owned_dofs();
@@ -408,8 +413,7 @@ namespace DoFRenumbering
 
     // If the index set is not complete, need to get indices in local index
     // space.
-    if (locally_owned.n_elements() !=
-        locally_owned.size())
+    if (locally_owned.n_elements() != locally_owned.size())
       {
         // Create sparsity pattern from dsp by transferring its indices to
         // processor-local index space and doing Cuthill-McKee there
@@ -419,11 +423,14 @@ namespace DoFRenumbering
         for (unsigned int i=0; i<locally_owned.n_elements(); ++i)
           {
             const types::global_dof_index row = locally_owned.nth_index_in_set(i);
+            const unsigned int row_length = dsp.row_length(row);
             row_entries.clear();
-            for (DynamicSparsityPattern::iterator it =
-                   dsp.begin(row); it != dsp.end(row); ++it)
-              if (it->column() != row && locally_owned.is_element(it->column()))
-                row_entries.push_back(locally_owned.index_within_set(it->column()));
+            for (unsigned int j=0; j<row_length; ++j)
+              {
+                const unsigned int col = dsp.column_number(row, j);
+                if (col != row && locally_owned.is_element(col))
+                  row_entries.push_back(locally_owned.index_within_set(col));
+              }
             sparsity.add_entries(i, row_entries.begin(), row_entries.end(),
                                  true);
           }
index feabaa724266607dbd06d7c266f39280922351f5..6446b65023e3920eb3445d8de68b5e2b2f0bddab 100644 (file)
@@ -32,12 +32,20 @@ for (deal_II_dimension : DIMENSIONS)
 
 #if deal_II_dimension > 1
   template
-  void 
+  void
   DoFTools::extract_locally_relevant_dofs<DoFHandler<deal_II_dimension-1,deal_II_dimension > >
   (const DoFHandler<deal_II_dimension-1,deal_II_dimension > & dof_handler,
    IndexSet & dof_set);
 #endif
 
+#if deal_II_dimension > 2
+  template
+  void
+  DoFTools::extract_locally_relevant_dofs<DoFHandler<deal_II_dimension-2,deal_II_dimension > >
+  (const DoFHandler<deal_II_dimension-2,deal_II_dimension > & dof_handler,
+   IndexSet & dof_set);
+#endif
+
   template
   void DoFTools::make_vertex_patches (SparsityPattern&, const DoFHandler<deal_II_dimension>&,
   unsigned int, bool, bool, bool, bool);
@@ -207,7 +215,7 @@ void
 DoFTools::extract_locally_relevant_dofs<DoFHandler<deal_II_dimension> >
 (const DoFHandler<deal_II_dimension> & dof_handler,
  IndexSet & dof_set);
+
 template
 void
 DoFTools::extract_locally_relevant_dofs<hp::DoFHandler<deal_II_dimension> >
@@ -257,7 +265,7 @@ void
 DoFTools::get_subdomain_association<hp::DoFHandler<deal_II_dimension> >
 (const hp::DoFHandler<deal_II_dimension> &dof_handler,
  std::vector<types::subdomain_id>           &subdomain_association);
+
 template
 std::vector<IndexSet>
 DoFTools::locally_owned_dofs_per_subdomain<DoFHandler<deal_II_dimension> >
@@ -368,7 +376,7 @@ void
 DoFTools::get_subdomain_association<hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> >
 (const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> &dof_handler,
  std::vector<types::subdomain_id>           &subdomain_association);
+
 template
 std::vector<IndexSet>
 DoFTools::locally_owned_dofs_per_subdomain<DoFHandler<deal_II_dimension,deal_II_dimension+1> >
@@ -422,7 +430,7 @@ void
 DoFTools::get_subdomain_association<hp::DoFHandler<1,3> >
 (const hp::DoFHandler<1,3> &dof_handler,
  std::vector<types::subdomain_id>           &subdomain_association);
+
 template
 std::vector<IndexSet>
 DoFTools::locally_owned_dofs_per_subdomain<DoFHandler<1,3> >

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.