Commit a58647ac authored by Sergey Yakovlev's avatar Sergey Yakovlev

Finished reworking HelmSolve timings (still there is assertion

violation)
Changed reorderings for the AssemblyMapCG/DG to make them the same for
various solver types
parent 56d14b50
......@@ -59,9 +59,11 @@ int main(int argc, char *argv[])
if (vComm->GetRank() == 0)
{
cout << "Solving 2D Helmholtz:" << endl;
cout << " Lambda : " << factors[StdRegions::eFactorLambda] << endl;
cout << " No. modes : " << num_modes << endl;
cout << "Solving 2D Helmholtz: " << endl;
cout << " Communication: " << vSession->GetComm()->GetType() << endl;
cout << " Solver type : " << vSession->GetSolverInfo("GlobalSysSoln") << endl;
cout << " Lambda : " << factors[StdRegions::eFactorLambda] << endl;
cout << " No. modes : " << bkey0.GetNumModes() << endl;
cout << endl;
}
......@@ -227,10 +229,10 @@ int main(int argc, char *argv[])
PostProc->EvaluateHDGPostProcessing(PostProc->UpdateCoeffs());
PostProc->BwdTrans_IterPerExp(PostProc->GetCoeffs(),PostProc->UpdatePhys());
NekDouble vLinfError = Exp->Linf(fce);
NekDouble vL2Error = Exp->L2 (fce);
NekDouble L2ErrorPostProc = PostProc->L2(ppSol);
NekDouble LinfErrorPostProc = PostProc->Linf(ppSol);
NekDouble vLinfError = Exp->Linf(Exp->GetPhys(), fce);
NekDouble vL2Error = Exp->L2 (Exp->GetPhys(), fce);
NekDouble L2ErrorPostProc = PostProc->L2(PostProc->GetPhys(), ppSol);
NekDouble LinfErrorPostProc = PostProc->Linf(PostProc->GetPhys(), ppSol);
if (vSession->GetComm()->GetRank() == 0)
{
......
......@@ -1283,7 +1283,6 @@ namespace Nektar
{
case eDirectFullMatrix:
case eIterativeFull:
case eIterativeStaticCond:
case eXxtFullMatrix:
case eXxtStaticCond:
{
......@@ -1291,6 +1290,7 @@ namespace Nektar
}
break;
case eDirectStaticCond:
case eIterativeStaticCond:
{
CuthillMckeeReordering(boostGraphObj,perm,iperm);
}
......
......@@ -1224,7 +1224,6 @@ namespace Nektar
{
case eDirectFullMatrix:
case eIterativeFull:
case eIterativeStaticCond:
case eXxtFullMatrix:
case eXxtStaticCond:
{
......@@ -1232,6 +1231,7 @@ namespace Nektar
}
break;
case eDirectStaticCond:
case eIterativeStaticCond:
{
CuthillMckeeReordering(boostGraphObj,perm,iperm);
}
......
......@@ -439,6 +439,7 @@ namespace Nektar
break;
}
case eDirectMultiLevelStaticCond:
case eIterativeMultiLevelStaticCond:
{
MultiLevelBisectionReordering(boostGraphObj,perm,iperm,bottomUpGraph);
break;
......
......@@ -2358,7 +2358,7 @@
// Transforming back to modified basis
Array<OneD, NekDouble> work(nq_elmt);
ppExp->BwdTrans(out.GetPtr(), work);
exp ->FwdTrans(work, tmp_coeffs = outarray + m_coeff_offset[eid]);
(*m_exp)[eid]->FwdTrans(work, tmp_coeffs = outarray + m_coeff_offset[eid]);
}
}
......
......@@ -11,41 +11,45 @@ MinTimeFile="./MinTime.dat"
MaxNumModesp1=16;
echo "% Type nElements nModes nCalls Time Time/Call L2Error L2Error(hi-res) LinfError LinfErr(hi-res) nLocCoef nGlobCoef nLocBCoef nGlobBCoef nLocDCoef nGlobDCoef nnz optlevel" > $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" > $TimingResultsFile
# Loop over the element type
for Type in 1 2 3
# Loop over the mesh-size
for MeshSize in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
do
# Loop over the optimisation level
for OptimisationLevel in 0 2 3
do
# Loop over the mesh-size
for MeshSize in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
do
# Loop over the number of modes
for ((NumModes=2; NumModes<MaxNumModesp1; NumModes++))
do
# Initialise the minimal time to a really big value
MinTime=10000000000000000;
# Loop over the number of Loops you want to run it
for ((a=0; a<NumLoops; a++))
do
TimingCGHelmSolve2D $Type $MeshSize $NumModes $OptimisationLevel
echo Nektar++ TimingCGHelmSolve2D $Type $MeshSize $NumModes $OptimisationLevel
read TypeOut NumElementsOut NumModesOut NumCallsOut ElapsedTimeOut TimepCallOut L2Out L2OutBis LinfOut LinfOutBis nLocCoefOut nGlobCoefOut nLocBCoefOut nGlobBCoefOut nLocDCoefOut nGlobDCoefOut nnzOut optLevelOut< $ExecutableDumpFile
if [ $ElapsedTimeOut -lt $MinTime ];
then
MinTime=$ElapsedTimeOut
cp $ExecutableDumpFile $MinTimeFile
fi
done
cat $MinTimeFile >> $TimingResultsFile
done
done
done
# Loop over the element type: 1 - RQuad, 2 - DQuad, 3 - RTri
for Type in 1 3
do
# Loop over the LinSysSolver type: 0 - DirectStaticCond, 1 - DirectMultiLevelStaticCond, 2 - IterativeStaticCond, 3 - IterativeMultiLevelStaticCond
for LinSysSolver in 0 1 2 3
do
# Loop over the optimisation level: 0 - ElSumFac, 2 - ElBlkMat, 3 - GlbMat
for OptimisationLevel in 0 2 3
do
# Loop over the number of modes
for ((NumModes=2; NumModes<MaxNumModesp1; NumModes++))
do
# Initialise the minimal time to a really big value
MinTime=10000000000000000;
# Loop over the number of Loops you want to run it
for ((a=0; a<NumLoops; a++))
do
TimingCGHelmSolve2D $Type $MeshSize $NumModes $OptimisationLevel $LinSysSolver
echo Nektar++ TimingCGHelmSolve2D $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
if [ $ElapsedTimeOut -lt $MinTime ];
then
MinTime=$ElapsedTimeOut
cp $ExecutableDumpFile $MinTimeFile
fi
done
cat $MinTimeFile >> $TimingResultsFile
done
done
done
done
done
rm -f $MinTimeFile
......
......@@ -11,7 +11,7 @@ MinTimeFile="./MinTimeCG3D.dat"
MaxNumModesp1=10;
echo "% 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" > $TimingResultsFile
# Loop over the mesh-size
for MeshSize in 1 2 3 4 5 6 7 8 9 10
......@@ -19,30 +19,34 @@ do
# Loop over the element type: 1 - RHex, 2 - DHex, 3 - RTet
for Type in 1 3
do
# Loop over the optimisation level: 0 - ElSumFac, 2 - ElBlkMat, 3 - GlbMat
for OptimisationLevel in 0 2 3
# Loop over the LinSysSolver type: 0 - DirectStaticCond, 1 - DirectMultiLevelStaticCond, 2 - IterativeStaticCond, 3 - IterativeMultiLevelStaticCond
for LinSysSolver in 0 1 2 3
do
# Loop over the number of modes
for ((NumModes=2; NumModes<MaxNumModesp1; NumModes++))
do
# Initialise the minimal time to a really big value
MinTime=10000000000000000;
# Loop over the number of Loops you want to run it
for ((a=0; a<NumLoops; a++))
do
TimingCGHelmSolve3D $Type $MeshSize $NumModes $OptimisationLevel
echo Nektar++ TimingCGHelmSolve3D $Type $MeshSize $NumModes $OptimisationLevel
read TypeOut NumElementsOut NumModesOut NumCallsOut ElapsedTimeOut TimepCallOut L2Out L2OutBis LinfOut LinfOutBis nLocCoefOut nGlobCoefOut nLocBCoefOut nGlobBCoefOut nLocDCoefOut nGlobDCoefOut nnzOut optLevelOut< $ExecutableDumpFile
if [ $ElapsedTimeOut -lt $MinTime ];
then
MinTime=$ElapsedTimeOut
cp $ExecutableDumpFile $MinTimeFile
fi
# Loop over the optimisation level: 0 - ElSumFac, 2 - ElBlkMat, 3 - GlbMat
for OptimisationLevel in 0 2 3
do
# Loop over the number of modes
for ((NumModes=2; NumModes<MaxNumModesp1; NumModes++))
do
# Initialise the minimal time to a really big value
MinTime=10000000000000000;
# Loop over the number of Loops you want to run it
for ((a=0; a<NumLoops; a++))
do
TimingCGHelmSolve3D $Type $MeshSize $NumModes $OptimisationLevel $LinSysSolver
echo Nektar++ TimingCGHelmSolve3D $Type $MeshSize $NumModes $OptimisationLevel $LinSysSolver
read TypeOut NumElementsOut NumModesOut NumCallsOut ElapsedTimeOut TimepCallOut L2Out L2OutBis LinfOut LinfOutBis nLocCoefOut nGlobCoefOut nLocBCoefOut nGlobBCoefOut nLocDCoefOut nGlobDCoefOut nnzOut optLevelOut< $ExecutableDumpFile
if [ $ElapsedTimeOut -lt $MinTime ];
then
MinTime=$ElapsedTimeOut
cp $ExecutableDumpFile $MinTimeFile
fi
done
cat $MinTimeFile >> $TimingResultsFile
done
cat $MinTimeFile >> $TimingResultsFile
done
done
done
......
......@@ -11,41 +11,45 @@ MinTimeFile="./MinTime.dat"
MaxNumModesp1=16;
echo "% Type nElements nModes nCalls Time Time/Call L2Error L2Error(hi-res) LinfError LinfErr(hi-res) nLocCoef nGlobCoef nLocBCoef nGlobBCoef nLocDCoef nGlobDCoef nnz optlevel" > $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" > $TimingResultsFile
# Loop over the element type
for Type in 1 2 3
# Loop over the mesh-size
for MeshSize in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
do
# Loop over the optimisation level
for OptimisationLevel in 0 2 3
do
# Loop over the mesh-size
for MeshSize in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
do
# Loop over the number of modes
for ((NumModes=2; NumModes<MaxNumModesp1; NumModes++))
do
# Initialise the minimal time to a really big value
MinTime=10000000000000000;
# Loop over the number of Loops you want to run it
for ((a=0; a<NumLoops; a++))
do
TimingHDGHelmSolve2D $Type $MeshSize $NumModes $OptimisationLevel
echo Nektar++ TimingHDGHelmSolve2D $Type $MeshSize $NumModes $OptimisationLevel
read TypeOut NumElementsOut NumModesOut NumCallsOut ElapsedTimeOut TimepCallOut L2Out L2OutBis LinfOut LinfOutBis nLocCoefOut nGlobCoefOut nLocBCoefOut nGlobBCoefOut nLocDCoefOut nGlobDCoefOut nnzOut optLevelOut< $ExecutableDumpFile
if [ $ElapsedTimeOut -lt $MinTime ];
then
MinTime=$ElapsedTimeOut
cp $ExecutableDumpFile $MinTimeFile
fi
done
cat $MinTimeFile >> $TimingResultsFile
done
done
done
# Loop over the element type: 1 - RQuad, 2 - DQuad, 3 - RTri
for Type in 1 3
do
# Loop over the LinSysSolver type: 0 - DirectStaticCond, 1 - DirectMultiLevelStaticCond, 2 - IterativeStaticCond, 3 - IterativeMultiLevelStaticCond
for LinSysSolver in 0 1 2 3
do
# Loop over the optimisation level: 0 - ElSumFac, 2 - ElBlkMat, 3 - GlbMat
for OptimisationLevel in 0 2 3
do
# Loop over the number of modes
for ((NumModes=2; NumModes<MaxNumModesp1; NumModes++))
do
# Initialise the minimal time to a really big value
MinTime=10000000000000000;
# Loop over the number of Loops you want to run it
for ((a=0; a<NumLoops; a++))
do
TimingHDGHelmSolve2D $Type $MeshSize $NumModes $OptimisationLevel $LinSysSolver
echo Nektar++ TimingHDGHelmSolve2D $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
if [ $ElapsedTimeOut -lt $MinTime ];
then
MinTime=$ElapsedTimeOut
cp $ExecutableDumpFile $MinTimeFile
fi
done
cat $MinTimeFile >> $TimingResultsFile
done
done
done
done
done
rm -f $MinTimeFile
......
......@@ -11,7 +11,7 @@ MinTimeFile="./MinTimeHDG3D.dat"
MaxNumModesp1=10;
echo "% 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" > $TimingResultsFile
# Loop over the mesh-size
for MeshSize in 1 2 3 4 5 6 7 8 9 10
......@@ -19,30 +19,34 @@ do
# Loop over the element type: 1 - RHex, 2 - DHex, 3 - RTet
for Type in 1 3
do
# Loop over the optimisation level: 0 - ElSumFac, 2 - ElBlkMat, 3 - GlbMat
for OptimisationLevel in 0 2 3
# Loop over the LinSysSolver type: 0 - DirectStaticCond, 1 - DirectMultiLevelStaticCond, 2 - IterativeStaticCond, 3 - IterativeMultiLevelStaticCond
for LinSysSolver in 0 1 2 3
do
# Loop over the number of modes
for ((NumModes=2; NumModes<MaxNumModesp1; NumModes++))
do
# Initialise the minimal time to a really big value
MinTime=10000000000000000;
# Loop over the number of Loops you want to run it
for ((a=0; a<NumLoops; a++))
do
TimingHDGHelmSolve3D $Type $MeshSize $NumModes $OptimisationLevel
echo Nektar++ TimingHDGHelmSolve3D $Type $MeshSize $NumModes $OptimisationLevel
read optLevelOut TypeOut NumElementsOut NumModesOut ElapsedTimeOut NumCallsOut TimepCallOut L2Out ppL2Out L2OutBis LinfOut ppLinfOut LinfOutBis nLocCoefOut nGlobCoefOut nLocBCoefOut nGlobBCoefOut nLocDCoefOut nGlobDCoefOut GlobRankOut GlobBndwthOut nnzOut< $ExecutableDumpFile
if [ $ElapsedTimeOut -lt $MinTime ];
then
MinTime=$ElapsedTimeOut
cp $ExecutableDumpFile $MinTimeFile
fi
# Loop over the optimisation level: 0 - ElSumFac, 2 - ElBlkMat, 3 - GlbMat
for OptimisationLevel in 0 2 3
do
# Loop over the number of modes
for ((NumModes=2; NumModes<MaxNumModesp1; NumModes++))
do
# Initialise the minimal time to a really big value
MinTime=10000000000000000;
# Loop over the number of Loops you want to run it
for ((a=0; a<NumLoops; a++))
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
if [ $ElapsedTimeOut -lt $MinTime ];
then
MinTime=$ElapsedTimeOut
cp $ExecutableDumpFile $MinTimeFile
fi
done
cat $MinTimeFile >> $TimingResultsFile
done
cat $MinTimeFile >> $TimingResultsFile
done
done
done
......
......@@ -25,7 +25,7 @@ int main(int argc, char *argv[])
NekDouble lambda;
vector<string> vFilenames;
if(argc != 5)
if(argc != 6)
{
fprintf(stderr,"Usage: TimingCGHelmSolve2D Type MeshSize NumModes OptimisationLevel\n");
fprintf(stderr," where: - Type is one of the following:\n");
......@@ -39,6 +39,11 @@ int main(int argc, char *argv[])
fprintf(stderr," 2: Use elemental matrix evaluation using blockmatrices \n");
fprintf(stderr," 3: Use global matrix evaluation \n");
fprintf(stderr," 4: Use optimal evaluation (this option requires optimisation-files being set-up) \n");
fprintf(stderr," where: - LinSysSolver is one of the following:\n");
fprintf(stderr," 0: Use DirectStaticCond Solver \n");
fprintf(stderr," 1: Use DirectMultilevelStaticCond Solver\n");
fprintf(stderr," 2: Use IterativeStaticCond Solver \n");
fprintf(stderr," 3: Use IterativeMultilevelStaticCond Solver\n");
exit(1);
}
......@@ -50,6 +55,8 @@ int main(int argc, char *argv[])
int NumModes = atoi(argv[3]);
int optLevel = atoi(argv[4]);
std::string optLevelStr;
int SolverType = atoi(argv[5]);
std::string SolverTypeStr;
//----------------------------------------------
// Retrieve the necessary input files
......@@ -152,11 +159,44 @@ int main(int argc, char *argv[])
boost::filesystem::path(GlobOptFileName.str());
vFilenames.push_back(PortablePath(GlobOptFilePath));
//----------------------------------------------
//////////////////////////////////////////////////////////////////////////////////////
// solution and error computation
//////////////////////////////////////////////////////////////////////////////////////
LibUtilities::SessionReaderSharedPtr vSession
= LibUtilities::SessionReader::CreateInstance(argc, argv, vFilenames);
switch(SolverType)
{
case 0:
{
vSession->SetSolverInfo("GlobalSysSoln", "DirectStaticCond");
SolverTypeStr = "DSC";
}
break;
case 1:
{
vSession->SetSolverInfo("GlobalSysSoln", "DirectMultiLevelStaticCond");
SolverTypeStr = "DMSC";
}
break;
case 2:
{
vSession->SetSolverInfo("GlobalSysSoln", "IterativeStaticCond");
SolverTypeStr = "ISC";
}
break;
case 3:
{
vSession->SetSolverInfo("GlobalSysSoln", "IterativeMultiLevelStaticCond");
SolverTypeStr = "IMSC";
}
break;
default:
{
ASSERTL0(false,"Unrecognised system solver");
}
}
//----------------------------------------------
// Read in mesh from input file
SpatialDomains::MeshGraphSharedPtr graph2D = MemoryManager<SpatialDomains::MeshGraph2D>::AllocateSharedPtr(vSession);
......@@ -242,8 +282,11 @@ int main(int argc, char *argv[])
NekDouble L2Error = Exp->L2 (sol);
NekDouble LinfError = Exp->Linf(sol);
//--------------------------------------------
// alternative error calculation
//////////////////////////////////////////////////////////////////////////////////////
// Alternative error computation (finer sampling)
//////////////////////////////////////////////////////////////////////////////////////
const LibUtilities::PointsKey PkeyT1(30,LibUtilities::eGaussLobattoLegendre);
const LibUtilities::PointsKey PkeyT2(30,LibUtilities::eGaussRadauMAlpha1Beta0);
const LibUtilities::PointsKey PkeyQ1(30,LibUtilities::eGaussLobattoLegendre);
......@@ -362,6 +405,7 @@ int main(int argc, char *argv[])
ofstream outfile("TimingCGHelmSolve2D.dat");
outfile.precision(0);
outfile << setw(10) << SolverTypeStr << " ";
outfile << setw(10) << optLevelStr << " ";
outfile << setw(10) << TypeStr << " ";
outfile << setw(10) << NumElements << " ";
......
......@@ -25,7 +25,7 @@ int main(int argc, char *argv[])
NekDouble lambda;
vector<string> vFilenames;
if(argc != 5)
if(argc != 6)
{
fprintf(stderr,"Usage: TimingCGHelmSolve3D Type MeshSize NumModes OptimisationLevel\n");
fprintf(stderr," where: - Type is one of the following:\n");
......@@ -39,6 +39,11 @@ int main(int argc, char *argv[])
fprintf(stderr," 2: Use elemental matrix evaluation using blockmatrices \n");
fprintf(stderr," 3: Use global matrix evaluation \n");
fprintf(stderr," 4: Use optimal evaluation (this option requires optimisation-files being set-up) \n");
fprintf(stderr," where: - LinSysSolver is one of the following:\n");
fprintf(stderr," 0: Use DirectStaticCond Solver \n");
fprintf(stderr," 1: Use DirectMultilevelStaticCond Solver\n");
fprintf(stderr," 2: Use IterativeStaticCond Solver \n");
fprintf(stderr," 3: Use IterativeMultilevelStaticCond Solver\n");
exit(1);
}
......@@ -50,6 +55,8 @@ int main(int argc, char *argv[])
int NumModes = atoi(argv[3]);
int optLevel = atoi(argv[4]);
std::string optLevelStr;
int SolverType = atoi(argv[5]);
std::string SolverTypeStr;
//----------------------------------------------
// Retrieve the necessary input files
......@@ -152,11 +159,44 @@ int main(int argc, char *argv[])
boost::filesystem::path(GlobOptFileName.str());
vFilenames.push_back(PortablePath(GlobOptFilePath));
//----------------------------------------------
//////////////////////////////////////////////////////////////////////////////////////
// solution and error computation
//////////////////////////////////////////////////////////////////////////////////////
LibUtilities::SessionReaderSharedPtr vSession
= LibUtilities::SessionReader::CreateInstance(argc, argv, vFilenames);
switch(SolverType)
{
case 0:
{
vSession->SetSolverInfo("GlobalSysSoln", "DirectStaticCond");
SolverTypeStr = "DSC";
}
break;
case 1:
{
vSession->SetSolverInfo("GlobalSysSoln", "DirectMultiLevelStaticCond");
SolverTypeStr = "DMSC";
}
break;
case 2:
{
vSession->SetSolverInfo("GlobalSysSoln", "IterativeStaticCond");
SolverTypeStr = "ISC";
}
break;
case 3:
{
vSession->SetSolverInfo("GlobalSysSoln", "IterativeMultiLevelStaticCond");
SolverTypeStr = "IMSC";
}
break;
default:
{
ASSERTL0(false,"Unrecognised system solver");
}
}
//----------------------------------------------
// Read in mesh from input file
SpatialDomains::MeshGraphSharedPtr graph3D = MemoryManager<SpatialDomains::MeshGraph3D>::AllocateSharedPtr(vSession);
......@@ -242,8 +282,11 @@ int main(int argc, char *argv[])
NekDouble L2Error = Exp->L2 (sol);
NekDouble LinfError = Exp->Linf(sol);
//--------------------------------------------
// alternative error calculation
//////////////////////////////////////////////////////////////////////////////////////
// Alternative error computation (finer sampling)
//////////////////////////////////////////////////////////////////////////////////////
const LibUtilities::PointsKey PkeyT1(30,LibUtilities::eGaussLobattoLegendre);
const LibUtilities::PointsKey PkeyT2(30,LibUtilities::eGaussRadauMAlpha1Beta0);
const LibUtilities::PointsKey PkeyT3(30,LibUtilities::eGaussRadauMAlpha2Beta0);
......@@ -366,6 +409,7 @@ int main(int argc, char *argv[])
ofstream outfile("TimingCGHelmSolve3D.dat");
outfile.precision(0);
outfile << setw(10) << SolverTypeStr << " ";
outfile << setw(10) << optLevelStr << " ";
outfile << setw(10) << TypeStr << " ";
outfile << setw(10) << NumElements << " ";
......
This diff is collapsed.
......@@ -25,7 +25,7 @@ int main(int argc, char *argv[])
NekDouble lambda;
vector<string> vFilenames;
if(argc != 5)
if(argc != 6)
{
fprintf(stderr,"Usage: TimingHDGHelmSolve3D Type MeshSize NumModes OptimisationLevel\n");
fprintf(stderr," where: - Type is one of the following:\n");
......@@ -39,6 +39,11 @@ int main(int argc, char *argv[])
fprintf(stderr," 2: Use elemental matrix evaluation using blockmatrices \n");
fprintf(stderr," 3: Use global matrix evaluation \n");
fprintf(stderr," 4: Use optimal evaluation (this option requires optimisation-files being set-up) \n");
fprintf(stderr," where: - LinSysSolver is one of the following:\n");
fprintf(stderr," 0: Use DirectStaticCond Solver \n");
fprintf(stderr," 1: Use DirectMultilevelStaticCond Solver\n");
fprintf(stderr," 2: Use IterativeStaticCond Solver \n");
fprintf(stderr," 3: Use IterativeMultilevelStaticCond Solver\n");
exit(1);
}
......@@ -50,6 +55,8 @@ int main(int argc, char *argv[])
int NumModes = atoi(argv[3]);
int optLevel = atoi(argv[4]);
std::string optLevelStr;
int SolverType = atoi(argv[5]);
std::string SolverTypeStr;
//----------------------------------------------
// Retrieve the necessary input files
......@@ -161,6 +168,37 @@ int main(int argc, char *argv[])
LibUtilities::SessionReaderSharedPtr vSession
= LibUtilities::SessionReader::CreateInstance(argc, argv, vFilenames);
switch(SolverType)
{
case 0:
{
vSession->SetSolverInfo("GlobalSysSoln", "DirectStaticCond");
SolverTypeStr = "DSC";
}
break;
case 1:
{
vSession->SetSolverInfo("GlobalSysSoln", "DirectMultiLevelStaticCond");
SolverTypeStr = "DMSC";
}
break;
case 2:
{
vSession->SetSolverInfo("GlobalSysSoln", "IterativeStaticCond");
SolverTypeStr = "ISC";
}
break;
case 3:
{
vSession->SetSolverInfo("GlobalSysSoln", "IterativeMultiLevelStaticCond");
SolverTypeStr = "IMSC";
}
break;
default:
{
ASSERTL0(false,"Unrecognised system solver");
}
}
//----------------------------------------------
// Read in mesh from input file
SpatialDomains::MeshGraphSharedPtr graph3D = MemoryManager<SpatialDomains::MeshGraph3D>::AllocateSharedPtr(vSession);
......@@ -452,6 +490,7 @@ int main(int argc, char *argv[])
ofstream outfile("TimingHDGHelmSolve3D.dat");<