You are here: GSI Wiki>Personalpages Web>EvaMartenstein>ProgramFlow (revision 13)EditAttach

7. Program flow and starting the program

Willst du ein Geheimnis hören?
Kekse sind toll big grin

7.1 CUDA-Code flow diagram and source code

flow_diagram_with_arrow.png

Constants

   //Bash
   __constant__ double dt_1440[6];                                              // dt/24
   __constant__ double dt_1440_P[6];

   // Coulomb
   __constant__ unsigned int NumTiles;
   __constant__ double k1;                                                      // k1=q^2/(4*pi*e0*m)

   // EField
   __constant__ double wk[15];
   __constant__ double wk_2[15];                                                // wk^2/4
   __constant__ double ak[15];
   __constant__ double bk[15];
   __constant__ double ak_bar[15]; 
   __constant__ double bk_bar[15];
   __constant__ double qmwk[15];                                                // -q/m*wk
   __constant__ double qmwk_2[15];                                              // -q/(2*m)*wk^2

   //Bfield
   __constant__ double wc_z;                                                    // q/M*Bz

   //Current
   __constant__   double   zk1[2];//      =   {-3.420000000000000e-003, -5.300000000000000e-004};
   __constant__   double   zk2[2];//      =   {5.300000000000000e-004, 3.420000000000000e-003};

   __constant__   double   q;
   __constant__   int      numIons;

   __constant__   double   A1_k[2];//      =   { 1.124200857823431e+002, 7.638144882605995e+001 };
   __constant__   double   A2_k[2];//      =   { 2.291995469476302e+007, 4.543296642619807e+006 };
   __constant__   double   A3_k[2];//      =   { 1.145997734738151e+007, 2.271648321309904e+006 };
   __constant__   double   A4_k[2];//      =   { 4.672868905535898e+012, 2.702429019099451e+011 };

   __constant__   double   yk_2[2];//           =       { 4.904899999999999e-006, 1.681190000000000e-005 };

   //RLC
   __constant__   double   Rw0_2;
   __constant__   double   inv_dtC;
   __constant__   double   w0_2;
   __constant__   double   gamma;

To The Top

Bfield - Magnetic Field

__device__ void AccBfield (double *vel, double *f)

(description)

Parameters:

vel - velocity

f - acceleration

Returns:

Note:

To The Top

Coulomb

__device__ void AccCoulomb(double *Pos0, double *pos, double *f, double e_2)

(description - particle interaction)

Parameters:

Pos0 - vector; coordinate of all particles

pos - vector; ortskoordinate vom teilchen auf die man kräfte ausrechnen will

f - acceleration

e_2 - softening

Returns:

Note:

To The Top

Efield - Electric field

__device__ void AccEfield(double *pos, double U, double *f)

(description - particle interaction)

Parameters:

pos - vector; ortskoordinate vom teilchen auf die man kräfte ausrechnen will

U - voltage

f - acceleration

Returns:

Note:

To The Top

Current

__device__ void CurrentTotal(double *Ik, double *I, double *dI)

(description - particle interaction)

Input: Ik(t_j+1), I(t_j)

Output: I(t_j+1), dI(t_j+1)

Ik(t_j+1) = single ion currents

I(t_j+1) = total current

dI(t_j+1) = I(t_j+1) - I(t_j)

Note:

To The Top

IONBash6

__global__ void RunIONBash6 (double *Pos6, double *Vel6, double *Acc6, double *Pos5, double *Vel5, double *Acc5, double *Vel4, double *Acc4, double *Vel3, double *Acc3, double *Vel2, double *Acc2, double *Vel1, double *Acc1, double *Vel0, double *U, double e_2)

(description - particle interaction)

Parameters:

Pos6 - ... (1x3*N-Matrix, out)

Pos5 - ... (1x3*N-Matrix, in)

Acc6 - acceleration (1x3*N-Matrix, out)

Acc0 - Acc5 - acceleration (1x3*N-Matrix, in)

Vel6 - velocity (1x3*N-Matrix, out)

Vel0 - Vel5 - velocity (1x3*N-Matrix, in)

U - voltage (1x1-matrix)

e_2 - softening (in)

Note:

To The Top

IONBash6_P

__global__ void RunIONBash6 (double *Pos6, double *Vel6, double *Acc6, double *Pos5, double *Vel5, double *Acc5, double *Vel4, double *Acc4, double *Vel3, double *Acc3, double *Vel2, double *Acc2, double *Vel1, double *Acc1, double *Vel0, double *U, double e_2)

(description - particle interaction)

Parameters:

Pos6 - ... (1x3*N-Matrix, out)

Pos5 - ... (1x3*N-Matrix, in)

Acc6 - acceleration (1x3-Matrix, out)

Acc0 - Acc5 - acceleration (1x3*N-Matrix, in)

Vel6 - velocity (1x3*N-Matrix, out)

Vel0 - Vel5 - velocity (1x3*N-Matrix, in)

U - voltage (1x1-matrix)

e_2 - softening (in)

Note:

To The Top

RLCBash6

__global__ void RunRLCBash6(double *U6, double *V6, double *g6, double *U5, double *V5, double *g5, double *V4, double *g4, double *V3, double *g3, double *V2, double *g2, double *V1, double *g1, double *V0, double *I, double *dI)

(description - particle interaction)

Parameters: (1x1-Matrix)

U6 - voltage (out)

U0 - U5 - voltage (in)

V6 - ... (out)

V1 - V5 - ... (in)

g6 - ... (out)

g1 - g5 - ... (in)

I - difference current (in)

dI - single current of each particle (in)

Note:

To The Top

RLCBash6_P

__global__ void RunRLCBash6_P(double *U6, double *V6, double *g6, double *U5, double *V5, double *g5, double *V4, double *g4, double *V3, double *g3, double *V2, double *g2, double *V1, double *UP, double *VP, double *IP, double *dIP)

(description - particle interaction)

Parameters:

U6 - voltage (out)

U5 - voltage (in)

UP - (in)

V6 - ... (out)

V1 - V5 - ... (in)

VP - (in)

g6 - ... (out)

g2 - g5 - ... (in)

IP - difference current P (in)

dIP - single current of each particle P (in)

Note:

To The Top

Back Table of Contents Forward


-- EvaMartenstein - 20 Apr 2015
Edit | Attach | Print version |  PDF | History: r16 | r14 < r13 < r12 < r11 | Backlinks | View wiki text | Edit WikiText | More topic actions...
Topic revision: r13 - 2015-05-06, EvaMartenstein
 
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding GSI Wiki? Send feedback
Imprint (in German)
Privacy Policy (in German)