Feature: support list input parse and multiple values for bessel_nao_rcut#3454
Merged
kirk0830 merged 6 commits intodeepmodeling:developfrom Jan 10, 2024
Merged
Feature: support list input parse and multiple values for bessel_nao_rcut#3454kirk0830 merged 6 commits intodeepmodeling:developfrom
bessel_nao_rcut#3454kirk0830 merged 6 commits intodeepmodeling:developfrom
Conversation
jinzx10
reviewed
Jan 9, 2024
YuLiu98
approved these changes
Jan 10, 2024
WHUweiqingzhou
approved these changes
Jan 10, 2024
Collaborator
WHUweiqingzhou
left a comment
There was a problem hiding this comment.
This PR offers a new function Input::read_value2stdvector to read a vector<T> from one line. For heterogeneous vector, you can use string first, and cast which type you want.
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Feature
Present implementation
Under project of ABACUS Pseudopot-Nao Square (APNS), for quick generation of numerical orbitals and corresponding quick tests in batch, the orbital generation procedure needs to be fast as much as possible. I find present workflow of orbital generation will run identical SCF (differs only with
bessel_nao_rcut) for times as many asrcutrequested by user. Therefore I make ABACUS support mutiple values ofbessel_nao_rcut.For example, If only one value is given to keyword
bessel_nao_rcutinINPUT:One can still find the overlap matrices calculated and named in original way:
If four values given, which means in
INPUTit is:Then stdout wil be like:
One can find four groups of files in
OUT.${suffix}:For python-end the PTG_dpsi, I will submit PR to repo ABACUS-orbitals: https://github.com/abacusmodeling/ABACUS-orbitals
Future heterogeneous container demand
Present implementation suggests use
std::vector<std::string>to get value from input, then cast values one-by-one and case-by-case to values in datatype required.Reminder
Linked Issue
Fix #3334
What's changed?
template <typename T> read_value2stdvector(std::ifstream& ifs, std::vector<T>& var)in module_io/input, Input class, along with two instantiation forintanddouble.std::vector<double> bessel_nao_rcutsbessel_nao_rcut, save the first value toINPUT.bessel_nao_rcutand all values toINPUT.bessel_nao_rcutsbyread_value2stdvector.OVERLAP_QandOVERLAP_Sbynumerical basisinstance inesolver_ks_pw.cpp.bessel_nao_rcutAny changes of core modules? (ignore if not applicable)