Skip to content

Commit

Permalink
Print warnings when not running on GPU
Browse files Browse the repository at this point in the history
  • Loading branch information
pghysels committed Jun 19, 2024
1 parent 5deff93 commit 5352d83
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 5 deletions.
11 changes: 11 additions & 0 deletions src/SparseSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,17 @@ namespace strumpack {
auto MFsolve =
[&](scalar_t* w) {
DenseMW_t X(x.rows(), 1, w, x.ld());
#if !defined(STRUMPACK_USE_MAGMA)
if (opts_.use_gpu())
std::cerr
<< "-------------------------------------------------------" << std::endl
<< "WARNING: sparse multifrontal solve is done on CPU," << std::endl
<< "GPU solve requires MAGMA, see" << std::endl
<< " https://bitbucket.org/icl/magma/src/master/" << std::endl
<< "Configure with -DTPL_ENABLE_MAGMA=ON" << std::endl
<< "and set the MAGMA_DIR environment variable" << std::endl
<< "-------------------------------------------------------" << std::endl
#endif
tree()->multifrontal_solve(X);
};

Expand Down
15 changes: 11 additions & 4 deletions src/SparseSolverMPIDist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,20 @@ namespace strumpack {
#if defined(STRUMPACK_USE_SLATE_SCALAPACK)
int thread_level;
MPI_Query_thread(&thread_level);
if (thread_level != MPI_THREAD_MULTIPLE &&
mpi_rank(comm) == 0)
if (thread_level != MPI_THREAD_MULTIPLE && !mpi_rank(comm))
std::cerr << "MPI_THREAD_MULTIPLE is required for SLATE"
<< std::endl;
#else
if (opts_.use_gpu() && !mpi_rank(comm))
std::cerr
<< "-------------------------------------------------------" << std::endl
<< "WARNING: SLATE is required for full GPU support." << std::endl
<< "SLATE is a GPU-capable replacement for ScaLAPACK, see" << std::endl
<< " https://github.com/icl-utk-edu/slate" << std::endl
<< "Configure with -DTPL_ENABLE_SLATE=ON" << std::endl
<< "and set the SLATE_DIR environment variable." << std::endl
<< "-------------------------------------------------------" << std::endl;
#endif
// Set the default reordering to PARMETIS?
//opts_.set_reordering_method(ReorderingStrategy::PARMETIS);
}

template<typename scalar_t,typename integer_t> MPI_Comm
Expand Down
6 changes: 5 additions & 1 deletion src/sparse/fronts/FrontMAGMA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -803,8 +803,12 @@ namespace strumpack {
FrontMAGMA<scalar_t,integer_t>::multifrontal_solve
(DenseM_t& b) const {
if (dev_factors_) gpu_solve(b);
else // factors are not on the device, solve on CPU
else {
if (!mpi_rank())
std::cerr << "WARNING: Solve is performed on CPU" << std::endl;
// factors are not on the device, solve on CPU
FrontalMatrix<scalar_t,integer_t>::multifrontal_solve(b);
}
}

template<typename scalar_t,typename integer_t> void
Expand Down

0 comments on commit 5352d83

Please sign in to comment.