Skip to content

Commit

Permalink
Revert "compil correction due to SolverStater API modification"
Browse files Browse the repository at this point in the history
This reverts commit 3b68b99.
  • Loading branch information
gratienj committed Jun 22, 2023
1 parent 3b68b99 commit c80b738
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ MatrixInternal<ValueT>::_compute(HPDDM::MatrixCSR<ValueT>* matrix_dirichlet,
// unsigned short nu = ref;
Real eigen_solver_time = 0.;
if (nu > 0) {
Alien::SolverStater::Sentry s(eigen_solver_time);
Alien::BaseSolverStater::Sentry s(eigen_solver_time);
m_matrix.template solveGEVP<EIGENSOLVER>(matrix_neumann);
// nu = opt["geneo_nu"];
// m_hpddm_matrix.super::initialize(nu);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ HPDDMInternalSolver::HPDDMInternalSolver(
IMessagePassingMng* parallel_mng, IOptionsHPDDMSolver* options)
: m_parallel_mng(parallel_mng)
, m_options(options)
, m_stater(this)
{
}

Expand Down Expand Up @@ -157,7 +158,7 @@ HPDDMInternalSolver::solve(
alien_info([&] { cout() << "HPDDMSolver::solve"; });

{
Alien::SolverStater::Sentry s(m_init_solver_time);
Alien::BaseSolverStater::Sentry s(m_init_solver_time);

HPDDM::Option& opt = *HPDDM::Option::get();
bool schwarz_coarse_correction = opt.set("schwarz_coarse_correction");
Expand All @@ -168,7 +169,7 @@ HPDDMInternalSolver::solve(
}

{
Alien::SolverStater::Sentry s(m_iter_solver_time);
Alien::BaseSolverStater::Sentry s(m_iter_solver_time);
m_status.iteration_count =
HPDDM::IterativeMethod::solve(m_hpddm_matrix.matrix(), m_hpddm_rhs.data(),
m_hpddm_sol.data(), 1, m_hpddm_matrix.matrix().getCommunicator());
Expand All @@ -194,7 +195,7 @@ HPDDMInternalSolver::solve(CSRMatrixType const& Ad, CSRMatrixType const& An,
alien_info([&] { cout() << "HPDDMSolver::solve"; });
{

Alien::SolverStater::Sentry s(m_init_solver_time);
Alien::BaseSolverStater::Sentry s(m_init_solver_time);

HPDDM::Option& opt = *HPDDM::Option::get();
bool schwarz_coarse_correction = opt.set("schwarz_coarse_correction");
Expand All @@ -206,7 +207,7 @@ HPDDMInternalSolver::solve(CSRMatrixType const& Ad, CSRMatrixType const& An,
}

{
Alien::SolverStater::Sentry s(m_iter_solver_time);
Alien::BaseSolverStater::Sentry s(m_iter_solver_time);
m_status.iteration_count =
HPDDM::IterativeMethod::solve(m_hpddm_matrix.matrix(), m_hpddm_rhs.data(),
m_hpddm_sol.data(), 1, m_hpddm_matrix.matrix().getCommunicator());
Expand Down Expand Up @@ -245,13 +246,13 @@ HPDDMInternalSolver::solve(IMatrix const& A, IVector const& b, IVector& x)
using namespace Alien;

#ifdef ALIEN_USE_HPDDM
SolverStatSentry<HPDDMInternalSolver> sentry(this, SolverStater::ePrepare);
SolverStatSentry<HPDDMInternalSolver> sentry(m_stater, BaseSolverStater::ePrepare);
CSRMatrixType const& matrix = A.impl()->get<BackEnd::tag::simplecsr>();
CSRVectorType const& rhs = b.impl()->get<BackEnd::tag::simplecsr>();
CSRVectorType& sol = x.impl()->get<BackEnd::tag::simplecsr>(true);
sentry.release();

SolverStatSentry<HPDDMInternalSolver> sentry2(this, SolverStater::eSolve);
SolverStatSentry<HPDDMInternalSolver> sentry2(m_stater, BaseSolverStater::eSolve);
return solve(matrix, rhs, sol);
#else
return false;
Expand All @@ -265,14 +266,14 @@ HPDDMInternalSolver::solve(
using namespace Alien;

#ifdef ALIEN_USE_HPDDM
SolverStatSentry<HPDDMInternalSolver> sentry(this, SolverStater::ePrepare);
SolverStatSentry<HPDDMInternalSolver> sentry(m_stater, BaseSolverStater::ePrepare);
CSRMatrixType const& matrixD = Ad.impl()->get<BackEnd::tag::simplecsr>();
CSRMatrixType const& matrixN = An.impl()->get<BackEnd::tag::simplecsr>();
CSRVectorType const& rhs = b.impl()->get<BackEnd::tag::simplecsr>();
CSRVectorType& sol = x.impl()->get<BackEnd::tag::simplecsr>(true);
sentry.release();

SolverStatSentry<HPDDMInternalSolver> sentry2(this, SolverStater::eSolve);
SolverStatSentry<HPDDMInternalSolver> sentry2(m_stater, BaseSolverStater::eSolve);
return solve(matrixD, matrixN, rhs, sol);
#else
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include <alien/core/backend/IInternalLinearSolverT.h>
#include <alien/kernels/hpddm/linear_solver/HPDDMOptionTypes.h>
#include <alien/expression/solver/SolverStat.h>
#include <alien/expression/solver/SolverStater.h>
#include <alien/core/backend/IInternalLinearSolverT.h>
#include <alien/utils/ObjectWithTrace.h>
#include <alien/kernels/simple_csr/SimpleCSRVector.h>
Expand Down Expand Up @@ -81,14 +80,9 @@ class ALIEN_HPDDM_EXPORT HPDDMInternalSolver

//! Etat du solveur
const Alien::ILinearSolver::Status& getStatus() const { return m_status; }
Alien::ILinearSolver::Status& getStatusRef() { return m_status; }

const SolverStat& getSolverStat() const { return m_stat; }
SolverStat& getSolverStat() { return m_stat; }

Alien::SolverStater& getSolverStater() {
return m_stater;
}

bool solve(const Alien::IMatrix& A, const Alien::IVector& b, Alien::IVector& x);

Expand Down Expand Up @@ -120,7 +114,7 @@ class ALIEN_HPDDM_EXPORT HPDDMInternalSolver
std::vector<Real> m_hpddm_rhs;

Alien::SolverStat m_stat; //<! Statistiques d'ex�cution du solveur
Alien::SolverStater m_stater;
Alien::SolverStater<HPDDMInternalSolver> m_stater;
Alien::ILinearSolver::Status m_status;
Real m_init_solver_time = 0.;
Real m_iter_solver_time = 0.;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ HTSInternalLinearSolver::HTSInternalLinearSolver(
Arccore::MessagePassing::IMessagePassingMng* parallel_mng, IOptionsHTSSolver* options)
: m_parallel_mng(parallel_mng)
, m_options(options)
, m_stater(this)
{
}

Expand All @@ -68,7 +69,7 @@ HTSInternalLinearSolver::init(int argc, char const** argv)
void
HTSInternalLinearSolver::init()
{
SolverStatSentry<HTSInternalLinearSolver> sentry(this, SolverStater::eInit);
SolverStatSentry<HTSInternalLinearSolver> sentry(m_stater, BaseSolverStater::eInit);
m_output_level = m_options->output();

#ifdef ALIEN_USE_HTSSOLVER
Expand Down Expand Up @@ -403,15 +404,6 @@ HTSInternalLinearSolver::getStatus() const
return m_status;
}

Alien::SolverStatus&
HTSInternalLinearSolver::getStatusRef()
{
if (m_output_level > 0) {
printInfo();
}
return m_status;
}

void
HTSInternalLinearSolver::printInfo()
{
Expand Down Expand Up @@ -458,13 +450,13 @@ HTSInternalLinearSolver::solve(IMatrix const& A, IVector const& b, IVector& x)
using namespace Alien;

#ifdef ALIEN_USE_HTSSOLVER
SolverStatSentry<HTSInternalLinearSolver> sentry(this, SolverStater::ePrepare);
SolverStatSentry<HTSInternalLinearSolver> sentry(m_stater, BaseSolverStater::ePrepare);
CSRMatrixType const& matrix = A.impl()->get<BackEnd::tag::simplecsr>();
CSRVectorType const& rhs = b.impl()->get<BackEnd::tag::simplecsr>();
CSRVectorType& sol = x.impl()->get<BackEnd::tag::simplecsr>(true);
sentry.release();

SolverStatSentry<HTSInternalLinearSolver> sentry2(this, SolverStater::eSolve);
SolverStatSentry<HTSInternalLinearSolver> sentry2(m_stater, BaseSolverStater::eSolve);
return solve(matrix, rhs, sol);
#endif
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,10 @@ class ALIEN_IFPEN_SOLVERS_EXPORT HTSInternalLinearSolver

//! Etat du solveur
const Alien::SolverStatus& getStatus() const;
Alien::SolverStatus& getStatusRef() ;

const SolverStat& getSolverStat() const { return m_stat; }
SolverStat& getSolverStat() { return m_stat; }

SolverStater& getSolverStater() {
return m_stater;
}

String getName() const { return "htssolver"; }

//! Etat du solveur
Expand Down Expand Up @@ -175,7 +170,7 @@ class ALIEN_IFPEN_SOLVERS_EXPORT HTSInternalLinearSolver
Real m_int_total_finish_time = 0.;

SolverStat m_stat;
SolverStater m_stater;
SolverStater<HTSInternalLinearSolver> m_stater;

IOptionsHTSSolver* m_options = nullptr;
std::vector<double> m_pressure_diag;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ IFPInternalLinearSolver::IFPInternalLinearSolver(
: m_parallel_mng(parallel_mng)
, m_print_info(0)
, m_options(options)
, m_stater(this)
{
}

Expand All @@ -58,7 +59,7 @@ IFPInternalLinearSolver::~IFPInternalLinearSolver()
void
IFPInternalLinearSolver::init()
{
SolverStatSentry<IFPInternalLinearSolver> sentry(this, SolverStater::eInit);
SolverStatSentry<IFPInternalLinearSolver> sentry(m_stater, BaseSolverStater::eInit);
if (m_parallel_mng == nullptr)
return;

Expand Down Expand Up @@ -173,12 +174,6 @@ IFPInternalLinearSolver::getStatus() const
return m_status;
}

Alien::SolverStatus&
IFPInternalLinearSolver::getStatusRef()
{
return m_status;
}

/*---------------------------------------------------------------------------*/

bool
Expand All @@ -189,7 +184,7 @@ IFPInternalLinearSolver::solve(const MatrixType& A, const VectorType& b, VectorS

bool isSolverOk = false;

SolverStatSentry<IFPInternalLinearSolver> sentry(this, SolverStater::ePrepare);
SolverStatSentry<IFPInternalLinearSolver> sentry(m_stater, BaseSolverStater::ePrepare);

// m_stater.startPrepareMeasure();

Expand Down Expand Up @@ -223,7 +218,7 @@ IFPInternalLinearSolver::solve(const MatrixType& A, const VectorType& b, VectorS
m_ilu0_algo = 4;
sentry.release();

SolverStatSentry<IFPInternalLinearSolver> sentry2(this, SolverStater::eSolve);
SolverStatSentry<IFPInternalLinearSolver> sentry2(m_stater, BaseSolverStater::eSolve);
if (matrix.internal()->m_system_is_resizeable == true)
isSolverOk = _solveRs(matrix.internal()->m_system_is_resizeable);
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,11 @@ class ALIEN_IFPEN_SOLVERS_EXPORT IFPInternalLinearSolver : public ILinearSolver

//! Etat du solveur
const Status& getStatus() const;
Status& getStatusRef() ;

//! Statistiques du solveur
const SolverStat& getSolverStat() const { return m_stat; }
SolverStat& getSolverStat() { return m_stat; }

SolverStater& getSolverStater() {
return m_stater;
}

//! Etat du solveur
void setNullSpaceConstantOption(bool flag);

Expand All @@ -96,7 +91,7 @@ class ALIEN_IFPEN_SOLVERS_EXPORT IFPInternalLinearSolver : public ILinearSolver
Arccore::MessagePassing::IMessagePassingMng* m_parallel_mng;
Status m_status;
SolverStat m_stat; //<! Statistiques d'exécution du solveur
SolverStater m_stater;
SolverStater<IFPInternalLinearSolver> m_stater;
Integer m_print_info;
IOptionsIFPLinearSolver* m_options;
};
Expand Down

0 comments on commit c80b738

Please sign in to comment.