Quick Start Tutorial

Contents:



System Requirements

The program had been validated with the following:

The code is optimized for GPUs with compute capability 1.3, although it should be possible to execute on any GPU.


Compilation

Create a new folder, put the compressed source inside and unpack it:

mkdir myprojectfolder
cd myprojectfolder
cp /<pathToSource>/mdgpu.tar.bz2 .
tar xfj mdgpu.tar.bz2

Now, switch into the source root folder and build the executable:

cd mdgpu
make

Now you should see the executable

ls mdgpu.run

Run Simulations

In principle, you need an input configuration and can pass all parameters at the command line to the executable, see main . Another approch is, to use a wrapper script in which all neccessary parameters are specified.

To generate such a script, just execute the program without any parameters and make the generated script executable:

./mdgpu.run
chmod +x example.sh

The content of example.sh is the following:

#!/bin/bash

# input x-v-data file name
input=N16_T0.5_g2.0_k0.1_init.dat

# output base filename
basename=N16_T0.5_g2.0_k0.1_

# Dimension of the simulation
dim=3

# particle number
N=4096

# maximum number of coupled nearest neighbors
num_nn=6

# temperature
temperature=0.5

# spring constant
k=0.1

# edge length of the simulation box
box=32

# timestep
timestep=0.004

# offset for simulation steps
Noffset=0

# simulate till NSim steps are done
Nsim=10000

# output intervall (CONSTRAINT: must be a multiple of 'Nadjust')
Nout=1000

# NVT velocity scaling and drift removal intervall
Nadjust=100

# number of GPU device to run the job on
gpuDevNo=0

##################

./mdgpu.run $input $basename $dim $N $num_nn $temperature $k $box $timestep $Noffset $Nsim $Nout $Nadjust $gpuDevNo

The initial configuration is given in example/N16_T0.5_g2.0_k0.1_init.dat and its first few lines look like this:

0.0 0.0 0.0 -6.649932e-01 -8.858194e-01 8.121774e-01 1 16 15 240 256 3840
2.0 0.0 0.0 9.269127e-01 -1.844186e+00 1.103101e+00 2 17 0 241 257 3841
4.0 0.0 0.0 8.825894e-01 6.828894e-01 8.500201e-01 3 18 1 242 258 3842
6.0 0.0 0.0 1.918201e+00 -4.599530e-02 -4.693910e-01 4 19 2 243 259 3843
8.0 0.0 0.0 -8.083532e-01 -8.912569e-01 2.317303e-01 5 20 3 244 260 3844
1.0 0.0 0.0 -6.904981e-01 -4.891694e-01 6.587133e-01 6 21 4 245 261 3845

Each row contains the information for one particle beginning with the x-, y-, z-component of the position, followed by the velocity components and the six indices of harmonic coupled particles.

Finally, to start the simulation, you have to copy this file into the root folder and execute the wrapper script:

cp example/N16_T0.5_g2.0_k0.1_init.dat .
./example.sh

How To Proceed

Now you know how to setup a simulation. If you would like to parse new configurations with a different structure than above, please check the implementation of loadInitData and extend the wrapper for that purpose.

In case that you would like to apply different forces, you should have a look at gpu_forces.cuh .

 All Files Functions Defines

Generated on Thu Jun 17 14:22:54 2010 for mdgpu - a molecular dynamic simulation program using GPUs by  doxygen 1.6.1