@@ -136,6 +136,12 @@ namespace {
136
136
const global_size_t INVALID = OrdinalTraits<global_size_t >::invalid ();
137
137
RCP<const Comm<int > > comm = getDefaultComm ();
138
138
const size_t rank = comm->getRank ();
139
+ if (rank==0 ) {
140
+ std::cout << std::endl
141
+ << " >> UnitTest for ShyLUBasker::Initialization with Scalar = "
142
+ << ST::name () << " <<" << std::endl << std::endl;
143
+ }
144
+
139
145
// create a Map
140
146
const size_t numLocal = 10 ;
141
147
RCP<Map<LO,GO,Node> > map = rcp ( new Map<LO,GO,Node>(INVALID,numLocal,0 ,comm) );
@@ -183,6 +189,11 @@ namespace {
183
189
const global_size_t INVALID = OrdinalTraits<global_size_t >::invalid ();
184
190
RCP<const Comm<int > > comm = getDefaultComm ();
185
191
const size_t rank = comm->getRank ();
192
+ if (rank==0 ) {
193
+ std::cout << std::endl
194
+ << " >> UnitTest for ShyLUBasker::SymbolicFactorization with Scalar = "
195
+ << ST::name () << " <<" << std::endl << std::endl;
196
+ }
186
197
// create a Map
187
198
const size_t numLocal = 10 ;
188
199
RCP<Map<LO,GO,Node> > map = rcp ( new Map<LO,GO,Node>(INVALID,numLocal,0 ,comm) );
@@ -217,6 +228,11 @@ namespace {
217
228
const global_size_t INVALID = OrdinalTraits<global_size_t >::invalid ();
218
229
RCP<const Comm<int > > comm = getDefaultComm ();
219
230
const size_t rank = comm->getRank ();
231
+ if (rank==0 ) {
232
+ std::cout << std::endl
233
+ << " >> UnitTest for ShyLUBasker::NumericFactorization with Scalar = "
234
+ << ST::name () << " <<" << std::endl << std::endl;
235
+ }
220
236
// create a Map
221
237
const size_t numLocal = 10 ;
222
238
RCP<Map<LO,GO,Node> > map = rcp ( new Map<LO,GO,Node>(INVALID,numLocal,0 ,comm) );
@@ -257,6 +273,12 @@ namespace {
257
273
const size_t numVecs = 1 ;
258
274
259
275
RCP<const Comm<int > > comm = Tpetra::getDefaultComm ();
276
+ const size_t rank = comm->getRank ();
277
+ if (rank==0 ) {
278
+ std::cout << std::endl
279
+ << " >> UnitTest for ShyLUBasker::Solve with Scalar = "
280
+ << ST::name () << " <<" << std::endl << std::endl;
281
+ }
260
282
261
283
// NDE: Beginning changes towards passing parameter list to shylu basker
262
284
// for controlling various parameters per test, matrix, etc.
@@ -325,6 +347,11 @@ namespace {
325
347
Array<Mag> xhatnorms (numVecs), xnorms (numVecs);
326
348
Xhat->norm2 (xhatnorms ());
327
349
X->norm2 (xnorms ());
350
+ if (rank==0 ) {
351
+ for (int i=0 ; i<xnorms.size (); i++)
352
+ std::cout << " err[" << i << " ] = " << xnorms[i] << " - " << xhatnorms[i]
353
+ << " = " << xnorms[i]-xhatnorms[i] << std::endl;
354
+ }
328
355
TEST_COMPARE_FLOATING_ARRAYS ( xhatnorms, xnorms, 0.005 );
329
356
}
330
357
@@ -338,6 +365,12 @@ namespace {
338
365
const size_t numVecs = 1 ;
339
366
340
367
RCP<const Comm<int > > comm = Tpetra::getDefaultComm ();
368
+ const size_t rank = comm->getRank ();
369
+ if (rank==0 ) {
370
+ std::cout << std::endl
371
+ << " >> UnitTest for ShyLUBasker::SolveTrans with Scalar = "
372
+ << ST::name () << " <<" << std::endl << std::endl;
373
+ }
341
374
342
375
// NDE: Beginning changes towards passing parameter list to shylu basker
343
376
// for controlling various parameters per test, matrix, etc.
@@ -405,6 +438,11 @@ namespace {
405
438
Array<Mag> xhatnorms (numVecs), xnorms (numVecs);
406
439
Xhat->norm2 (xhatnorms ());
407
440
X->norm2 (xnorms ());
441
+ if (rank==0 ) {
442
+ for (int i=0 ; i<xnorms.size (); i++)
443
+ std::cout << " err[" << i << " ] = " << xnorms[i] << " - " << xhatnorms[i]
444
+ << " = " << xnorms[i]-xhatnorms[i] << std::endl;
445
+ }
408
446
TEST_COMPARE_FLOATING_ARRAYS ( xhatnorms, xnorms, 0.005 );
409
447
}
410
448
@@ -479,9 +517,13 @@ namespace {
479
517
using Scalar = SCALAR;
480
518
481
519
RCP<const Comm<int > > comm = Tpetra::getDefaultComm ();
482
-
483
520
size_t myRank = comm->getRank ();
484
521
const global_size_t numProcs = comm->getSize ();
522
+ if (myRank==0 ) {
523
+ std::cout << std::endl
524
+ << " >> UnitTest for ShyLUBasker::NonContigGID with Scalar = "
525
+ << ST::name () << " <<" << std::endl << std::endl;
526
+ }
485
527
486
528
// Unit test created for 2 processes
487
529
if ( numProcs == 2 ) {
@@ -621,6 +663,11 @@ namespace {
621
663
Array<Mag> xhatnorms (numVectors), xnorms (numVectors);
622
664
Xhat->norm2 (xhatnorms ());
623
665
X->norm2 (xnorms ());
666
+ if (myRank==0 ) {
667
+ for (int i=0 ; i<xnorms.size (); i++)
668
+ std::cout << " err[" << i << " ] = " << xnorms[i] << " - " << xhatnorms[i]
669
+ << " = " << xnorms[i]-xhatnorms[i] << std::endl;
670
+ }
624
671
TEST_COMPARE_FLOATING_ARRAYS ( xhatnorms, xnorms, 0.005 );
625
672
} // end if numProcs = 2
626
673
}
@@ -636,6 +683,12 @@ namespace {
636
683
// typedef ScalarTraits<Mag> MT;
637
684
638
685
RCP<const Comm<int > > comm = Tpetra::getDefaultComm ();
686
+ size_t myRank = comm->getRank ();
687
+ if (myRank==0 ) {
688
+ std::cout << std::endl
689
+ << " >> UnitTest for ShyLUBasker::ComplexSolve with Scalar = "
690
+ << ST::name () << " <<" << std::endl << std::endl;
691
+ }
639
692
640
693
RCP<MAT> A =
641
694
Tpetra::MatrixMarket::Reader<MAT>::readSparseFile (" ../matrices/amesos2_test_mat4.mtx" ,comm);
@@ -692,6 +745,11 @@ namespace {
692
745
Array<Mag> xhatnorms (1 ), xnorms (1 );
693
746
Xhat->norm2 (xhatnorms ());
694
747
X->norm2 (xnorms ());
748
+ if (myRank==0 ) {
749
+ for (int i=0 ; i<xnorms.size (); i++)
750
+ std::cout << " err[" << i << " ] = " << xnorms[i] << " - " << xhatnorms[i]
751
+ << " = " << xnorms[i]-xhatnorms[i] << std::endl;
752
+ }
695
753
TEST_COMPARE_FLOATING_ARRAYS ( xhatnorms, xnorms, 0.005 );
696
754
}
697
755
@@ -706,6 +764,12 @@ namespace {
706
764
const size_t numVecs = 7 ;
707
765
708
766
RCP<const Comm<int > > comm = Tpetra::getDefaultComm ();
767
+ size_t myRank = comm->getRank ();
768
+ if (myRank==0 ) {
769
+ std::cout << std::endl
770
+ << " >> UnitTest for ShyLUBasker::ComplexSolve2 with Scalar = "
771
+ << ST::name () << " <<" << std::endl << std::endl;
772
+ }
709
773
710
774
RCP<MAT> A =
711
775
Tpetra::MatrixMarket::Reader<MAT>::readSparseFile (" ../matrices/amesos2_test_mat2.mtx" ,comm);
@@ -738,6 +802,11 @@ namespace {
738
802
Array<Mag> xhatnorms (numVecs), xnorms (numVecs);
739
803
Xhat->norm2 (xhatnorms ());
740
804
X->norm2 (xnorms ());
805
+ if (myRank==0 ) {
806
+ for (int i=0 ; i<xnorms.size (); i++)
807
+ std::cout << " err[" << i << " ] = " << xnorms[i] << " - " << xhatnorms[i]
808
+ << " = " <<xnorms[i]-xhatnorms[i] << std::endl;
809
+ }
741
810
TEST_COMPARE_FLOATING_ARRAYS ( xhatnorms, xnorms, 0.005 );
742
811
}
743
812
@@ -752,6 +821,12 @@ namespace {
752
821
const size_t numVecs = 7 ;
753
822
754
823
RCP<const Comm<int > > comm = Tpetra::getDefaultComm ();
824
+ size_t myRank = comm->getRank ();
825
+ if (myRank==0 ) {
826
+ std::cout << std::endl
827
+ << " >> UnitTest for ShyLUBasker::ComplexSolve2Trans with Scalar = "
828
+ << ST::name () << " <<" << std::endl << std::endl;
829
+ }
755
830
756
831
RCP<MAT> A =
757
832
Tpetra::MatrixMarket::Reader<MAT>::readSparseFile (" ../matrices/amesos2_test_mat3.mtx" ,comm);
@@ -776,7 +851,7 @@ namespace {
776
851
= Amesos2::create<MAT,MV>(" ShyLUBasker" , A, Xhat, B);
777
852
778
853
Teuchos::ParameterList amesos2_params (" Amesos2" );
779
- amesos2_params.sublist (" ShyLUBasker" ).set (" Trans " , " CONJ " ," Solve with conjugate-transpose" );
854
+ amesos2_params.sublist (" ShyLUBasker" ).set (" transpose " , true ," Solve with conjugate-transpose" );
780
855
781
856
solver->setParameters ( rcpFromRef (amesos2_params) );
782
857
solver->symbolicFactorization ().numericFactorization ().solve ();
@@ -788,16 +863,35 @@ namespace {
788
863
Array<Mag> xhatnorms (numVecs), xnorms (numVecs);
789
864
Xhat->norm2 (xhatnorms ());
790
865
X->norm2 (xnorms ());
866
+ if (myRank==0 ) {
867
+ for (int i=0 ; i<xnorms.size (); i++)
868
+ std::cout << " err[" << i << " ] = " << xnorms[i] << " - " << xhatnorms[i]
869
+ << " = " << xnorms[i]-xhatnorms[i] << std::endl;
870
+ }
791
871
TEST_COMPARE_FLOATING_ARRAYS ( xhatnorms, xnorms, 0.005 );
792
872
}
793
873
794
874
795
875
/*
796
876
* Instantiations
797
877
*/
878
+ #ifdef HAVE_TPETRA_INST_COMPLEX_FLOAT
879
+ # define UNIT_TEST_GROUP_ORDINAL_COMPLEX_FLOAT (LO, GO ) \
880
+ TEUCHOS_UNIT_TEST_TEMPLATE_3_INSTANT ( ShyLUBasker, ComplexSolve, float , LO, GO ) \
881
+ TEUCHOS_UNIT_TEST_TEMPLATE_3_INSTANT( ShyLUBasker, ComplexSolve2, float , LO, GO ) \
882
+ /* TEUCHOS_UNIT_TEST_TEMPLATE_3_INSTANT( ShyLUBasker, ComplexSolve2Trans, float, LO, GO ) */
883
+ #else
798
884
# define UNIT_TEST_GROUP_ORDINAL_COMPLEX_FLOAT (LO, GO )
885
+ #endif
886
+
887
+ #ifdef HAVE_TPETRA_INST_COMPLEX_DOUBLE
888
+ # define UNIT_TEST_GROUP_ORDINAL_COMPLEX_DOUBLE (LO, GO ) \
889
+ TEUCHOS_UNIT_TEST_TEMPLATE_3_INSTANT ( ShyLUBasker, ComplexSolve, double , LO, GO ) \
890
+ TEUCHOS_UNIT_TEST_TEMPLATE_3_INSTANT( ShyLUBasker, ComplexSolve2, double , LO, GO ) \
891
+ /* TEUCHOS_UNIT_TEST_TEMPLATE_3_INSTANT( ShyLUBasker, ComplexSolve2Trans, double, LO, GO ) */
892
+ #else
799
893
# define UNIT_TEST_GROUP_ORDINAL_COMPLEX_DOUBLE (LO, GO )
800
- // #endif
894
+ #endif
801
895
802
896
#ifdef HAVE_TPETRA_INST_FLOAT
803
897
# define UNIT_TEST_GROUP_ORDINAL_FLOAT ( LO, GO ) \
@@ -818,11 +912,12 @@ namespace {
818
912
TEUCHOS_UNIT_TEST_TEMPLATE_3_INSTANT ( ShyLUBasker, SolveTrans, SCALAR, LO, GO )
819
913
820
914
#define UNIT_TEST_GROUP_ORDINAL_ORDINAL ( LO, GO ) \
821
- UNIT_TEST_GROUP_ORDINAL_FLOAT (LO, GO) \
822
- UNIT_TEST_GROUP_ORDINAL_DOUBLE (LO, GO) \
823
- UNIT_TEST_GROUP_ORDINAL_COMPLEX_DOUBLE (LO,GO)
915
+ UNIT_TEST_GROUP_ORDINAL_FLOAT (LO, GO) \
916
+ UNIT_TEST_GROUP_ORDINAL_DOUBLE (LO, GO) \
917
+ UNIT_TEST_GROUP_ORDINAL_COMPLEX_DOUBLE (LO,GO) \
918
+ UNIT_TEST_GROUP_ORDINAL_COMPLEX_FLOAT (LO,GO)
824
919
825
- #define UNIT_TEST_GROUP_ORDINAL ( ORDINAL ) \
920
+ #define UNIT_TEST_GROUP_ORDINAL ( ORDINAL ) \
826
921
UNIT_TEST_GROUP_ORDINAL_ORDINAL ( ORDINAL, ORDINAL )
827
922
828
923
// Add JDB (10-19-215)
0 commit comments