[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ccp4bb]: Error running FFT in alpha



***  For details on how to be removed from this list visit the  ***
***    CCP4 home page http://www.dl.ac.uk/CCP/CCP4/main.html    ***

>>>>> "CCB" == C C Ballard <C.C.Ballard@dl.ac.uk> writes:

 CCB> first off, what Alpha machine are you using.  Previously we have
 CCB> had reports of problems using fft on the XP1000, divide by zero
 CCB> in that case.

Both the compiler version and the exact architecture it's targeting
could be relevant.

 CCB> That seemed to have been caused by various arrays being
 CCB> overwritten, although the problem was not fully tracked down.

Unless they have been redone recently, the CCP4 fftlib routines
disobey the Fortran aliasing and argument-passing rules and have
always been liable to fail with aggressive optimizers for certain
sorts of processor.

Also I expect that their structure -- apparently optimized for old
non-optimizing compilers -- is rather pessimized for current systems.
I remember LTE disagrees, and I don't recall the details of how they
work.

 CCB> Several solutions were found though.

 CCB> 1.  use FFTBIG.  This worked.  It uses dynamic memory
 CCB> allocation.

It also doesn't have the aliasing problem.

 CCB> 3.  turning off optimization seemed to also cure the problem.  Could be
 CCB>     that it arose due code reordering.  Warning: this leads to a large
 CCB>     performance hit.

The DEC Fortran flag specific to the optimization I'm thinking of is
`-assume dummy_aliases'; there are similar ones in other compilers.
It should show whether that's the problem, at least, and would
minimize the speed hit if it is.

Footnotes: 

1. I asked a DEC engineer specifically about DEC Fortran with the sort
   of invalid thing that fftlib does, but it's clear what any compiler
   could do with it.

2. `FFTW' <URL:http://www.fftw.org/> seems to be state-of-the art in
   basic FFT (without the crystallographic symmetry tricks).  It's
   also generally interesting, but is GPLed and so couldn't be used in
   CCP4 without an exception from the authors.

-- 
If you lie to the compiler it will get its revenge.  -- Henry Spencer