]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Use 64 bits version of trilinos functions and replace n_global_elements by NumGlobalE...
authorturcksin <turcksin@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 26 Mar 2013 15:50:26 +0000 (15:50 +0000)
committerturcksin <turcksin@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 26 Mar 2013 15:50:26 +0000 (15:50 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_bigger_global_dof_indices_4@29039 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/lac/trilinos_sparse_matrix.h
deal.II/include/deal.II/lac/trilinos_sparsity_pattern.h
deal.II/include/deal.II/lac/trilinos_vector_base.h
deal.II/source/lac/trilinos_precondition.cc
deal.II/source/lac/trilinos_sparsity_pattern.cc
deal.II/source/lac/trilinos_vector.cc
deal.II/source/lac/trilinos_vector_base.cc

index 82a5ca95b947e5f0ffcd9cdeb8f4bf38da3225d7..c44a0e1459b0547080484294299b9ee1de15417b 100644 (file)
@@ -3027,8 +3027,8 @@ namespace TrilinosWrappers
   SparseMatrix::in_local_range (const size_type index) const
   {
     TrilinosWrappers::types::int_type begin, end;
-    begin = matrix->RowMap().MinMyGID();
-    end = matrix->RowMap().MaxMyGID()+1;
+    begin = matrix->RowMap().MinMyGID64();
+    end = matrix->RowMap().MaxMyGID64()+1;
 
     return ((index >= static_cast<size_type>(begin)) &&
             (index < static_cast<size_type>(end)));
index a0b7cb947facceda5c9b940fe42286fe3d49a3dc..99ad13531c5a6eff4c362a3826cb8e25839f3eb2 100644 (file)
@@ -1011,7 +1011,7 @@ namespace TrilinosWrappers
      * entries per row on the current
      * processor.
      */
-    size_type max_entries_per_row () const;
+    unsigned int max_entries_per_row () const;
 
     /**
      * Return the number of rows in this
@@ -1594,8 +1594,8 @@ namespace TrilinosWrappers
   SparsityPattern::in_local_range (const size_type index) const
   {
     TrilinosWrappers::types::int_type begin, end;
-    begin = graph->RowMap().MinMyGID();
-    end = graph->RowMap().MaxMyGID()+1;
+    begin = graph->RowMap().MinMyGID64();
+    end = graph->RowMap().MaxMyGID64()+1;
 
     return ((index >= static_cast<size_type>(begin)) &&
             (index < static_cast<size_type>(end)));
index f38ba80582e03a1c106397d07efa706cc2610dd4..02e2bff5c775dd3f91c791fb0429d5cc6872068f 100644 (file)
@@ -1490,8 +1490,8 @@ namespace TrilinosWrappers
   VectorBase::local_range () const
   {
     TrilinosWrappers::types::int_type begin, end;
-    begin = vector->Map().MinMyGID();
-    end = vector->Map().MaxMyGID()+1;
+    begin = vector->Map().MinMyGID64();
+    end = vector->Map().MaxMyGID64()+1;
     return std::make_pair (begin, end);
   }
 
index 6a8e1d52427a6c9340b12443b1f8c7929ae63e1f..6203d1f313305f3232ab999ebe49bcf9ffc497d2 100644 (file)
@@ -591,9 +591,9 @@ namespace TrilinosWrappers
           Assert (n_relevant_rows == my_size,
                   ExcDimensionMismatch(n_relevant_rows, my_size));
         Assert (n_rows ==
-                static_cast<size_type>(distributed_constant_modes.GlobalLength()),
+                static_cast<size_type>(distributed_constant_modes.GlobalLength64()),
                 ExcDimensionMismatch(n_rows,
-                                     distributed_constant_modes.GlobalLength()));
+                                     distributed_constant_modes.GlobalLength64()));
 
         // Reshape null space as a
         // contiguous vector of
index ea9fc2014d6cabf653737c9620903a87e2c878da..a72333ad852de9e2bc6da112ae9df1323b8b30b2 100644 (file)
@@ -26,25 +26,6 @@ DEAL_II_NAMESPACE_OPEN
 
 namespace TrilinosWrappers
 {
-  namespace
-  {
-    // define a helper function that queries the size of an Epetra_Map object
-    // by calling either the 32- or 64-bit function necessary, and returns the
-    // result in the correct data type so that we can use it in calling other
-    // Epetra member functions that are overloaded by index type
-#ifndef DEAL_II_USE_LARGE_INDEX_TYPE
-    int n_global_elements (const Epetra_BlockMap &map)
-    {
-      return map.NumGlobalElements();
-    }
-#else
-    long long int n_global_elements (const Epetra_BlockMap &map)
-    {
-      return map.NumGlobalElements64();
-    }
-#endif
-  }
-
 
   namespace SparsityPatternIterators
   {
@@ -69,6 +50,7 @@ namespace TrilinosWrappers
       // get a representation of the present
       // row
       int ncols;
+      // TODO: casting a size_type to an int, could be a problem
       int colnums = sparsity_pattern->n_cols();
 
       int ierr;
@@ -265,7 +247,7 @@ namespace TrilinosWrappers
     // release memory before reallocation
     graph.reset ();
     AssertDimension (n_entries_per_row.size(),
-                     static_cast<size_type>(n_global_elements(input_row_map)));
+                     static_cast<size_type>(input_row_map.NumGlobalElements64()));
 
     column_space_map.reset (new Epetra_Map (input_col_map));
     compressed = false;
@@ -333,9 +315,9 @@ namespace TrilinosWrappers
     graph.reset ();
 
     AssertDimension (sp.n_rows(),
-                     static_cast<size_type>(n_global_elements(input_row_map)));
+                     static_cast<size_type>(input_row_map.NumGlobalElements64()));
     AssertDimension (sp.n_cols(),
-                     static_cast<size_type>(n_global_elements(input_col_map)));
+                     static_cast<size_type>(input_col_map.NumGlobalElements64()));
 
     column_space_map.reset (new Epetra_Map (input_col_map));
     compressed = false;
@@ -575,9 +557,9 @@ namespace TrilinosWrappers
   {
     TrilinosWrappers::types::int_type n_cols;
     if (graph->Filled() == true)
-      n_cols = graph -> NumGlobalCols();
+      n_cols = graph -> NumGlobalCols64();
     else
-      n_cols = n_global_elements(*column_space_map);
+      n_cols = column_space_map->NumGlobalElements64();
 
     return n_cols;
   }
@@ -609,19 +591,19 @@ namespace TrilinosWrappers
   SparsityPattern::size_type
   SparsityPattern::n_nonzero_elements () const
   {
-    TrilinosWrappers::types::int_type nnz = graph->NumGlobalEntries();
+    TrilinosWrappers::types::int_type nnz = graph->NumGlobalEntries64();
 
     return static_cast<size_type>(nnz);
   }
 
 
 
-  SparsityPattern::size_type
+  unsigned int
   SparsityPattern::max_entries_per_row () const
   {
-    TrilinosWrappers::types::int_type nnz = graph->MaxNumIndices();
+    int nnz = graph->MaxNumIndices();
 
-    return static_cast<size_type>(nnz);
+    return static_cast<unsigned int>(nnz);
   }
 
 
index 4bdb8c558af0e8a1a52051e80215c3fdf2da7820..e58e0abaf3bc60f39f51c564eccf426ab80ce39a 100644 (file)
@@ -28,25 +28,6 @@ DEAL_II_NAMESPACE_OPEN
 
 namespace TrilinosWrappers
 {
-  namespace
-  {
-    // define a helper function that queries the size of an Epetra_Map object
-    // by calling either the 32- or 64-bit function necessary, and returns the
-    // result in the correct data type so that we can use it in calling other
-    // Epetra member functions that are overloaded by index type
-#ifndef DEAL_II_USE_LARGE_INDEX_TYPE
-    int n_global_elements (const Epetra_BlockMap &map)
-    {
-      return map.NumGlobalElements();
-    }
-#else
-    long long int n_global_elements (const Epetra_BlockMap &map)
-    {
-      return map.NumGlobalElements64();
-    }
-#endif
-  }
-
   namespace MPI
   {
 
@@ -90,9 +71,9 @@ namespace TrilinosWrappers
       :
       VectorBase()
     {
-      AssertThrow (n_global_elements(input_map) == n_global_elements(v.vector->Map()),
-                  ExcDimensionMismatch (n_global_elements(input_map),
-                                        n_global_elements(v.vector->Map())));
+      AssertThrow (input_map.NumGlobalElements64() == v.vector->Map().NumGlobalElements64(),
+                  ExcDimensionMismatch (input_map.NumGlobalElements64(),
+                                        v.vector->Map().NumGlobalElements64()));
 
       last_action = Zero;
 
@@ -113,9 +94,10 @@ namespace TrilinosWrappers
       :
       VectorBase()
     {
-      AssertThrow ((size_type)parallel_partitioner.size() == n_global_elements(v.vector->Map()),
+      AssertThrow (parallel_partitioner.size() == 
+                   static_cast<size_type>(v.vector->Map().NumGlobalElements64()),
                    ExcDimensionMismatch (parallel_partitioner.size(),
-                                         n_global_elements(v.vector->Map())));
+                                         v.vector->Map().NumGlobalElements64()));
 
       last_action = Zero;
 
@@ -283,9 +265,9 @@ namespace TrilinosWrappers
 
       if (import_data == true)
         {
-          AssertThrow (static_cast<size_type>(actual_vec->GlobalLength())
+          AssertThrow (static_cast<size_type>(actual_vec->GlobalLength64())
                        == v.size(),
-                       ExcDimensionMismatch (actual_vec->GlobalLength(),
+                       ExcDimensionMismatch (actual_vec->GlobalLength64(),
                                              v.size()));
 
           Epetra_Import data_exchange (vector->Map(), actual_vec->Map());
@@ -405,7 +387,7 @@ namespace TrilinosWrappers
   Vector::Vector (const Epetra_Map &input_map)
   {
     last_action = Zero;
-    Epetra_LocalMap map (n_global_elements(input_map),
+    Epetra_LocalMap map (input_map.NumGlobalElements64(),
                          input_map.IndexBase(),
                          input_map.Comm());
     vector.reset (new Epetra_FEVector(map));
@@ -433,7 +415,7 @@ namespace TrilinosWrappers
   Vector::Vector (const VectorBase &v)
   {
     last_action = Zero;
-    Epetra_LocalMap map (n_global_elements(v.vector->Map()),
+    Epetra_LocalMap map (v.vector->Map().NumGlobalElements64(),
                          v.vector->Map().IndexBase(),
                          v.vector->Map().Comm());
     vector.reset (new Epetra_FEVector(map));
@@ -479,9 +461,9 @@ namespace TrilinosWrappers
   Vector::reinit (const Epetra_Map &input_map,
                   const bool        fast)
   {
-    if (n_global_elements(vector->Map()) != n_global_elements(input_map))
+    if (vector->Map().NumGlobalElements64() != input_map.NumGlobalElements64())
       {
-        Epetra_LocalMap map (n_global_elements(input_map),
+        Epetra_LocalMap map (input_map.NumGlobalElements64(),
                              input_map.IndexBase(),
                              input_map.Comm());
         vector.reset (new Epetra_FEVector (map));
@@ -506,7 +488,7 @@ namespace TrilinosWrappers
                   const MPI_Comm &communicator,
                   const bool      fast)
   {
-    if (n_global_elements(vector->Map()) !=
+    if (vector->Map().NumGlobalElements64() !=
         static_cast<TrilinosWrappers::types::int_type>(partitioning.size()))
       {
         Epetra_LocalMap map (static_cast<TrilinosWrappers::types::int_type>(partitioning.size()),
@@ -550,7 +532,7 @@ namespace TrilinosWrappers
       {
         if (local_range() != v.local_range())
           {
-            Epetra_LocalMap map (v.vector->GlobalLength(),
+            Epetra_LocalMap map (v.vector->GlobalLength64(),
                                  v.vector->Map().IndexBase(),
                                  v.vector->Comm());
             vector.reset (new Epetra_FEVector(map));
@@ -605,7 +587,7 @@ namespace TrilinosWrappers
   {
     if (size() != v.size())
       {
-        Epetra_LocalMap map (n_global_elements(v.vector->Map()),
+        Epetra_LocalMap map (v.vector->Map().NumGlobalElements64(),
                              v.vector->Map().IndexBase(),
                              v.vector->Comm());
         vector.reset (new Epetra_FEVector(map));
@@ -622,7 +604,7 @@ namespace TrilinosWrappers
   {
     if (size() != v.size())
       {
-        Epetra_LocalMap map (n_global_elements(v.vector->Map()),
+        Epetra_LocalMap map (v.vector->Map().NumGlobalElements64(),
                              v.vector->Map().IndexBase(),
                              v.vector->Comm());
         vector.reset (new Epetra_FEVector(map));
index f8f86754225ae0cfbc1f126c6501489e36d226e0..c8239f72d2da2161e14eab383531b49148ea44db 100644 (file)
@@ -350,7 +350,7 @@ namespace TrilinosWrappers
   void
   VectorBase::print (const char *format) const
   {
-    Assert (vector->GlobalLength()!=0, ExcEmptyObject());
+    Assert (vector->GlobalLength64()!=0, ExcEmptyObject());
 
     for (size_type j=0; j<size(); ++j)
       {

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.