Skip to content

Commit

Permalink
#210: remove usage of Belos Harwell-Being reader
Browse files Browse the repository at this point in the history
  • Loading branch information
tlamonthezie committed Sep 22, 2023
1 parent b7c73c3 commit 32299c3
Show file tree
Hide file tree
Showing 40 changed files with 14,314 additions and 5,760 deletions.
8 changes: 4 additions & 4 deletions packages/belos/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -104,19 +104,19 @@ ADD_SUBDIRECTORY(src)

TRIBITS_ADD_TEST_DIRECTORIES(test)

IF (Belos_ENABLE_Epetra)
IF (${PACKAGE_NAME}_ENABLE_Epetra)
ADD_SUBDIRECTORY(epetra)
ENDIF()

IF (Belos_ENABLE_Tpetra)
IF (${PACKAGE_NAME}_ENABLE_Tpetra)
ADD_SUBDIRECTORY(tpetra)
ENDIF()

IF (Belos_ENABLE_KokkosKernels)
IF (${PACKAGE_NAME}_ENABLE_KokkosKernels)
ADD_SUBDIRECTORY(kokkos)
ENDIF()

IF (Belos_ENABLE_Xpetra)
IF (${PACKAGE_NAME}_ENABLE_Xpetra)
ADD_SUBDIRECTORY(xpetra)
ENDIF()

Expand Down
20 changes: 10 additions & 10 deletions packages/belos/tpetra/example/BlockCG/BlockCGTpetraExFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,6 @@
// NOTE: No preconditioner is used in this example.
//

// Tpetra
#include <Tpetra_Map.hpp>
#include <Tpetra_Core.hpp>
#include <Tpetra_Vector.hpp>
#include <Tpetra_CrsMatrix.hpp>
// I/O for Harwell-Boeing files
#define HIDE_TPETRA_INOUT_IMPLEMENTATIONS
#include <Tpetra_MatrixIO.hpp>

// Teuchos
#include <Teuchos_RCP.hpp>
#include <Teuchos_Comm.hpp>
Expand All @@ -66,6 +57,15 @@
#include "Teuchos_StandardCatchMacros.hpp"
#include "Teuchos_CommandLineProcessor.hpp"

// Tpetra
#include <Tpetra_Map.hpp>
#include <Tpetra_Core.hpp>
#include <Tpetra_Vector.hpp>
#include <Tpetra_CrsMatrix.hpp>
// I/O for Harwell-Boeing files
#define HIDE_TPETRA_INOUT_IMPLEMENTATIONS
#include <Tpetra_MatrixIO.hpp>

// Belos
#include "BelosConfigDefs.hpp"
#include "BelosBlockCGSolMgr.hpp"
Expand Down Expand Up @@ -114,7 +114,7 @@ int run(int argc, char *argv[]) {
Teuchos::CommandLineProcessor cmdp(false,true);
cmdp.setOption("verbose","quiet",&verbose,"Print messages and results.");
cmdp.setOption("frequency",&frequency,"Solvers frequency for printing residuals (#iters).");
cmdp.setOption("filename",&filename,"Filename for test matrix. Acceptable file extensions: *.hb,*.mtx,*.triU,*.triS");
cmdp.setOption("filename",&filename,"Filename for Harwell-Boeing test matrix.");
cmdp.setOption("tol",&tol,"Relative residual tolerance used by CG solver.");
cmdp.setOption("num-rhs",&numrhs,"Number of right-hand sides to be solved for.");
cmdp.setOption("block-size",&blockSize,"Block size used by CG.");
Expand Down
37 changes: 16 additions & 21 deletions packages/belos/tpetra/example/BlockCG/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,25 +1,20 @@


ASSERT_DEFINED(${PACKAGE_NAME}_ENABLE_Triutils)
IF (${PACKAGE_NAME}_ENABLE_Triutils)
TRIBITS_ADD_EXECUTABLE_AND_TEST(
BlockCG_Tpetra_File_Ex
SOURCES BlockCGTpetraExFile.cpp
COMM serial mpi
)

TRIBITS_ADD_EXECUTABLE_AND_TEST(
BlockCG_Tpetra_File_Ex
SOURCES BlockCGTpetraExFile.cpp
COMM serial mpi
)
TRIBITS_ADD_EXECUTABLE_AND_TEST(
PseudoBlockCG_Tpetra_File_Ex
SOURCES PseudoBlockCGTpetraExFile.cpp
COMM serial mpi
)

TRIBITS_ADD_EXECUTABLE_AND_TEST(
PseudoBlockCG_Tpetra_File_Ex
SOURCES PseudoBlockCGTpetraExFile.cpp
COMM serial mpi
)

ASSERT_DEFINED(Anasazi_SOURCE_DIR)
TRIBITS_COPY_FILES_TO_BINARY_DIR(Tpetra_CopyExampleBlockCGFiles
SOURCE_DIR ${Anasazi_SOURCE_DIR}/testmatrices
SOURCE_FILES bcsstk14.hb
EXEDEPS BlockCG_Tpetra_File_Ex
)

ENDIF(${PACKAGE_NAME}_ENABLE_Triutils)
ASSERT_DEFINED(Anasazi_SOURCE_DIR)
TRIBITS_COPY_FILES_TO_BINARY_DIR(Tpetra_CopyExampleBlockCGFiles
SOURCE_DIR ${Anasazi_SOURCE_DIR}/testmatrices
SOURCE_FILES bcsstk14.hb
EXEDEPS BlockCG_Tpetra_File_Ex
)
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@
#include <Teuchos_Comm.hpp>
#include <Teuchos_CommHelpers.hpp>
#include <Teuchos_DefaultComm.hpp>
#include "Teuchos_ParameterList.hpp"
#include "Teuchos_StandardCatchMacros.hpp"
#include "Teuchos_CommandLineProcessor.hpp"
#include <Teuchos_ParameterList.hpp>
#include <Teuchos_StandardCatchMacros.hpp>
#include <Teuchos_CommandLineProcessor.hpp>

// Belos
#include "BelosConfigDefs.hpp"
Expand Down Expand Up @@ -114,7 +114,7 @@ int run(int argc, char *argv[]) {
Teuchos::CommandLineProcessor cmdp(false,true);
cmdp.setOption("verbose","quiet",&verbose,"Print messages and results.");
cmdp.setOption("frequency",&frequency,"Solvers frequency for printing residuals (#iters).");
cmdp.setOption("filename",&filename,"Filename for test matrix. Acceptable file extensions: *.hb,*.mtx,*.triU,*.triS");
cmdp.setOption("filename",&filename,"Filename for Harwell-Boeing test matrix.");
cmdp.setOption("tol",&tol,"Relative residual tolerance used by CG solver.");
cmdp.setOption("num-rhs",&numrhs,"Number of right-hand sides to be solved for.");
cmdp.setOption("block-size",&blockSize,"Block size used by CG.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,23 @@
#include <Tpetra_Core.hpp>
#include <Tpetra_Vector.hpp>
#include <Tpetra_CrsMatrix.hpp>
// I/O for Harwell-Boeing files
#define HIDE_TPETRA_INOUT_IMPLEMENTATIONS
#include <Tpetra_MatrixIO.hpp>

// Teuchos
#include <Teuchos_RCP.hpp>
#include <Teuchos_Comm.hpp>
#include <Teuchos_CommHelpers.hpp>
#include <Teuchos_DefaultComm.hpp>
#include "Teuchos_ParameterList.hpp"
#include "Teuchos_StandardCatchMacros.hpp"
#include "Teuchos_CommandLineProcessor.hpp"
#include <Teuchos_ParameterList.hpp>
#include <Teuchos_StandardCatchMacros.hpp>
#include <Teuchos_CommandLineProcessor.hpp>

// Belos
#include "BelosConfigDefs.hpp"
#include "BelosBlockGmresSolMgr.hpp"
#include "BelosLinearProblem.hpp"
#include "BelosTpetraTestFramework.hpp"


template <typename ScalarType>
Expand Down Expand Up @@ -117,7 +119,7 @@ int run(int argc, char *argv[]) {
cmdp.setOption("verbose","quiet",&verbose,"Print messages and results.");
cmdp.setOption("debug","nondebug",&debug,"Print debugging information from solver.");
cmdp.setOption("frequency",&frequency,"Solvers frequency for printing residuals (#iters).");
cmdp.setOption("filename",&filename,"Filename for test matrix. Acceptable file extensions: *.hb,*.mtx,*.triU,*.triS");
cmdp.setOption("filename",&filename,"Filename for Harwell-Boeing test matrix.");
cmdp.setOption("tol",&tol,"Relative residual tolerance used by GMRES solver.");
cmdp.setOption("num-rhs",&numrhs,"Number of right-hand sides to be solved for.");
cmdp.setOption("block-size",&blockSize,"Block size used by GMRES.");
Expand All @@ -138,9 +140,9 @@ int run(int argc, char *argv[]) {
}

// Get the problem
Belos::Tpetra::HarwellBoeingReader<tcrsmatrix_t> reader( comm );
RCP<tcrsmatrix_t> A = reader.readFromFile( filename );
RCP<const tmap_t> Map = A->getDomainMap();
RCP<tcrsmatrix_t> A;
Tpetra::Utils::readHBMatrix(filename, comm, A);
RCP<const tmap_t> map = A->getDomainMap();

// Create initial vectors
RCP<MV> B, X;
Expand Down
42 changes: 19 additions & 23 deletions packages/belos/tpetra/example/BlockGmres/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,39 +1,35 @@

ASSERT_DEFINED(${PACKAGE_NAME}_ENABLE_Galeri)
ASSERT_DEFINED(${PACKAGE_NAME}_ENABLE_Triutils)

IF (${PACKAGE_NAME}_ENABLE_Triutils)
TRIBITS_ADD_EXECUTABLE(
BlockGmres_Tpetra_File_Ex
SOURCES BlockGmresTpetraExFile.cpp
COMM serial mpi
)

TRIBITS_ADD_EXECUTABLE(
BlockGmres_Tpetra_File_Ex
SOURCES BlockGmresTpetraExFile.cpp
COMM serial mpi
)

TRIBITS_ADD_EXECUTABLE(
PseudoBlockGmres_Tpetra_File_Ex
SOURCES PseudoBlockGmresTpetraExFile.cpp
COMM serial mpi
)

TRIBITS_COPY_FILES_TO_BINARY_DIR(Tpetra_CopyExampleBlockGmresFiles
SOURCE_DIR ${Belos_SOURCE_DIR}/tpetra/example/BlockGmres
SOURCE_FILES orsirr1.hb identity.mtx
EXEDEPS BlockGmres_Tpetra_File_Ex
)
TRIBITS_ADD_EXECUTABLE(
PseudoBlockGmres_Tpetra_File_Ex
SOURCES PseudoBlockGmresTpetraExFile.cpp
COMM serial mpi
)

ENDIF(${PACKAGE_NAME}_ENABLE_Triutils)
TRIBITS_COPY_FILES_TO_BINARY_DIR(Tpetra_CopyExampleBlockGmresFiles
SOURCE_DIR ${Belos_SOURCE_DIR}/tpetra/testmatrices
SOURCE_FILES orsirr1.hb identity.mtx
EXEDEPS BlockGmres_Tpetra_File_Ex
)

ASSERT_DEFINED(${PACKAGE_NAME}_ENABLE_Galeri)
IF (${PACKAGE_NAME}_ENABLE_Galeri AND ${PACKAGE_NAME}_ENABLE_Xpetra)

TRIBITS_ADD_EXECUTABLE_AND_TEST(
Tpetra_BlockGmres_Galeri_Ex
SOURCES BlockGmresTpetraGaleriEx.cpp
COMM serial mpi
ARGS "--verbose --nx=10 --ortho=DGKS"
"--verbose --nx=10 --ortho=ICGS"
"--verbose --nx=10 --ortho=IMGS"
"--verbose --nx=10 --ortho=ICGS"
"--verbose --nx=10 --ortho=IMGS"
STANDARD_PASS_OUTPUT
)

ENDIF (${PACKAGE_NAME}_ENABLE_Galeri AND ${PACKAGE_NAME}_ENABLE_Xpetra)
ENDIF ()
2 changes: 0 additions & 2 deletions packages/belos/tpetra/example/BlockGmres/Dummy

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -48,26 +48,28 @@
// NOTE: No preconditioner is used in this example.
//

// Tpetra
#include <Tpetra_Map.hpp>
#include <Tpetra_Core.hpp>
#include <Tpetra_Vector.hpp>
#include <Tpetra_CrsMatrix.hpp>

// Teuchos
#include <Teuchos_RCP.hpp>
#include <Teuchos_Comm.hpp>
#include <Teuchos_CommHelpers.hpp>
#include <Teuchos_DefaultComm.hpp>
#include "Teuchos_ParameterList.hpp"
#include "Teuchos_StandardCatchMacros.hpp"
#include "Teuchos_CommandLineProcessor.hpp"
#include <Teuchos_ParameterList.hpp>
#include <Teuchos_StandardCatchMacros.hpp>
#include <Teuchos_CommandLineProcessor.hpp>

// Tpetra
#include <Tpetra_Map.hpp>
#include <Tpetra_Core.hpp>
#include <Tpetra_Vector.hpp>
#include <Tpetra_CrsMatrix.hpp>
// I/O for Harwell-Boeing files
#define HIDE_TPETRA_INOUT_IMPLEMENTATIONS
#include <Tpetra_MatrixIO.hpp>

// Belos
#include "BelosConfigDefs.hpp"
#include "BelosPseudoBlockGmresSolMgr.hpp"
#include "BelosLinearProblem.hpp"
#include "BelosTpetraTestFramework.hpp"


template <typename ScalarType>
Expand Down Expand Up @@ -114,7 +116,7 @@ int run(int argc, char *argv[]) {
Teuchos::CommandLineProcessor cmdp(false,true);
cmdp.setOption("verbose","quiet",&verbose,"Print messages and results.");
cmdp.setOption("frequency",&frequency,"Solvers frequency for printing residuals (#iters).");
cmdp.setOption("filename",&filename,"Filename for test matrix. Acceptable file extensions: *.hb,*.mtx,*.triU,*.triS");
cmdp.setOption("filename",&filename,"Filename for Harwell-Boeing test matrix.");
cmdp.setOption("tol",&tol,"Relative residual tolerance used by GMRES solver.");
cmdp.setOption("num-rhs",&numrhs,"Number of right-hand sides to be solved for.");
cmdp.setOption("block-size",&blockSize,"Block size used by GMRES.");
Expand All @@ -133,10 +135,10 @@ int run(int argc, char *argv[]) {
std::cout << Belos::Belos_Version() << std::endl << std::endl;
}

// Get the problem
Belos::Tpetra::HarwellBoeingReader<tcrsmatrix_t> reader( comm );
RCP<tcrsmatrix_t> A = reader.readFromFile( filename );
RCP<const tmap_t> Map = A->getDomainMap();
// Get the problem
RCP<tcrsmatrix_t> A;
Tpetra::Utils::readHBMatrix(filename, comm, A);
RCP<const tmap_t> map = A->getDomainMap();

// Create initial vectors
RCP<MV> B, X;
Expand Down
Loading

0 comments on commit 32299c3

Please sign in to comment.