Amesos Package Browser (Single Doxygen Collection)  Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TestSuperludist.cpp
Go to the documentation of this file.
1 #include "Epetra_Comm.h"
3 #include "Amesos.h"
4 #include "Epetra_CrsMatrix.h"
5 #include "Epetra_Map.h"
6 #include "Epetra_Vector.h"
7 #include "Epetra_LinearProblem.h"
9 
10 
11 //
12 // Returns the number of failures.
13 // Note: If AMESOS_SUPERLUDIST is not supported, TestSuperludist() will
14 // always return 0
15 //
16 // TestSuperludist performs the following tests:
17 // Redistribute AddZeroToDiag SUB: ReuseSymbolic MaxProcesses
18 // Test number:
19 // 1 disabled AddToDiag=100 true true true 2
20 // 2 disabled AddToDiag=100 true false true 2
21 // 3 true true false 2
22 // 4 true true true 1
23 // 5 true true false 1
24 // 6 true true false 10
25 // 7 true false true -1
26 // 8 true false true -2
27 // 9 true false true -3
28 // 10 true false false 4
29 // 11 false/true true true 4
30 // 12 false/true true true 2
31 // Test #12 appears to duplicate test #11 and perhaps #4
32 // 13 false/true true false 1
33 // 14 false/true true false 2
34 // 15 false/true false true 1
35 // 16 false/true false true 2
36 // 17 SamePattern true false true 10
37 // 18 RowPerm - NATURAL true false false 10
38 // 19 RowPerm - LargeDiag_MC64 true false false 10
39 // 20 RowPerm - NATURAL true false false 10
40 // 21 RowPerm - LargeDiag_MC64 true false false 10
41 // 22 RowPerm - TinyPivot=t true false false 10
42 // 23 RowPerm - TinyPivot=f true false false 10
43 //
44 
45 
47  int EpetraMatrixType,
48  bool transpose,
49  bool verbose,
50  int Levels,
51  const double Rcond,
52  double &maxrelerror,
53  double &maxrelresidual,
54  const char *filename,
55  int &NumTests ) {
56 
57  std::string StringFilename = filename ;
58  bool ImpcolB = ( StringFilename.find("ImpcolB") < StringFilename.find("xdz_notaname_garbage") );
59  int NumErrors = 0 ;
60  maxrelerror = 0.0;
61  maxrelresidual = 0.0;
62  const Epetra_Comm& Comm = Amat->Comm();
63  double relerror;
64  double relresidual;
65 
66 
67  {
68  bool MyVerbose = false ; // if set to verbose - we exceed the test harness 1 Megabyte limit
69  // bool MyVerbose = verbose ; // if set to verbose - we exceed the test harness 1 Megabyte limit
70 
71  //
72  // Bug #1990 - AddToDiag fails in Amesos_Superludist
73  //
74 #if 0
75  // Test #1 - disabled - bug #1990
76  {
77  Teuchos::ParameterList ParamList ;
78  ParamList.set( "Redistribute", true );
79  ParamList.set( "AddZeroToDiag", true );
80  ParamList.set( "AddToDiag", 1e2 );
81  Teuchos::ParameterList& SuperludistParams = ParamList.sublist("Superludist") ;
82  SuperludistParams.set( "ReuseSymbolic", true );
83  SuperludistParams.set( "MaxProcesses", 2 );
84  // ParamList.print( std::cerr, 10 ) ;
85 
86  const int ExpectedError = 0 ;
87  int Errors = PerformOneSolveAndTest("Amesos_Superludist",
88  EpetraMatrixType,
89  Comm,
90  transpose,
91  MyVerbose,
92  ParamList,
93  Amat,
94  Levels,
95  Rcond,
96  relerror,
97  relresidual,
98  ExpectedError ) ;
99 
100  if ( Errors < 0 ) {
101  NumErrors++;
102  NumTests++ ;
103  if ( MyVerbose ) {
104  std::cout << "Amesos_Superludist failed with error code " << Errors<< std::endl ;
105  }
106  } else {
107 
108  NumErrors += Errors ;
109  maxrelerror = EPETRA_MAX( relerror, maxrelerror ) ;
110  maxrelresidual = EPETRA_MAX( relresidual, maxrelresidual ) ;
111  NumTests++ ;
112 
113 
114  }
115  }
116  {
117 
118  // Test #2 - disabled - bug #1990 - AddToDiag fails
119  Teuchos::ParameterList ParamList ;
120  ParamList.set( "Redistribute", true );
121  ParamList.set( "AddZeroToDiag", false );
122  ParamList.set( "AddToDiag", 1e2 );
123  Teuchos::ParameterList& SuperludistParams = ParamList.sublist("Superludist") ;
124  SuperludistParams.set( "ReuseSymbolic", true );
125  SuperludistParams.set( "MaxProcesses", 2 );
126  // ParamList.print( std::cerr, 10 ) ;
127 
128  int Errors = PerformOneSolveAndTest("Amesos_Superludist",
129  EpetraMatrixType,
130  Comm,
131  transpose,
132  MyVerbose,
133  ParamList,
134  Amat,
135  Levels,
136  Rcond,
137  relerror,
138  relresidual) ;
139 
140  if ( Errors < 0 ) {
141  NumErrors++;
142  NumTests++ ;
143  if ( MyVerbose ) {
144  std::cout << "Amesos_Superludist failed with error code " << Errors<< std::endl ;
145  }
146  } else {
147 
148  NumErrors += Errors ;
149  maxrelerror = EPETRA_MAX( relerror, maxrelerror ) ;
150  maxrelresidual = EPETRA_MAX( relresidual, maxrelresidual ) ;
151  NumTests++ ;
152 
153 
154  }
155  }
156 #endif
157  {
158  // test #3 -
159  Teuchos::ParameterList ParamList ;
160  ParamList.set( "Redistribute", true );
161  ParamList.set( "AddZeroToDiag", true );
162  Teuchos::ParameterList& SuperludistParams = ParamList.sublist("Superludist") ;
163  SuperludistParams.set( "ReuseSymbolic", false );
164  SuperludistParams.set( "MaxProcesses", 2 );
165  // ParamList.print( std::cerr, 10 ) ;
166 
167  if ( MyVerbose ) std::cout << __FILE__ << "::" << __LINE__
168  << " ParamList = " <<
169  ParamList << std::endl ;
170 
171  NumErrors += PerformOneSolveAndTest("Amesos_Superludist",
172  EpetraMatrixType,
173  Comm,
174  transpose,
175  MyVerbose,
176  ParamList,
177  Amat,
178  Levels,
179  Rcond,
180  relerror,
181  relresidual ) ;
182  maxrelerror = EPETRA_MAX( relerror, maxrelerror ) ;
183  maxrelresidual = EPETRA_MAX( relresidual, maxrelresidual ) ;
184  NumTests++ ;
185 
186  }
187 
188  {
189  // test #4
190  Teuchos::ParameterList ParamList ;
191  ParamList.set( "Redistribute", true );
192  ParamList.set( "AddZeroToDiag", true );
193  Teuchos::ParameterList& SuperludistParams = ParamList.sublist("Superludist") ;
194  SuperludistParams.set( "ReuseSymbolic", true );
195  SuperludistParams.set( "MaxProcesses", 1 );
196  // ParamList.print( std::cerr, 10 ) ;
197 
198  if ( MyVerbose ) std::cout << __FILE__ << "::" << __LINE__
199  << " ParamList = " <<
200  ParamList << std::endl ;
201 
202  NumErrors += PerformOneSolveAndTest("Amesos_Superludist",
203  EpetraMatrixType,
204  Comm,
205  transpose,
206  MyVerbose,
207  ParamList,
208  Amat,
209  Levels,
210  Rcond,
211  relerror,
212  relresidual ) ;
213  maxrelerror = EPETRA_MAX( relerror, maxrelerror ) ;
214  maxrelresidual = EPETRA_MAX( relresidual, maxrelresidual ) ;
215  NumTests++ ;
216 
217  // NumErrors += PerformOneSolveAndTest( Comm, ParamList ) ;
218  }
219 
220  {
221  // test #5
222  Teuchos::ParameterList ParamList ;
223  ParamList.set( "Redistribute", true );
224  ParamList.set( "AddZeroToDiag", true );
225  Teuchos::ParameterList& SuperludistParams = ParamList.sublist("Superludist") ;
226  SuperludistParams.set( "ReuseSymbolic", false );
227  SuperludistParams.set( "MaxProcesses", 1 );
228  // ParamList.print( std::cerr, 10 ) ;
229 
230  if ( MyVerbose ) std::cout << __FILE__ << "::" << __LINE__
231  << " ParamList = " <<
232  ParamList << std::endl ;
233 
234  NumErrors += PerformOneSolveAndTest("Amesos_Superludist",
235  EpetraMatrixType,
236  Comm,
237  transpose,
238  MyVerbose,
239  ParamList,
240  Amat,
241  Levels,
242  Rcond,
243  relerror,
244  relresidual ) ;
245  maxrelerror = EPETRA_MAX( relerror, maxrelerror ) ;
246  maxrelresidual = EPETRA_MAX( relresidual, maxrelresidual ) ;
247  NumTests++ ;
248 
249  // NumErrors += PerformOneSolveAndTest( Comm, ParamList ) ;
250  }
251 
252 
253  {
254 
255  // test #6
256  Teuchos::ParameterList ParamList ;
257  ParamList.set( "Redistribute", true );
258  ParamList.set( "AddZeroToDiag", true );
259  Teuchos::ParameterList& SuperludistParams = ParamList.sublist("Superludist") ;
260  SuperludistParams.set( "ReuseSymbolic", false );
261  SuperludistParams.set( "MaxProcesses", 10 );
262  // ParamList.print( std::cerr, 10 ) ;
263 
264  NumErrors += PerformOneSolveAndTest("Amesos_Superludist",
265  EpetraMatrixType,
266  Comm,
267  transpose,
268  MyVerbose,
269  ParamList,
270  Amat,
271  Levels,
272  Rcond,
273  relerror,
274  relresidual ) ;
275  maxrelerror = EPETRA_MAX( relerror, maxrelerror ) ;
276  maxrelresidual = EPETRA_MAX( relresidual, maxrelresidual ) ;
277  NumTests++ ;
278 
279  // NumErrors += PerformOneSolveAndTest( Comm, ParamList ) ;
280  }
281 
282 
283  {
284  // Test #7
285  Teuchos::ParameterList ParamList ;
286  ParamList.set( "Redistribute", true );
287  ParamList.set( "AddZeroToDiag", false );
288  Teuchos::ParameterList& SuperludistParams = ParamList.sublist("Superludist") ;
289  SuperludistParams.set( "ReuseSymbolic", true );
290  SuperludistParams.set( "MaxProcesses", -1 );
291  // ParamList.print( std::cerr, 10 ) ;
292 
293  if ( MyVerbose ) std::cout << __FILE__ << "::" << __LINE__
294  << " ParamList = " <<
295  ParamList << std::endl ;
296 
297  NumErrors += PerformOneSolveAndTest("Amesos_Superludist",
298  EpetraMatrixType,
299  Comm,
300  transpose,
301  MyVerbose,
302  ParamList,
303  Amat,
304  Levels,
305  Rcond,
306  relerror,
307  relresidual ) ;
308  maxrelerror = EPETRA_MAX( relerror, maxrelerror ) ;
309  maxrelresidual = EPETRA_MAX( relresidual, maxrelresidual ) ;
310  NumTests++ ;
311 
312  // NumErrors += PerformOneSolveAndTest( Comm, ParamList ) ;
313  }
314 
315 
316  {
317  // Test #8
318  Teuchos::ParameterList ParamList ;
319  ParamList.set( "Redistribute", true );
320  ParamList.set( "AddZeroToDiag", false );
321  Teuchos::ParameterList& SuperludistParams = ParamList.sublist("Superludist") ;
322  SuperludistParams.set( "ReuseSymbolic", true );
323  SuperludistParams.set( "MaxProcesses", -2 );
324  // ParamList.print( std::cerr, 10 ) ;
325 
326  if ( MyVerbose ) std::cout << __FILE__ << "::" << __LINE__
327  << " ParamList = " <<
328  ParamList << std::endl ;
329 
330  NumErrors += PerformOneSolveAndTest("Amesos_Superludist",
331  EpetraMatrixType,
332  Comm,
333  transpose,
334  MyVerbose,
335  ParamList,
336  Amat,
337  Levels,
338  Rcond,
339  relerror,
340  relresidual ) ;
341  maxrelerror = EPETRA_MAX( relerror, maxrelerror ) ;
342  maxrelresidual = EPETRA_MAX( relresidual, maxrelresidual ) ;
343  NumTests++ ;
344 
345  // NumErrors += PerformOneSolveAndTest( Comm, ParamList ) ;
346  }
347 
348 
349  {
350  // Test #9
351  Teuchos::ParameterList ParamList ;
352  ParamList.set( "Redistribute", true );
353  ParamList.set( "AddZeroToDiag", false );
354  Teuchos::ParameterList& SuperludistParams = ParamList.sublist("Superludist") ;
355  SuperludistParams.set( "ReuseSymbolic", false );
356  SuperludistParams.set( "MaxProcesses", -3 );
357  // ParamList.print( std::cerr, 10 ) ;
358 
359  if ( MyVerbose ) std::cout << __FILE__ << "::" << __LINE__
360  << " ParamList = " <<
361  ParamList << std::endl ;
362 
363  NumErrors += PerformOneSolveAndTest("Amesos_Superludist",
364  EpetraMatrixType,
365  Comm,
366  transpose,
367  MyVerbose,
368  ParamList,
369  Amat,
370  Levels,
371  Rcond,
372  relerror,
373  relresidual ) ;
374  maxrelerror = EPETRA_MAX( relerror, maxrelerror ) ;
375  maxrelresidual = EPETRA_MAX( relresidual, maxrelresidual ) ;
376  NumTests++ ;
377 
378  // NumErrors += PerformOneSolveAndTest( Comm, ParamList ) ;
379  }
380 
381 
382  {
383  // Test #10
384  Teuchos::ParameterList ParamList ;
385  ParamList.set( "Redistribute", true );
386  ParamList.set( "AddZeroToDiag", false );
387  Teuchos::ParameterList& SuperludistParams = ParamList.sublist("Superludist") ;
388  SuperludistParams.set( "ReuseSymbolic", false );
389  SuperludistParams.set( "MaxProcesses", 4 );
390  // ParamList.print( std::cerr, 10 ) ;
391 
392  if ( MyVerbose ) std::cout << __FILE__ << "::" << __LINE__
393  << " ParamList = " <<
394  ParamList << std::endl ;
395 
396  NumErrors += PerformOneSolveAndTest("Amesos_Superludist",
397  EpetraMatrixType,
398  Comm,
399  transpose,
400  MyVerbose,
401  ParamList,
402  Amat,
403  Levels,
404  Rcond,
405  relerror,
406  relresidual ) ;
407  maxrelerror = EPETRA_MAX( relerror, maxrelerror ) ;
408  maxrelresidual = EPETRA_MAX( relresidual, maxrelresidual ) ;
409  NumTests++ ;
410 
411  // NumErrors += PerformOneSolveAndTest( Comm, ParamList ) ;
412  }
413 
414 
415  {
416  // Test #11
417  Teuchos::ParameterList ParamList ;
418  ParamList.set( "AddZeroToDiag", true );
419  Teuchos::ParameterList& SuperludistParams = ParamList.sublist("Superludist") ;
420  SuperludistParams.set( "ReuseSymbolic", true );
421  SuperludistParams.set( "MaxProcesses", 4 );
422  if ( Amat->RowMatrixRowMap().LinearMap() == false ) // bug #1408
423  ParamList.set( "Redistribute", true );
424  else
425  ParamList.set( "Redistribute", false );
426  // ParamList.print( std::cerr, 10 ) ;
427 
428  if ( MyVerbose ) std::cout << __FILE__ << "::" << __LINE__
429  << " ParamList = " <<
430  ParamList << std::endl ;
431 
432  NumErrors += PerformOneSolveAndTest("Amesos_Superludist",
433  EpetraMatrixType,
434  Comm,
435  transpose,
436  MyVerbose,
437  ParamList,
438  Amat,
439  Levels,
440  Rcond,
441  relerror,
442  relresidual ) ;
443  maxrelerror = EPETRA_MAX( relerror, maxrelerror ) ;
444  maxrelresidual = EPETRA_MAX( relresidual, maxrelresidual ) ;
445  NumTests++ ;
446 
447  // NumErrors += PerformOneSolveAndTest( Comm, ParamList ) ;
448  }
449 
450  {
451  // Test #12
452  Teuchos::ParameterList ParamList ;
453  if ( Amat->RowMatrixRowMap().LinearMap() == false ) // bug #1408
454  ParamList.set( "Redistribute", true );
455  else
456  ParamList.set( "Redistribute", false );
457  ParamList.set( "AddZeroToDiag", true );
458  Teuchos::ParameterList& SuperludistParams = ParamList.sublist("Superludist") ;
459  SuperludistParams.set( "ReuseSymbolic", true );
460  SuperludistParams.set( "MaxProcesses", 4 );
461  // ParamList.print( std::cerr, 10 ) ;
462 
463  if ( MyVerbose ) std::cout << __FILE__ << "::" << __LINE__
464  << " ParamList = " <<
465  ParamList << std::endl ;
466 
467  NumErrors += PerformOneSolveAndTest("Amesos_Superludist",
468  EpetraMatrixType,
469  Comm,
470  transpose,
471  MyVerbose,
472  ParamList,
473  Amat,
474  Levels,
475  Rcond,
476  relerror,
477  relresidual ) ;
478  maxrelerror = EPETRA_MAX( relerror, maxrelerror ) ;
479  maxrelresidual = EPETRA_MAX( relresidual, maxrelresidual ) ;
480  NumTests++ ;
481 
482  // NumErrors += PerformOneSolveAndTest( Comm, ParamList ) ;
483  }
484 
485 
486  {
487  // Test #13
488  Teuchos::ParameterList ParamList ;
489  if ( Amat->RowMatrixRowMap().LinearMap() == false ) // bug #1408
490  ParamList.set( "Redistribute", true );
491  else
492  ParamList.set( "Redistribute", false );
493  ParamList.set( "AddZeroToDiag", true );
494  Teuchos::ParameterList& SuperludistParams = ParamList.sublist("Superludist") ;
495  SuperludistParams.set( "ReuseSymbolic", false );
496  SuperludistParams.set( "MaxProcesses", 1 );
497  // ParamList.print( std::cerr, 10 ) ;
498 
499  if ( MyVerbose ) std::cout << __FILE__ << "::" << __LINE__
500  << " ParamList = " <<
501  ParamList << std::endl ;
502 
503  NumErrors += PerformOneSolveAndTest("Amesos_Superludist",
504  EpetraMatrixType,
505  Comm,
506  transpose,
507  MyVerbose,
508  ParamList,
509  Amat,
510  Levels,
511  Rcond,
512  relerror,
513  relresidual ) ;
514  maxrelerror = EPETRA_MAX( relerror, maxrelerror ) ;
515  maxrelresidual = EPETRA_MAX( relresidual, maxrelresidual ) ;
516  NumTests++ ;
517 
518  // NumErrors += PerformOneSolveAndTest( Comm, ParamList ) ;
519  }
520 
521 
522  {
523  // Test #14
524  Teuchos::ParameterList ParamList ;
525  if ( Amat->RowMatrixRowMap().LinearMap() == false ) // bug #1408
526  ParamList.set( "Redistribute", true );
527  else
528  ParamList.set( "Redistribute", false );
529  ParamList.set( "AddZeroToDiag", true );
530  Teuchos::ParameterList& SuperludistParams = ParamList.sublist("Superludist") ;
531  SuperludistParams.set( "ReuseSymbolic", false );
532  SuperludistParams.set( "MaxProcesses", 2 );
533  // ParamList.print( std::cerr, 10 ) ;
534 
535  if ( MyVerbose ) std::cout << __FILE__ << "::" << __LINE__
536  << " ParamList = " <<
537  ParamList << std::endl ;
538 
539  NumErrors += PerformOneSolveAndTest("Amesos_Superludist",
540  EpetraMatrixType,
541  Comm,
542  transpose,
543  MyVerbose,
544  ParamList,
545  Amat,
546  Levels,
547  Rcond,
548  relerror,
549  relresidual ) ;
550  maxrelerror = EPETRA_MAX( relerror, maxrelerror ) ;
551  maxrelresidual = EPETRA_MAX( relresidual, maxrelresidual ) ;
552  NumTests++ ;
553 
554  // NumErrors += PerformOneSolveAndTest( Comm, ParamList ) ;
555  }
556 
557 
558  {
559  // Test #15
560  Teuchos::ParameterList ParamList ;
561  if ( Amat->RowMatrixRowMap().LinearMap() == false ) // bug #1408
562  ParamList.set( "Redistribute", true );
563  else
564  ParamList.set( "Redistribute", false );
565  ParamList.set( "AddZeroToDiag", false );
566  Teuchos::ParameterList& SuperludistParams = ParamList.sublist("Superludist") ;
567  SuperludistParams.set( "ReuseSymbolic", true );
568  SuperludistParams.set( "MaxProcesses", 1 );
569  // ParamList.print( std::cerr, 10 ) ;
570 
571  if ( MyVerbose ) std::cout << __FILE__ << "::" << __LINE__
572  << " ParamList = " <<
573  ParamList << std::endl ;
574 
575  NumErrors += PerformOneSolveAndTest("Amesos_Superludist",
576  EpetraMatrixType,
577  Comm,
578  transpose,
579  MyVerbose,
580  ParamList,
581  Amat,
582  Levels,
583  Rcond,
584  relerror,
585  relresidual ) ;
586  maxrelerror = EPETRA_MAX( relerror, maxrelerror ) ;
587  maxrelresidual = EPETRA_MAX( relresidual, maxrelresidual ) ;
588  NumTests++ ;
589 
590  // NumErrors += PerformOneSolveAndTest( Comm, ParamList ) ;
591  }
592 
593 
594  {
595  // Test #16
596  Teuchos::ParameterList ParamList ;
597  if ( Amat->RowMatrixRowMap().LinearMap() == false ) // bug #1408
598  ParamList.set( "Redistribute", true );
599  else
600  ParamList.set( "Redistribute", false );
601  ParamList.set( "AddZeroToDiag", false );
602  Teuchos::ParameterList& SuperludistParams = ParamList.sublist("Superludist") ;
603  SuperludistParams.set( "ReuseSymbolic", true );
604  SuperludistParams.set( "MaxProcesses", 2 );
605  // ParamList.print( std::cerr, 10 ) ;
606 
607  if ( MyVerbose ) std::cout << __FILE__ << "::" << __LINE__
608  << " ParamList = " <<
609  ParamList << std::endl ;
610 
611  NumErrors += PerformOneSolveAndTest("Amesos_Superludist",
612  EpetraMatrixType,
613  Comm,
614  transpose,
615  MyVerbose,
616  ParamList,
617  Amat,
618  Levels,
619  Rcond,
620  relerror,
621  relresidual ) ;
622  maxrelerror = EPETRA_MAX( relerror, maxrelerror ) ;
623  maxrelresidual = EPETRA_MAX( relresidual, maxrelresidual ) ;
624  NumTests++ ;
625 
626  // NumErrors += PerformOneSolveAndTest( Comm, ParamList ) ;
627  }
628  {
629  // Test #17
630  Teuchos::ParameterList ParamList ;
631  if ( Amat->RowMatrixRowMap().LinearMap() == false ) // bug #1408
632  ParamList.set( "Redistribute", true );
633  else
634  ParamList.set( "Redistribute", false );
635  ParamList.set( "AddZeroToDiag", false );
636  Teuchos::ParameterList& SuperludistParams = ParamList.sublist("Superludist") ;
637  SuperludistParams.set( "ReuseSymbolic", true );
638  SuperludistParams.set( "Fact", "SamePattern" );
639  SuperludistParams.set( "MaxProcesses", 2 );
640  // ParamList.print( std::cerr, 10 ) ;
641 
642  if ( MyVerbose ) std::cout << __FILE__ << "::" << __LINE__
643  << " ParamList = " <<
644  ParamList << std::endl ;
645 
646  NumErrors += PerformOneSolveAndTest("Amesos_Superludist",
647  EpetraMatrixType,
648  Comm,
649  transpose,
650  MyVerbose,
651  ParamList,
652  Amat,
653  Levels,
654  Rcond,
655  relerror,
656  relresidual ) ;
657  maxrelerror = EPETRA_MAX( relerror, maxrelerror ) ;
658  maxrelresidual = EPETRA_MAX( relresidual, maxrelresidual ) ;
659  NumTests++ ;
660 
661  // NumErrors += PerformOneSolveAndTest( Comm, ParamList ) ;
662  }
663 
664  if (!ImpcolB ) // ImpcolB fails if the NATURAL order - i.e. no pivoting - is chosen
665  {
666  // Test #18
667  Teuchos::ParameterList ParamList ;
668  ParamList.set( "Redistribute", true );
669  ParamList.set( "AddZeroToDiag", false );
670  Teuchos::ParameterList& SuperludistParams = ParamList.sublist("Superludist") ;
671  SuperludistParams.set( "ReuseSymbolic", false );
672  SuperludistParams.set( "RowPerm", "NATURAL" );
673  SuperludistParams.set( "MaxProcesses", 10 );
674  // ParamList.print( std::cerr, 10 ) ;
675 
676  if ( MyVerbose ) std::cout << __FILE__ << "::" << __LINE__
677  << " ParamList = " <<
678  ParamList << std::endl ;
679 
680  NumErrors += PerformOneSolveAndTest("Amesos_Superludist",
681  EpetraMatrixType,
682  Comm,
683  transpose,
684  MyVerbose,
685  ParamList,
686  Amat,
687  Levels,
688  Rcond,
689  relerror,
690  relresidual ) ;
691  maxrelerror = EPETRA_MAX( relerror, maxrelerror ) ;
692  maxrelresidual = EPETRA_MAX( relresidual, maxrelresidual ) ;
693  NumTests++ ;
694 
695  // NumErrors += PerformOneSolveAndTest( Comm, ParamList ) ;
696  }
697 
698 
699  {
700  // Test #19
701  Teuchos::ParameterList ParamList ;
702  ParamList.set( "Redistribute", true );
703  ParamList.set( "AddZeroToDiag", false );
704  Teuchos::ParameterList& SuperludistParams = ParamList.sublist("Superludist") ;
705  SuperludistParams.set( "ReuseSymbolic", false );
706 #if (SUPERLU_DIST_MAJOR_VERSION > 5) || ( SUPERLU_DIST_MAJOR_VERSION == 5 && SUPERLU_DIST_MINOR_VERSION > 3)
707  SuperludistParams.set( "RowPerm", "LargeDiag_MC64" );
708 #else
709  SuperludistParams.set( "RowPerm", "LargeDiag" );
710 #endif
711  SuperludistParams.set( "MaxProcesses", 10 );
712  // ParamList.print( std::cerr, 10 ) ;
713 
714  if ( MyVerbose ) std::cout << __FILE__ << "::" << __LINE__
715  << " ParamList = " <<
716  ParamList << std::endl ;
717 
718  NumErrors += PerformOneSolveAndTest("Amesos_Superludist",
719  EpetraMatrixType,
720  Comm,
721  transpose,
722  MyVerbose,
723  ParamList,
724  Amat,
725  Levels,
726  Rcond,
727  relerror,
728  relresidual ) ;
729  maxrelerror = EPETRA_MAX( relerror, maxrelerror ) ;
730  maxrelresidual = EPETRA_MAX( relresidual, maxrelresidual ) ;
731  NumTests++ ;
732 
733  // NumErrors += PerformOneSolveAndTest( Comm, ParamList ) ;
734  }
735 
736 
737  if (!ImpcolB ) // ImpcolB fails if the NATURAL order - i.e. no pivoting - is chosen
738  {
739  // Test #20
740  Teuchos::ParameterList ParamList ;
741  ParamList.set( "Redistribute", true );
742  ParamList.set( "AddZeroToDiag", false );
743  Teuchos::ParameterList& SuperludistParams = ParamList.sublist("Superludist") ;
744  SuperludistParams.set( "ReuseSymbolic", true );
745  SuperludistParams.set( "RowPerm", "NATURAL" );
746  SuperludistParams.set( "MaxProcesses", 10 );
747  // ParamList.print( std::cerr, 10 ) ;
748 
749  if ( MyVerbose ) std::cout << __FILE__ << "::" << __LINE__
750  << " ParamList = " <<
751  ParamList << std::endl ;
752 
753  NumErrors += PerformOneSolveAndTest("Amesos_Superludist",
754  EpetraMatrixType,
755  Comm,
756  transpose,
757  MyVerbose,
758  ParamList,
759  Amat,
760  Levels,
761  Rcond,
762  relerror,
763  relresidual ) ;
764  maxrelerror = EPETRA_MAX( relerror, maxrelerror ) ;
765  maxrelresidual = EPETRA_MAX( relresidual, maxrelresidual ) ;
766  NumTests++ ;
767 
768  // NumErrors += PerformOneSolveAndTest( Comm, ParamList ) ;
769  }
770 
771 
772  {
773  // Test #21
774  Teuchos::ParameterList ParamList ;
775  ParamList.set( "Redistribute", true );
776  ParamList.set( "AddZeroToDiag", false );
777  Teuchos::ParameterList& SuperludistParams = ParamList.sublist("Superludist") ;
778  SuperludistParams.set( "ReuseSymbolic", true );
779 #if (SUPERLU_DIST_MAJOR_VERSION > 5) || ( SUPERLU_DIST_MAJOR_VERSION == 5 && SUPERLU_DIST_MINOR_VERSION > 3)
780  SuperludistParams.set( "RowPerm", "LargeDiag_MC64" );
781 #else
782  SuperludistParams.set( "RowPerm", "LargeDiag" );
783 #endif
784  SuperludistParams.set( "MaxProcesses", 10 );
785  // ParamList.print( std::cerr, 10 ) ;
786 
787  if ( MyVerbose ) std::cout << __FILE__ << "::" << __LINE__
788  << " ParamList = " <<
789  ParamList << std::endl ;
790 
791  NumErrors += PerformOneSolveAndTest("Amesos_Superludist",
792  EpetraMatrixType,
793  Comm,
794  transpose,
795  MyVerbose,
796  ParamList,
797  Amat,
798  Levels,
799  Rcond,
800  relerror,
801  relresidual ) ;
802  maxrelerror = EPETRA_MAX( relerror, maxrelerror ) ;
803  maxrelresidual = EPETRA_MAX( relresidual, maxrelresidual ) ;
804  NumTests++ ;
805 
806  // NumErrors += PerformOneSolveAndTest( Comm, ParamList ) ;
807  }
808 
809  {
810  // Test #22
811  Teuchos::ParameterList ParamList ;
812  ParamList.set( "Redistribute", true );
813  ParamList.set( "AddZeroToDiag", false );
814  Teuchos::ParameterList& SuperludistParams = ParamList.sublist("Superludist") ;
815  SuperludistParams.set( "ReuseSymbolic", true );
816  SuperludistParams.set( "ReplaceTinyPivot", true );
817  SuperludistParams.set( "MaxProcesses", 10 );
818  // ParamList.print( std::cerr, 10 ) ;
819 
820  if ( MyVerbose ) std::cout << __FILE__ << "::" << __LINE__
821  << " ParamList = " <<
822  ParamList << std::endl ;
823 
824  NumErrors += PerformOneSolveAndTest("Amesos_Superludist",
825  EpetraMatrixType,
826  Comm,
827  transpose,
828  MyVerbose,
829  ParamList,
830  Amat,
831  Levels,
832  Rcond,
833  relerror,
834  relresidual ) ;
835  maxrelerror = EPETRA_MAX( relerror, maxrelerror ) ;
836  maxrelresidual = EPETRA_MAX( relresidual, maxrelresidual ) ;
837  NumTests++ ;
838 
839  // NumErrors += PerformOneSolveAndTest( Comm, ParamList ) ;
840  }
841 
842  {
843  // Test #23
844  Teuchos::ParameterList ParamList ;
845  ParamList.set( "Redistribute", true );
846  ParamList.set( "AddZeroToDiag", false );
847  Teuchos::ParameterList& SuperludistParams = ParamList.sublist("Superludist") ;
848  SuperludistParams.set( "ReuseSymbolic", true );
849  SuperludistParams.set( "ReplaceTinyPivot", false );
850  SuperludistParams.set( "MaxProcesses", 10 );
851  // ParamList.print( std::cerr, 10 ) ;
852 
853  if ( MyVerbose ) std::cout << __FILE__ << "::" << __LINE__
854  << " ParamList = " <<
855  ParamList << std::endl ;
856 
857  NumErrors += PerformOneSolveAndTest("Amesos_Superludist",
858  EpetraMatrixType,
859  Comm,
860  transpose,
861  MyVerbose,
862  ParamList,
863  Amat,
864  Levels,
865  Rcond,
866  relerror,
867  relresidual ) ;
868  maxrelerror = EPETRA_MAX( relerror, maxrelerror ) ;
869  maxrelresidual = EPETRA_MAX( relresidual, maxrelresidual ) ;
870  NumTests++ ;
871 
872  // NumErrors += PerformOneSolveAndTest( Comm, ParamList ) ;
873  }
874 
875 
876 
877  return NumErrors;
878  }
879 
880 }
const Epetra_Map & RowMatrixRowMap() const
static bool verbose
Definition: Amesos.cpp:70
RCP< ParameterList > sublist(const RCP< ParameterList > &paramList, const std::string &name, bool mustAlreadyExist=false, const std::string &docString="")
ParameterList & set(std::string const &name, T &&value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
bool LinearMap() const
int TestSuperludist(Epetra_CrsMatrix *&Amat, int EpetraMatrixType, bool transpose, bool verbose, int Levels, const double Rcond, double &maxrelerror, double &maxrelresidual, const char *filename, int &NumTests)
const Epetra_Comm & Comm() const
int PerformOneSolveAndTest(const char *AmesosClass, int EpetraMatrixType, const Epetra_Comm &Comm, bool transpose, bool verbose, Teuchos::ParameterList ParamList, Epetra_CrsMatrix *&InMat, int Levels, const double Rcond, double &relerror, double &relresidual, int ExpectedError)
#define EPETRA_MAX(x, y)