Commit 3549436b by Francois Gygi

Added MPI barriers for more accurate timing.

Added print of grid sizes.


git-svn-id: http://qboxcode.org/svn/qb/trunk@1757 cba15fb0-1239-40c8-b417-11db7ca47a34
parent 48ada5bf
......@@ -13,6 +13,10 @@
//
// testFourierTransform.C
//
// test and timing of the Qbox FourierTransform class
//
// The FourierTransform functionality is tested in the following 8 tests
// relevant to the use of the class in different parts of Qbox
#include <iostream>
#include <iomanip>
......@@ -136,6 +140,7 @@ int main(int argc, char **argv)
// test ft (small grid)
cout << mype << ": ft.np2_loc(): " << ft.np2_loc() << endl;
MPI_Barrier(MPI_COMM_WORLD);
cout << " test ft: ";
ft.forward(&f1[0],&x[0]);
cout << " forward done ";
......@@ -145,6 +150,7 @@ int main(int argc, char **argv)
#if 1
MPI_Barrier(MPI_COMM_WORLD);
tm.reset();
ft2.reset_timers();
tm.start();
......@@ -156,6 +162,8 @@ int main(int argc, char **argv)
ApcStop(1);
#endif
tm.stop();
cout << " fwd1: size: " << ft2.np0() << " "
<< ft2.np1() << " " << ft2.np2() << endl;
cout << " fwd1: vgrid->wf" << endl;
cout << " fwd1: tm_f_fft: " << ft2.tm_f_fft.real() << endl;
cout << " fwd1: tm_f_mpi: " << ft2.tm_f_mpi.real() << endl;
......@@ -172,6 +180,7 @@ int main(int argc, char **argv)
cout << " fwd1 time: " << tm.cpu() << " / " << tm.real()
<< " " << 1.e-6*flops/tm.real() << " MFlops" << endl;
MPI_Barrier(MPI_COMM_WORLD);
tm.reset();
ft2.reset_timers();
tm.start();
......@@ -183,6 +192,8 @@ int main(int argc, char **argv)
ApcStop(2);
#endif
tm.stop();
cout << " bwd1: size: " << ft2.np0() << " "
<< ft2.np1() << " " << ft2.np2() << endl;
cout << " bwd1: wf->vgrid" << endl;
cout << " bwd1: tm_b_fft: " << ft2.tm_b_fft.real() << endl;
cout << " bwd1: tm_b_mpi: " << ft2.tm_b_mpi.real() << endl;
......@@ -199,6 +210,7 @@ int main(int argc, char **argv)
cout << " bwd1 time: " << tm.cpu() << " / " << tm.real()
<< " " << 1.e-6*flops/tm.real() << " MFlops" << endl;
MPI_Barrier(MPI_COMM_WORLD);
tm.reset();
ft2.reset_timers();
tm.start();
......@@ -210,6 +222,8 @@ int main(int argc, char **argv)
ApcStop(3);
#endif
tm.stop();
cout << " fwd2: size: " << ft2.np0() << " "
<< ft2.np1() << " " << ft2.np2() << endl;
cout << " fwd2: vgrid->wf" << endl;
cout << " fwd2: tm_f_fft: " << ft2.tm_f_fft.real() << endl;
cout << " fwd2: tm_f_mpi: " << ft2.tm_f_mpi.real() << endl;
......@@ -229,6 +243,7 @@ int main(int argc, char **argv)
cout << " fwd2 time: " << tm.cpu() << " / " << tm.real()
<< " " << 1.e-6*flops/tm.real() << " MFlops" << endl;
MPI_Barrier(MPI_COMM_WORLD);
tm.reset();
ft2.reset_timers();
tm.start();
......@@ -240,6 +255,8 @@ int main(int argc, char **argv)
ApcStop(4);
#endif
tm.stop();
cout << " bwd2: size: " << ft2.np0() << " "
<< ft2.np1() << " " << ft2.np2() << endl;
cout << " bwd2: wf->vgrid" << endl;
cout << " bwd2: tm_b_fft: " << ft2.tm_b_fft.real() << endl;
cout << " bwd2: tm_b_mpi: " << ft2.tm_b_mpi.real() << endl;
......@@ -260,6 +277,7 @@ int main(int argc, char **argv)
<< " " << 1.e-6*flops/tm.real() << " MFlops" << endl;
// double transform
MPI_Barrier(MPI_COMM_WORLD);
tm.reset();
ft2.reset_timers();
tm.start();
......@@ -271,6 +289,8 @@ int main(int argc, char **argv)
ApcStop(5);
#endif
tm.stop();
cout << " fwd3: size: " << ft2.np0() << " "
<< ft2.np1() << " " << ft2.np2() << endl;
cout << " fwd3: vgrid->wf double transform" << endl;
cout << " fwd3: tm_f_fft: " << ft2.tm_f_fft.real() << endl;
cout << " fwd3: tm_f_mpi: " << ft2.tm_f_mpi.real() << endl;
......@@ -287,6 +307,7 @@ int main(int argc, char **argv)
cout << " fwd3 time: " << tm.cpu() << " / " << tm.real()
<< " " << 1.e-6*flops/tm.real() << " MFlops" << endl;
MPI_Barrier(MPI_COMM_WORLD);
tm.reset();
ft2.reset_timers();
tm.start();
......@@ -298,6 +319,8 @@ int main(int argc, char **argv)
ApcStop(6);
#endif
tm.stop();
cout << " bwd3: size: " << ft2.np0() << " "
<< ft2.np1() << " " << ft2.np2() << endl;
cout << " bwd3: wf->vgrid double transform" << endl;
cout << " bwd3: tm_b_fft: " << ft2.tm_b_fft.real() << endl;
cout << " bwd3: tm_b_mpi: " << ft2.tm_b_mpi.real() << endl;
......@@ -331,6 +354,7 @@ int main(int argc, char **argv)
double vflops = 2*vbasis.nrod_loc() * fft_flops(vft.np2()) +
vft.np1() * vft.np2() * fft_flops(vft.np0()) +
vft.np0() * vft.np2() * fft_flops(vft.np1());
MPI_Barrier(MPI_COMM_WORLD);
tm.reset();
vft.reset_timers();
tm.start();
......@@ -342,6 +366,8 @@ int main(int argc, char **argv)
ApcStop(7);
#endif
tm.stop();
cout << " fwd4: size: " << vft.np0() << " "
<< vft.np1() << " " << vft.np2() << endl;
cout << " fwd4: vgrid->v(g)" << endl;
cout << " fwd4: tm_f_fft: " << vft.tm_f_fft.real() << endl;
cout << " fwd4: tm_f_mpi: " << vft.tm_f_mpi.real() << endl;
......@@ -358,6 +384,7 @@ int main(int argc, char **argv)
cout << " fwd4 time: " << tm.cpu() << " / " << tm.real()
<< " " << 1.e-6*vflops/tm.real() << " MFlops" << endl;
MPI_Barrier(MPI_COMM_WORLD);
tm.reset();
vft.reset_timers();
tm.start();
......@@ -369,6 +396,8 @@ int main(int argc, char **argv)
ApcStop(8);
#endif
tm.stop();
cout << " bwd4: size: " << vft.np0() << " "
<< vft.np1() << " " << vft.np2() << endl;
cout << " bwd4: v(g)->vgrid" << endl;
cout << " bwd4: tm_b_fft: " << vft.tm_b_fft.real() << endl;
cout << " bwd4: tm_b_mpi: " << vft.tm_b_mpi.real() << endl;
......
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