CNS errors before/after recompilation


#1

I recompiled CNS with the files provided in the HADDOCK2.2 distribution

I get the following error message:

cns < run1/protocols/generate_A.inp
%SETFPEPS increase value of MXFPEPS2 and recompile
%SETFPEPS error encountered: Could not determine machine epsilon
(CNS is in mode: SET ABORT=NORMal END)


ABORT mode will terminate program execution.


Program will stop immediately.

But if I adjust this param MXFPEPS2 in machvar.inc I get another error

cns_solve_1.3/intel-x86_64bit-linux/bin/cns < run1/protocols/generate_A.inp
%SETFPEPS Machine epsilon determined to be 0.494-323
%SETFPEPS error encountered: Machine epsilon value is too small
(CNS is in mode: SET ABORT=NORMal END)

What am I doing wrong?

Eiso


#2

Googling this error message you can find a number of possible solutions/causes.
It seems to be related to 32/64 bits and depending on the compiler you are using.

Various solutions have been proposed:

  1. Removing -fast-math as a compiler option

  2. Modify the machvar.f like this (line numbers on the left). The file should in the source folder
    65 ONEP = DPTRUNC(ONE) + DPTRUNC(FPEPS) 66 ONEM = DPTRUNC(ONE) - DPTRUNC(FPEPS) 67 IF (ONE .EQ. ONEP .OR. ONE .EQ. ONEM) THEN 68 I = I - 1
    Let us know what works for you and also which compiler/OS combination your are using


#3

those lines were already in the code.

I’m using Centos-7 + gfortran
%fortran --version
GNU Fortran (GCC) 4.9.2

I’ll try to remove the flag…

E


#4

removing the -ffast-math gets rid of the %SETFPEPS error but
creates a new one.

cns_solve_1.3/intel-x86_64bit-linux/bin/cns < run1/protocols/generate_A.inp

[…snip…]
RTFRDR>! DNA-RNA-ALLATOM.TOP
RTFRDR>
RTFRDR>set message ? end eval ($old_message=$result) set echo ? end eval ($old_echo=$result)
MESSage=NORM
EVALUATE: symbol $OLD_MESSAGE set to “NORM” (string)
ECHO=TRUE {ON}
EVALUATE: symbol $OLD_ECHO set to TRUE (logical)
RTFRDR>set message=off echo=off end
%AUTOAN error encountered: exceeded MXRTP (RTF) parameter --> recompile program
(CNS is in mode: SET ABORT=NORMal END)


ABORT mode will terminate program execution.


Program will stop immediately.

I will try adjusting MXRTP but I’m a bit surprised. The system is not very large
(170aa)

Eiso


#5

Indeed - we run into that too. Probably coming from reading several parameter files in the script


#6

could be due to the ACPYPE topologies, they have more dihedrals than
usual prodrg topologies.

You could distribute the cns source files with adjusted params right?
Or is it unusual that this is a problem?

I set MXRTP to 4000 and now there’s not error.
Do you expect a performance hit from leaving the -ffast-math out?

E

Eiso


#7

indeed - will make a note of this.


#8

Dear Eiso,

if you fixed the problem, could you please let me know more in detail that how you fix same error as follows ?. how to remove the -fast-math as a compiler option ?.
Because i am getting same error. I am trying to compile with gcc and gfortan !
%SETFPEPS Machine epsilon determined to be 0.494-323
%SETFPEPS error encountered: Machine epsilon value is too small
(CNS is in mode: SET ABORT=NORMal END)

Thanking you !

I am using OS X EI Captain
version 10.11.3
Mac Pro (Early 2009)


#9

Dear Dr. Alexandre Bonvin,

could you please let me know that how to issue the command for Removing -fast-math as a compiler option ?. Because i am getting following error. while cns installation.

%SETFPEPS Machine epsilon determined to be 0.494-323
%SETFPEPS error encountered: Machine epsilon value is too small

Thanking you !


#10

this worked for me

I set MXRTP to 4000 and now there’s no error

E

Srinivas Penumutchu wrote:


#11

simply edit the Makefile you are using and remove that option


#12

Dear Eiso,

Where did you edit the MXRTP ?. Could you please let me know file name and location ?

Thanking you !


#13

in rtf.inc in the source directory


#14

Thanks you Dr. Alexandre Bonvin, , finally it is working after i did four modifications ! I hope it will be helpful to someone :slight_smile:

first modification
set MXFPEPS2 value to 8192 in machvar.inc

second modification
removed flag -fastm in make file

third modification
MXRTP to 4000 in rtf.inc in the source directory

fourth modification

add the below line in the machvar.f
WRITE (6,’(I6,E10.3,E10.3)’) I, ONEP, ONEM
just above line 67, which looks like this:
IF (ONE .EQ. ONEP .OR. ONE .EQ. ONEM) THEN


#15

These are two unrelated errors:

What @eiso was dealing with is a problem of the number of parameters and the ‘dynamic’ memory allocation of CNS.

What @srinivas_penumutchu found happens quite often in Mac OSX and for some reason is only solved with the solution you posted, which just adds a print statement… This will add a bunch of unnecessary output to the CNS initialization headers though… Would be great if someone with more FORTRAN skills could take a look at it!


#16

Suggestion for a proper solution to this problem:

Replace the SETFPEPS subroutine as follows

C ==========================================================================
C
SUBROUTINE SETFPEPS
C
IMPLICIT NONE
C I/O
INCLUDE ‘numbers.inc’
INCLUDE ‘machvar.inc’
C
C Determine the machine epsilon i.e. the smallest FPEPS such that both
C 1+FPEPS and 1-FPEPS are different from 1.
C
C local
DOUBLE PRECISION ONEDP
DOUBLE COMPLEX DBCOMP
C
C external
C NONE
C
C begin
C
C ONEDP doesn’t really need to be defined - EPSILON() only needs to know
C the type
ONEDP=(1.00)
FPEPS = EPSILON(ONEDP)
DBCOMP = DCMPLX(ZERO,ZERO)
CALL DECLAR(‘FP_EPSILON’, ‘DP’, ’ ', DBCOMP, FPEPS)
RETURN
END


#17

Thanks Brian - is this generic for any OS? Or OSX-specific?


#18

Hi Alexandre,

This should be a generic solution. I see the issue on LINUX (CentOS 7) with gcc 4.8.5.

Brian


#19

Hi Srinivas sir,
Can you please explain how to remove flag -fastm in the makefile?


#20

After replacing subrotines in machvar.f file
and then recompile cns_solve
shows error:

make[3]: Target '../bin/cns_solve' not remade because of errors.
Makefile:58: recipe for target 'cns_solve' failed
make[2]: *** [cns_solve] Error 2
Makefile:64: recipe for target 'cns_solve' failed
make[1]: *** [cns_solve] Error 2