Skip to content

Commit

Permalink
Merged in ctestsModified (pull request #325)
Browse files Browse the repository at this point in the history
Modified random vector generation for upper bound calculation. ctests updated to be made more stable

Approved-by: Phani Motamarri <[email protected]>
  • Loading branch information
dsambit committed Oct 6, 2019
2 parents 74da6eb + 24ec011 commit 323aa73
Show file tree
Hide file tree
Showing 164 changed files with 1,040 additions and 1,747 deletions.
21 changes: 8 additions & 13 deletions src/linAlg/linearAlgebraOperations.cc
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ namespace linearAlgebraOperations



const unsigned int lanczosIterations=20;
const unsigned int lanczosIterations=dftParameters::reproducible_output?40:20;
double beta;


Expand All @@ -180,19 +180,12 @@ namespace linearAlgebraOperations
vVector = 0.0,fVector = 0.0;
//std::srand(this_mpi_process);
const unsigned int local_size = vVector.local_size();
std::vector<dealii::IndexSet::size_type> local_dof_indices(local_size);
vVector.locally_owned_elements().fill_index_vector(local_dof_indices);
std::vector<double> local_values(local_size, 0.0);

for (unsigned int i = 0; i < local_size; i++)
{
local_values[i] = ((double)std::rand())/((double)RAND_MAX);
}
vVector.local_element(i) = ((double)std::rand())/((double)RAND_MAX);

operatorMatrix.getConstraintMatrixEigen()->distribute_local_to_global(local_values,
local_dof_indices,
vVector);
vVector.compress(dealii::VectorOperation::add);
operatorMatrix.getConstraintMatrixEigen()->set_zero(vVector);
vVector.update_ghost_values();

//
//evaluate l2 norm
Expand All @@ -207,6 +200,7 @@ namespace linearAlgebraOperations
v[0] = vVector;
f[0] = fVector;
operatorMatrix.HX(v,f);
operatorMatrix.getConstraintMatrixEigen()->set_zero(v[0]);
fVector = f[0];

#ifdef USE_COMPLEX
Expand All @@ -231,6 +225,7 @@ namespace linearAlgebraOperations
v0Vector = vVector; vVector.equ(1.0/beta,fVector);
v[0] = vVector,f[0] = fVector;
operatorMatrix.HX(v,f);
operatorMatrix.getConstraintMatrixEigen()->set_zero(v[0]);
fVector = f[0];
fVector.add(-1.0*beta,v0Vector);//beta is real
#ifdef USE_COMPLEX
Expand Down Expand Up @@ -275,8 +270,8 @@ namespace linearAlgebraOperations
sprintf(buffer, "bUp1: %18.10e, bUp2: %18.10e\n", eigenValuesT[lanczosIterations-1], fVector.l2_norm());
//pcout << buffer;
}

return (eigenValuesT[lanczosIterations-1]+fVector.l2_norm());
double upperBound=eigenValuesT[lanczosIterations-1]+fVector.l2_norm();
return (std::ceil(upperBound));
}


Expand Down
4 changes: 4 additions & 0 deletions src/linAlg/linearAlgebraOperationsOpt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1615,10 +1615,14 @@ namespace dftfe{


projHamParTrans.copy_transposed(projHamPar);
#if(defined DFTFE_WITH_ELPA)
if (dftParameters::useELPA)
projHamPar.add(projHamParTrans,T(-1.0),T(-1.0));
else
projHamPar.add(projHamParTrans,T(1.0),T(1.0));
#else
projHamPar.add(projHamParTrans,T(1.0),T(1.0));
#endif

if (processGrid->is_process_active())
for (unsigned int i = 0; i < projHamPar.local_n(); ++i)
Expand Down
28 changes: 14 additions & 14 deletions tests/dft/allElectron/complex/silicon_01.mpirun=12.output
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ Number Image Charges 3280

Finite element mesh information
-------------------------------------------------
number of elements: 4724
number of degrees of freedom: 48479
number of elements: 636
number of degrees of freedom: 23569
-------------------------------------------------

Setting initial guess for wavefunctions....
Expand All @@ -38,23 +38,23 @@ SCF iterations converged to the specified tolerance after: 17 iterations.

Energy computations (Hartree)
-------------------
Total energy: -1923.77258938
Total energy: -1873.18179155

Absolute values of ion forces (Hartree/Bohr)
--------------------------------------------------------------------------------------------
AtomId 0: 0.003204,0.000247,0.001277
AtomId 1: 0.031847,0.000301,0.001255
AtomId 2: 0.007141,0.000440,0.005565
AtomId 3: 0.010129,0.000165,0.011577
AtomId 4: 0.042995,0.030273,0.012914
AtomId 5: 0.043409,0.053223,0.002854
AtomId 6: 0.032856,0.019190,0.005831
AtomId 7: 0.029664,0.040352,0.000751
AtomId 0: 0.000370,0.000010,0.000380
AtomId 1: 0.004469,0.000008,0.000380
AtomId 2: 0.001850,0.000025,0.000230
AtomId 3: 0.002245,0.000066,0.002673
AtomId 4: 0.016376,0.018641,0.001403
AtomId 5: 0.016645,0.014534,0.002817
AtomId 6: 0.014359,0.016701,0.000417
AtomId 7: 0.014339,0.012149,0.002093
--------------------------------------------------------------------------------------------

Absolute value of cell stress (Hartree/Bohr^3)
------------------------------------------------------------------------
0.124730 0.007808 0.005814
0.007808 0.124945 0.007815
0.005814 0.007815 0.125220
0.188625 0.000014 0.000654
0.000014 0.188594 0.000015
0.000654 0.000015 0.189058
------------------------------------------------------------------------
60 changes: 0 additions & 60 deletions tests/dft/allElectron/complex/silicon_01.mpirun=8.output

This file was deleted.

14 changes: 7 additions & 7 deletions tests/dft/allElectron/complex/silicon_01.prm.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ subsection Geometry
set NATOM TYPES=1
set ATOMIC COORDINATES FILE = @SOURCE_DIR@/silicon_coordinates.inp
set DOMAIN VECTORS FILE = @SOURCE_DIR@/silicon_domainBoundingVectors.inp

subsection Optimization
set ION FORCE=true
set CELL STRESS=true
Expand All @@ -29,13 +29,13 @@ end


subsection Finite element mesh parameters
set POLYNOMIAL ORDER = 2
set POLYNOMIAL ORDER = 3

subsection Auto mesh generation parameters
set BASE MESH SIZE = 4.0
set ATOM BALL RADIUS = 2.0
set MESH SIZE AROUND ATOM = 0.5
set MESH SIZE AT ATOM = 0.5
set MESH SIZE AROUND ATOM = 1.0
set MESH SIZE AT ATOM = 1.0
end

end
Expand Down Expand Up @@ -76,15 +76,15 @@ subsection SCF parameters
subsection Eigen-solver parameters
set NUMBER OF KOHN-SHAM WAVEFUNCTIONS = 72
set LOWER BOUND WANTED SPECTRUM = -70.0
set CHEBYSHEV POLYNOMIAL DEGREE = 30
set CHEBYSHEV FILTER TOLERANCE=1e-3
set CHEBYSHEV POLYNOMIAL DEGREE = 20
set CHEBYSHEV FILTER TOLERANCE=1e-4
set ORTHOGONALIZATION TYPE=LW
end
end


subsection Poisson problem parameters
set MAXIMUM ITERATIONS = 10000
set TOLERANCE = 1e-12
set TOLERANCE = 1e-10
end
set H REFINED ELECTROSTATICS=false
16 changes: 8 additions & 8 deletions tests/dft/allElectron/complex/silicon_coordinates.inp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
14 4 0.0 0.0 0.0
14 4 0.5 0.5 0.0
14 4 0.0 0.5 0.5
14 4 0.5 0.0 0.5
14 4 0.25 0.25 0.25
14 4 0.75 0.75 0.25
14 4 0.25 0.75 0.75
14 4 0.75 0.25 0.75
14 14 0.0 0.0 0.0
14 14 0.5 0.5 0.0
14 14 0.0 0.5 0.5
14 14 0.5 0.0 0.5
14 14 0.25 0.25 0.25
14 14 0.75 0.75 0.25
14 14 0.25 0.75 0.75
14 14 0.75 0.25 0.75
10 changes: 6 additions & 4 deletions tests/dft/allElectron/real/methane_01.mpirun=4.output
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
number of atoms: 5
number of atoms types: 2
Z:6
Z:1
=============================================================================================================================
number of electrons: 10
number of eigen values: 10
=============================================================================================================================
-----------Simulation Domain bounding vectors (lattice vectors in fully periodic case)-------------
v1 : 8.000000000000000000e+01 0.000000000000000000e+00 0.000000000000000000e+00
v2 : 0.000000000000000000e+00 8.000000000000000000e+01 0.000000000000000000e+00
Expand All @@ -20,10 +26,6 @@ number of degrees of freedom: 70571
-------------------------------------------------

Setting initial guess for wavefunctions....
=============================================================================================================================
number of electrons: 10
number of eigen values: 10
=============================================================================================================================

Reading initial guess for electron-density.....

Expand Down
10 changes: 6 additions & 4 deletions tests/dft/allElectron/real/methane_01.mpirun=8.output
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
number of atoms: 5
number of atoms types: 2
Z:6
Z:1
=============================================================================================================================
number of electrons: 10
number of eigen values: 10
=============================================================================================================================
-----------Simulation Domain bounding vectors (lattice vectors in fully periodic case)-------------
v1 : 8.000000000000000000e+01 0.000000000000000000e+00 0.000000000000000000e+00
v2 : 0.000000000000000000e+00 8.000000000000000000e+01 0.000000000000000000e+00
Expand All @@ -20,10 +26,6 @@ number of degrees of freedom: 70571
-------------------------------------------------

Setting initial guess for wavefunctions....
=============================================================================================================================
number of electrons: 10
number of eigen values: 10
=============================================================================================================================

Reading initial guess for electron-density.....

Expand Down
2 changes: 1 addition & 1 deletion tests/dft/allElectron/real/methane_01.prm.in
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ subsection SCF parameters
set MAXIMUM ITERATIONS = 40
set TEMPERATURE = 500
set TOLERANCE = 1e-6

set STARTING WFC=ATOMIC
subsection Eigen-solver parameters
set NUMBER OF KOHN-SHAM WAVEFUNCTIONS = 10
set ORTHOGONALIZATION TYPE=GS
Expand Down
4 changes: 2 additions & 2 deletions tests/dft/allElectron/real/methane_coordinates.inp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
6 4 0.00000000E+00 0.00000000E+00 0.00000000E+00
6 6 0.00000000E+00 0.00000000E+00 0.00000000E+00
1 1 1.20000000E+00 1.20000000E+00 1.20000000E+00
1 1 -1.20000000E+00 -1.20000000E+00 1.20000000E+00
1 1 1.20000000E+00 -1.20000000E+00 -1.20000000E+00
1 1 -1.20000000E+00 1.20000000E+00 -1.20000000E+00
1 1 -1.20000000E+00 1.20000000E+00 -1.20000000E+00
15 changes: 8 additions & 7 deletions tests/dft/allElectron/real/oxygenMolecule_01.mpirun=4.output
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
number of atoms: 2
number of atoms types: 1
Z:8
=============================================================================================================================
number of electrons: 16
number of eigen values: 10
=============================================================================================================================
-----------Simulation Domain bounding vectors (lattice vectors in fully periodic case)-------------
v1 : 3.000000000000000000e+01 0.000000000000000000e+00 0.000000000000000000e+00
v2 : 0.000000000000000000e+00 3.000000000000000000e+01 0.000000000000000000e+00
Expand All @@ -17,22 +22,18 @@ number of degrees of freedom: 37741
-------------------------------------------------

Setting initial guess for wavefunctions....
=============================================================================================================================
number of electrons: 16
number of eigen values: 20
=============================================================================================================================

Reading initial guess for electron-density.....

Starting SCF iterations....
SCF iterations converged to the specified tolerance after: 24 iterations.
SCF iterations converged to the specified tolerance after: 25 iterations.

Energy computations (Hartree)
-------------------
Total energy: -148.96286341
Total energy: -148.96286339

Absolute values of ion forces (Hartree/Bohr)
--------------------------------------------------------------------------------------------
AtomId 0: 0.000000,0.000000,0.044508
AtomId 0: 0.000000,0.000000,0.044507
AtomId 1: 0.000000,0.000000,0.450597
--------------------------------------------------------------------------------------------
4 changes: 2 additions & 2 deletions tests/dft/allElectron/real/oxygenMolecule_01.prm.in
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ subsection SCF parameters
set MAXIMUM ITERATIONS = 50
set TEMPERATURE = 10
set TOLERANCE = 1e-6

set STARTING WFC= ATOMIC
subsection Eigen-solver parameters
set NUMBER OF KOHN-SHAM WAVEFUNCTIONS = 20
set NUMBER OF KOHN-SHAM WAVEFUNCTIONS = 10
set ORTHOGONALIZATION TYPE=GS
set CHEBYSHEV POLYNOMIAL DEGREE = 80
set CHEBYSHEV FILTER TOLERANCE=1e-3
Expand Down
15 changes: 8 additions & 7 deletions tests/dft/pseudopotential/complex/fccAl_02.mpirun=16.output
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
number of atoms: 4
number of atoms types: 1
Z:13
=============================================================================================================================
number of electrons: 12
number of eigen values: 20
=============================================================================================================================
Total number of k-points 8
-----------Simulation Domain bounding vectors (lattice vectors in fully periodic case)-------------
v1 : 7.599999999999999645e+00 0.000000000000000000e+00 0.000000000000000000e+00
Expand All @@ -21,10 +26,6 @@ number of degrees of freedom: 15849
-------------------------------------------------

Setting initial guess for wavefunctions....
=============================================================================================================================
number of electrons: 12
number of eigen values: 20
=============================================================================================================================

Reading initial guess for electron-density.....

Expand All @@ -44,9 +45,9 @@ Absolute value of cell stress (Hartree/Bohr^3)
0.000000 0.000000 0.000011
------------------------------------------------------------------------
-----------Simulation Domain bounding vectors (lattice vectors in fully periodic case)-------------
v1 : 7.596192 0.000000 0.000000
v2 : 0.000000 7.596192 0.000000
v3 : 0.000000 0.000000 7.596192
v1 : 7.596193 0.000000 0.000000
v2 : 0.000000 7.596193 0.000000
v3 : 0.000000 0.000000 7.596193
-----------------------------------------------------------------------------------------
-----Fractional coordinates of atoms------
AtomId 0: 0.000000 0.000000 0.000000
Expand Down
Loading

0 comments on commit 323aa73

Please sign in to comment.