Compiling LAMMPS with the user-cuda package

Hello!

I would like to compile LAMMPS with the user-cuda package. It's
possible to build the liblammpscuda.a library with options below:
[email protected]... ~/lammps-9Dec11/lib/cuda $ make precision=1 arch=21 cufft=1

However, making the lammps executable fails:
[email protected]... ~/lammps-9Dec11/src $ make michelin
make[1]: Entering directory `/home/ta/lammps-9Dec11/src/Obj_michelin'
mpiCC -O2 -DLAMMPS_GZIP -I../../lib/cuda -DLMP_USER_CUDA
-I../../lib/poems -DFFT_SINGLE -I/opt/cuda/include -DUNIX
-DFFT_CUFFT -DCUDA_PRECISION=1 -DCUDA_ARCH=20 -c fft3d_cuda.cpp
fft3d_cuda.cpp: In function 'void fft_3d_cuda(FFT_DATA*, FFT_DATA*,
int, fft_plan_3d*)':
fft3d_cuda.cpp:110:99: error: cannot convert 'double*' to
'FFT_SCALAR*' for argument '1' to 'void remap_3d(FFT_SCALAR*,
FFT_SCALAR*, FFT_SCALAR*, remap_plan_3d*)'
make[1]: *** [fft3d_cuda.o] Error 1
make[1]: Leaving directory `/home/ta/lammps-9Dec11/src/Obj_michelin'
make: *** [michelin] Error 2

Could anyone give a hint what's wrong here, because I cannot see it?

Thomas

Hi Thomas

probably something was changed with the fft3d base class in lammps, and that screwed up the derived stuff in the USER-CUDA package.
I am going to look into it (the last version I build was probably 3rd of december or so) and let you (and Steve) know how to fix it.

Cheers
Christian

-------- Original-Nachricht --------

Hello!

I would like to compile LAMMPS with the user-cuda package. It's
possible to build the liblammpscuda.a library with options below:
[email protected]... ~/lammps-9Dec11/lib/cuda $ make precision=1 arch=21 cufft=1

However, making the lammps executable fails:
[email protected]... ~/lammps-9Dec11/src $ make michelin
make[1]: Entering directory `/home/ta/lammps-9Dec11/src/Obj_michelin'
mpiCC -O2 -DLAMMPS_GZIP -I../../lib/cuda -DLMP_USER_CUDA
-I../../lib/poems -DFFT_SINGLE -I/opt/cuda/include -DUNIX
-DFFT_CUFFT -DCUDA_PRECISION=1 -DCUDA_ARCH=20 -c fft3d_cuda.cpp
fft3d_cuda.cpp: In function 'void fft_3d_cuda(FFT_DATA*, FFT_DATA*,
int, fft_plan_3d*)':
fft3d_cuda.cpp:110:99: error: cannot convert 'double*' to
'FFT_SCALAR*' for argument '1' to 'void remap_3d(FFT_SCALAR*,
FFT_SCALAR*, FFT_SCALAR*, remap_plan_3d*)'
make[1]: *** [fft3d_cuda.o] Error 1
make[1]: Leaving directory `/home/ta/lammps-9Dec11/src/Obj_michelin'
make: *** [michelin] Error 2

Could anyone give a hint what's wrong here, because I cannot see it?

pppm/cuda does not (yet) support single precision FFTs.

remove -DFFT_SINGLE and you should be good.

axel.

Just checked out the latest version (git pull), deleted all packages (make no-all), installed Molecule, manybody,kspace,class2 and user-cuda (in that order) and build the executable. For me it worked.

So there must be something different going on.

Ah I just saw you got -DFFT_SINGLE defined. That could be a problem. I think that option did not exist then I wrote the fft3d_cuda stuff. Could you try building with -DFFT_NONE instead or using fftw (-DFFT_FFTW)?

Cheers
Christian

-------- Original-Nachricht --------

Hi

just guessed the same (see email before). Actually the USER-CUDA package supports single and double precision since the beginning. But its defined within the USER-CUDA package. So if you build with one of the pre-defined settings (precision=1, precision=4 or precision=2) its using single/single/double precision respectively. Actually internally you can define it seperate with giving -DFFT_PRECISION=2 or =1 for double and single precision, the same as you could define -DX_PRECISION, -DV_PRECISION, -DF_PRECISION, -DENERGY_PRECISION and -DPPPM_PRECISION. precision=x is just a shortform for certaion combinations (see lib/cuda/Makefile.common).
Btw. CUDA_PRECISION is the default setting for all calculations, and the sub settings override the respective sub settings.

But I probably should intercept that FFT_SINGLE setting somewhere. Gonna think about how to do that.

Cheers
Christian

-------- Original-Nachricht --------

Hello!

\> Ah I just saw you got -DFFT_SINGLE defined. That could be a
problem. I think that option did not exist then I wrote the fft3d_cuda
stuff. Could you try building with -DFFT_NONE instead or using fftw
(-DFFT_FFTW)?

Yes, that solves the problem.

Thanks,
Thomas