<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi!<br class=""><br class="">I am very new to the PETSc world. I am working with a GitHub repo that uses PETSc together with Stan (a statistics open source software), <a href="https://discourse.mc-stan.org/t/using-petsc-library-together-with-stan/17550" class="">here</a> you can find the discussion. <br class="">It has been defined a <a href="https://github.com/IvanYashchuk/stan-math-petsc/blob/stan-petsc/stan/math/prim/fun/stan_petsc_interface.hpp" class="">functor</a> to convert EigenVector to PetscVec and viceversa, both sequentially and in parallel. <br class="">The <a href="https://github.com/IvanYashchuk/stan-math-petsc/blob/stan-petsc/stan/math/rev/functor/petsc_functor.hpp" class="">file</a> using these functions does the conversions with the sequential setting. I changed to those using MPI, that is from EigenVectorToPetscVecSeq to EigenVectorToPetscVecMPI and so on because I want to evaluate the scaling.<br class="">Running the example with <font face="Menlo" size="1" class="">mpirun -n 5 examples/rosenbrock/rosenbrock optimize</font> in the debug mode I get the error <font face="Menlo" size="1" class="">Caught signal number 11 SEGV</font>. I therefore used the option <font face="Menlo" class=""><font size="1" class="">-start_in_debugger</font> </font>and I get the following:<div class=""><span class=""><br class=""><font face="Menlo" size="1" class="">[2]PETSC ERROR: ------------------------------------------------------------------------<br class="">[2]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, probably memory access out of range<br class="">[2]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger<br class="">[2]PETSC ERROR: or see <a href="https://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind" class="">https://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind</a><br class="">[2]PETSC ERROR: or try http://valgrind.org on GNU/linux and Apple Mac OS X to find memory corruption errors<br class="">[2]PETSC ERROR: likely location of problem given in stack below<br class="">[2]PETSC ERROR: ---------------------  Stack Frames ------------------------------------<br class="">[2]PETSC ERROR: Note: The EXACT line numbers in the stack are not available,<br class="">[2]PETSC ERROR:       INSTEAD the line number of the start of the function<br class="">[2]PETSC ERROR:       is given.<br class="">[3]PETSC ERROR: ------------------------------------------------------------------------<br class="">[3]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, probably memory access out of range<br class="">[3]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger<br class="">[3]PETSC ERROR: or see https://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind<br class="">[3]PETSC ERROR: or try http://valgrind.org on GNU/linux and Apple Mac OS X to find memory corruption errors<br class="">[3]PETSC ERROR: likely location of problem given in stack below<br class="">[3]PETSC ERROR: ---------------------  Stack Frames ------------------------------------<br class="">[3]PETSC ERROR: Note: The EXACT line numbers in the stack are not available,<br class="">[3]PETSC ERROR:       INSTEAD the line number of the start of the function<br class="">[3]PETSC ERROR:       is given.<br class="">[3]PETSC ERROR: PetscAbortErrorHandler: User provided function() line 0 in  unknown file (null)<br class="">  To prevent termination, change the error handler using PetscPushErrorHandler()<br class="">[2]PETSC ERROR: PetscAbortErrorHandler: User provided function() line 0 in  unknown file (null)<br class="">  To prevent termination, change the error handler using PetscPushErrorHandler()<br class=""><br class="">===================================================================================<br class="">=   BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES<br class="">=   PID 22939 RUNNING AT srvulx13<br class="">=   EXIT CODE: 134<br class="">=   CLEANING UP REMAINING PROCESSES<br class="">=   YOU CAN IGNORE THE BELOW CLEANUP MESSAGES<br class="">===================================================================================<br class="">YOUR APPLICATION TERMINATED WITH THE EXIT STRING: Aborted (signal 6)<br class="">This typically refers to a problem with your application.<br class="">Please see the FAQ page for debugging suggestions</font></span><div class=""><span class=""><font face="Menlo" size="1" class=""><br class=""></font></span></div><div class=""><span class="">I read the documentation regarding the PetscAbortErrorHandler, but I do not know where should I use it. How can I solve the problem? </span></div><div class=""><span class="">I hope I have been clear enough.</span></div><div class=""><span class="">Attached you can find also my configure.log and make.log files.</span></div><div class=""><span class=""><br class=""></span></div><div class=""><span class="">Best,</span></div><div class=""><span class="">Francesco</span></div><div class=""><span class=""><br class=""></span></div><div class=""></div></div></body></html>