[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ESPResSo-devel] Porting Interaction Calculations to CUDA
From: |
Axel Arnold |
Subject: |
Re: [ESPResSo-devel] Porting Interaction Calculations to CUDA |
Date: |
Tue, 24 Apr 2012 16:38:04 +0200 |
User-agent: |
KMail/1.13.6 (Linux/2.6.38-14-generic; KDE/4.6.5; x86_64; ; ) |
Hi!
If I didn't missunderstand you, you basically want to do the same as the LB-
GPU code. That code also copies the positions and velocities to the GPU and
gets the forces back. The interesting parts for you are lbgpu_cfile.c,
lb_calc_particle_lattice_ia_gpu and lb_send_forces_gpu. These also handle the
gathering of the parallely distributed particle data.
There are some minor issues with the C++/C interfacing since CUDA is
inherently C++, but that can be solved using "extern "C" {}" constructs. In
any case, you don't need to recompile the whole code, just your GPU code and
of course linking.
Axel
On Tuesday 24 April 2012, Toson Peter wrote:
> Hallo!
>
> I am trying to port the force calculation of some self-implemented
> bonded interactions to CUDA. For a beginning, I would like to write
> isolated tests (for performance and correctness) comparing
> the CPU and GPU calculations.
>
> The tests should look something like this:
>
> ================================================================
> build Particles
> build Interactions
>
> for each Particle P {
> for each Interaction I of P {
> add force cause by I to P
> }
> }
>
> convert Particle and Interaction data to a GPU-friendly format
> do force calculation on GPU
>
> compare results and times
> ================================================================
>
> What would be the best way to do it, without compiling whole ESPResSo
> after any change to the GPU-Implementation?
>
>
> "Only" using the Particle and Interaction structs from ESPResSo? Is
> that even possible considering the many includes in particle_data.h/c?
>
> Implementing fake Particle and Interaction structs containing only the
> members needed for the force calculation?
>
> Some other way I did not think of?
>
>
> --
> Peter Toson
> Industrial Simulation
> St. Poelten University of Applied Sciences
--
JP Dr. Axel Arnold Tel: +49 711 685 67609
ICP, Universität Stuttgart Email: address@hidden
Pfaffenwaldring 27
70569 Stuttgart, Germany