Skip to content

Commit 132a61b

Browse files
change compile time combination tests
- move Directional Splitting test from laser wakefield to KHI - add `CELL_WIDTH` precompiler switch in `gridConfig.param`
1 parent 6580212 commit 132a61b

File tree

4 files changed

+58
-33
lines changed

4 files changed

+58
-33
lines changed

examples/KelvinHelmholtz/cmakeFlags

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ flags[3]="-DCUDA_ARCH=sm_35 -DPARAM_OVERWRITES:LIST=-DPARAM_CURRENTSOLVER=ZigZag
3636
flags[4]="-DCUDA_ARCH=sm_35 -DPARAM_OVERWRITES:LIST=-DPARAM_CURRENTSOLVER=ZigZag<UsedParticleShape>;-DPARAM_PARTICLESHAPE=PCS"
3737
flags[5]="-DCUDA_ARCH=sm_35 -DPARAM_OVERWRITES:LIST=-DPARAM_CURRENTSOLVER=ZigZag<UsedParticleShape>;-DPARAM_PARTICLESHAPE=TSC"
3838
flags[6]="-DCUDA_ARCH=sm_35 -DPARAM_OVERWRITES:LIST=-DPARAM_CURRENTSOLVER=ZigZag<UsedParticleShape>;-DPARAM_PARTICLESHAPE=TSC;-DPARAM_DIMENSION=DIM2"
39+
flags[7]="-DCUDA_ARCH=sm_20 -DPARAM_OVERWRITES:LIST=-DPARAM_FIELDSOLVER=fieldSolverDirSplitting"
3940

4041

4142
################################################################################

examples/KelvinHelmholtz/include/simulation_defines/param/componentsConfig.param

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,13 @@ namespace picongpu
5050
* - fieldSolverYeeNative : generic version of fieldSolverYee
5151
* (need more shared memory per GPU and is slow)
5252
*/
53-
namespace fieldSolver = fieldSolverYee;
53+
#ifndef PARAM_FIELDSOLVER
54+
/* WARNING: if you change field solver by hand please update your CELL_WIDTH_SI
55+
* in `gridConfig.param` to fulfill the convergence condition (CFL)
56+
*/
57+
#define PARAM_FIELDSOLVER fieldSolverYee
58+
#endif
59+
namespace fieldSolver = PARAM_FIELDSOLVER;
5460

5561
/*enable (1) or disable (0) current calculation*/
5662
#define ENABLE_CURRENT 1

examples/KelvinHelmholtz/include/simulation_defines/param/gridConfig.param

Lines changed: 41 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
/**
22
* Copyright 2013-2015 Axel Huebl, Rene Widera, Richard Pausch
33
*
4-
* This file is part of PIConGPU.
5-
*
6-
* PIConGPU is free software: you can redistribute it and/or modify
7-
* it under the terms of the GNU General Public License as published by
8-
* the Free Software Foundation, either version 3 of the License, or
9-
* (at your option) any later version.
10-
*
11-
* PIConGPU is distributed in the hope that it will be useful,
12-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14-
* GNU General Public License for more details.
15-
*
16-
* You should have received a copy of the GNU General Public License
17-
* along with PIConGPU.
18-
* If not, see <http://www.gnu.org/licenses/>.
19-
*/
20-
4+
* This file is part of PIConGPU.
5+
*
6+
* PIConGPU is free software: you can redistribute it and/or modify
7+
* it under the terms of the GNU General Public License as published by
8+
* the Free Software Foundation, either version 3 of the License, or
9+
* (at your option) any later version.
10+
*
11+
* PIConGPU is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
* GNU General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU General Public License
17+
* along with PIConGPU.
18+
* If not, see <http://www.gnu.org/licenses/>.
19+
*/
20+
2121

2222

2323
#pragma once
@@ -32,7 +32,27 @@ namespace picongpu
3232
const double DELTA_T_SI = 1.79e-16;
3333
/** equals X
3434
* unit: meter */
35+
#define fieldSolverDirSplitting 1
36+
#if (PARAM_FIELDSOLVER == 1)
37+
/* THIS CODE PATH IS ONLY USED IF `PARAM_FIELDSOLVER` IS CHANGED IN
38+
* `cmakeFlags` and the field solver there is set to fieldSolverDirSplitting
39+
*
40+
* Directional Splitting requires a fixed ratio between dt and dx
41+
* and in addition cubic cells.
42+
* conditions: dX == dt * c
43+
* dX == dY
44+
* dX == dZ
45+
*/
46+
const double CELL_WIDTH_SI = DELTA_T_SI*SPEED_OF_LIGHT_SI;
47+
#else
48+
/* cell size for Yee solver (must fulfill CFL)
49+
* WARNING: if you change the field solver in `componentsConfig` you
50+
* have to change the CELL_SIZE in this code path
51+
*/
3552
const double CELL_WIDTH_SI = 9.34635e-8;
53+
#endif
54+
#undef fieldSolverDirSplitting
55+
3656
/** equals Y - the propagation direction
3757
* unit: meter */
3858
const double CELL_HEIGHT_SI = CELL_WIDTH_SI;
@@ -47,22 +67,22 @@ namespace picongpu
4767
{32, 32}, /*y direction [negative,positive]*/
4868
{32, 32} /*z direction [negative,positive]*/
4969
}; //unit: number of cells
50-
70+
5171
//! Define the strange of the absober for any direction
5272
const float_X ABSORBER_STRENGTH[3][2] = {
5373
{1.0e-3, 1.0e-3}, /*x direction [negative,positive]*/
5474
{1.0e-3, 1.0e-3}, /*y direction [negative,positive]*/
5575
{1.0e-3, 1.0e-3} /*z direction [negative,positive]*/
56-
}; //unit: none
76+
}; //unit: none
5777

5878
const uint32_t ABSORBER_FADE_IN_STEPS = 16;
59-
79+
6080
/** When to move the co-moving window.
6181
* An initial pseudo particle, flying with the speed of light,
6282
* is fired at the begin of the simulation.
6383
* When it reaches slide_point % of the absolute(*) simulation area,
6484
* the co-moving window starts to move with the speed of light.
65-
*
85+
*
6686
* (*) Note: beware, that there is one "hidden" row of gpus at the y-front,
6787
* when you use the co-moving window
6888
* 0.75 means only 75% of simulation area is used for real simulation

examples/LaserWakefield/cmakeFlags

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,15 @@
3131

3232
flags[0]="-DCUDA_ARCH=sm_20"
3333
flags[1]="-DCUDA_ARCH=sm_20 -DPARAM_OVERWRITES:LIST=-DPARAM_FIELDSOLVER=fieldSolverLehe;-DPARAM_PARTICLEPUSHER=Vay"
34-
flags[2]="-DCUDA_ARCH=sm_20 -DPARAM_OVERWRITES:LIST=-DPARAM_FIELDSOLVER=fieldSolverDirSplitting"
35-
flags[3]="-DCUDA_ARCH=sm_20 -DPARAM_OVERWRITES:LIST=-DPARAM_CURRENTSOLVER=Esirkepov;-DPARAM_PARTICLESHAPE=CIC"
36-
flags[4]="-DCUDA_ARCH=sm_20 -DPARAM_OVERWRITES:LIST=-DPARAM_CURRENTSOLVER=VillaBune;-DPARAM_PARTICLESHAPE=CIC"
37-
flags[5]="-DCUDA_ARCH=sm_20 -DPARAM_OVERWRITES:LIST=-DPARAM_PRECISION=precision64Bit"
38-
flags[6]="-DCUDA_ARCH=sm_20 -DPARAM_OVERWRITES:LIST=-DPARAM_FIELDSOLVER=fieldSolverDirSplitting;-DPARAM_PRECISION=precision64Bit"
39-
flags[7]="-DCUDA_ARCH=sm_35 -DPARAM_OVERWRITES:LIST=-DENABLE_CURRENT=0"
40-
flags[8]="-DCUDA_ARCH=sm_20 -DPARAM_OVERWRITES:LIST=-DPARAM_DIMENSION=DIM2"
41-
flags[9]="-DCUDA_ARCH=sm_20 -DPARAM_OVERWRITES:LIST=-DPARAM_CURRENTSOLVER=Esirkepov;-DPARAM_PARTICLESHAPE=CIC;-DPARAM_DIMENSION=DIM2"
42-
flags[10]="-DCUDA_ARCH=sm_20 -DPARAM_OVERWRITES:LIST=-DPARAM_PRECISION=precision64Bit;-DPARAM_DIMENSION=DIM2"
43-
flags[11]="-DCUDA_ARCH=sm_35 -DPARAM_OVERWRITES:LIST=-DENABLE_CURRENT=0;-DPARAM_DIMENSION=DIM2"
44-
flags[12]="-DCUDA_ARCH=sm_35 -DPARAM_OVERWRITES:LIST=-DPARAM_IONS=1;-DPARAM_IONIZATION=1"
34+
flags[2]="-DCUDA_ARCH=sm_20 -DPARAM_OVERWRITES:LIST=-DPARAM_CURRENTSOLVER=Esirkepov;-DPARAM_PARTICLESHAPE=CIC"
35+
flags[3]="-DCUDA_ARCH=sm_20 -DPARAM_OVERWRITES:LIST=-DPARAM_CURRENTSOLVER=VillaBune;-DPARAM_PARTICLESHAPE=CIC"
36+
flags[4]="-DCUDA_ARCH=sm_20 -DPARAM_OVERWRITES:LIST=-DPARAM_PRECISION=precision64Bit"
37+
flags[5]="-DCUDA_ARCH=sm_35 -DPARAM_OVERWRITES:LIST=-DENABLE_CURRENT=0"
38+
flags[6]="-DCUDA_ARCH=sm_20 -DPARAM_OVERWRITES:LIST=-DPARAM_DIMENSION=DIM2"
39+
flags[7]="-DCUDA_ARCH=sm_20 -DPARAM_OVERWRITES:LIST=-DPARAM_CURRENTSOLVER=Esirkepov;-DPARAM_PARTICLESHAPE=CIC;-DPARAM_DIMENSION=DIM2"
40+
flags[8]="-DCUDA_ARCH=sm_20 -DPARAM_OVERWRITES:LIST=-DPARAM_PRECISION=precision64Bit;-DPARAM_DIMENSION=DIM2"
41+
flags[9]="-DCUDA_ARCH=sm_35 -DPARAM_OVERWRITES:LIST=-DENABLE_CURRENT=0;-DPARAM_DIMENSION=DIM2"
42+
flags[10]="-DCUDA_ARCH=sm_35 -DPARAM_OVERWRITES:LIST=-DPARAM_IONS=1;-DPARAM_IONIZATION=1"
4543
################################################################################
4644
# execution
4745

0 commit comments

Comments
 (0)