[petsc-users] MatSetValues() for MATMPICUSP

recrusader recrusader at gmail.com
Sat Feb 11 10:58:20 CST 2012


As you suggest, I added the print codes in libmesh after creating the
matrix and do MatSetOption as follows:
    "    ierr = MatCreateMPIAIJ (libMesh::COMM_WORLD,

  m_local, n_local,
                                m_global, n_global,
                                PETSC_NULL, (int*) &n_nz[0],
                                PETSC_NULL, (int*) &n_oz[0], &_mat);
             CHKERRABORT(libMesh::COMM_WORLD,ierr);

      MatSetOption(_mat,MAT_NEW_NONZERO_ALLOCATION_ERR,PETSC_FALSE); //by
Yujie
      std::cout<<"MatSetOption"<<std::endl;"

I run the same codes in CPU and GPU modes (the same parameters except that
GPU uses '-vec_type mpicusp -mat_type mpiaijcusp'). I can find
"MatSetOption" output from both the modes. Does that mean that the codes
set the options for both the modes?
Thank you very much.

Best,
Yujie


On Sat, Feb 11, 2012 at 10:56 AM, Jed Brown <jedbrown at mcs.anl.gov> wrote:

> On Sat, Feb 11, 2012 at 10:52, recrusader <recrusader at gmail.com> wrote:
>
>> When I removed 'if (NONEW == -2)
>> SETERRQ2(PETSC_COMM_SELF,PETSC_ERR_ARG_OUTOFRANGE,"New nonzero at
>> (%D,%D) caused a malloc",ROW,COL); \' from the following function in
>> src/mat/impls/aij/seq/aij.h. It works in GPU mode. Do you have any
>> comments? Thanks a lot.
>>
>
> If you want that effect, you can
>
> MatSetOption(A,MAT_NEW_NONZERO_ALLOCATION_ERR,PETSC_FALSE);
>
> or -mat_new_nonzero_allocation_err 0.
>
> The more serious problem is that preallocation information seems to be
> getting lost. If you don't fix that, assembly will be horrendously slow.
> Are you sure the Mat type is being set *before* the call to
> MatMPIAIJSetPreallocation()?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120211/47afbc2a/attachment.htm>


More information about the petsc-users mailing list