[petsc-users] Parallelizing Nonlinear Algebraic systems without DM

Nidish nb25 at rice.edu
Sun Aug 9 01:14:49 CDT 2020


Hello,

My question is related to solving a generic nonlinear algebraic system 
in parallel. I'm using the word generic to point to the fact that the 
system may or may not be from a finite element/mesh type object - it's 
just a residual function and a Jacobian function that I can provide.

I followed the serial example in $PETSC_DIR/src/snes/tutorials/ex1.c 
pretty much verbatim (albeit with a slightly different objective 
function whose size can be controlled), and have been trying to extend 
it to a parallel application (the given example is strictly serial).

When I run my code in serial everything works well and I get the 
solution I expect. However, even if I use just two cores, the code 
starts returning garbage. I had a feeling it has something to do with 
index ordering, but I want to get this code working without using a DM 
object. I'm attaching my code with this email.

TL;DR Version: What modifications must be made in 
"$PETSC_DIR/src/snes/tutorials/ex1.c" to make it work in Parallel? Is it 
possible to make minimal modifications to make it run in parallel too?

Thank You,
Nidish
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sness.c
Type: text/x-csrc
Size: 4060 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20200809/0188f4ed/attachment.bin>


More information about the petsc-users mailing list