Page 1 of 1

Using both MSR and CSR Matrix

Posted: Mon Sep 12, 2016 3:29 am
by msgsvc
Hello,

The example in the file(src/user_examples/cs_user_performance_tuning.c.) you mentioned helps me to force CSR for scalar matrices but not for the velocity(version 4.0). But if I want to set MSR for the velocity and CSR for most scalar matrices, what should I do?

Best Regards,

Jackie

Re: Using both MSR and CSR Matrix

Posted: Mon Sep 12, 2016 9:21 am
by Yvan Fournier
Hello,

The setting is done for a specific fill type. So you need to force the MSR format for the CS_MATRIX_BLOCK_D fill type in addition to forcing CSR for CS_MATRIX_SCALAR and possibly CS_MATRIX_SCALAR_SYM.

Regards,

Yvan

Re: Using both MSR and CSR Matrix

Posted: Tue Sep 13, 2016 8:44 am
by msgsvc
Hello,

If I set the file(src/user_examples/cs_user_performance_tuning.c.) you mentioned, most linear systems should use CSR. But recently I find that most linear systems still use NATIVE when I use callgrind tool for the call graph. It shows that "_mat_vec_p_l_native" is the main call for CG, and _b_mat_vec_p_l_native is the main call for block_3_jacobi.

but If set the MSR format for the CS_MATRIX_BLOCK_D fill type. It shows that "_mat_vec_p_l_native" is the main call for CG, and _b_mat_vec_p_l_msr is the main call for block_3_jacobi.

No matter how I set the file, I still get the similar result. I don't know why this keeps happening? And I don't know how to set the two matrix format for the same time, there is no user example for me.

The revise code as follow:
(1)CSR format

Code: Select all

    cs_matrix_variant_t *mv
      = cs_matrix_variant_create(CS_MATRIX_CSR,
                                 cs_glob_mesh->i_face_numbering);
    cs_matrix_variant_set_func(mv,
                               cs_glob_mesh->i_face_numbering,
                              CS_MATRIX_SCALAR,
                               2,
                               "default");

    cs_matrix_set_variant(CS_MATRIX_SCALAR, mv);

    cs_matrix_variant_destroy(&mv);
(2)MSR format

Code: Select all

    cs_matrix_variant_t *mv
      = cs_matrix_variant_create(CS_MATRIX_CSR,
                                 cs_glob_mesh->i_face_numbering);
    cs_matrix_variant_set_func(mv,
                               cs_glob_mesh->i_face_numbering,
                               CS_MATRIX_33_BLOCK_D,
                               2,
                               "default");

    cs_matrix_set_variant(CS_MATRIX_33_BLOCK_D, mv);

    cs_matrix_variant_destroy(&mv);

Best Regards,

Jackie

Re: Using both MSR and CSR Matrix

Posted: Tue Sep 13, 2016 9:10 am
by Yvan Fournier
Hello,

At the beginning of your block (2), for MSR, you still have CSR instead of MSR. Fixing the typo should help.

Regards,

Yvan

Re: Using both MSR and CSR Matrix

Posted: Wed Sep 14, 2016 2:40 am
by msgsvc
Hello,

Thanks a lot. That's a mistake. But when I fix the error, I still get the same problem.
but If set the MSR format for the CS_MATRIX_BLOCK_D fill type. It shows that "_mat_vec_p_l_native" is the main call for CG, and _b_mat_vec_p_l_msr is the main call for block_3_jacobi.

Best Regards,

Jackie

Re: Using both MSR and CSR Matrix

Posted: Wed Sep 14, 2016 9:24 am
by Yvan Fournier
Hello,

Which solvers are you using for which variables ? Could you follow the forum's usage recommendations regarding details to provide ?

Regards,

Yvan