]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Changed SparseDirectUMFPACK to use umfpack_dl_* routines
authorallmaras <allmaras@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 16 Oct 2008 18:28:08 +0000 (18:28 +0000)
committerallmaras <allmaras@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 16 Oct 2008 18:28:08 +0000 (18:28 +0000)
git-svn-id: https://svn.dealii.org/trunk@17243 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/doc/news/changes.h
deal.II/lac/include/lac/sparse_direct.h
deal.II/lac/source/sparse_direct.cc

index 313d6ee4d7388c03fb0df0566bd1c54f03f9745e..00a7296b5ffc4d726c2f4c4c5b5277ddf04cc197 100644 (file)
@@ -299,6 +299,15 @@ inconvenience this causes.
 <h3>lac</h3>
 
 <ol>
+  <li>
+  <p>
+  Changed: The SparseDirectUMFPACK class now calls the umfpack_dl_* routines 
+  instead of umfpack_di_*. On machines with 64-bit longs this allows the 
+  UMFPACK solver to allocate more than 2GB of memory for large problems.
+  <br>
+  (Moritz Allmaras 2008/10/16)
+  </p>
+
   <li>
   <p>
   Improved: The SparseILU::initialize function, for some reason, required
index 10b58e733195a9142a606c26f1ea25d7d69275d2..8ad51e6e3166ba52d0ea23a8d0f4d0b4e75bd88e 100644 (file)
@@ -1248,8 +1248,8 @@ class SparseDirectUMFPACK : public Subscriptor
                                       * The arrays in which we store the data
                                       * for the solver.
                                       */
-    std::vector<int> Ap;
-    std::vector<int> Ai;
+    std::vector<long int> Ap;
+    std::vector<long int> Ai;
     std::vector<double> Ax;
 
                                      /**
index f700dfa9e37bf9ce014e37e0a431528b99469902..808bb138a1abfae0758b186cf0abcfbb6994ee23 100644 (file)
@@ -1499,7 +1499,7 @@ SparseDirectUMFPACK::SparseDirectUMFPACK ()
                 numeric_decomposition (0),
                 control (UMFPACK_CONTROL)
 {
-  umfpack_di_defaults (&control[0]);
+  umfpack_dl_defaults (&control[0]);
 }
 
 
@@ -1511,23 +1511,23 @@ SparseDirectUMFPACK::clear ()
                                    // yet
   if (symbolic_decomposition != 0)
     {
-      umfpack_di_free_symbolic (&symbolic_decomposition);
+      umfpack_dl_free_symbolic (&symbolic_decomposition);
       symbolic_decomposition = 0;
     }
 
   if (numeric_decomposition != 0)
     {
-      umfpack_di_free_numeric (&numeric_decomposition);
+      umfpack_dl_free_numeric (&numeric_decomposition);
       numeric_decomposition = 0;
     }
   
   {
-    std::vector<int> tmp;
+    std::vector<long int> tmp;
     tmp.swap (Ap);
   }
 
   {
-    std::vector<int> tmp;
+    std::vector<long int> tmp;
     tmp.swap (Ai);
   }
   
@@ -1536,7 +1536,7 @@ SparseDirectUMFPACK::clear ()
     tmp.swap (Ax);
   }
 
-  umfpack_di_defaults (&control[0]);
+  umfpack_dl_defaults (&control[0]);
 }
 
 
@@ -1578,7 +1578,7 @@ sort_arrays (const SparseMatrix<number> &matrix)
                                        // that the row has at least two
                                        // entries and that the diagonal
                                        // entry is really in the wrong place
-      int cursor = Ap[row];
+      long int cursor = Ap[row];
       while ((cursor < Ap[row+1]-1) &&
              (Ai[cursor] > Ai[cursor+1]))
         {
@@ -1609,7 +1609,7 @@ sort_arrays (const BlockSparseMatrix<number> &matrix)
                                    // do it multiple times
   for (unsigned int row=0; row<matrix.m(); ++row)
     {
-      int cursor = Ap[row];
+      long int cursor = Ap[row];
       for (unsigned int block=0; block<matrix.n_block_cols(); ++block)
         {
 
@@ -1627,7 +1627,7 @@ sort_arrays (const BlockSparseMatrix<number> &matrix)
                                          // otherwise swap this entry
                                          // with successive ones as
                                          // long as necessary
-        int element = cursor;
+        long int element = cursor;
         while ((element < Ap[row+1]-1) &&
                (Ai[element] > Ai[element+1]))
           {
@@ -1660,7 +1660,7 @@ factorize (const Matrix &matrix)
                                    // work around this by, rather than
                                    // shuffling things around, copy over the
                                    // data we have, but then call the
-                                   // umfpack_di_solve function with the
+                                   // umfpack_dl_solve function with the
                                    // UMFPACK_At argument, meaning that we
                                    // want to solve for the transpose system
                                    //
@@ -1705,7 +1705,7 @@ factorize (const Matrix &matrix)
                                     // have an array that for each
                                     // row points to the first entry
                                     // not yet written to
-    std::vector<int> row_pointers = Ap;
+    std::vector<long int> row_pointers = Ap;
     
     for (typename Matrix::const_iterator p=matrix.begin();
          p!=matrix.end(); ++p)
@@ -1733,21 +1733,21 @@ factorize (const Matrix &matrix)
   sort_arrays (matrix);
         
   int status;
-  status = umfpack_di_symbolic (N, N,
+  status = umfpack_dl_symbolic (N, N,
                                 &Ap[0], &Ai[0], &Ax[0],
                                 &symbolic_decomposition,
                                 &control[0], 0);
   AssertThrow (status == UMFPACK_OK,
-               ExcUMFPACKError("umfpack_di_symbolic", status));
+               ExcUMFPACKError("umfpack_dl_symbolic", status));
   
-  status = umfpack_di_numeric (&Ap[0], &Ai[0], &Ax[0],
+  status = umfpack_dl_numeric (&Ap[0], &Ai[0], &Ax[0],
                                symbolic_decomposition,
                                &numeric_decomposition,
                                &control[0], 0);
   AssertThrow (status == UMFPACK_OK,
-               ExcUMFPACKError("umfpack_di_numeric", status));
+               ExcUMFPACKError("umfpack_dl_numeric", status));
 
-  umfpack_di_free_symbolic (&symbolic_decomposition) ;
+  umfpack_dl_free_symbolic (&symbolic_decomposition) ;
 }
 
 
@@ -1771,12 +1771,12 @@ SparseDirectUMFPACK::solve (Vector<double> &rhs_and_solution) const
                                    // SparsityPattern classes, we solve for
                                    // UMFPACK's A^T instead
   const int status
-    = umfpack_di_solve (UMFPACK_At,
+    = umfpack_dl_solve (UMFPACK_At,
                         &Ap[0], &Ai[0], &Ax[0],
                         rhs_and_solution.begin(), rhs.begin(),
                         numeric_decomposition,
                         &control[0], 0);
-  AssertThrow (status == UMFPACK_OK, ExcUMFPACKError("umfpack_di_solve", status));
+  AssertThrow (status == UMFPACK_OK, ExcUMFPACKError("umfpack_dl_solve", status));
 }
 
 

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.