# Top level directory has the include files

ADD_EXECUTABLE( MultTiming MultTiming.cpp )
ADD_EXECUTABLE( MultTest MultTest.cpp )
ADD_EXECUTABLE( ReduceTest ReduceTest.cpp )
ADD_EXECUTABLE( TransposeTest TransposeTest.cpp )
ADD_EXECUTABLE( IteratorTest IteratorTest.cpp )
ADD_EXECUTABLE( IndexingTest IndexingTest.cpp )
ADD_EXECUTABLE( SpAsgnTest SpAsgnTest.cpp )
ADD_EXECUTABLE( GalerkinNew GalerkinNew.cpp )
ADD_EXECUTABLE( IndexingTiming IndexingTiming.cpp )
ADD_EXECUTABLE( FindSparse FindSparse.cpp )
ADD_EXECUTABLE( ParIOTest ParIOTest.cpp )

TARGET_LINK_LIBRARIES( MultTiming CombBLAS)
TARGET_LINK_LIBRARIES( MultTest CombBLAS)
TARGET_LINK_LIBRARIES( ReduceTest CombBLAS)
TARGET_LINK_LIBRARIES( TransposeTest CombBLAS)
TARGET_LINK_LIBRARIES( IteratorTest CombBLAS)
TARGET_LINK_LIBRARIES( IndexingTest CombBLAS)
TARGET_LINK_LIBRARIES( SpAsgnTest CombBLAS)
TARGET_LINK_LIBRARIES( GalerkinNew CombBLAS)
TARGET_LINK_LIBRARIES( IndexingTiming CombBLAS)
TARGET_LINK_LIBRARIES( FindSparse CombBLAS)
TARGET_LINK_LIBRARIES( ParIOTest CombBLAS)


ADD_TEST(NAME Multiplication_Test COMMAND ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} 4 $<TARGET_FILE:MultTest> ../TESTDATA/rmat_scale16_A.mtx ../TESTDATA/rmat_scale16_B.mtx ../TESTDATA/rmat_scale16_productAB.mtx ../TESTDATA/x_65536_halfdense.txt ../TESTDATA/y_65536_halfdense.txt )
ADD_TEST(NAME Reduction_Test COMMAND ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} 4 $<TARGET_FILE:ReduceTest> ../TESTDATA/sprand10000 ../TESTDATA/sprand10000_sumcols ../TESTDATA/sprand10000_sumrows)
ADD_TEST(NAME Iterator_Test COMMAND ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} 4 $<TARGET_FILE:IteratorTest> ../TESTDATA sprand10000)
ADD_TEST(NAME Transpose_Test COMMAND ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} 4 $<TARGET_FILE:TransposeTest> ../TESTDATA betwinput_scale16 betwinput_transposed_scale16)
ADD_TEST(NAME Indexing_Test COMMAND ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} 4 $<TARGET_FILE:IndexingTest> ../TESTDATA B_100x100.txt B_10x30_Indexed.txt rand10outta100.txt rand30outta100.txt)
ADD_TEST(NAME SpAsgn_Test COMMAND ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} 4 $<TARGET_FILE:SpAsgnTest> ../TESTDATA A_100x100.txt A_with20x30hole.txt dense_20x30matrix.txt A_wdenseblocks.txt 20outta100.txt 30outta100.txt)
ADD_TEST(NAME GalerkinNew_Test COMMAND ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} 4 $<TARGET_FILE:GalerkinNew> ../TESTDATA/grid3d_k5.txt ../TESTDATA/offdiag_grid3d_k5.txt ../TESTDATA/diag_grid3d_k5.txt ../TESTDATA/restrict_T_grid3d_k5.txt)
ADD_TEST(NAME FindSparse_Test COMMAND ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} 4 $<TARGET_FILE:FindSparse> ../TESTDATA findmatrix.txt)
