boutproject / BOUT-dev

BOUT++: Plasma fluid finite-difference simulation code in curvilinear coordinate systems
http://boutproject.github.io/
GNU Lesser General Public License v3.0
184 stars 95 forks source link

Error in PETsc finalisation after BOUT simulation finishes #805

Closed arkabokshi closed 6 years ago

arkabokshi commented 6 years ago

The issue seems to be in the LaplaceXY routine. The code was run with the default BOUT.inp file options.

Have attached the error message. PETSC_error_after_run_finishes.txt

The output is:

Writing options to file data/BOUT.settings Finalising PETSc. Warning: Instances of PetscLib still exist. [0]PETSC ERROR: --------------------- Error Message ------------------------------------ [0]PETSC ERROR: Corrupt argument: see http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind! [0]PETSC ERROR: Unexpected keyval! [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: Petsc Release Version 3.4.5, Jun, 29, 2014 [0]PETSC ERROR: See docs/changes/index.html for recent updates. [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting. [0]PETSC ERROR: See docs/index.html for manual pages. [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: ./electroGEM on a arch-linux2-cxx-debug named login2.york.ac.uk by ab1209 Thu Jan 18 08:41:18 2018 [0]PETSC ERROR: Libraries linked from /scratch/ab1209/petsc-3.4.5/arch-linux2-cxx-debug/lib [0]PETSC ERROR: Configure run at Fri Jan 12 12:24:57 2018 [0]PETSC ERROR: Configure options --with-clanguage=cxx --with-mpi=yes --with-precision=double --with-scalar-type=real --with-shared-libraries=0 --download-superlu_dist --download-mumps --download-hypre --download-parmetis --download-metis --download-scalapack [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: Petsc_DelComm_Outer() line 403 in /scratch/ab1209/petsc-3.4.5/src/sys/objects/pinit.c

dschwoerer commented 6 years ago

What code did you run?

How did you compile BOUT++?

arkabokshi commented 6 years ago

This is a gyrofluid model @d7919 and I have been working on. Not on the BOUT++ GitHub yet. Compiled BOUT++in the usual way ./configure --with-petsc and the latter library was successfully compiled and tested (the flags I used while compiling PETsc can be seen in the above error file message).

d7919 commented 6 years ago

I suspect you'd see the same thing in some of the examples/integrated tests (but worth checking).

Along with the model there's the question of which version of BOUT++ (i.e. what branch/commit of the main code are you using).

arkabokshi commented 6 years ago

BOUT++ version 4.1.2 Revision: 25ee5aa25a3bb1e17a03e08c98d1caa7ab8f81aa MD5 checksum: 4a2f46d4d882fd7e12f9fed999b11642

I am on branch master.

Yes, BOUT-dev/examples/laplacexy/alfven-wave gives the same error.

ZedThree commented 6 years ago

There's some suggestions on how to track this down here: http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind

They suggest that it's likely due to some memory corruption, and the first thing to try is to pass PETSc -malloc_debug.

ZedThree commented 6 years ago

Fixed in #1050