Re: [Libmesh-users] assertion fails in optimized mode

2016-11-26 Thread Roy Stogner
On Wed, 23 Nov 2016, Michael Povolotskyi wrote: > I found the flag: > it is -DNDEBUG > apparently I need to add use it I compile my application in optimized mode. Possibly, but this seems very doubtful. Turning off assertions doesn't mean your code is correct, it just means that we stop checkin

Re: [Libmesh-users] assertion fails in optimized mode

2016-11-23 Thread Michael Povolotskyi
I found the flag: it is -DNDEBUG apparently I need to add use it I compile my application in optimized mode. You need code in the header files because of the templates, right? On 11/23/2016 4:20 PM, Roy Stogner wrote: > > On Wed, 23 Nov 2016, Michael Povolotskyi wrote: > >> after making compilatio

Re: [Libmesh-users] assertion fails in optimized mode

2016-11-23 Thread Roy Stogner
On Wed, 23 Nov 2016, Michael Povolotskyi wrote: > after making compilation flags identical, it works. Now I will change them > one by one to see which one matters. Good idea. > Does this happen because of the code in header files? Yes. > If yes, is it possible to avoid code in the header fi

Re: [Libmesh-users] assertion fails in optimized mode

2016-11-23 Thread Michael Povolotskyi
Hi Roy, after making compilation flags identical, it works. Now I will change them one by one to see which one matters. Does this happen because of the code in header files? If yes, is it possible to avoid code in the header files? You see, I'd prefer to keep libmesh always built in optimized mo

Re: [Libmesh-users] assertion fails in optimized mode

2016-11-23 Thread Roy Stogner
On Wed, 23 Nov 2016, Michael Povolotskyi wrote: > My application is built with debug flags. Libmesh is built either with debug > flags or without. Ah, hell. Yes, that could be your problem, depending on what you mean by "debug flags". -DDEBUG changes parts of the libMesh API and ABI, and -D_G

Re: [Libmesh-users] assertion fails in optimized mode

2016-11-23 Thread Michael Povolotskyi
Thank you! Yes, Roy, I'm using different flags while building libmesh and my application. My application is built with debug flags. Libmesh is built either with debug flags or without. I will now try different combination and will let you know. Michael. On 11/23/2016 1:21 PM, Roy Stogner wrote: >

Re: [Libmesh-users] assertion fails in optimized mode

2016-11-23 Thread Roy Stogner
On Wed, 23 Nov 2016, Michael Povolotskyi wrote: > The fact that it is not theoretically possible suggests that I need to check > if I do something very nasty with memory. No, no; there's nothing memory-related here (I mean, there might be, but that would be a separate problem). This is a pure

Re: [Libmesh-users] assertion fails in optimized mode

2016-11-23 Thread Michael Povolotskyi
In devel mode it also runs okay. The fact that it is not theoretically possible suggests that I need to check if I do something very nasty with memory. I'll keep searching. On 11/23/2016 12:39 PM, Roy Stogner wrote: > > On Wed, 23 Nov 2016, Michael Povolotskyi wrote: > >> I see a strange situation

Re: [Libmesh-users] assertion fails in optimized mode

2016-11-23 Thread Roy Stogner
On Wed, 23 Nov 2016, Michael Povolotskyi wrote: > I see a strange situation: one assertion fails if libmesh is built in > opt mode, but the code runs fine if libmesh is built in dbg mode. Try devel mode? And this is more than "strange", it's "not theoretically possible". Our assertions are like

Re: [Libmesh-users] assertion fails in optimized mode

2016-11-23 Thread Cody Permann
"Fine" is a stretch here. You are currently getting away with accessing an item in a size zero vector so you are definitely in the land of undefined behavior. If you move to a different machine, it may very well crash. libMesh does bounds checking on many container access methods to look for this t

[Libmesh-users] assertion fails in optimized mode

2016-11-23 Thread Michael Povolotskyi
Dear libmesh users/developers, I see a strange situation: one assertion fails if libmesh is built in opt mode, but the code runs fine if libmesh is built in dbg mode. What I'm doing is as follows: I'm solving a nonlinear system with changing the sparsity pattern by hand using system->get_dof_m