Amesos Package Browser (Single Doxygen Collection) Development
TestSuperludist.cpp
Go to the documentation of this file.
00001 #include "Epetra_Comm.h"
00002 #include "Teuchos_ParameterList.hpp"
00003 #include "Amesos.h"
00004 #include "Epetra_CrsMatrix.h"
00005 #include "Epetra_Map.h"
00006 #include "Epetra_Vector.h"
00007 #include "Epetra_LinearProblem.h"
00008 #include "PerformOneSolveAndTest.h"
00009 
00010 
00011 //
00012 //  Returns the number of failures.
00013 //  Note:  If AMESOS_SUPERLUDIST is not supported, TestSuperludist() will 
00014 //  always return 0
00015 //
00016 //  TestSuperludist performs the following tests:
00017 //                         Redistribute   AddZeroToDiag   SUB:  ReuseSymbolic MaxProcesses
00018 //  Test number:
00019 //   1 disabled AddToDiag=100 true           true                   true           2
00020 //   2 disabled AddToDiag=100 true           false                  true           2
00021 //   3                        true           true                   false          2
00022 //   4                        true           true                   true           1
00023 //   5                        true           true                   false          1
00024 //   6                        true           true                   false          10
00025 //   7                        true           false                  true           -1
00026 //   8                        true           false                  true           -2
00027 //   9                        true           false                  true           -3
00028 //   10                       true           false                  false          4  
00029 //   11                       false/true     true                   true           4
00030 //   12                       false/true     true                   true           2
00031 //     Test #12 appears to duplicate test #11 and perhaps #4 
00032 //   13                       false/true     true                   false          1
00033 //   14                       false/true     true                   false          2
00034 //   15                       false/true     false                  true           1
00035 //   16                       false/true     false                  true           2
00036 //   17 SamePattern           true           false                  true           10
00037 //   18 RowPerm - NATURAL     true           false                  false          10
00038 //   19 RowPerm - LargeDiag   true           false                  false          10
00039 //   20 RowPerm - NATURAL     true           false                  false          10
00040 //   21 RowPerm - LargeDiag   true           false                  false          10
00041 //   22 RowPerm - TinyPivot=t true           false                  false          10
00042 //   23 RowPerm - TinyPivot=f true           false                  false          10
00043 //   
00044 
00045 
00046 int TestSuperludist( Epetra_CrsMatrix *& Amat, 
00047          int EpetraMatrixType,
00048          bool transpose, 
00049          bool verbose, 
00050          int Levels,
00051          const double Rcond,
00052          double &maxrelerror, 
00053          double &maxrelresidual,
00054          char *filename,
00055          int &NumTests ) {
00056 
00057   std::string StringFilename = filename ; 
00058   bool ImpcolB = ( StringFilename.find("ImpcolB") < StringFilename.find("xdz_notaname_garbage") );
00059   int NumErrors = 0 ;
00060   maxrelerror = 0.0;
00061   maxrelresidual = 0.0;
00062   const Epetra_Comm& Comm = Amat->Comm();
00063   double relerror;
00064   double relresidual;
00065    
00066 
00067   {
00068     bool MyVerbose = false ; // if set to verbose - we exceed the test harness 1 Megabyte limit
00069     //  bool MyVerbose = verbose ; // if set to verbose - we exceed the test harness 1 Megabyte limit
00070 
00071     //
00072     //  Bug #1990 - AddToDiag fails in Amesos_Superludist 
00073     //
00074 #if 0 
00075     //  Test #1 - disabled - bug #1990
00076     {
00077       Teuchos::ParameterList ParamList ;
00078       ParamList.set( "Redistribute", true );
00079       ParamList.set( "AddZeroToDiag", true );
00080       ParamList.set( "AddToDiag", 1e2 );
00081       Teuchos::ParameterList& SuperludistParams = ParamList.sublist("Superludist") ;
00082       SuperludistParams.set( "ReuseSymbolic", true );
00083       SuperludistParams.set( "MaxProcesses", 2 );
00084       //  ParamList.print( std::cerr, 10 ) ; 
00085       
00086       const int ExpectedError = 0 ;
00087       int Errors = PerformOneSolveAndTest("Amesos_Superludist",
00088             EpetraMatrixType,
00089             Comm, 
00090             transpose, 
00091             MyVerbose,
00092             ParamList, 
00093             Amat, 
00094             Levels,
00095             Rcond, 
00096             relerror, 
00097             relresidual,
00098             ExpectedError ) ;
00099       
00100       if ( Errors < 0 ) {
00101   NumErrors++;
00102   NumTests++ ; 
00103   if ( MyVerbose ) {
00104     std::cout << "Amesos_Superludist failed with error code " << Errors<< std::endl ; 
00105   }
00106       } else { 
00107   
00108   NumErrors += Errors ; 
00109   maxrelerror = EPETRA_MAX( relerror, maxrelerror ) ; 
00110   maxrelresidual = EPETRA_MAX( relresidual, maxrelresidual ) ; 
00111   NumTests++ ; 
00112   
00113             
00114       }
00115     }
00116     {
00117 
00118       // Test #2 - disabled -  bug #1990 - AddToDiag fails 
00119       Teuchos::ParameterList ParamList ;
00120       ParamList.set( "Redistribute", true );
00121       ParamList.set( "AddZeroToDiag", false );
00122       ParamList.set( "AddToDiag", 1e2 );
00123       Teuchos::ParameterList& SuperludistParams = ParamList.sublist("Superludist") ;
00124       SuperludistParams.set( "ReuseSymbolic", true );
00125       SuperludistParams.set( "MaxProcesses", 2 );
00126       //  ParamList.print( std::cerr, 10 ) ; 
00127       
00128       int Errors = PerformOneSolveAndTest("Amesos_Superludist",
00129             EpetraMatrixType,
00130             Comm, 
00131             transpose, 
00132             MyVerbose,
00133             ParamList, 
00134             Amat, 
00135             Levels,
00136             Rcond, 
00137             relerror, 
00138             relresidual) ;
00139       
00140       if ( Errors < 0 ) {
00141   NumErrors++;
00142   NumTests++ ; 
00143   if ( MyVerbose ) {
00144     std::cout << "Amesos_Superludist failed with error code " << Errors<< std::endl ; 
00145   }
00146       } else { 
00147   
00148   NumErrors += Errors ; 
00149   maxrelerror = EPETRA_MAX( relerror, maxrelerror ) ; 
00150   maxrelresidual = EPETRA_MAX( relresidual, maxrelresidual ) ; 
00151   NumTests++ ; 
00152   
00153             
00154       }
00155     }
00156 #endif     
00157     {
00158       // test #3 - 
00159       Teuchos::ParameterList ParamList ;
00160       ParamList.set( "Redistribute", true );
00161       ParamList.set( "AddZeroToDiag", true );
00162       Teuchos::ParameterList& SuperludistParams = ParamList.sublist("Superludist") ;
00163       SuperludistParams.set( "ReuseSymbolic", false );
00164       SuperludistParams.set( "MaxProcesses", 2 );
00165       //  ParamList.print( std::cerr, 10 ) ; 
00166   
00167     if ( MyVerbose ) std::cout  << __FILE__ << "::"  << __LINE__ 
00168       << " ParamList = " <<
00169          ParamList <<  std::endl ; 
00170       
00171       NumErrors += PerformOneSolveAndTest("Amesos_Superludist",
00172             EpetraMatrixType,
00173             Comm, 
00174             transpose, 
00175             MyVerbose,
00176             ParamList, 
00177             Amat, 
00178             Levels,
00179             Rcond, 
00180             relerror, 
00181             relresidual ) ; 
00182       maxrelerror = EPETRA_MAX( relerror, maxrelerror ) ; 
00183       maxrelresidual = EPETRA_MAX( relresidual, maxrelresidual ) ; 
00184       NumTests++ ; 
00185   
00186     }
00187       
00188     {
00189       //  test #4 
00190       Teuchos::ParameterList ParamList ;
00191       ParamList.set( "Redistribute", true );
00192       ParamList.set( "AddZeroToDiag", true );
00193       Teuchos::ParameterList& SuperludistParams = ParamList.sublist("Superludist") ;
00194       SuperludistParams.set( "ReuseSymbolic", true );
00195       SuperludistParams.set( "MaxProcesses", 1 );
00196       //  ParamList.print( std::cerr, 10 ) ; 
00197    
00198       if ( MyVerbose ) std::cout  << __FILE__ << "::"  << __LINE__ 
00199          << " ParamList = " <<
00200            ParamList <<  std::endl ; 
00201       
00202       NumErrors += PerformOneSolveAndTest("Amesos_Superludist",
00203             EpetraMatrixType,
00204             Comm, 
00205             transpose, 
00206             MyVerbose,
00207             ParamList, 
00208             Amat, 
00209             Levels,
00210             Rcond, 
00211             relerror, 
00212             relresidual ) ; 
00213       maxrelerror = EPETRA_MAX( relerror, maxrelerror ) ; 
00214       maxrelresidual = EPETRA_MAX( relresidual, maxrelresidual ) ; 
00215       NumTests++ ; 
00216   
00217       //      NumErrors += PerformOneSolveAndTest( Comm, ParamList ) ; 
00218     }
00219 
00220     {
00221       //  test #5
00222       Teuchos::ParameterList ParamList ;
00223       ParamList.set( "Redistribute", true );
00224       ParamList.set( "AddZeroToDiag", true );
00225       Teuchos::ParameterList& SuperludistParams = ParamList.sublist("Superludist") ;
00226       SuperludistParams.set( "ReuseSymbolic", false );
00227       SuperludistParams.set( "MaxProcesses", 1 );
00228       //  ParamList.print( std::cerr, 10 ) ; 
00229    
00230       if ( MyVerbose ) std::cout  << __FILE__ << "::"  << __LINE__ 
00231          << " ParamList = " <<
00232            ParamList <<  std::endl ; 
00233       
00234       NumErrors += PerformOneSolveAndTest("Amesos_Superludist",
00235             EpetraMatrixType,
00236             Comm, 
00237             transpose, 
00238             MyVerbose,
00239             ParamList, 
00240             Amat, 
00241             Levels,
00242             Rcond, 
00243             relerror, 
00244             relresidual ) ; 
00245       maxrelerror = EPETRA_MAX( relerror, maxrelerror ) ; 
00246       maxrelresidual = EPETRA_MAX( relresidual, maxrelresidual ) ; 
00247       NumTests++ ; 
00248   
00249       //      NumErrors += PerformOneSolveAndTest( Comm, ParamList ) ; 
00250     }
00251   
00252   
00253     {
00254 
00255       //  test #6 
00256       Teuchos::ParameterList ParamList ;
00257       ParamList.set( "Redistribute", true );
00258       ParamList.set( "AddZeroToDiag", true );
00259       Teuchos::ParameterList& SuperludistParams = ParamList.sublist("Superludist") ;
00260       SuperludistParams.set( "ReuseSymbolic", false );
00261       SuperludistParams.set( "MaxProcesses", 10 );
00262       //  ParamList.print( std::cerr, 10 ) ; 
00263    
00264       NumErrors += PerformOneSolveAndTest("Amesos_Superludist",
00265             EpetraMatrixType,
00266             Comm, 
00267             transpose, 
00268             MyVerbose,
00269             ParamList, 
00270             Amat, 
00271             Levels,
00272             Rcond, 
00273             relerror, 
00274             relresidual ) ; 
00275       maxrelerror = EPETRA_MAX( relerror, maxrelerror ) ; 
00276       maxrelresidual = EPETRA_MAX( relresidual, maxrelresidual ) ; 
00277       NumTests++ ; 
00278   
00279       //      NumErrors += PerformOneSolveAndTest( Comm, ParamList ) ; 
00280     }
00281   
00282   
00283     {
00284       //  Test #7 
00285       Teuchos::ParameterList ParamList ;
00286       ParamList.set( "Redistribute", true );
00287       ParamList.set( "AddZeroToDiag", false );
00288       Teuchos::ParameterList& SuperludistParams = ParamList.sublist("Superludist") ;
00289       SuperludistParams.set( "ReuseSymbolic", true );
00290       SuperludistParams.set( "MaxProcesses", -1 );
00291       //  ParamList.print( std::cerr, 10 ) ; 
00292    
00293       if ( MyVerbose ) std::cout  << __FILE__ << "::"  << __LINE__ 
00294          << " ParamList = " <<
00295            ParamList <<  std::endl ; 
00296       
00297       NumErrors += PerformOneSolveAndTest("Amesos_Superludist",
00298             EpetraMatrixType,
00299             Comm, 
00300             transpose, 
00301             MyVerbose,
00302             ParamList, 
00303             Amat, 
00304             Levels,
00305             Rcond, 
00306             relerror, 
00307             relresidual ) ; 
00308       maxrelerror = EPETRA_MAX( relerror, maxrelerror ) ; 
00309       maxrelresidual = EPETRA_MAX( relresidual, maxrelresidual ) ; 
00310       NumTests++ ; 
00311   
00312       //      NumErrors += PerformOneSolveAndTest( Comm, ParamList ) ; 
00313     }
00314   
00315   
00316     {
00317       //  Test #8 
00318       Teuchos::ParameterList ParamList ;
00319       ParamList.set( "Redistribute", true );
00320       ParamList.set( "AddZeroToDiag", false );
00321       Teuchos::ParameterList& SuperludistParams = ParamList.sublist("Superludist") ;
00322       SuperludistParams.set( "ReuseSymbolic", true );
00323       SuperludistParams.set( "MaxProcesses", -2 );
00324       //  ParamList.print( std::cerr, 10 ) ; 
00325    
00326       if ( MyVerbose ) std::cout  << __FILE__ << "::"  << __LINE__ 
00327          << " ParamList = " <<
00328            ParamList <<  std::endl ; 
00329       
00330       NumErrors += PerformOneSolveAndTest("Amesos_Superludist",
00331             EpetraMatrixType,
00332             Comm, 
00333             transpose, 
00334             MyVerbose,
00335             ParamList, 
00336             Amat, 
00337             Levels,
00338             Rcond, 
00339             relerror, 
00340             relresidual ) ; 
00341       maxrelerror = EPETRA_MAX( relerror, maxrelerror ) ; 
00342       maxrelresidual = EPETRA_MAX( relresidual, maxrelresidual ) ; 
00343       NumTests++ ; 
00344   
00345       //      NumErrors += PerformOneSolveAndTest( Comm, ParamList ) ; 
00346     }
00347   
00348   
00349     {
00350       //  Test #9 
00351       Teuchos::ParameterList ParamList ;
00352       ParamList.set( "Redistribute", true );
00353       ParamList.set( "AddZeroToDiag", false );
00354       Teuchos::ParameterList& SuperludistParams = ParamList.sublist("Superludist") ;
00355       SuperludistParams.set( "ReuseSymbolic", false );
00356       SuperludistParams.set( "MaxProcesses", -3 );
00357       //  ParamList.print( std::cerr, 10 ) ; 
00358    
00359       if ( MyVerbose ) std::cout  << __FILE__ << "::"  << __LINE__ 
00360          << " ParamList = " <<
00361            ParamList <<  std::endl ; 
00362       
00363       NumErrors += PerformOneSolveAndTest("Amesos_Superludist",
00364             EpetraMatrixType,
00365             Comm, 
00366             transpose, 
00367             MyVerbose,
00368             ParamList, 
00369             Amat, 
00370             Levels,
00371             Rcond, 
00372             relerror, 
00373             relresidual ) ; 
00374       maxrelerror = EPETRA_MAX( relerror, maxrelerror ) ; 
00375       maxrelresidual = EPETRA_MAX( relresidual, maxrelresidual ) ; 
00376       NumTests++ ; 
00377   
00378       //      NumErrors += PerformOneSolveAndTest( Comm, ParamList ) ; 
00379     }
00380   
00381   
00382     {
00383       //  Test #10
00384       Teuchos::ParameterList ParamList ;
00385       ParamList.set( "Redistribute", true );
00386       ParamList.set( "AddZeroToDiag", false );
00387       Teuchos::ParameterList& SuperludistParams = ParamList.sublist("Superludist") ;
00388       SuperludistParams.set( "ReuseSymbolic", false );
00389       SuperludistParams.set( "MaxProcesses", 4 );
00390       //  ParamList.print( std::cerr, 10 ) ; 
00391    
00392       if ( MyVerbose ) std::cout  << __FILE__ << "::"  << __LINE__ 
00393          << " ParamList = " <<
00394            ParamList <<  std::endl ; 
00395       
00396       NumErrors += PerformOneSolveAndTest("Amesos_Superludist",
00397             EpetraMatrixType,
00398             Comm, 
00399             transpose, 
00400             MyVerbose,
00401             ParamList, 
00402             Amat, 
00403             Levels,
00404             Rcond, 
00405             relerror, 
00406             relresidual ) ; 
00407       maxrelerror = EPETRA_MAX( relerror, maxrelerror ) ; 
00408       maxrelresidual = EPETRA_MAX( relresidual, maxrelresidual ) ; 
00409       NumTests++ ; 
00410   
00411       //      NumErrors += PerformOneSolveAndTest( Comm, ParamList ) ; 
00412     }
00413   
00414 
00415     {
00416       //  Test #11 
00417       Teuchos::ParameterList ParamList ;
00418       ParamList.set( "AddZeroToDiag", true );
00419       Teuchos::ParameterList& SuperludistParams = ParamList.sublist("Superludist") ;
00420       SuperludistParams.set( "ReuseSymbolic", true );
00421       SuperludistParams.set( "MaxProcesses", 4 );
00422       if ( Amat->RowMatrixRowMap().LinearMap() == false )   // bug #1408
00423   ParamList.set( "Redistribute", true );
00424       else
00425   ParamList.set( "Redistribute", false );
00426       //  ParamList.print( std::cerr, 10 ) ; 
00427    
00428       if ( MyVerbose ) std::cout  << __FILE__ << "::"  << __LINE__ 
00429          << " ParamList = " <<
00430            ParamList <<  std::endl ; 
00431       
00432       NumErrors += PerformOneSolveAndTest("Amesos_Superludist",
00433             EpetraMatrixType,
00434             Comm, 
00435             transpose, 
00436             MyVerbose,
00437             ParamList, 
00438             Amat, 
00439             Levels,
00440             Rcond, 
00441             relerror, 
00442             relresidual ) ; 
00443       maxrelerror = EPETRA_MAX( relerror, maxrelerror ) ; 
00444       maxrelresidual = EPETRA_MAX( relresidual, maxrelresidual ) ; 
00445       NumTests++ ; 
00446   
00447       //      NumErrors += PerformOneSolveAndTest( Comm, ParamList ) ; 
00448     }
00449   
00450     {
00451       //  Test #12 
00452       Teuchos::ParameterList ParamList ;
00453       if ( Amat->RowMatrixRowMap().LinearMap() == false )   // bug #1408
00454   ParamList.set( "Redistribute", true );
00455       else
00456   ParamList.set( "Redistribute", false );
00457       ParamList.set( "AddZeroToDiag", true );
00458       Teuchos::ParameterList& SuperludistParams = ParamList.sublist("Superludist") ;
00459       SuperludistParams.set( "ReuseSymbolic", true );
00460       SuperludistParams.set( "MaxProcesses", 4 );
00461       //  ParamList.print( std::cerr, 10 ) ; 
00462    
00463       if ( MyVerbose ) std::cout  << __FILE__ << "::"  << __LINE__ 
00464          << " ParamList = " <<
00465            ParamList <<  std::endl ; 
00466       
00467       NumErrors += PerformOneSolveAndTest("Amesos_Superludist",
00468             EpetraMatrixType,
00469             Comm, 
00470             transpose, 
00471             MyVerbose,
00472             ParamList, 
00473             Amat, 
00474             Levels,
00475             Rcond, 
00476             relerror, 
00477             relresidual ) ; 
00478       maxrelerror = EPETRA_MAX( relerror, maxrelerror ) ; 
00479       maxrelresidual = EPETRA_MAX( relresidual, maxrelresidual ) ; 
00480       NumTests++ ; 
00481   
00482       //      NumErrors += PerformOneSolveAndTest( Comm, ParamList ) ; 
00483     }
00484   
00485   
00486     {
00487       //  Test #13 
00488       Teuchos::ParameterList ParamList ;
00489       if ( Amat->RowMatrixRowMap().LinearMap() == false )   // bug #1408
00490   ParamList.set( "Redistribute", true );
00491       else
00492   ParamList.set( "Redistribute", false );
00493       ParamList.set( "AddZeroToDiag", true );
00494       Teuchos::ParameterList& SuperludistParams = ParamList.sublist("Superludist") ;
00495       SuperludistParams.set( "ReuseSymbolic", false );
00496       SuperludistParams.set( "MaxProcesses", 1 );
00497       //  ParamList.print( std::cerr, 10 ) ; 
00498    
00499       if ( MyVerbose ) std::cout  << __FILE__ << "::"  << __LINE__ 
00500          << " ParamList = " <<
00501            ParamList <<  std::endl ; 
00502       
00503       NumErrors += PerformOneSolveAndTest("Amesos_Superludist",
00504             EpetraMatrixType,
00505             Comm, 
00506             transpose, 
00507             MyVerbose,
00508             ParamList, 
00509             Amat, 
00510             Levels,
00511             Rcond, 
00512             relerror, 
00513             relresidual ) ; 
00514       maxrelerror = EPETRA_MAX( relerror, maxrelerror ) ; 
00515       maxrelresidual = EPETRA_MAX( relresidual, maxrelresidual ) ; 
00516       NumTests++ ; 
00517   
00518       //      NumErrors += PerformOneSolveAndTest( Comm, ParamList ) ; 
00519     }
00520   
00521   
00522     {
00523       // Test #14 
00524       Teuchos::ParameterList ParamList ;
00525       if ( Amat->RowMatrixRowMap().LinearMap() == false )   // bug #1408
00526   ParamList.set( "Redistribute", true );
00527       else
00528   ParamList.set( "Redistribute", false );
00529       ParamList.set( "AddZeroToDiag", true );
00530       Teuchos::ParameterList& SuperludistParams = ParamList.sublist("Superludist") ;
00531       SuperludistParams.set( "ReuseSymbolic", false );
00532       SuperludistParams.set( "MaxProcesses", 2 );
00533       //  ParamList.print( std::cerr, 10 ) ; 
00534    
00535       if ( MyVerbose ) std::cout  << __FILE__ << "::"  << __LINE__ 
00536          << " ParamList = " <<
00537            ParamList <<  std::endl ; 
00538       
00539       NumErrors += PerformOneSolveAndTest("Amesos_Superludist",
00540             EpetraMatrixType,
00541             Comm, 
00542             transpose, 
00543             MyVerbose,
00544             ParamList, 
00545             Amat, 
00546             Levels,
00547             Rcond, 
00548             relerror, 
00549             relresidual ) ; 
00550       maxrelerror = EPETRA_MAX( relerror, maxrelerror ) ; 
00551       maxrelresidual = EPETRA_MAX( relresidual, maxrelresidual ) ; 
00552       NumTests++ ; 
00553   
00554       //      NumErrors += PerformOneSolveAndTest( Comm, ParamList ) ; 
00555     }
00556   
00557   
00558     {
00559       //  Test #15 
00560       Teuchos::ParameterList ParamList ;
00561       if ( Amat->RowMatrixRowMap().LinearMap() == false )   // bug #1408
00562   ParamList.set( "Redistribute", true );
00563       else
00564   ParamList.set( "Redistribute", false );
00565       ParamList.set( "AddZeroToDiag", false );
00566       Teuchos::ParameterList& SuperludistParams = ParamList.sublist("Superludist") ;
00567       SuperludistParams.set( "ReuseSymbolic", true );
00568       SuperludistParams.set( "MaxProcesses", 1 );
00569       //  ParamList.print( std::cerr, 10 ) ; 
00570    
00571       if ( MyVerbose ) std::cout  << __FILE__ << "::"  << __LINE__ 
00572          << " ParamList = " <<
00573            ParamList <<  std::endl ; 
00574       
00575       NumErrors += PerformOneSolveAndTest("Amesos_Superludist",
00576             EpetraMatrixType,
00577             Comm, 
00578             transpose, 
00579             MyVerbose,
00580             ParamList, 
00581             Amat, 
00582             Levels,
00583             Rcond, 
00584             relerror, 
00585             relresidual ) ; 
00586       maxrelerror = EPETRA_MAX( relerror, maxrelerror ) ; 
00587       maxrelresidual = EPETRA_MAX( relresidual, maxrelresidual ) ; 
00588       NumTests++ ; 
00589   
00590       //      NumErrors += PerformOneSolveAndTest( Comm, ParamList ) ; 
00591     }
00592   
00593   
00594     {
00595       //  Test #16 
00596       Teuchos::ParameterList ParamList ;
00597       if ( Amat->RowMatrixRowMap().LinearMap() == false )   // bug #1408
00598   ParamList.set( "Redistribute", true );
00599       else
00600   ParamList.set( "Redistribute", false );
00601       ParamList.set( "AddZeroToDiag", false );
00602       Teuchos::ParameterList& SuperludistParams = ParamList.sublist("Superludist") ;
00603       SuperludistParams.set( "ReuseSymbolic", true );
00604       SuperludistParams.set( "MaxProcesses", 2 );
00605       //  ParamList.print( std::cerr, 10 ) ; 
00606    
00607       if ( MyVerbose ) std::cout  << __FILE__ << "::"  << __LINE__ 
00608          << " ParamList = " <<
00609            ParamList <<  std::endl ; 
00610       
00611       NumErrors += PerformOneSolveAndTest("Amesos_Superludist",
00612             EpetraMatrixType,
00613             Comm, 
00614             transpose, 
00615             MyVerbose,
00616             ParamList, 
00617             Amat, 
00618             Levels,
00619             Rcond, 
00620             relerror, 
00621             relresidual ) ; 
00622       maxrelerror = EPETRA_MAX( relerror, maxrelerror ) ; 
00623       maxrelresidual = EPETRA_MAX( relresidual, maxrelresidual ) ; 
00624       NumTests++ ; 
00625   
00626       //      NumErrors += PerformOneSolveAndTest( Comm, ParamList ) ; 
00627     }
00628     {
00629       //  Test #17 
00630       Teuchos::ParameterList ParamList ;
00631       if ( Amat->RowMatrixRowMap().LinearMap() == false )   // bug #1408
00632   ParamList.set( "Redistribute", true );
00633       else
00634   ParamList.set( "Redistribute", false );
00635       ParamList.set( "AddZeroToDiag", false );
00636       Teuchos::ParameterList& SuperludistParams = ParamList.sublist("Superludist") ;
00637       SuperludistParams.set( "ReuseSymbolic", true );
00638       SuperludistParams.set( "Fact", "SamePattern" );
00639       SuperludistParams.set( "MaxProcesses", 2 );
00640       //  ParamList.print( std::cerr, 10 ) ; 
00641    
00642       if ( MyVerbose ) std::cout  << __FILE__ << "::"  << __LINE__ 
00643          << " ParamList = " <<
00644            ParamList <<  std::endl ; 
00645       
00646       NumErrors += PerformOneSolveAndTest("Amesos_Superludist",
00647             EpetraMatrixType,
00648             Comm, 
00649             transpose, 
00650             MyVerbose,
00651             ParamList, 
00652             Amat, 
00653             Levels,
00654             Rcond, 
00655             relerror, 
00656             relresidual ) ; 
00657       maxrelerror = EPETRA_MAX( relerror, maxrelerror ) ; 
00658       maxrelresidual = EPETRA_MAX( relresidual, maxrelresidual ) ; 
00659       NumTests++ ; 
00660   
00661       //      NumErrors += PerformOneSolveAndTest( Comm, ParamList ) ; 
00662     }
00663   
00664     if (!ImpcolB )   // ImpcolB fails if the NATURAL order - i.e. no pivoting - is chosen  
00665     {
00666       //  Test #18 
00667       Teuchos::ParameterList ParamList ;
00668       ParamList.set( "Redistribute", true );
00669       ParamList.set( "AddZeroToDiag", false );
00670       Teuchos::ParameterList& SuperludistParams = ParamList.sublist("Superludist") ;
00671       SuperludistParams.set( "ReuseSymbolic", false );
00672       SuperludistParams.set( "RowPerm", "NATURAL" );
00673       SuperludistParams.set( "MaxProcesses", 10 );
00674       //  ParamList.print( std::cerr, 10 ) ; 
00675    
00676       if ( MyVerbose ) std::cout  << __FILE__ << "::"  << __LINE__ 
00677          << " ParamList = " <<
00678            ParamList <<  std::endl ; 
00679       
00680       NumErrors += PerformOneSolveAndTest("Amesos_Superludist",
00681             EpetraMatrixType,
00682             Comm, 
00683             transpose, 
00684             MyVerbose,
00685             ParamList, 
00686             Amat, 
00687             Levels,
00688             Rcond, 
00689             relerror, 
00690             relresidual ) ; 
00691       maxrelerror = EPETRA_MAX( relerror, maxrelerror ) ; 
00692       maxrelresidual = EPETRA_MAX( relresidual, maxrelresidual ) ; 
00693       NumTests++ ; 
00694   
00695       //      NumErrors += PerformOneSolveAndTest( Comm, ParamList ) ; 
00696     }
00697   
00698   
00699     {
00700       //  Test #19 
00701       Teuchos::ParameterList ParamList ;
00702       ParamList.set( "Redistribute", true );
00703       ParamList.set( "AddZeroToDiag", false );
00704       Teuchos::ParameterList& SuperludistParams = ParamList.sublist("Superludist") ;
00705       SuperludistParams.set( "ReuseSymbolic", false );
00706       SuperludistParams.set( "RowPerm", "LargeDiag" );
00707       SuperludistParams.set( "MaxProcesses", 10 );
00708       //  ParamList.print( std::cerr, 10 ) ; 
00709    
00710       if ( MyVerbose ) std::cout  << __FILE__ << "::"  << __LINE__ 
00711          << " ParamList = " <<
00712            ParamList <<  std::endl ; 
00713       
00714       NumErrors += PerformOneSolveAndTest("Amesos_Superludist",
00715             EpetraMatrixType,
00716             Comm, 
00717             transpose, 
00718             MyVerbose,
00719             ParamList, 
00720             Amat, 
00721             Levels,
00722             Rcond, 
00723             relerror, 
00724             relresidual ) ; 
00725       maxrelerror = EPETRA_MAX( relerror, maxrelerror ) ; 
00726       maxrelresidual = EPETRA_MAX( relresidual, maxrelresidual ) ; 
00727       NumTests++ ; 
00728   
00729       //      NumErrors += PerformOneSolveAndTest( Comm, ParamList ) ; 
00730     }
00731   
00732   
00733     if (!ImpcolB )   // ImpcolB fails if the NATURAL order - i.e. no pivoting - is chosen  
00734     {
00735       //  Test #20 
00736       Teuchos::ParameterList ParamList ;
00737       ParamList.set( "Redistribute", true );
00738       ParamList.set( "AddZeroToDiag", false );
00739       Teuchos::ParameterList& SuperludistParams = ParamList.sublist("Superludist") ;
00740       SuperludistParams.set( "ReuseSymbolic", true );
00741       SuperludistParams.set( "RowPerm", "NATURAL" );
00742       SuperludistParams.set( "MaxProcesses", 10 );
00743       //  ParamList.print( std::cerr, 10 ) ; 
00744    
00745       if ( MyVerbose ) std::cout  << __FILE__ << "::"  << __LINE__ 
00746          << " ParamList = " <<
00747            ParamList <<  std::endl ; 
00748       
00749       NumErrors += PerformOneSolveAndTest("Amesos_Superludist",
00750             EpetraMatrixType,
00751             Comm, 
00752             transpose, 
00753             MyVerbose,
00754             ParamList, 
00755             Amat, 
00756             Levels,
00757             Rcond, 
00758             relerror, 
00759             relresidual ) ; 
00760       maxrelerror = EPETRA_MAX( relerror, maxrelerror ) ; 
00761       maxrelresidual = EPETRA_MAX( relresidual, maxrelresidual ) ; 
00762       NumTests++ ; 
00763   
00764       //      NumErrors += PerformOneSolveAndTest( Comm, ParamList ) ; 
00765     }
00766   
00767   
00768     {
00769       //  Test #21
00770       Teuchos::ParameterList ParamList ;
00771       ParamList.set( "Redistribute", true );
00772       ParamList.set( "AddZeroToDiag", false );
00773       Teuchos::ParameterList& SuperludistParams = ParamList.sublist("Superludist") ;
00774       SuperludistParams.set( "ReuseSymbolic", true );
00775       SuperludistParams.set( "RowPerm", "LargeDiag" );
00776       SuperludistParams.set( "MaxProcesses", 10 );
00777       //  ParamList.print( std::cerr, 10 ) ; 
00778    
00779       if ( MyVerbose ) std::cout  << __FILE__ << "::"  << __LINE__ 
00780          << " ParamList = " <<
00781            ParamList <<  std::endl ; 
00782       
00783       NumErrors += PerformOneSolveAndTest("Amesos_Superludist",
00784             EpetraMatrixType,
00785             Comm, 
00786             transpose, 
00787             MyVerbose,
00788             ParamList, 
00789             Amat, 
00790             Levels,
00791             Rcond, 
00792             relerror, 
00793             relresidual ) ; 
00794       maxrelerror = EPETRA_MAX( relerror, maxrelerror ) ; 
00795       maxrelresidual = EPETRA_MAX( relresidual, maxrelresidual ) ; 
00796       NumTests++ ; 
00797   
00798       //      NumErrors += PerformOneSolveAndTest( Comm, ParamList ) ; 
00799     }
00800   
00801     {
00802       //  Test #22
00803       Teuchos::ParameterList ParamList ;
00804       ParamList.set( "Redistribute", true );
00805       ParamList.set( "AddZeroToDiag", false );
00806       Teuchos::ParameterList& SuperludistParams = ParamList.sublist("Superludist") ;
00807       SuperludistParams.set( "ReuseSymbolic", true );
00808       SuperludistParams.set( "ReplaceTinyPivot", true );
00809       SuperludistParams.set( "MaxProcesses", 10 );
00810       //  ParamList.print( std::cerr, 10 ) ; 
00811    
00812       if ( MyVerbose ) std::cout  << __FILE__ << "::"  << __LINE__ 
00813          << " ParamList = " <<
00814            ParamList <<  std::endl ; 
00815       
00816       NumErrors += PerformOneSolveAndTest("Amesos_Superludist",
00817             EpetraMatrixType,
00818             Comm, 
00819             transpose, 
00820             MyVerbose,
00821             ParamList, 
00822             Amat, 
00823             Levels,
00824             Rcond, 
00825             relerror, 
00826             relresidual ) ; 
00827       maxrelerror = EPETRA_MAX( relerror, maxrelerror ) ; 
00828       maxrelresidual = EPETRA_MAX( relresidual, maxrelresidual ) ; 
00829       NumTests++ ; 
00830   
00831       //      NumErrors += PerformOneSolveAndTest( Comm, ParamList ) ; 
00832     }
00833   
00834     {
00835       //  Test #23
00836       Teuchos::ParameterList ParamList ;
00837       ParamList.set( "Redistribute", true );
00838       ParamList.set( "AddZeroToDiag", false );
00839       Teuchos::ParameterList& SuperludistParams = ParamList.sublist("Superludist") ;
00840       SuperludistParams.set( "ReuseSymbolic", true );
00841       SuperludistParams.set( "ReplaceTinyPivot", false );
00842       SuperludistParams.set( "MaxProcesses", 10 );
00843       //  ParamList.print( std::cerr, 10 ) ; 
00844    
00845       if ( MyVerbose ) std::cout  << __FILE__ << "::"  << __LINE__ 
00846          << " ParamList = " <<
00847            ParamList <<  std::endl ; 
00848       
00849       NumErrors += PerformOneSolveAndTest("Amesos_Superludist",
00850             EpetraMatrixType,
00851             Comm, 
00852             transpose, 
00853             MyVerbose,
00854             ParamList, 
00855             Amat, 
00856             Levels,
00857             Rcond, 
00858             relerror, 
00859             relresidual ) ; 
00860       maxrelerror = EPETRA_MAX( relerror, maxrelerror ) ; 
00861       maxrelresidual = EPETRA_MAX( relresidual, maxrelresidual ) ; 
00862       NumTests++ ; 
00863   
00864       //      NumErrors += PerformOneSolveAndTest( Comm, ParamList ) ; 
00865     }
00866   
00867   
00868 
00869     return NumErrors; 
00870   }
00871 
00872 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines