[Known Bug] Warning for numerical orbital users

General discussion of the Cambridge quantum Monte Carlo code CASINO; how to install and setup; how to use it; what it does; applications.
Post Reply
Ryan_Hunt
Posts: 26
Joined: Thu Mar 10, 2016 10:58 am
Location: Lancaster, UK

[Known Bug] Warning for numerical orbital users

Post by Ryan_Hunt »

Dear fellow CASINO users,

I am writing this post to make anybody who might be using numerical orbitals in their QMC calculations aware of a bug we (myself and Neil Drummond) have found. If you have compiled CASINO on a version of gfortran >= 4.9, and are using numerical orbitals in DMC, there is a high chance that you have suffered an issue (in our test case, the DMC energy of Neon with a numerical basis, as found in CASINO/examples/atom/neon_n, was found to lie 4 a. u. lower than the current best estimate in a non-bugged version - which is consistent with earlier values reported in the literature). This is a problem that arises from a known point in the source code and it will be fixed in the near future.

A temporary workaround to this problem, which does not require installation of a new (or in this case old) gfortran version, is to make the following subsitution in the file "CASINO/arch/data/f90/gnu.arch" : the "-Ofast" flag should be replaced by -> "-O3 -ffast-math -fstack-arrays".

I.e. the line

Code: Select all

FFLAGS_opt   = -Ofast -fpeel-loops -fcray-pointer
should be replaced with the line

Code: Select all

FFLAGS_opt   = -O3 -ffast-math -fstack-arrays -fpeel-loops -fcray-pointer
A newly compiled version of CASINO with this change made should not suffer this bug. Hope nobody has been stung by this, and good luck in your work!

Regards,
Ryan.
Mike Towler
Posts: 239
Joined: Thu May 30, 2013 11:03 pm
Location: Florence
Contact:

Re: [Known Bug] Warning for numerical orbital users

Post by Mike Towler »

Ryan has now modified the standard gfortran compiler flags in the current beta CASINO distribution so that the problem no longer occurs for that compiler.

The problem lies in the -fno-protect-parens option which is implied by the -Ofast flag; this allows the compiler to disrespect mathematical parantheses under certain circumstances in an attempt to make the code go faster - but that can clearly lead to numerical problems and hence the wrong answer, crashing etc.. Very dangerous!

I fixed a similar problem with the Intel compiler a few years ago (patch 2.13.216); if anyone is aware of related issues with other compilers let me know.

Cheers,
Mike
Post Reply