Commit e0bef7d4 authored by Sergey Yakovlev's avatar Sergey Yakovlev

Added total solve time and postprocessing time to the timing scripts

parent 255417b5
......@@ -58,7 +58,7 @@ int main(int argc, char *argv[])
if (vComm->GetRank() == 0)
{
cout << "Solving 2D Helmholtz:" << endl;
cout << "Solving 3D Helmholtz:" << endl;
cout << " Lambda : " << factors[StdRegions::eFactorLambda] << endl;
cout << " No. modes : " << num_modes << endl;
cout << " No. points : " << num_points << endl;
......
......@@ -3,7 +3,7 @@
<CONDITIONS>
<PARAMETERS>
<P> w = 3 </P>
<P> w = 5 </P>
<P> Lambda = 1 </P>
</PARAMETERS>
......
......@@ -11,7 +11,7 @@ MinTimeFile="./MinTimeCG3D.dat"
MaxNumModesp1=10;
echo "% Solver optlevel Type nElements nModes Time nCalls Time/Call L2Error ppL2Error L2Error(hi-res) LinfError ppLinfErr LinfErr(hi-res) nLocCoef nGlobCoef nLocBCoef nGlobBCoef nLocDCoef nGlobDCoef GlobRank GlobBndwth nnz" > $TimingResultsFile
echo "% Solver optlevel Type nElements nModes Time nCalls Time/Call L2Error ppL2Error L2Error(hi-res) LinfError ppLinfErr LinfErr(hi-res) nLocCoef nGlobCoef nLocBCoef nGlobBCoef nLocDCoef nGlobDCoef GlobRank GlobBndwth nnz FullSolveTime ppTime" > $TimingResultsFile
# Loop over the mesh-size
for MeshSize in 1 2 3 4 5 6 7 8 9 10
......@@ -37,7 +37,7 @@ do
TimingCGHelmSolve3D $Type $MeshSize $NumModes $OptimisationLevel $LinSysSolver
echo Nektar++ TimingCGHelmSolve3D $Type $MeshSize $NumModes $OptimisationLevel $LinSysSolver
read LinSysSolverOut optLevelOut TypeOut NumElementsOut NumModesOut ElapsedTimeOut NumCallsOut TimepCallOut L2Out ppL2Out L2OutBis LinfOut ppLinfOut LinfOutBis nLocCoefOut nGlobCoefOut nLocBCoefOut nGlobBCoefOut nLocDCoefOut nGlobDCoefOut GlobRankOut GlobBndwthOut nnzOut< $ExecutableDumpFile
read LinSysSolverOut optLevelOut TypeOut NumElementsOut NumModesOut ElapsedTimeOut NumCallsOut TimepCallOut L2Out ppL2Out L2OutBis LinfOut ppLinfOut LinfOutBis nLocCoefOut nGlobCoefOut nLocBCoefOut nGlobBCoefOut nLocDCoefOut nGlobDCoefOut GlobRankOut GlobBndwthOut nnzOut FullSolveTimeOut ppTimeOut< $ExecutableDumpFile
if [ $ElapsedTimeOut -lt $MinTime ];
then
MinTime=$ElapsedTimeOut
......
......@@ -11,7 +11,7 @@ MinTimeFile="./MinTimeHDG3D.dat"
MaxNumModesp1=10;
echo "% Solver optlevel Type nElements nModes Time nCalls Time/Call L2Error ppL2Error L2Error(hi-res) LinfError ppLinfErr LinfErr(hi-res) nLocCoef nGlobCoef nLocBCoef nGlobBCoef nLocDCoef nGlobDCoef GlobRank GlobBndwth nnz" > $TimingResultsFile
echo "% Solver optlevel Type nElements nModes Time nCalls Time/Call L2Error ppL2Error L2Error(hi-res) LinfError ppLinfErr LinfErr(hi-res) nLocCoef nGlobCoef nLocBCoef nGlobBCoef nLocDCoef nGlobDCoef GlobRank GlobBndwth nnz FullSolveTime ppTime" > $TimingResultsFile
# Loop over the mesh-size
for MeshSize in 1 2 3 4 5 6 7 8 9 10
......@@ -37,7 +37,7 @@ do
TimingHDGHelmSolve3D $Type $MeshSize $NumModes $OptimisationLevel $LinSysSolver
echo Nektar++ TimingHDGHelmSolve3D $Type $MeshSize $NumModes $OptimisationLevel $LinSysSolver
read LinSysSolverOut optLevelOut TypeOut NumElementsOut NumModesOut ElapsedTimeOut NumCallsOut TimepCallOut L2Out ppL2Out L2OutBis LinfOut ppLinfOut LinfOutBis nLocCoefOut nGlobCoefOut nLocBCoefOut nGlobBCoefOut nLocDCoefOut nGlobDCoefOut GlobRankOut GlobBndwthOut nnzOut< $ExecutableDumpFile
read LinSysSolverOut optLevelOut TypeOut NumElementsOut NumModesOut ElapsedTimeOut NumCallsOut TimepCallOut L2Out ppL2Out L2OutBis LinfOut ppLinfOut LinfOutBis nLocCoefOut nGlobCoefOut nLocBCoefOut nGlobBCoefOut nLocDCoefOut nGlobDCoefOut GlobRankOut GlobBndwthOut nnzOut FullSolveTimeOut ppTimeOut< $ExecutableDumpFile
if [ $ElapsedTimeOut -lt $MinTime ];
then
MinTime=$ElapsedTimeOut
......
......@@ -24,6 +24,10 @@ int main(int argc, char *argv[])
Array<OneD,NekDouble> xc0,xc1,xc2;
NekDouble lambda;
vector<string> vFilenames;
//defining timing variables
timeval timer1, timer2;
NekDouble time1, time2;
NekDouble exeTime, fullTime, ppTime = 0.0;
if(argc < 6)//< is added to be able to submit "verbose" option
{
......@@ -197,6 +201,10 @@ int main(int argc, char *argv[])
ASSERTL0(false,"Unrecognised system solver");
}
}
//timing the whole solve including mesh loading
gettimeofday(&timer1, NULL);
//----------------------------------------------
// Read in mesh from input file
SpatialDomains::MeshGraphSharedPtr graph3D = MemoryManager<SpatialDomains::MeshGraph3D>::AllocateSharedPtr(vSession);
......@@ -264,6 +272,11 @@ int main(int argc, char *argv[])
Exp->BwdTrans(Exp->GetCoeffs(), Exp->UpdatePhys(),
MultiRegions::eGlobal);
//----------------------------------------------
//end of full solve timing
gettimeofday(&timer2, NULL);
time1 = timer1.tv_sec*1000000.0+(timer1.tv_usec);
time2 = timer2.tv_sec*1000000.0+(timer2.tv_usec);
fullTime = (time2-time1);
//----------------------------------------------
// See if there is an exact solution, if so
......@@ -342,10 +355,6 @@ int main(int argc, char *argv[])
//----------------------------------------------
//----------------------------------------------
// Do the timings
timeval timer1, timer2;
NekDouble time1, time2;
NekDouble exeTime;
// We first do a single run in order to estimate the number of calls
// we are going to make
......@@ -431,6 +440,9 @@ int main(int argc, char *argv[])
outfile << setw(10) << nGlobBndRank << " ";
outfile << setw(10) << nGlobBandwidth << " ";
outfile << setw(10) << nnz << " ";
outfile.precision(0);
outfile << setw(10) << fixed << noshowpoint << fullTime << " ";
outfile << setw(10) << fixed << noshowpoint << ppTime << " ";
outfile << endl;
outfile.close();
......
......@@ -24,6 +24,10 @@ int main(int argc, char *argv[])
Array<OneD,NekDouble> xc0,xc1,xc2;
NekDouble lambda;
vector<string> vFilenames;
//defining timing variables
timeval timer1, timer2;
NekDouble time1, time2;
NekDouble exeTime, fullTime, ppTime;
if(argc < 6)//< is used to be able to submit "verbose" option
{
......@@ -199,6 +203,10 @@ int main(int argc, char *argv[])
ASSERTL0(false,"Unrecognised system solver");
}
}
//timing the whole solve including mesh loading
gettimeofday(&timer1, NULL);
//----------------------------------------------
// Read in mesh from input file
SpatialDomains::MeshGraphSharedPtr graph3D = MemoryManager<SpatialDomains::MeshGraph3D>::AllocateSharedPtr(vSession);
......@@ -265,6 +273,11 @@ int main(int argc, char *argv[])
// Backward Transform Solution to get solved values at
Exp->BwdTrans(Exp->GetCoeffs(), Exp->UpdatePhys());
//----------------------------------------------
//end of full solve timing
gettimeofday(&timer2, NULL);
time1 = timer1.tv_sec*1000000.0+(timer1.tv_usec);
time2 = timer2.tv_sec*1000000.0+(timer2.tv_usec);
fullTime = (time2-time1);
//----------------------------------------------
// See if there is an exact solution, if so
......@@ -335,6 +348,8 @@ int main(int argc, char *argv[])
//////////////////////////////////////////////////////////////////////////////////////
// postprocessing and error computation
//////////////////////////////////////////////////////////////////////////////////////
//timing postprocessing
gettimeofday(&timer1, NULL);
int num_points = NumModes + 1;
//Tetrahedron
......@@ -413,6 +428,11 @@ int main(int argc, char *argv[])
PostProc->EvaluateHDGPostProcessing(PostProc->UpdateCoeffs());
PostProc->BwdTrans_IterPerExp(PostProc->GetCoeffs(),PostProc->UpdatePhys());
//end postprocessing timing
gettimeofday(&timer2, NULL);
time1 = timer1.tv_sec*1000000.0+(timer1.tv_usec);
time2 = timer2.tv_sec*1000000.0+(timer2.tv_usec);
ppTime = (time2-time1);
NekDouble L2ErrorPostProc = PostProc->L2(PostProc->GetPhys(), ppSol);
NekDouble LinfErrorPostProc = PostProc->Linf(PostProc->GetPhys(), ppSol);
......@@ -426,13 +446,6 @@ int main(int argc, char *argv[])
cout << "L infinity error: " << LinfErrorBis << endl;
cout << "L 2 error: " << L2ErrorBis << endl;
#endif
//----------------------------------------------
//----------------------------------------------
// Do the timings
timeval timer1, timer2;
NekDouble time1, time2;
NekDouble exeTime;
// We first do a single run in order to estimate the number of calls
// we are going to make
......@@ -515,6 +528,9 @@ int main(int argc, char *argv[])
outfile << setw(10) << nGlobBndRank << " ";
outfile << setw(10) << nGlobBandwidth << " ";
outfile << setw(10) << nnz << " ";
outfile.precision(0);
outfile << setw(10) << fixed << noshowpoint << fullTime << " ";
outfile << setw(10) << fixed << noshowpoint << ppTime << " ";
outfile << endl;
outfile.close();
......
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