Hi,<br>1. <br> I want to allow setting the MatType by option -mat_type. It seems that I can rewrite <br> ierr=MatCreateSeqAIJ(comm,m,n,nz,nnz,A); CHKERRQ(ierr);<br> to <br> ierr=MatCreate(comm,A);CHKERRQ(ierr);<br> ierr=MatSetSizes(*A,PETSC_DECIDE,PETSC_DECIDE,m,n);CHKERRQ(ierr);<br>
ierr=MatSetFromOptions(*A);CHKERRQ(ierr);<br> So that the MatType can be set using -mat_type options.<br> But then how can the nz or nnz be specified? <br><br>2. If we set mat_type to cusp and use MatSetValues, when do the values goto device memory? Is it assembly first on host memory and then copy it once to device memory together after MatAssemblyEnd() or is it done in a different way? Does it also contain a flag to indicate whether the data value is current? <br>
<br>Thanks. <br>
<br> Shiyuan <br><br><br>