spectralDNS / mpiFFT4py

Parallel FFT in 3D or 2D using MPI for Python. Slab or pencil decomposition possible in 3D. Note this rep is being deprecated in favour of mpi4py-fft (https://bitbucket.org/mpi4py/mpi4py-fft)
GNU Lesser General Public License v3.0
21 stars 10 forks source link

Change integer divisions to python 3 syntax: // #8

Closed tberlok closed 8 years ago

tberlok commented 8 years ago

Great tool! I am using it with python 3 where it works but gives deprecation warnings about integer division. This can be fixed by simply replacing / with //. I have tested that the test suite works with homebrew python 2.7.12 and python 3.5.2.

mikaem commented 8 years ago

Great, thanks! Even cleaned up the whitespaces:-)

tberlok commented 8 years ago

That was fast :) Thanks for making the code public!

mikaem commented 8 years ago

I need better tests!! Took me one hour today to track down line 268 in pencil.py that after merging said:

if dealias == '3//2-rule':

which of course is never true. Fixed now.

tberlok commented 8 years ago

I should have been more careful - sorry about that! Tests can be helpful but it will always be dangerous to put too much trust in them (as I did yesterday). I took another look right now but if problems persist let me know and I'll try to help debugging it.

mikaem commented 8 years ago

No worries, it did show me that the tests need to be improved:-) Actually, some tests in the solver here https://github.com/spectralDNS/spectralDNS broke because of it.

tberlok commented 8 years ago

I'll make sure to run those tests too next time :)