ddemidov/amgcl

Does amgcl support the trillinos csrmatrix format.

ztdepztdep opened this issue · 7 comments

I have a code writing with trillinos, and i want to call the amgcl routine from my trillinos code. Does amgcl supoor thtis?

There is the epetra_map adapter that should allow to use Trilinos matrices as inputs to amgcl solvers.

`  amgcl::mpi::init mpi();
	amgcl::mpi::communicator world(MPI_COMM_WORLD);
	amgcl::profiler<> prof("Heat Condcution");
   	typedef amgcl::backend::builtin<double> DBackend;
        typedef amgcl::mpi::make_solver<amgcl::mpi::amg<DBackend,
                                        amgcl::mpi::coarsening::smoothed_aggregation<DBackend>,
                                        amgcl::mpi::relaxation::spai0<DBackend>>,
                                        amgcl::mpi::solver::bicgstab<DBackend>> Solver;
        
   Solver solve(world, amgcl::adapter::epetra_map(EpetraA_Diffusion));
     std::vector<double> x(NumMyRows);
   std::vector<double> rhs(NumMyRows);
   std::tie(NumIters, TrueResidual) = solve(rhs, x);

`

great, it works. But it is very slow compared to the trillinos's bicgstab solver.
trillinos 0.15s
amgcl 1.6s

I don't have much experience with Trilinos, may be @RiccardoRossi may comment?

Also, make sure you have enabled full optimization for compilation of the amgcl test.

mmm,

as i understand you have a backend in the middle, and as i understand that is making a copy of the matrix. @ddemidov am I wrong?

having said this we benchmarked against ML and it was very competitive... are u sure you properly defined the NDEBUG flag?

Yes, there is a copy being made from the adapter into amgcl distributed matrix. @ztdepztdep, if you measure the construction and the application of the solver separately, it should be clear which part takes more time (the matrix is copied inside the constructor).

Could you please give me some advices about how to define NDEBUG in the cmake file?

Cmake should do this for you if you set CMAKE_BUILD_TYPE=Release