NVIDIA / NVIDIA/AMGX

AMGX_solver_solve_with_0_initial_guess() requires explicit initializing of solution vector

Open
#80 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement good first issue tracking internally
Dominant language
Cuda
Stars
692
Forks
197
PR merge metrics
No merged PRs in 30d

Description

{
AMGX_matrix_handle A1;
AMGX_vector_handle rhs;
AMGX_vector_handle sln;

        AMGX_matrix_create(&A1, rsrc, AMGX_mode_dDDI);
        AMGX_vector_create(&rhs, rsrc, AMGX_mode_dDDI);
        AMGX_vector_create(&sln, rsrc, AMGX_mode_dDDI);

        double data[] = {1, -2, -3, 1, 1, -4, -5, 1};
        AMGX_pin_memory(data, sizeof(double) * 8);
        int col_ind[] = {0, 1};
        int row_ptr[] = {0, 1, 2};
        AMGX_matrix_upload_all(A1, 2, 2, 2, 2, row_ptr, col_ind, data, 0);
        int nn, block_dimx, block_dimy;
        AMGX_matrix_get_size(A1, &nn, &block_dimx, &block_dimy);
        double data1[] = {1, 2, 3, 4};
        AMGX_pin_memory(data1, sizeof(double) * 4);
        AMGX_vector_upload(rhs, 2, 2, data1);
        int nnn, block_dim;
        AMGX_vector_get_size(rhs, &nnn, &block_dim);
        //AMGX_vector_create(x1, )
        AMGX_solver_create(&solver, rsrc, AMGX_mode_dDDI, config);
        AMGX_solver_setup(solver, A1);
        AMGX_solver_solve_with_0_initial_guess(solver, rhs, sln);
    }

Good afternoon. Please tell me why in this example I get an error of mismatch of dimensions? Purely in blocks everything turns out correctly. I use the solver FGMRES. Maybe there is a working example in which the matrix and vector are initialized from arrays, and not from a file. The documentation seems to be doing everything right.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the provided snippet and inspect the dimensions passed to AMGX_matrix_upload_all, AMGX_vector_upload, and AMGX_solver_solve_with_0_initial_guess. Compare the matrix, right-hand side, and solution block dimensions, then verify the corrected array-based initialization against the FGMRES solver behavior.

Written by the indexing model from the issue text.

Assessment

Domain
hpc
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.