<div dir="ltr"><div>I'm having some trouble pulling out the subsolver. I tried to use SNESNASMGetSNES in a loop over each subdomain. However I get an error when I run the code with more than one MPI processors. Here is a snippet from my code: </div><div><br><font face="monospace"> SNES snes, subsnes;<br> PetscMPIInt rank, size;<br></font></div><div><font face="monospace"> ... </font></div><div><div><font face="monospace"> ierr = SNESCreate(PETSC_COMM_WORLD,&snes); CHKERRQ(ierr);<br> ierr = SNESSetType(snes,SNESNASM); CHKERRQ(ierr);<br> ierr = SNESNASMSetType(snes,PC_ASM_RESTRICT); CHKERRQ(ierr);<br> ... <br> ierr = SNESSetFromOptions(snes); CHKERRQ(ierr);<br> ierr = SNESSetUp(snes); CHKERRQ(ierr);<br> PetscPrintf(PETSC_COMM_WORLD, "Size = %d\n",size);<br> for (i=0; i<size; i++) {<br> PetscPrintf(PETSC_COMM_WORLD, "rank = %d\n",i);<br> SNESNASMGetSNES(snes,i,&subsnes);<br> // char prefix[10];<br> // sprintf(prefix,"sub_%d_",i);<br> // SNESSetOptionsPrefix(subsnes,prefix);<br> }</font><br></div></div><div><font face="monospace"> ... </font></div><div><font face="monospace"> ierr = SNESSolve(snes,NULL,u_initial); CHKERRQ(ierr);<br></font></div><div><font face="monospace"><br></font></div><div><br></div><div>And, here is the output of the code when I run with 2 MPI procs: </div><div><br></div><div><font face="monospace">takahashi@ubuntu:~/Desktop/MA-DDM/C/Rectangle$ mpiexec -n 2 ./test1<br>Size = 2<br>rank = 0<br>rank = 1<br>[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------<br>[0]PETSC ERROR: Argument out of range<br>[0]PETSC ERROR: No such subsolver<br>[0]PETSC ERROR: See <a href="https://petsc.org/release/faq/">https://petsc.org/release/faq/</a> for trouble shooting.<br>[0]PETSC ERROR: Petsc Release Version 3.17.1, unknown <br>[0]PETSC ERROR: ./test1 on a linux-gnu-c-debug named ubuntu by takahashi Fri Jun 17 06:06:38 2022<br>[0]PETSC ERROR: Configure options --with-mpi-dir=/usr --with-fc=0<br>[0]PETSC ERROR: #1 SNESNASMGetSNES() at /home/takahashi/Desktop/petsc/src/snes/impls/nasm/nasm.c:923<br><br>===================================================================================<br>= BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES<br>= RANK 0 PID 976566 RUNNING AT ubuntu<br>= KILLED BY SIGNAL: 9 (Killed)<br>===================================================================================</font><br></div><div><br></div><div>This error doesn't occur when I run this without MPI. However, I tried to change the prefix of the subdomain to `sub_0_` but I am not able to change the snes_type using this prefix. Running<font face="monospace"> ./test1 -snes_view -help | grep sub_0_snes_type </font><font face="arial, sans-serif">prints nothing. </font></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jun 16, 2022 at 6:23 PM Matthew Knepley <<a href="mailto:knepley@gmail.com">knepley@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">On Thu, Jun 16, 2022 at 5:57 PM tt73 <<a href="mailto:tt73@njit.edu" target="_blank">tt73@njit.edu</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div dir="auto"><br></div><div dir="auto">Hi, </div><div dir="auto"><br></div><div dir="auto">I am using NASM as the outer solver for a nonlinear problem. For one of the subdomains, I want to run the local solve with a different set of options form the others. Is there any way to set options for each subdomain? </div></div></blockquote></div><br clear="all"><div>I can see two ways:</div><div><br></div><div> 1) Pull out the subsolver and set it using the API</div><div><br></div><div> 2) Pull out the subsolver and give it a different prefix</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>
</blockquote></div>