ruoxi-wang / BBFMM3D

Other
23 stars 13 forks source link

Does not compile with fftw2 or fftw3 #2

Closed fgfuchs closed 8 years ago

fgfuchs commented 8 years ago

Hi,

I am unable to compile the code, which version of fftw is this supposed to compile with.

Thank you for your answer,

Franz

ruoxi-wang commented 8 years ago

Hi Franz,

The 3D code was implemented using FFTW2, and the interface for FFTW2 and FFTW3 has changed a lot. So currently you would need to use FFTW2 to compile it.

Let me know if that works for you.

Best, Ruoxi

On Fri, Feb 26, 2016 at 12:47 AM, Franz Georg Fuchs < notifications@github.com> wrote:

Hi,

I am unable to compile the code, which version of fftw is this supposed to compile with.

Thank you for your answer,

Franz

— Reply to this email directly or view it on GitHub https://github.com/ruoxi-wang/BBFMM3D/issues/2.

fgfuchs commented 8 years ago

Thank you for the fast answer. I am linking to FFTW2 now.

1) Out of the box it fails to compile with: ./include/H2_3D_Tree.hpp:10:19: fatal error: rfftw.h: No such file or directory

2) I get it to compile by using drfftw instead (you are using double precision, right?): diff --git a/Makefile b/Makefile -LDFLAGS = -llapack -lblas -lrfftw -lfftw -lm +LDFLAGS = -llapack -lblas -ldrfftw -ldfftw -lm

diff --git a/include/H2_3D_Tree.hpp b/include/H2_3D_Tree.hpp -#include "rfftw.h" +#include "drfftw.h"

diff --git a/include/compute.hpp b/include/compute.hpp -#include "rfftw.h" +#include "drfftw.h"

However, running the executable produces NaN: ./binary_file_mykernel Reading pre-compute files ... Direct calculation starts from: 0 to 0. Pre-computation time: 0.007253 FMM computing time: 0.062469 Exact computing time: 0.030866 Relative Error: -nan

I guess that is not what is supposed to happen.

Thanks again, any hints are much appreciated,

Franz

fgfuchs commented 8 years ago

Hi Ruoxi,

I also managed to download and compile fftw2 from source. However, I still get that the relative error is NaN. (So your code without changes...)

Best, Franz

ruoxi-wang commented 8 years ago

Hi Franz,

That should not happen, something must go wrong. But can I get back to you tomorrow (I am in pacific time and have an early meeting tomorrow)? Sorry about this. I hope you are not in a rush to use it.

Best, Ruoxi

On Fri, Feb 26, 2016 at 1:17 AM, Franz Georg Fuchs <notifications@github.com

wrote:

Hi Ruoxi,

I also managed to download and compile fftw2 from source. However, I still get that the relative error is NaN. (So your code without changes...)

Best, Franz

— Reply to this email directly or view it on GitHub https://github.com/ruoxi-wang/BBFMM3D/issues/2#issuecomment-189179998.

fgfuchs commented 8 years ago

No problem at all, thanks for the fast response!

Best, Franz

fgfuchs commented 8 years ago

btw: the standard kernel produces the following output: make binary_file_standard_kernel && cd exec && ./binary_file_standard_kernel && cd .. make: Nothing to be done for 'binary_file_standard_kernel'. Pre-Compute files do not exit. Creating now ...

Direct calculation starts from: 0 to 0. Pre-computation time: 9.78698 FMM computing time: 4.63847 Exact computing time: 17.4209 Relative Error: 3.38474e-05

ruoxi-wang commented 8 years ago

Hi Franz,

It is due to the fact that the direct computation we used to compute the relative error is wrong. And this is because of the memory initialization issue. Therefore in some computers it is correct and in some it gives you Nan.

I have fixed this bug. You can git pull to try it, remember to delete some precomputed binary files in the folder output/. Thank you for pointing this out!

Best, Ruoxi

On Fri, Feb 26, 2016 at 5:06 AM, Franz Georg Fuchs <notifications@github.com

wrote:

btw: the standard kernel produces the following output: make binary_file_standard_kernel && cd exec && ./binary_file_standard_kernel && cd .. make: Nothing to be done for 'binary_file_standard_kernel'. Pre-Compute files do not exit. Creating now ...

Direct calculation starts from: 0 to 0. Pre-computation time: 9.78698 FMM computing time: 4.63847 Exact computing time: 17.4209 Relative Error: 3.38474e-05

— Reply to this email directly or view it on GitHub https://github.com/ruoxi-wang/BBFMM3D/issues/2#issuecomment-189265749.

fgfuchs commented 8 years ago

Hi Ruoxi,

I tried it and it worked flawlessly. Thank you for your lightning fast response!

Best, Franz