Commit 1a860389 authored by adelmann's avatar adelmann 🎗
Browse files

clean up timing output

parent 869d877e
......@@ -1152,10 +1152,6 @@ FFT<RCTransform,Dim,T>::transformDKSRC(
int streamId,
const bool& constInput)
{
// time the whole mess
static IpplTimings::TimerRef tottimer=IpplTimings::getTimer("RC-total-gpu");
IpplTimings::startTimer(tottimer);
//check the domain of incoming field
const Layout_t& in_layout = f.getLayout();
const Domain_t& in_dom = in_layout.getDomain();
......@@ -1303,7 +1299,6 @@ FFT<RCTransform,Dim,T>::transformDKSRC(
/* end dks part */
// finish timing the whole mess
IpplTimings::stopTimer(tottimer);
}
#endif
......@@ -1566,16 +1561,9 @@ FFT<RCTransform,Dim,T>::transform(
typename FFT<RCTransform,Dim,T>::ComplexField_t& g,
const bool& constInput)
{
// ippl timers
static IpplTimings::TimerRef tr1=IpplTimings::getTimer("RC-RRtranspose");
static IpplTimings::TimerRef tr2=IpplTimings::getTimer("RC-CCtranspose");
static IpplTimings::TimerRef ffttr1=IpplTimings::getTimer("RC-RC1Dfft");
static IpplTimings::TimerRef ffttr2=IpplTimings::getTimer("RC-CC1Dfft");
static IpplTimings::TimerRef tottimer=IpplTimings::getTimer("RC-total");
FFTDBG(Inform tmsg("FFT-RC-forward"));
// time the whole mess
IpplTimings::startTimer(tottimer);
// indicate we're doing another fft
// incipplstat(incffts);
......@@ -1636,10 +1624,7 @@ FFT<RCTransform,Dim,T>::transform(
// transpose AND PERMUTE TO REAL FIELD WITH TRANSFORM DIM FIRST
FFTDBG(tmsg << "doing transpose of real field into temporary ");
FFTDBG(tmsg << "with layout = " << tempR->getLayout() << std::endl);
IpplTimings::startTimer(tr1);
(*tempR)[tempR->getDomain()] = f[in_dom];
IpplTimings::stopTimer(tr1);
}
......@@ -1676,9 +1661,6 @@ FFT<RCTransform,Dim,T>::transform(
FFTDBG(tmsg << "doing real->complex fft of first dimension ..." << std::endl);
IpplTimings::startTimer(ffttr1);
// loop over all the vnodes, working on the lfield in each.
typename RealField_t::const_iterator_if rl_i, rl_end = tempR->end_if();
typename ComplexField_t::const_iterator_if cl_i = temp->begin_if();
......@@ -1718,9 +1700,6 @@ FFT<RCTransform,Dim,T>::transform(
} // loop over all the lfields
IpplTimings::stopTimer(ffttr1);
// compress temporary storage
if (this->compressTemps() && tempR != &f)
*tempR = 0;
......@@ -1755,11 +1734,9 @@ FFT<RCTransform,Dim,T>::transform(
FFTDBG(tmsg << "doing complex->complex transpose into field ");
FFTDBG(tmsg << "with layout = " << tempFields_m[idim]->getLayout());
FFTDBG(tmsg << std::endl);
IpplTimings::startTimer(tr2);
(*tempFields_m[idim])[tempLayouts_m[idim]->getDomain()] =
(*temp)[temp->getLayout().getDomain()];
IpplTimings::stopTimer(tr2);
// compress out previous iterate's storage:
if (this->compressTemps())
......@@ -1776,9 +1753,7 @@ FFT<RCTransform,Dim,T>::transform(
FFTDBG(tmsg << "with layout = " << g.getLayout());
FFTDBG(tmsg << std::endl);
IpplTimings::startTimer(tr2);
g[out_dom] = (*temp)[temp->getLayout().getDomain()];
IpplTimings::stopTimer(tr2);
// compress out previous iterate's storage:
if (this->compressTemps())
......@@ -1789,7 +1764,6 @@ FFT<RCTransform,Dim,T>::transform(
FFTDBG(tmsg << "doing complex->complex fft of other dimension .." << std::endl);
IpplTimings::startTimer(ffttr2);
// loop over all the vnodes, working on the lfield in each.
typename ComplexField_t::const_iterator_if l_i, l_end = temp->end_if();
......@@ -1818,8 +1792,6 @@ FFT<RCTransform,Dim,T>::transform(
} // loop over 1D strips
} // loop over all the LFields
IpplTimings::stopTimer(ffttr2);
} // loop over all transformed dimensions
......@@ -1832,9 +1804,8 @@ FFT<RCTransform,Dim,T>::transform(
FFTDBG(tmsg << "into return ");
FFTDBG(tmsg << "with layout = " << g.getLayout());
FFTDBG(tmsg << std::endl);
IpplTimings::startTimer(tr2);
g[out_dom] = (*temp)[temp->getLayout().getDomain()];
IpplTimings::stopTimer(tr2);
if (this->compressTemps()) *temp = 0;
......@@ -1844,7 +1815,6 @@ FFT<RCTransform,Dim,T>::transform(
if (direction == +1) g = g * this->getNormFact();
// finish timing the whole mess
IpplTimings::stopTimer(tottimer);
}
//#endif
......@@ -1870,9 +1840,6 @@ FFT<RCTransform,Dim,T>::transformDKSCR(
int streamId,
const bool& constInput)
{
// time the whole mess
static IpplTimings::TimerRef tottimer=IpplTimings::getTimer("RC-total-gpu");
IpplTimings::startTimer(tottimer);
const Layout_t& out_layout = g.getLayout();
const Domain_t& out_dom = out_layout.getDomain();
......@@ -2015,7 +1982,6 @@ FFT<RCTransform,Dim,T>::transformDKSCR(
}
// finish timing the whole mess
IpplTimings::stopTimer(tottimer);
}
#endif
......@@ -2258,17 +2224,8 @@ FFT<RCTransform,Dim,T>::transform(
typename FFT<RCTransform,Dim,T>::RealField_t& g,
const bool& constInput)
{
// IPPL timers
static IpplTimings::TimerRef tr1=IpplTimings::getTimer("RC-RRtranspose");
static IpplTimings::TimerRef tr2=IpplTimings::getTimer("RC-CCtranspose");
static IpplTimings::TimerRef ffttr1=IpplTimings::getTimer("RC-RC1Dfft");
static IpplTimings::TimerRef ffttr2=IpplTimings::getTimer("RC-CC1Dfft");
static IpplTimings::TimerRef tottimer=IpplTimings::getTimer("RC-total");
FFTDBG(Inform tmsg("FFT-RC-reverse"));
// time the whole mess
IpplTimings::startTimer(tottimer);
// indicate we're doing another FFT
// INCIPPLSTAT(incFFTs);
......@@ -2316,10 +2273,8 @@ FFT<RCTransform,Dim,T>::transform(
// transpose and permute to Field with transform dim first
FFTDBG(tmsg << "Doing complex->complex transpose into field ");
FFTDBG(tmsg << "with layout = "<<tempFields_m[idim]->getLayout()<<std::endl);
IpplTimings::startTimer(tr2);
(*tempFields_m[idim])[tempLayouts_m[idim]->getDomain()] =
(*temp)[temp->getLayout().getDomain()];
IpplTimings::stopTimer(tr2);
// Compress out previous iterate's storage:
if (this->compressTemps() && temp != &f)
......@@ -2329,7 +2284,6 @@ FFT<RCTransform,Dim,T>::transform(
FFTDBG(tmsg << "Doing complex->complex fft of other dimension .." << std::endl);
IpplTimings::startTimer(ffttr2);
// Loop over all the Vnodes, working on the LField in each.
typename ComplexField_t::const_iterator_if l_i, l_end = temp->end_if();
......@@ -2359,8 +2313,6 @@ FFT<RCTransform,Dim,T>::transform(
} // loop over 1D strips
} // loop over all the LFields
IpplTimings::stopTimer(ffttr2);
} // loop over all transformed dimensions
// handle last CR transform separately
......@@ -2420,10 +2372,8 @@ FFT<RCTransform,Dim,T>::transform(
// transpose and permute to complex Field with transform dim first
FFTDBG(tmsg << "Doing final complex->complex transpose into field ");
FFTDBG(tmsg << "with layout = "<<tempFields_m[0]->getLayout()<<std::endl);
IpplTimings::startTimer(tr2);
(*tempFields_m[0])[tempLayouts_m[0]->getDomain()] =
(*temp)[temp->getLayout().getDomain()];
IpplTimings::stopTimer(tr2);
// compress previous iterates storage
if (this->compressTemps() && temp != &f)
......@@ -2434,8 +2384,6 @@ FFT<RCTransform,Dim,T>::transform(
FFTDBG(tmsg << "Doing complex->real fft of final dimension ..." << std::endl);
IpplTimings::startTimer(ffttr1);
// Loop over all the Vnodes, working on the LField in each.
typename RealField_t::const_iterator_if rl_i, rl_end = tempR->end_if();
typename ComplexField_t::const_iterator_if cl_i = temp->begin_if();
......@@ -2474,9 +2422,6 @@ FFT<RCTransform,Dim,T>::transform(
} // loop over 1D strips
} // loop over all the LFields
IpplTimings::stopTimer(ffttr1);
// compress previous iterates storage
if (this->compressTemps() && temp != &f)
*temp = 0;
......@@ -2488,9 +2433,7 @@ FFT<RCTransform,Dim,T>::transform(
// Now assign into output Field, and compress last temp's storage:
FFTDBG(tmsg << "Doing cleanup real->real transpose into return ");
FFTDBG(tmsg << "with layout = " << g.getLayout() << std::endl);
IpplTimings::startTimer(tr1);
g[out_dom] = (*tempR)[tempR->getLayout().getDomain()];
IpplTimings::stopTimer(tr1);
if (this->compressTemps())
*tempR = 0;
......@@ -2501,7 +2444,6 @@ FFT<RCTransform,Dim,T>::transform(
if (direction == +1) g = g * this->getNormFact();
// finish up timing the whole mess
IpplTimings::stopTimer(tottimer);
}
//#endif
......
......@@ -187,13 +187,10 @@ void PartBunch::computeSelfFields(int binNumber) {
/// Find potential from charge in this bin (no image yet) using Poisson's
/// equation (without coefficient: -1/(eps)).
IpplTimings::startTimer(compPotenTimer_m);
imagePotential = rho_m;
fs_m->solver_m->computePotential(rho_m, hr_scaled);
IpplTimings::stopTimer(compPotenTimer_m);
/// Scale mesh back (to same units as particle locations.)
rho_m *= hr_scaled[0] * hr_scaled[1] * hr_scaled[2];
......@@ -268,9 +265,7 @@ void PartBunch::computeSelfFields(int binNumber) {
/// Find potential from image charge in this bin using Poisson's
/// equation (without coefficient: -1/(eps)).
IpplTimings::startTimer(compPotenTimer_m);
fs_m->solver_m->computePotential(imagePotential, hr_scaled, zshift);
IpplTimings::stopTimer(compPotenTimer_m);
/// Scale mesh back (to same units as particle locations.)
imagePotential *= hr_scaled[0] * hr_scaled[1] * hr_scaled[2];
......@@ -537,12 +532,8 @@ void PartBunch::computeSelfFields() {
#endif
// charge density is in rho_m
IpplTimings::startTimer(compPotenTimer_m);
fs_m->solver_m->computePotential(rho_m, hr_scaled);
IpplTimings::stopTimer(compPotenTimer_m);
//do the multiplication of the grid-cube volume coming
//from the discretization of the convolution integral.
//this is only necessary for the FFT solver
......@@ -722,12 +713,8 @@ void PartBunch::computeSelfFields_cycl(double gamma) {
/// now charge density is in rho_m
/// calculate Possion equation (without coefficient: -1/(eps))
IpplTimings::startTimer(compPotenTimer_m);
fs_m->solver_m->computePotential(rho_m, hr_scaled);
IpplTimings::stopTimer(compPotenTimer_m);
//do the multiplication of the grid-cube volume coming
//from the discretization of the convolution integral.
//this is only necessary for the FFT solver
......@@ -918,12 +905,8 @@ void PartBunch::computeSelfFields_cycl(int bin) {
/// now charge density is in rho_m
/// calculate Possion equation (without coefficient: -1/(eps))
IpplTimings::startTimer(compPotenTimer_m);
fs_m->solver_m->computePotential(rho_m, hr_scaled);
IpplTimings::stopTimer(compPotenTimer_m);
// Do the multiplication of the grid-cube volume coming from the discretization of the convolution integral.
// This is only necessary for the FFT solver. FIXME: later move this scaling into FFTPoissonSolver
if(fs_m->getFieldSolverType() == "FFT" || fs_m->getFieldSolverType() == "FFTBOX")
......
......@@ -140,7 +140,6 @@ PartBunchBase<T, Dim>::PartBunchBase(AbstractParticle<T, Dim>* pb)
boundpTimer_m = IpplTimings::getTimer("Boundingbox");
statParamTimer_m = IpplTimings::getTimer("Compute Statistics");
selfFieldTimer_m = IpplTimings::getTimer("SelfField total");
compPotenTimer_m = IpplTimings::getTimer("SF: Potential");
histoTimer_m = IpplTimings::getTimer("Histogram");
......@@ -229,7 +228,6 @@ PartBunchBase<T, Dim>::PartBunchBase(AbstractParticle<T, Dim>* pb, const PartDat
boundpTimer_m = IpplTimings::getTimer("Boundingbox");
statParamTimer_m = IpplTimings::getTimer("Compute Statistics");
selfFieldTimer_m = IpplTimings::getTimer("SelfField total");
compPotenTimer_m = IpplTimings::getTimer("SF: Potential");
histoTimer_m = IpplTimings::getTimer("Histogram");
......@@ -2435,7 +2433,6 @@ void PartBunchBase<T, Dim>::setup(AbstractParticle<T, Dim>* pb) {
boundpTimer_m = IpplTimings::getTimer("Boundingbox");
statParamTimer_m = IpplTimings::getTimer("Compute Statistics");
selfFieldTimer_m = IpplTimings::getTimer("SelfField total");
compPotenTimer_m = IpplTimings::getTimer("SF: Potential");
histoTimer_m = IpplTimings::getTimer("Histogram");
......@@ -2462,4 +2459,4 @@ void PartBunchBase<T, Dim>::setup(AbstractParticle<T, Dim>* pb) {
setMinimumNumberOfParticlesPerCore(0);
}
#endif
\ No newline at end of file
#endif
......@@ -177,6 +177,7 @@ FFTPoissonSolver::FFTPoissonSolver(Mesh_t *mesh, FieldLayout_t *fl, std::string
GreensFunctionTimer_m = IpplTimings::getTimer("SF: GreensFTotal");
/*
if(greensFunction_m == std::string("INTEGRATED")) {
IntGreensFunctionTimer1_m = IpplTimings::getTimer("SF: IntGreenF1");
IntGreensFunctionTimer2_m = IpplTimings::getTimer("SF: IntGreenF2");
......@@ -192,7 +193,7 @@ FFTPoissonSolver::FFTPoissonSolver(Mesh_t *mesh, FieldLayout_t *fl, std::string
GreensFunctionTimer1_m = IpplTimings::getTimer("SF: GreenF1");
GreensFunctionTimer4_m = IpplTimings::getTimer("SF: GreenF4");
}
*/
ComputePotential_m = IpplTimings::getTimer("ComputePotential");
#ifdef OPAL_DKS
......@@ -567,9 +568,7 @@ void FFTPoissonSolver::greensFunction() {
//hr_m[0]=hr_m[1]=hr_m[2]=1;
Vector_t hrsq(hr_m * hr_m);
IpplTimings::startTimer(GreensFunctionTimer1_m);
SpecializedGreensFunction<3>::calculate(hrsq, rho2_m, grnIField_m);
IpplTimings::stopTimer(GreensFunctionTimer1_m);
// Green's function calculation complete at this point.
// The next step is to FFT it.
// FFT of Green's function
......@@ -585,9 +584,7 @@ void FFTPoissonSolver::greensFunction() {
//IFF: +1 is forward
// 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
IpplTimings::startTimer(GreensFunctionTimer4_m);
fft_m->transform(-1, rho2_m, grntr_m);
IpplTimings::stopTimer(GreensFunctionTimer4_m);
// ofstream fstr2;
// fstr2.precision(9);
......@@ -619,8 +616,6 @@ void FFTPoissonSolver::integratedGreensFunction() {
IpplTimings::startTimer(IntGreensFunctionTimer1_m);
/**
* This integral can be calculated analytically in a closed from:
*/
......@@ -653,9 +648,6 @@ void FFTPoissonSolver::integratedGreensFunction() {
}
}
IpplTimings::stopTimer(IntGreensFunctionTimer1_m);
IpplTimings::startTimer(IntGreensFunctionTimer2_m);
//assign seems to have problems when we need values that are on another CPU, i.e. [I+1]
/*assign(rho2_m[I][J][K] ,
......@@ -679,21 +671,15 @@ void FFTPoissonSolver::integratedGreensFunction() {
rho2_m[I][J][K] -= tmpgreen[I][J+1][K+1];
rho2_m[I][J][K] -= tmpgreen[I][J][K];
IpplTimings::stopTimer(IntGreensFunctionTimer2_m);
mirrorRhoField();
IpplTimings::startTimer(IntGreensFunctionTimer3_m);
fft_m->transform(-1, rho2_m, grntr_m);
IpplTimings::stopTimer(IntGreensFunctionTimer3_m);
}
void FFTPoissonSolver::integratedGreensFunctionDKS() {
#ifdef OPAL_DKS
IpplTimings::startTimer(IntGreensFunctionTimer1_m);
/**
* This integral can be calculated analytically in a closed from:
*/
......@@ -701,10 +687,6 @@ void FFTPoissonSolver::integratedGreensFunctionDKS() {
dksbase.callGreensIntegral(tmpgreen_ptr, idx[0].length(), idx[1].length(), idx[2].length(),
nr_m[0]+1, nr_m[1]+1, hr_m[0], hr_m[1], hr_m[2], streamGreens);
IpplTimings::stopTimer(IntGreensFunctionTimer1_m);
IpplTimings::startTimer(IntGreensFunctionTimer2_m);
Index I = nr_m[0] + 1;
Index J = nr_m[1] + 1;
Index K = nr_m[2] + 1;
......@@ -712,8 +694,6 @@ void FFTPoissonSolver::integratedGreensFunctionDKS() {
dksbase.callGreensIntegration(rho2_m_ptr, tmpgreen_ptr, nr_m[0]+1, nr_m[1]+1, nr_m[2]+1,
streamGreens);
IpplTimings::stopTimer(IntGreensFunctionTimer2_m);
dksbase.callMirrorRhoField(rho2_m_ptr, nr_m[0], nr_m[1], nr_m[2], streamGreens);
#endif
......@@ -726,7 +706,7 @@ void FFTPoissonSolver::shiftedIntGreensFunction(double zshift) {
grn2 = 0.0;
NDIndex<3> idx = layout4_m->getLocalNDIndex();
double cellVolume = hr_m[0] * hr_m[1] * hr_m[2];
IpplTimings::startTimer(ShIntGreensFunctionTimer1_m);
for(int k = idx[2].first(); k <= idx[2].last(); k++) {
for(int j = idx[1].first(); j <= idx[1].last(); j++) {
for(int i = idx[0].first(); i <= idx[0].last(); i++) {
......@@ -749,9 +729,7 @@ void FFTPoissonSolver::shiftedIntGreensFunction(double zshift) {
}
}
}
IpplTimings::stopTimer(ShIntGreensFunctionTimer1_m);
IpplTimings::startTimer(ShIntGreensFunctionTimer2_m);
for(int k = idx[2].first(); k <= idx[2].last(); k++) {
for(int j = idx[1].first(); j <= idx[1].last(); j++) {
for(int i = idx[0].first(); i <= idx[0].last(); i++) {
......@@ -774,8 +752,6 @@ void FFTPoissonSolver::shiftedIntGreensFunction(double zshift) {
}
}
}
IpplTimings::stopTimer(ShIntGreensFunctionTimer2_m);
/**
** (x[0:nr_m[0]-1]^2 + y[0:nr_m[1]-1]^2 + (z_c + z[0:nr_m[2]-1])^2)^{-0.5}
** (x[nr_m[0]:1]^2 + y[0:nr_m[1]-1]^2 + (z_c + z[0:nr_m[2]-1])^2)^{-0.5}
......@@ -788,8 +764,6 @@ void FFTPoissonSolver::shiftedIntGreensFunction(double zshift) {
** (x[nr_m[0]:1]^2 + y[nr_m[1]:1]^2 + (z_c - z[nr_m[2]:1])^2)^{-0.5}
*/
IpplTimings::startTimer(ShIntGreensFunctionTimer3_m);
Index I = nr_m[0] + 1;
Index J = nr_m[1] + 1;
Index K = nr_m[2] + 1;
......@@ -814,19 +788,14 @@ void FFTPoissonSolver::shiftedIntGreensFunction(double zshift) {
tmpgreen[I][J][K] -= grn2[I+1][J][K+1];
tmpgreen[I][J][K] -= grn2[I][J+1][K+1];
tmpgreen[I][J][K] -= grn2[I][J][K];
IpplTimings::stopTimer(ShIntGreensFunctionTimer3_m);
mirrorRhoField(tmpgreen);
IpplTimings::startTimer(ShIntGreensFunctionTimer4_m);
fft_m->transform(-1, rho2_m, grntr_m);
IpplTimings::stopTimer(ShIntGreensFunctionTimer4_m);
}
void FFTPoissonSolver::mirrorRhoField() {
IpplTimings::startTimer(IntGreensMirrorTimer1_m);
Index aI(0, 2 * nr_m[0]);
Index aJ(0, 2 * nr_m[1]);
......@@ -847,12 +816,10 @@ void FFTPoissonSolver::mirrorRhoField() {
rho2_m[aI][JE][K ] = rho2_m[aI ][mirroredJE][K ];
rho2_m[aI][aJ][KE] = rho2_m[aI ][aJ ][mirroredKE];
IpplTimings::stopTimer(IntGreensMirrorTimer1_m);
}
void FFTPoissonSolver::mirrorRhoField(Field_t & ggrn2) {
IpplTimings::startTimer(IntGreensMirrorTimer2_m);
Index aI(0, 2 * nr_m[0]);
Index aK(0, 2 * nr_m[2]);
......@@ -871,7 +838,6 @@ void FFTPoissonSolver::mirrorRhoField(Field_t & ggrn2) {
rho2_m[IE][J ][aK] = rho2_m[mirroredIE][J ][aK ];
rho2_m[aI][JE][aK] = rho2_m[aI ][mirroredJE][aK ];
IpplTimings::stopTimer(IntGreensMirrorTimer2_m);
}
Inform &FFTPoissonSolver::print(Inform &os) const {
......@@ -884,4 +850,4 @@ Inform &FFTPoissonSolver::print(Inform &os) const {
/***************************************************************************
* $RCSfile: FFTPoissonSolver.cc,v $ $Author: adelmann $
* $Revision: 1.6 $ $Date: 2001/08/16 09:36:08 $
***************************************************************************/
\ No newline at end of file
***************************************************************************/
......@@ -168,7 +168,7 @@ private:
bool bcz_m;
IpplTimings::TimerRef GreensFunctionTimer_m;
/*
IpplTimings::TimerRef IntGreensFunctionTimer1_m;
IpplTimings::TimerRef IntGreensFunctionTimer2_m;
IpplTimings::TimerRef IntGreensFunctionTimer3_m;
......@@ -182,7 +182,7 @@ private:
IpplTimings::TimerRef GreensFunctionTimer1_m;
IpplTimings::TimerRef GreensFunctionTimer4_m;
*/
IpplTimings::TimerRef ComputePotential_m;
};
......
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