<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Right now this is only a toy example. I do not expect to see any actual improvement over the number of processors, or should I?<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">Il giorno 31 mar 2021, alle ore 16:43, Stefano Zampini <<a href="mailto:stefano.zampini@gmail.com" class="">stefano.zampini@gmail.com</a>> ha scritto:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Are you trying to parallelize a 3 equations system? Or you just use your SIR code to experiment with TS?<div class=""><br class=""><div class=""><br class=""><blockquote type="cite" class=""><div class="">On Mar 31, 2021, at 5:18 PM, Matthew Knepley <<a href="mailto:knepley@gmail.com" class="">knepley@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><div dir="ltr" class="">On Wed, Mar 31, 2021 at 10:15 AM Francesco Brarda <<a href="mailto:brardafrancesco@gmail.com" class="">brardafrancesco@gmail.com</a>> wrote:<br class=""></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div style="overflow-wrap: break-word;" class="">Thank you for your advices. <div class="">I wrote what seems to me a very basic code, but I got this error when I run it with more than 1 processor:<br class="">Clearly the result 299. is wrong but I do not understand what am doing wrong. With 1 processor it works fine.<br class=""></div></div></blockquote><div class=""><br class=""></div><div class="">My guess is that you do VecGetArray() and index the array using global indices rather than local indices, because</div><div class="">there memory corruption with a Vec array.</div><div class=""><br class=""></div><div class=""> Thanks,</div><div class=""><br class=""></div><div class=""> Matt</div><div class=""> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div style="overflow-wrap: break-word;" class=""><div class=""><div class=""><font face="Menlo" size="1" class="">steps 150, ftime 15.<br class="">Vec Object: 2 MPI processes<br class=""> type: mpi<br class="">Process [0]<br class="">16.5613<br class="">2.91405<br class="">Process [1]<br class="">299.<br class="">[0]PETSC ERROR: PetscTrFreeDefault() called from VecDestroy_MPI() line 21 in /home/fbrarda/petsc/src/vec/vec/impls/mpi/pdvec.c<br class="">[0]PETSC ERROR: Block [id=0(16)] at address 0x15812a0 is corrupted (probably write past end of array)<br class="">[0]PETSC ERROR: Block allocated in VecCreate_MPI_Private() line 514 in /home/fbrarda/petsc/src/vec/vec/impls/mpi/pbvec.c<br class="">[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------<br class="">[0]PETSC ERROR: Memory corruption: <a href="https://www.mcs.anl.gov/petsc/documentation/installation.html#valgrind" target="_blank" class="">https://www.mcs.anl.gov/petsc/documentation/installation.html#valgrind</a><br class="">[0]PETSC ERROR: Corrupted memory<br class="">[0]PETSC ERROR: See<span class="Apple-converted-space"> </span><a href="https://www.mcs.anl.gov/petsc/documentation/faq.html" target="_blank" class="">https://www.mcs.anl.gov/petsc/documentation/faq.html</a><span class="Apple-converted-space"> </span>for trouble shooting.<br class="">[0]PETSC ERROR: Petsc Release Version 3.14.4, unknown <br class="">[0]PETSC ERROR: ./par_sir_model on a arch-debug named srvulx13 by fbrarda Wed Mar 31 16:05:22 2021<br class="">[0]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --with-openblas-dir=/opt/packages/openblas/0.2.13-gcc --download-mpich PETSC_ARCH=arch-debug<br class="">[0]PETSC ERROR: #1 PetscTrFreeDefault() line 310 in /home/fbrarda/petsc/src/sys/memory/mtr.c<br class="">[0]PETSC ERROR: #2 VecDestroy_MPI() line 21 in /home/fbrarda/petsc/src/vec/vec/impls/mpi/pdvec.c<br class="">[0]PETSC ERROR: #3 VecDestroy() line 396 in /home/fbrarda/petsc/src/vec/vec/interface/vector.c<br class="">[0]PETSC ERROR: #4 SNESLineSearchReset() line 284 in /home/fbrarda/petsc/src/snes/linesearch/interface/linesearch.c<br class="">[0]PETSC ERROR: #5 SNESReset() line 3229 in /home/fbrarda/petsc/src/snes/interface/snes.c<br class="">[0]PETSC ERROR: #6 TSReset() line 2800 in /home/fbrarda/petsc/src/ts/interface/ts.c<br class="">[0]PETSC ERROR: #7 TSDestroy() line 2856 in /home/fbrarda/petsc/src/ts/interface/ts.c<br class="">[0]PETSC ERROR: #8 main() line 256 in par_sir_model.c<br class="">[0]PETSC ERROR: No PETSc Option Table entries<br class="">[0]PETSC ERROR: ----------------End of Error Message -------send entire error message to <a href="mailto:petsc-maint@mcs.anl.gov" class="">petsc-maint@mcs.anl.gov</a>----------<br class="">application called MPI_Abort(MPI_COMM_SELF, 256001) - process 0<br class="">[1]PETSC ERROR: PetscTrFreeDefault() called from VecDestroy_MPI() line 21 in /home/fbrarda/petsc/src/vec/vec/impls/mpi/pdvec.c<br class="">[1]PETSC ERROR: Block [id=0(16)] at address 0xbd9520 is corrupted (probably write past end of array)<br class="">[1]PETSC ERROR: Block allocated in VecCreate_MPI_Private() line 514 in /home/fbrarda/petsc/src/vec/vec/impls/mpi/pbvec.c<br class="">[1]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------<br class="">[1]PETSC ERROR: Memory corruption: <a href="https://www.mcs.anl.gov/petsc/documentation/installation.html#valgrind" target="_blank" class="">https://www.mcs.anl.gov/petsc/documentation/installation.html#valgrind</a><br class="">[1]PETSC ERROR: Corrupted memory<br class="">[1]PETSC ERROR: See<span class="Apple-converted-space"> </span><a href="https://www.mcs.anl.gov/petsc/documentation/faq.html" target="_blank" class="">https://www.mcs.anl.gov/petsc/documentation/faq.html</a><span class="Apple-converted-space"> </span>for trouble shooting.<br class="">[1]PETSC ERROR: Petsc Release Version 3.14.4, unknown <br class="">[1]PETSC ERROR: ./par_sir_model on a arch-debug named srvulx13 by fbrarda Wed Mar 31 16:05:22 2021<br class="">[1]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --with-openblas-dir=/opt/packages/openblas/0.2.13-gcc --download-mpich PETSC_ARCH=arch-debug<br class="">[1]PETSC ERROR: #1 PetscTrFreeDefault() line 310 in /home/fbrarda/petsc/src/sys/memory/mtr.c<br class="">[1]PETSC ERROR: #2 VecDestroy_MPI() line 21 in /home/fbrarda/petsc/src/vec/vec/impls/mpi/pdvec.c<br class="">[1]PETSC ERROR: #3 VecDestroy() line 396 in /home/fbrarda/petsc/src/vec/vec/interface/vector.c<br class="">[1]PETSC ERROR: #4 TSReset() line 2806 in /home/fbrarda/petsc/src/ts/interface/ts.c<br class="">[1]PETSC ERROR: #5 TSDestroy() line 2856 in /home/fbrarda/petsc/src/ts/interface/ts.c<br class="">[1]PETSC ERROR: #6 main() line 256 in par_sir_model.c<br class="">[1]PETSC ERROR: No PETSc Option Table entries<br class="">[1]PETSC ERROR: ----------------End of Error Message -------send entire error message to <a href="mailto:petsc-maint@mcs.anl.gov" class="">petsc-maint@mcs.anl.gov</a>----------<br class="">application called MPI_Abort(MPI_COMM_SELF, 256001) - process 0<br class=""></font><br class=""><blockquote type="cite" class="">Il giorno 31 mar 2021, alle ore 12:06, Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank" class="">knepley@gmail.com</a>> ha scritto:<br class=""><br class="">On Wed, Mar 31, 2021 at 3:54 AM Francesco Brarda <<a href="mailto:brardafrancesco@gmail.com" target="_blank" class="">brardafrancesco@gmail.com</a>> wrote:<br class="">Hi everyone!<br class=""><br class="">I am trying to solve a system of 3 ODEs (a basic SIR model) with TS. Sequentially works pretty well, but I need to switch it into a parallel version. <br class="">I started working with TS not very long time ago, there are few questions I’d like to share with you and if you have any advices I’d be happy to hear.<br class="">First of all, do I need to use a DM object even if the model is only time dependent? All the examples I found were using that object for the other variable when solving PDEs.<br class=""><br class="">You do not need one. We use it in examples because it makes it easy to create the data.<br class=""> <br class="">When I preallocate the space for the Jacobian matrix, is it better to decide the local or global space?<br class=""><br class="">Since you are producing all the Jacobian values, it is whatever is easier in your code I think.<br class=""><br class=""> <span class="Apple-converted-space"> </span>THanks,<br class=""><br class=""> <span class="Apple-converted-space"> </span>Matt<br class=""> <br class="">Best,<br class="">Francesco<br class=""><br class=""><br class="">-- <br class="">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br class="">-- Norbert Wiener<br class=""><br class=""><a href="https://www.cse.buffalo.edu/~knepley/" target="_blank" class="">https://www.cse.buffalo.edu/~knepley/</a><br class=""></blockquote><br class=""></div></div></div></blockquote></div><br clear="all" class=""><div class=""><br class=""></div>--<span class="Apple-converted-space"> </span><br class=""><div dir="ltr" class="gmail_signature"><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class="">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br class="">-- Norbert Wiener</div><div class=""><br class=""></div><div class=""><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank" class="">https://www.cse.buffalo.edu/~knepley/</a></div></div></div></div></div></div></div></div></div></blockquote></div><br class=""></div></div></div></blockquote></div><br class=""></body></html>