[petsc-users] [petsc-maint #107932] run a simple example ex19 in src/snes/examples/tutorials

Xiangze Zeng zengshixiangze at 163.com
Fri Mar 16 10:59:31 CDT 2012


I replace MATAIJCUSP with MATMPIAIJCUSP. It works well. The attachments are the outputs of log_summary.
MATAIJCUSP is used for serial matrices?

在 2012-03-16 23:00:29,"Jed Brown" <jedbrown at mcs.anl.gov> 写道:

2012/3/16 Xiangze Zeng <zengshixiangze at 163.com>

After I changed the Mat type for using GPU, can I still use MatMPIAIJSetPreallocation to set preallocation?


Yes, the code looks okay to me. 
 


I have add Petsc events in the code.The attachments are the outputs of log_summary (I'll configure --with-debugging=no later).
The fileinterface.c is my code in which set preallocation and insert matrices values.


You are running in serial so you should also call MatSeqAIJSetPreallocation(). The MPI allocation information is skipped because it's not an MPI matrix. It is safe to call all the preallocation routines, whichever matches will be used. Alternatively, you could call this function which will do all the variants for you:


http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/Mat/MatXAIJSetPreallocation.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120316/91ac0fe4/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: g_jacobi_sum2
Type: application/octet-stream
Size: 9986 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120316/91ac0fe4/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: g_sor_sum2
Type: application/octet-stream
Size: 10008 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120316/91ac0fe4/attachment-0003.obj>


More information about the petsc-users mailing list