<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" 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=""><br 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" 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 https://www.mcs.anl.gov/petsc/documentation/faq.html 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 petsc-maint@mcs.anl.gov----------<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: https://www.mcs.anl.gov/petsc/documentation/installation.html#valgrind<br class="">[1]PETSC ERROR: Corrupted memory<br class="">[1]PETSC ERROR: See https://www.mcs.anl.gov/petsc/documentation/faq.html 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 petsc-maint@mcs.anl.gov----------<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" 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" 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=""> THanks,<br class=""><br class=""> 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="">https://www.cse.buffalo.edu/~knepley/<br class=""></blockquote><br class=""></div></div></body></html>