Skip to content

Commit df36095

Browse files
committed
Merge branch 'publicGithubDevelop' of https://bitbucket.org/dftfedevelopers/dftfe into BFGSPreconOpt
2 parents e2d3a60 + 54f0a77 commit df36095

10 files changed

+79
-52
lines changed

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ ENDIF()
548548
#
549549
# ELPA. Pass path to -DCMAKE_PREFIX_PATH
550550
#
551-
find_package(ELPA 2022 REQUIRED)
551+
find_package(ELPA 2024 REQUIRED)
552552
MESSAGE(STATUS "Will Link With ELPA")
553553
target_link_libraries(${TARGETLIB} PUBLIC ELPA::ELPA)
554554

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ DFT-FE code builds on top of the deal.II library for everything that has to do w
1515
The steps to install the necessary dependencies and DFT-FE itself are described in the *Installation* section of the DFT-FE manual (compile doc/manual/manual.tex or download the development version manual [here](https://github.com/dftfeDevelopers/dftfe/blob/manual/manual-develop.pdf)).
1616

1717
We have created several shell based installation scripts for the development version of DFT-FE (`publicGithubDevelop` branch) on various machines:
18-
- [OLCF Frontier](https://github.com/dftfeDevelopers/install_DFTFE/tree/frontierScript)
18+
- [OLCF Frontier](https://github.com/dftfeDevelopers/install_DFTFE/tree/frontierScriptROCM6)
1919
- [NERSC Perlmutter](https://github.com/dftfeDevelopers/install_DFTFE/tree/perlmutterScript)
2020
- [ALCF Polaris](https://github.com/dftfeDevelopers/install_DFTFE/tree/polarisScript)
2121
- [UMICH Greatlakes](https://github.com/dftfeDevelopers/install_DFTFE/tree/greatlakesScript)

cmake/FindELPA.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ find_package(PkgConfig)
1818
# elpa-2020.05.001.pc
1919
set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE)
2020
foreach(pkg elpa_openmp elpa) # prioritize elpa_openmp
21-
foreach(ver 2022.11.001)
21+
foreach(ver 2024.03.001)
2222
pkg_search_module(PC_ELPA ${pkg})
2323
if(PC_ELPA_FOUND)
2424
break()

doc/manual/installation.tex

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ \subsubsection{Instructions for dependencies: ALGLIB, Libxc, spglib, Libxml2, Sc
5959
\item {\bf ScaLAPACK}: ScaLAPACK library is used by DFT-FE via ELPA for its parallel linear algebra routines involving dense matrices, as well being a dependency for ELPA. \textcolor{red}{\bf If Intel MKL math library is available, please skip this step, as the ScaLAPACK libraries therein can be used directly.} If Intel MKL math library is not available, Netlib ScaLAPACK \url{http://www.netlib.org/scalapack/} needs to be installed using the instructions below. Download the current release version (2.2.0) from \url{http://www.netlib.org/scalapack/#\_software}, and build a shared library (use \verb|BUILD_SHARED_LIBS=ON|, \verb|BUILD_STATIC_LIBS=OFF| and \verb|BUILD_TESTING=OFF|) installation of ScaLAPACK using cmake. We recommend using the ccmake gui interface for the installation. Further, use the appropriate compilers for \verb|CMAKE_C_COMPILER| and \verb|CMAKE_FORTRAN_COMPILER|, and also use \verb|-fPIC| flag for \verb|CMAKE_C_FLAGS| and \verb|-fPIC -fallow-argument-mismatch| for \verb|CMAKE_Fortran_FLAGS|. For best performance, ScaLAPACK must be linked to optimized BLAS-LAPACK libraries by using\\ \verb|USE_OPTIMIZED_LAPACK_BLAS=ON|, and providing external paths to BLAS-LAPACK libraries (MKL, OpenBlas, ESSL etc.) during the cmake configuration.
6060
%Alternatively one can also use the python based installer~\url{http://www.netlib.org/scalapack/scalapack_installer.tgz} for Linux.
6161

62-
\item {\bf ELPA}: ELPA library is used by DFT-FE for its parallel linear algebra routines involving dense matrices. ELPA requires the ScaLAPACK library (see above) as a dependency. Download the latest version elpa-2022.11.001 from \url{https://elpa.mpcdf.mpg.de/software/} and follow the installation instructions in there. Example of ELPA installation on UMICH Greatlakes supercomputer with GNU compiler, Open MPI library, and Intel MKL math library:
62+
\item {\bf ELPA}: ELPA library is used by DFT-FE for its parallel linear algebra routines involving dense matrices. ELPA requires the ScaLAPACK library (see above) as a dependency. Download the latest version elpa-2024.03.001 from \url{https://elpa.mpcdf.mpg.de/software/} and follow the installation instructions in there. Example of ELPA installation on UMICH Greatlakes supercomputer with GNU compiler, Open MPI library, and Intel MKL math library:
6363
\begin{verbatim}
6464
$ cd elpaDir
6565
$ mkdir build

pseudoConverters/pseudoPotentialToDftfeConverter.cc

+23-6
Original file line numberDiff line numberDiff line change
@@ -606,14 +606,12 @@ namespace dftfe
606606
}
607607
void
608608
xmltoOrbitalFile(std::string file_path_in, std::string file_path_out)
609-
{
610-
// Extracting radial coordinates
609+
{ // Extracting radial coordinates
611610
std::vector<double> radial_coord;
612611
std::vector<std::string> radial_tag;
613612
radial_tag.push_back("PP_MESH");
614613
radial_tag.push_back("PP_R");
615614
radial_coord = XmlTagReaderMain(radial_tag, file_path_in);
616-
617615
std::vector<std::string> pswfc_tag;
618616
pswfc_tag.push_back("PP_PSWFC");
619617
for (int i = 1; i <= xmlNodeChildCount(pswfc_tag, file_path_in); i++)
@@ -640,13 +638,32 @@ namespace dftfe
640638
{
641639
index = std::distance(attr_type.begin(), it);
642640
}
643-
std::string orbital_string = attr_value[index];
644-
for (auto &w : orbital_string)
641+
std::string orbital_string_nl = attr_value[index];
642+
for (auto &w : orbital_string_nl)
645643
{
646644
w = tolower(w);
647645
}
646+
char n = orbital_string_nl[0];
647+
char l;
648+
if (orbital_string_nl[1] == 's')
649+
{
650+
l = '0';
651+
}
652+
if (orbital_string_nl[1] == 'p')
653+
{
654+
l = '1';
655+
}
656+
if (orbital_string_nl[1] == 'd')
657+
{
658+
l = '2';
659+
}
660+
if (orbital_string_nl[1] == 'f')
661+
{
662+
l = '3';
663+
}
664+
std::string orbital_string = "psi";
648665
std::fstream file;
649-
file.open(file_path_out + "/" + orbital_string + ".dat",
666+
file.open(file_path_out + "/" + orbital_string + n + l + ".inp",
650667
std::ios::out);
651668
file << std::setprecision(12);
652669
if (file.is_open())

setupDevelopPetsc.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ libxcDir="/home/vikramg/DFT-softwares-gcc/libxc/libxc-5.2.3/install_libxc5.2.3"
2424
spglibDir="/home/vikramg/DFT-softwares-gcc/spglib/install"
2525
xmlIncludeDir="/usr/include/libxml2"
2626
xmlLibDir="/usr/lib64"
27-
ELPA_PATH="/home/vikramg/DFT-softwares-gcc/elpa/install202211"
27+
ELPA_PATH="/home/vikramg/DFT-softwares-gcc/elpa/install2024"
2828

2929

3030
#Paths for optional external libraries

src/dft/dft.cc

+22-22
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,29 @@ namespace dftfe
743743
<< std::endl;
744744
}
745745
}
746+
// convert pseudopotential files in upf format to dftfe format
747+
if (d_dftParamsPtr->verbosity >= 1)
748+
{
749+
pcout
750+
<< std::endl
751+
<< "Reading Pseudo-potential data for each atom from the list given in : "
752+
<< d_dftParamsPtr->pseudoPotentialFile << std::endl;
753+
}
754+
755+
int nlccFlag = 0;
756+
std::vector<int> pspFlags(2, 0);
757+
if (dealii::Utilities::MPI::this_mpi_process(d_mpiCommParent) == 0 &&
758+
d_dftParamsPtr->isPseudopotential == true)
759+
pspFlags = pseudoUtils::convert(d_dftParamsPtr->pseudoPotentialFile,
760+
d_dftfeScratchFolderName,
761+
d_dftParamsPtr->verbosity,
762+
d_dftParamsPtr->natomTypes,
763+
d_dftParamsPtr->pseudoTestsFlag);
746764

765+
nlccFlag = pspFlags[0];
766+
nlccFlag = dealii::Utilities::MPI::sum(nlccFlag, d_mpiCommParent);
767+
if (nlccFlag > 0 && d_dftParamsPtr->isPseudopotential == true)
768+
d_dftParamsPtr->nonLinearCoreCorrection = true;
747769
// estimate total number of wave functions from atomic orbital filling
748770
if (d_dftParamsPtr->startingWFCType == "ATOMIC")
749771
determineOrbitalFilling();
@@ -803,29 +825,7 @@ namespace dftfe
803825
d_numEigenValuesRR);
804826
}
805827

806-
// convert pseudopotential files in upf format to dftfe format
807-
if (d_dftParamsPtr->verbosity >= 1)
808-
{
809-
pcout
810-
<< std::endl
811-
<< "Reading Pseudo-potential data for each atom from the list given in : "
812-
<< d_dftParamsPtr->pseudoPotentialFile << std::endl;
813-
}
814-
815-
int nlccFlag = 0;
816-
std::vector<int> pspFlags(2, 0);
817-
if (dealii::Utilities::MPI::this_mpi_process(d_mpiCommParent) == 0 &&
818-
d_dftParamsPtr->isPseudopotential == true)
819-
pspFlags = pseudoUtils::convert(d_dftParamsPtr->pseudoPotentialFile,
820-
d_dftfeScratchFolderName,
821-
d_dftParamsPtr->verbosity,
822-
d_dftParamsPtr->natomTypes,
823-
d_dftParamsPtr->pseudoTestsFlag);
824828

825-
nlccFlag = pspFlags[0];
826-
nlccFlag = dealii::Utilities::MPI::sum(nlccFlag, d_mpiCommParent);
827-
if (nlccFlag > 0 && d_dftParamsPtr->isPseudopotential == true)
828-
d_dftParamsPtr->nonLinearCoreCorrection = true;
829829
if (d_dftParamsPtr->isPseudopotential == true)
830830
{
831831
// pcout<<"dft.cc 827 ONCV Number of cells DEBUG:

src/dft/initElectronicFields.cc

+18-16
Original file line numberDiff line numberDiff line change
@@ -92,26 +92,28 @@ namespace dftfe
9292
mpi_communicator, "Overloaded constraint matrices initialized");
9393

9494
//
95-
// initialize density and PSI/ interpolate from previous ground state
96-
// solution
95+
// initialize PSI and density
9796
//
98-
for (unsigned int kPoint = 0;
99-
kPoint < (1 + d_dftParamsPtr->spinPolarized) * d_kPointWeights.size();
100-
++kPoint)
97+
98+
AssertThrow(
99+
(1 + d_dftParamsPtr->spinPolarized) * d_kPointWeights.size() *
100+
d_numEigenValues <
101+
INT_MAX / matrix_free_data.get_vector_partitioner()->local_size(),
102+
dealii::ExcMessage(
103+
"DFT-FE error: size of local wavefunctions storage exceeds integer bounds. Please increase number of MPI tasks"));
104+
105+
d_eigenVectorsFlattenedHost.resize(
106+
(d_numEigenValues *
107+
matrix_free_data.get_vector_partitioner()->local_size()) *
108+
(1 + d_dftParamsPtr->spinPolarized) * d_kPointWeights.size(),
109+
dataTypes::number(0.0));
110+
if (d_numEigenValuesRR != d_numEigenValues)
101111
{
102-
d_eigenVectorsFlattenedHost.resize(
103-
(d_numEigenValues *
104-
matrix_free_data.get_vector_partitioner()->local_size()) *
112+
d_eigenVectorsRotFracDensityFlattenedHost.resize(
113+
d_numEigenValuesRR *
114+
matrix_free_data.get_vector_partitioner()->local_size() *
105115
(1 + d_dftParamsPtr->spinPolarized) * d_kPointWeights.size(),
106116
dataTypes::number(0.0));
107-
if (d_numEigenValuesRR != d_numEigenValues)
108-
{
109-
d_eigenVectorsRotFracDensityFlattenedHost.resize(
110-
d_numEigenValuesRR *
111-
matrix_free_data.get_vector_partitioner()->local_size() *
112-
(1 + d_dftParamsPtr->spinPolarized) * d_kPointWeights.size(),
113-
dataTypes::number(0.0));
114-
}
115117
}
116118

117119
pcout << std::endl

src/dft/psiInitialGuess.cc

+7-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ namespace dftfe
5353
//
5454
char psiFile[256];
5555

56-
if (d_dftParamsPtr->isPseudopotential)
56+
if (d_dftParamsPtr->isPseudopotential && d_dftParamsPtr->pseudoTestsFlag)
5757
// if(d_dftParamsPtr->pseudoProjector==2)
5858
// sprintf(psiFile,
5959
// "%s/data/electronicStructure/pseudoPotential/z%u/oncv/singleAtomData/psi%u%u.inp",
@@ -65,7 +65,12 @@ namespace dftfe
6565
Z,
6666
n,
6767
l);
68-
68+
else if (d_dftParamsPtr->isPseudopotential &&
69+
!d_dftParamsPtr->pseudoTestsFlag)
70+
strcpy(psiFile,
71+
(d_dftfeScratchFolderName + "/z" + std::to_string(Z) + "/" +
72+
"psi" + std::to_string(n) + std::to_string(l) + ".inp")
73+
.c_str());
6974
else
7075
sprintf(
7176
psiFile,

utils/dftParameters.cc

+4-1
Original file line numberDiff line numberDiff line change
@@ -1260,7 +1260,7 @@ namespace dftfe
12601260
useMixedPrecXTHXSpectrumSplit = false;
12611261
useMixedPrecSubspaceRotRR = false;
12621262
useMixedPrecCommunOnlyXTHXCGSO = false;
1263-
spectrumSplitStartingScfIter = 1;
1263+
spectrumSplitStartingScfIter = 0;
12641264
useELPA = false;
12651265
constraintsParallelCheck = true;
12661266
createConstraintsFromSerialDofhandler = true;
@@ -2013,6 +2013,9 @@ namespace dftfe
20132013
{
20142014
spinMixingEnhancementFactor = 1.0;
20152015
}
2016+
2017+
if (numCoreWfcRR == 0)
2018+
spectrumSplitStartingScfIter = 10000;
20162019
}
20172020

20182021

0 commit comments

Comments
 (0)