espressomd-devel
[Top][All Lists]
Advanced

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

Re: [ESPResSo-devel] Porting Interaction Calculations to CUDA


From: Peter Toson
Subject: Re: [ESPResSo-devel] Porting Interaction Calculations to CUDA
Date: Fri, 27 Apr 2012 18:16:24 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20120327 Thunderbird/11.0.1

Hallo!

Thanks for the quick reply and pointing me to that code - you've saved me a lot
of work.

Now I have a follow-up question: is there an array for all (local) interactions as well?
Or can I get the interaction information only from particles?

-- Peter


Am 24.04.2012 16:38, schrieb Axel Arnold:
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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]