amgcl icon indicating copy to clipboard operation
amgcl copied to clipboard

Hwo to read in the mm matrix file generated by Trilinos

Open ztdepztdep opened this issue 2 years ago • 4 comments

I have an mm file generated by Trilinos package with 3cpus. but the ordering of the rows is not by the natural sequences. It is based on the ordering of each cpu. So how to read it into the amgcl . Which api should i use. Couldd you please give me some suggestions?

ztdepztdep avatar Aug 13 '22 08:08 ztdepztdep

amgcl::io::mm_reader does not require the rows in the input file to be ordered, so you can use that (see usage examples in examples/solver.cpp). The reader will sort the rows as required by amgcl.

ddemidov avatar Aug 13 '22 08:08 ddemidov

Thank you very much. But what if I want to use mpi to perform parallel computations. How to read in the coordinate in the mm file for each cpu.

ztdepztdep avatar Aug 13 '22 08:08 ztdepztdep

I guess you would have to implement a custom reader in this case. If you want to solve the system also using three cpus, then maybe you could read the rows corresponding to each cpu from the file in their original order, while renumbering the columns accordingly. Since the matrix was assembled for three subdomains by trilinos, this should probably give you close to optimal partitioning of the matrix right away.

ddemidov avatar Aug 13 '22 09:08 ddemidov

Thank you very much for your help. Now, i met the following zero sum error. |terminate called after throwing an instance of 'std::runtime_error' what(): Zero sum in skyline_lu factorization| and the make_solver is as follows.

    typedef amgcl::mpi::make_solver<
   amgcl::mpi::amg< Backend,
        amgcl::mpi::coarsening::smoothed_aggregation<Backend>,
        amgcl::mpi::relaxation::gauss_seidel<Backend>
         >,
     amgcl::mpi::solver::bicgstab<Backend>
     > Solver;`

ztdepztdep avatar Aug 13 '22 12:08 ztdepztdep