12 #ifndef MFEM_AMGX_SOLVER 13 #define MFEM_AMGX_SOLVER 15 #include "../config/config.hpp" 24 #include "operator.hpp" 115 AmgXSolver(
const MPI_Comm &comm,
const int nDevs,
116 const AMGX_MODE amgx_Mode_,
const bool verbose);
179 std::string amgx_config =
"";
189 const bool update_mat =
false);
196 const bool update_mat =
false);
201 const int mpiTeamSz,
const MPI_Comm &mpiTeam)
const;
204 const int mpiTeamSz,
const MPI_Comm &mpiTeam)
const;
207 const int mpiTeamSz,
const MPI_Comm &mpiTeam)
const;
210 const int mpiTeamSz,
const MPI_Comm &mpiTeam)
const;
215 const int mpiTeamSz,
const MPI_Comm &mpiTeamComm,
219 const int mpiTeamSz,
const MPI_Comm &mpi_comm,
222 void SetMatrix(
const HypreParMatrix &A,
const bool update_mat =
false);
225 void SetMatrix(
const SparseMatrix &A,
const bool update_mat =
false);
230 bool isInitialized =
false;
234 std::string nodeName;
243 int gpuProc = MPI_UNDEFINED;
246 MPI_Comm globalCpuWorld = MPI_COMM_NULL;
249 MPI_Comm localCpuWorld;
282 AMGX_Mode precision_mode = AMGX_mode_dDDI;
285 AMGX_config_handle cfg =
nullptr;
288 AMGX_matrix_handle AmgXA =
nullptr;
291 AMGX_vector_handle AmgXP =
nullptr;
294 AMGX_vector_handle AmgXRHS =
nullptr;
297 AMGX_solver_handle solver =
nullptr;
300 static AMGX_resources_handle rsrc;
303 void SetDeviceIDs(
const int nDevs);
307 void InitMPIcomms(
const MPI_Comm &comm,
const int nDevs);
313 int64_t mat_local_rows;
315 std::string mpi_gpu_mode;
318 #endif // MFEM_USE_AMGX 319 #endif // MFEM_AMGX_SOLVER bool ConvergenceCheck
Flag to check for convergence.
void InitMPITeams(const MPI_Comm &comm, const int nDevs)
void ReadParameters(const std::string config, CONFIG_SRC source)
void source(const Vector &x, Vector &f)
void SetConvergenceCheck(bool setConvergenceCheck_=true)
Add a check for convergence after applying Mult.
void UpdateOperator(const Operator &op)
virtual void SetOperator(const Operator &op)
void DefaultParameters(const AMGX_MODE amgxMode_, const bool verbose)
void InitExclusiveGPU(const MPI_Comm &comm)
virtual void Mult(const Vector &b, Vector &x) const
Operator application: y=A(x).
Wrapper for hypre's ParCSR matrix class.
AMGX_MODE
Flags to configure AmgXSolver as a solver or preconditioner.