Discrepancy between debug and production versions

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
CTrinca
Posts: 32
Joined: Mon Mar 30, 2015 9:19 am

Discrepancy between debug and production versions

Post by CTrinca »

Hello,

I am experiencing a rather peculiar problem using version 4.0.1: when I run my simulation using my debug install, I get an error I do not have when I use my production version.
The error occurs in iniva0: I tracked it down to the line:

Code: Select all

call field_get_key_int (ivarfl(isca(iscal)), kivisl, ifcvsl)

My only scalar is temperature, so the instruction is executed once with iscal = 1.
When I use my debug installation, ifcvsl comes off with a value out of range, and I suspect it is some rubbish value from uninitialized memory. This causes the calculation to crash when it tries to retrieve the field. Interestingly, when I use the production installation, ifcvsl takes an acceptable value of 21 and the simulation goes on.
Is there any known cause for such a behaviour?
Thanks in advance to anyone answering,

Cosimo
Yvan Fournier
Posts: 4080
Joined: Mon Feb 20, 2012 3:25 pm

Re: Discrepancy between debug and production versions

Post by Yvan Fournier »

Hello,

This is strange, as we usually have less issues with the lower optimization settings of debug builds.

Which compiler are you using ? I also recommend using a more recent bug-fix release, such as version 4.0.7.

Regards,

Yvan
CTrinca
Posts: 32
Joined: Mon Mar 30, 2015 9:19 am

Re: Discrepancy between debug and production versions

Post by CTrinca »

Hello Yvan,

I think I have located the cause of the problem: in usipsu I called field_set_key_int but I had not initialized ifcvs. It is an old bug but it went unnoticed because it did not cause problems with my production installation. Perhaps uninitialized variables are set to 0 by my compiler unless debug flags are used?
I think I will take your advice and move to version 4.0.7, thanks.
Best regards,

Cosimo
Post Reply