From d7d76dda888c726802c16cb2cd827eaac65cc066 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Mon, 4 Apr 2005 18:30:43 +0000 Subject: [PATCH] // for some reason, it does not // seem to be possible to force // actual allocation of actual // entries by using the last // arguments to the call above. if // we don't initialize the entries // like in the following loop, then // the program is unbearably slow // because elements are allocated // and accessed in random order, // which is not what PETSc likes git-svn-id: https://svn.dealii.org/trunk@10343 0785d39b-7218-0410-832d-ea1e28bc413d --- .../source/petsc_parallel_sparse_matrix.cc | 40 ++++++++++++++++--- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/deal.II/lac/source/petsc_parallel_sparse_matrix.cc b/deal.II/lac/source/petsc_parallel_sparse_matrix.cc index d0822ad99a..05fd72b0aa 100644 --- a/deal.II/lac/source/petsc_parallel_sparse_matrix.cc +++ b/deal.II/lac/source/petsc_parallel_sparse_matrix.cc @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 2004 by the deal.II authors +// Copyright (C) 2004, 2005 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -355,6 +355,9 @@ namespace PETScWrappers sparsity_pattern.row_length(i), &row_entries[0], &row_values[0], INSERT_VALUES); } + + compress (); + #else // first set up the column number @@ -397,16 +400,43 @@ namespace PETScWrappers &rowstart_in_window[0], &colnums_in_window[0], 0); - - -#endif + // for some reason, it does not + // seem to be possible to force + // actual allocation of actual + // entries by using the last + // arguments to the call above. if + // we don't initialize the entries + // like in the following loop, then + // the program is unbearably slow + // because elements are allocated + // and accessed in random order, + // which is not what PETSc likes + // + // note that we actually have to + // set the entries to something + // non-zero! + for (unsigned int i=local_row_start; i