Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
OPAL
src
Commits
f7d9b4ad
Commit
f7d9b4ad
authored
Jan 20, 2017
by
Uldis Locans
Browse files
replace Options::enableDKS with IpplInfo::DKSEnabled
parent
e8a64a2c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
16 deletions
+14
-16
src/Algorithms/ParallelTTracker.cpp
src/Algorithms/ParallelTTracker.cpp
+5
-5
src/Classic/Solvers/CollimatorPhysics.cpp
src/Classic/Solvers/CollimatorPhysics.cpp
+5
-5
src/Solvers/FFTPoissonSolver.cpp
src/Solvers/FFTPoissonSolver.cpp
+4
-6
No files found.
src/Algorithms/ParallelTTracker.cpp
View file @
f7d9b4ad
...
...
@@ -203,7 +203,7 @@ timeIntegrationTimer2Push_m(IpplTimings::getTimer("TIntegration2Push"))
// itsBeamline = dynamic_cast<Beamline*>(beamline.clone());
#ifdef OPAL_DKS
if
(
Options
::
e
nable
DKS
)
{
if
(
IpplInfo
::
DKSE
nable
d
)
{
dksbase
.
setAPI
(
"Cuda"
,
4
);
dksbase
.
setDevice
(
"-gpu"
,
4
);
dksbase
.
initDevice
();
...
...
@@ -346,7 +346,7 @@ void ParallelTTracker::executeDefaultTracker() {
surfaceStatus_m
=
false
;
#ifdef OPAL_DKS
if
(
Options
::
e
nable
DKS
)
{
if
(
IpplInfo
::
DKSE
nable
d
)
{
//get number of elements in the bunch
numDeviceElements
=
itsBunch
->
getLocalNum
();
...
...
@@ -466,7 +466,7 @@ void ParallelTTracker::executeDefaultTracker() {
*
gmsg
<<
"done executing ParallelTTracker at "
<<
myt3
.
time
()
<<
endl
;
#ifdef OPAL_DKS
if
(
Options
::
e
nable
DKS
)
{
if
(
IpplInfo
::
DKSE
nable
d
)
{
//free device memory
freeDeviceMemory
();
dksbase
.
freeMemory
<
Vector_t
>
(
orient_ptr
,
itsOpalBeamline_m
.
sections_m
.
size
());
...
...
@@ -1283,7 +1283,7 @@ void ParallelTTracker::timeIntegration1(BorisPusher & pusher) {
IpplTimings
::
startTimer
(
timeIntegrationTimer1Push_m
);
if
(
Options
::
e
nable
DKS
)
{
if
(
IpplInfo
::
DKSE
nable
d
)
{
#ifdef OPAL_DKS
//if bunch is largen than before reallocate memory
if
(
itsBunch
->
getLocalNum
()
>
numDeviceElements
)
{
...
...
@@ -1466,7 +1466,7 @@ void ParallelTTracker::timeIntegration2(BorisPusher & pusher) {
//switchElements();
IpplTimings
::
startTimer
(
timeIntegrationTimer2Push_m
);
if
(
Options
::
e
nable
DKS
)
{
if
(
IpplInfo
::
DKSE
nable
d
)
{
#ifdef OPAL_DKS
//if bunch is largen than before reallocate memory
...
...
src/Classic/Solvers/CollimatorPhysics.cpp
View file @
f7d9b4ad
...
...
@@ -83,7 +83,7 @@ CollimatorPhysics::CollimatorPhysics(const std::string &name, ElementBase *eleme
lossDs_m
=
std
::
unique_ptr
<
LossDataSink
>
(
new
LossDataSink
(
FN_m
,
!
Options
::
asciidump
));
#ifdef OPAL_DKS
if
(
Options
::
e
nable
DKS
)
{
if
(
IpplInfo
::
DKSE
nable
d
)
{
dksbase
.
setAPI
(
"Cuda"
,
4
);
dksbase
.
setDevice
(
"-gpu"
,
4
);
dksbase
.
initDevice
();
...
...
@@ -103,7 +103,7 @@ CollimatorPhysics::~CollimatorPhysics() {
gsl_rng_free
(
rGen_m
);
#ifdef OPAL_DKS
if
(
Options
::
e
nable
DKS
)
if
(
IpplInfo
::
DKSE
nable
d
)
clearCollimatorDKS
();
#endif
...
...
@@ -268,7 +268,7 @@ void CollimatorPhysics::apply(PartBunch &bunch, size_t numParticlesInSimulation)
#ifdef OPAL_DKS
if
(
collshape_m
==
"DEGRADER"
&&
Options
::
e
nable
DKS
)
{
if
(
collshape_m
==
"DEGRADER"
&&
IpplInfo
::
DKSE
nable
d
)
{
//if firs call to apply setup needed accelerator resources
setupCollimatorDKS
(
bunch
,
deg
,
numParticlesInSimulation
);
...
...
@@ -874,7 +874,7 @@ void CollimatorPhysics::print(Inform &msg){
// ToDo: need to move that to a statistics function
#ifdef OPAL_DKS
if
(
collshape_m
==
"DEGRADER"
&&
Options
::
e
nable
DKS
)
if
(
collshape_m
==
"DEGRADER"
&&
IpplInfo
::
DKSE
nable
d
)
locPartsInMat_m
=
numparticles
+
dksParts_m
.
size
();
else
locPartsInMat_m
=
locParts_m
.
size
();
...
...
@@ -925,7 +925,7 @@ bool CollimatorPhysics::stillAlive(PartBunch &bunch) {
if
(
bunchOrigin
[
2
]
>
zBegin
)
{
degraderAlive
=
false
;
#ifdef OPAL_DKS
if
(
Options
::
e
nable
DKS
)
if
(
IpplInfo
::
DKSE
nable
d
)
clearCollimatorDKS
();
#endif
}
...
...
src/Solvers/FFTPoissonSolver.cpp
View file @
f7d9b4ad
...
...
@@ -202,7 +202,7 @@ FFTPoissonSolver::FFTPoissonSolver(Mesh_t *mesh, FieldLayout_t *fl, std::string
#ifdef OPAL_DKS
if
(
Options
::
e
nable
DKS
)
{
if
(
IpplInfo
::
DKSE
nable
d
)
{
int
dkserr
;
dksbase
.
setAPI
(
"Cuda"
,
4
);
...
...
@@ -346,10 +346,8 @@ FFTPoissonSolver::FFTPoissonSolver(PartBunch &beam, std::string greensFunction):
(
2
*
nr_m
[
i
]
-
domain2_m
[
i
]));
}
std
::
cout
<<
"Enable DKS: "
<<
Options
::
enableDKS
<<
std
::
endl
;
#ifdef OPAL_DKS
if
(
Options
::
e
nable
DKS
)
{
if
(
IpplInfo
::
DKSE
nable
d
)
{
int
dkserr
;
dksbase
.
setAPI
(
"Cuda"
,
4
);
...
...
@@ -409,7 +407,7 @@ FFTPoissonSolver::~FFTPoissonSolver() {
#ifdef OPAL_DKS
//free all the allocated memory
if
(
Options
::
e
nable
DKS
)
{
if
(
IpplInfo
::
DKSE
nable
d
)
{
if
(
Ippl
::
myNode
()
==
0
)
{
//get number of elements
int
sizegreen
=
tmpgreen
.
getLayout
().
getDomain
().
size
();
...
...
@@ -499,7 +497,7 @@ void FFTPoissonSolver::computePotential(Field_t &rho, Vector_t hr) {
// needed in greens function
hr_m
=
hr
;
if
(
!
Options
::
e
nable
DKS
)
{
if
(
!
IpplInfo
::
DKSE
nable
d
)
{
// FFT double-sized charge density
// we do a backward transformation so that we dont have to account for the normalization factor
// that is used in the forward transformation of the IPPL FFT
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment