As you suggest, I added the print codes in libmesh after creating the matrix and do MatSetOption as follows:<br> " ierr = MatCreateMPIAIJ (libMesh::COMM_WORLD,<br> <div id=":12r"> m_local, n_local,<br>
m_global, n_global,<br>
PETSC_NULL, (int*) &n_nz[0],<br> PETSC_NULL, (int*) &n_oz[0], &_mat);<br> CHKERRABORT(libMesh::COMM_WORLD,ierr);<br><br> MatSetOption(_mat,MAT_NEW_NONZERO_ALLOCATION_ERR,PETSC_FALSE); //by Yujie<br>
std::cout<<"MatSetOption"<<std::endl;"<br><br>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?<br>
Thank you very much.<br><br>Best,<br>Yujie</div><br><br><div class="gmail_quote">On Sat, Feb 11, 2012 at 10:56 AM, Jed Brown <span dir="ltr"><<a href="mailto:jedbrown@mcs.anl.gov">jedbrown@mcs.anl.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><div class="gmail_quote">On Sat, Feb 11, 2012 at 10:52, recrusader <span dir="ltr"><<a href="mailto:recrusader@gmail.com" target="_blank">recrusader@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>When I removed 'if (NONEW == -2)<br>
SETERRQ2(PETSC_COMM_SELF,PETSC_ERR_ARG_OUTOFRANGE,"New nonzero at<br>
(%D,%D) caused a malloc",ROW,COL); \' from the following function in<br>
src/mat/impls/aij/seq/aij.h. It works in GPU mode. Do you have any<br>
comments? Thanks a lot.</div></blockquote></div><br></div><div>If you want that effect, you can</div><div><br></div><div>MatSetOption(A,MAT_NEW_NONZERO_ALLOCATION_ERR,PETSC_FALSE);</div><div><br></div><div>or -mat_new_nonzero_allocation_err 0.</div>
<div><br></div><div>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()?</div>
</blockquote></div><br>