Commit f7d9b4ad authored by Uldis Locans's avatar Uldis Locans
Browse files

replace Options::enableDKS with IpplInfo::DKSEnabled

parent e8a64a2c
......@@ -203,7 +203,7 @@ timeIntegrationTimer2Push_m(IpplTimings::getTimer("TIntegration2Push"))
// itsBeamline = dynamic_cast<Beamline*>(beamline.clone());
#ifdef OPAL_DKS
if (Options::enableDKS) {
if (IpplInfo::DKSEnabled) {
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::enableDKS) {
if (IpplInfo::DKSEnabled) {
//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::enableDKS) {
if (IpplInfo::DKSEnabled) {
//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::enableDKS) {
if (IpplInfo::DKSEnabled) {
#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::enableDKS) {
if (IpplInfo::DKSEnabled) {
#ifdef OPAL_DKS
//if bunch is largen than before reallocate memory
......
......@@ -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::enableDKS) {
if (IpplInfo::DKSEnabled) {
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::enableDKS)
if (IpplInfo::DKSEnabled)
clearCollimatorDKS();
#endif
......@@ -268,7 +268,7 @@ void CollimatorPhysics::apply(PartBunch &bunch, size_t numParticlesInSimulation)
#ifdef OPAL_DKS
if (collshape_m == "DEGRADER" && Options::enableDKS) {
if (collshape_m == "DEGRADER" && IpplInfo::DKSEnabled) {
//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::enableDKS)
if (collshape_m == "DEGRADER" && IpplInfo::DKSEnabled)
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::enableDKS)
if (IpplInfo::DKSEnabled)
clearCollimatorDKS();
#endif
}
......
......@@ -202,7 +202,7 @@ FFTPoissonSolver::FFTPoissonSolver(Mesh_t *mesh, FieldLayout_t *fl, std::string
#ifdef OPAL_DKS
if (Options::enableDKS) {
if (IpplInfo::DKSEnabled) {
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::enableDKS) {
if (IpplInfo::DKSEnabled) {
int dkserr;
dksbase.setAPI("Cuda", 4);
......@@ -409,7 +407,7 @@ FFTPoissonSolver::~FFTPoissonSolver() {
#ifdef OPAL_DKS
//free all the allocated memory
if (Options::enableDKS) {
if (IpplInfo::DKSEnabled) {
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::enableDKS) {
if (!IpplInfo::DKSEnabled) {
// 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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment