Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create dft_interface module to interface with multiple DFT software. #61

Merged
merged 34 commits into from
Sep 26, 2019

Conversation

nw13slx
Copy link
Collaborator

@nw13slx nw13slx commented Sep 20, 2019

a new modeul "dft_interface" is set up in to allow a choice of software in OTF training.

  1. user can specify DFT software by setting dft_softwarename="qe", or "cp2k" in the OTF init function.
  2. generic interface available for any future DFT interfaces
  3. all function names in qe_util.py are changed to be more generic. Instead of "xx_pw_" and "xx_espresso_", the functions are all named as "xx_dft_"
  4. all predict functions in OTF.py is removed. now they only rely on the functions in predict.py
  5. the function argument for predict_on_atom is shrink to one tuple argument. so that it can be executed with multiple threads
  6. new unit tests for parallel OTF run with QE and CP2K are added.

closes #56 closes #14

This interface should make it much easier to have pymatgen and ase parser as mentioned in #19

@codecov-io
Copy link

codecov-io commented Sep 20, 2019

Codecov Report

Merging #61 into master will increase coverage by 6.23%.
The diff coverage is 94.05%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #61      +/-   ##
=========================================
+ Coverage   46.96%   53.2%   +6.23%     
=========================================
  Files          37      43       +6     
  Lines        5636    6242     +606     
=========================================
+ Hits         2647    3321     +674     
+ Misses       2989    2921      -68
Impacted Files Coverage Δ
tests/test_OTF_qe.py 98.24% <100%> (ø)
flare/dft_interface/__init__.py 100% <100%> (ø)
tests/test_qe_util.py 97.95% <100%> (ø) ⬆️
flare/predict.py 72.97% <75%> (+45.19%) ⬆️
flare/dft_interface/qe_util.py 76.62% <76.19%> (ø)
flare/otf.py 93.75% <85.71%> (+19.27%) ⬆️
flare/dft_interface/cp2k_util.py 92.56% <92.56%> (ø)
tests/test_OTF_cp2k_par.py 96.96% <96.96%> (ø)
tests/test_OTF_qe_par.py 97.22% <97.22%> (ø)
tests/test_cp2k_util.py 97.91% <97.91%> (ø)
... and 15 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 27ab10b...31e8e20. Read the comment docs.

@nw13slx
Copy link
Collaborator Author

nw13slx commented Sep 20, 2019

@anjohan Could you please help checking out how to install CP2K-6 in the Travis virtual machine properly? The Ubuntu16 LST repo only has CP2K-2...

@anjohan anjohan self-assigned this Sep 20, 2019
Copy link
Collaborator

@jonpvandermause jonpvandermause left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice! I think we can now close #14, #17, and #56.

flare/otf.py Outdated
# force, var = self.gp.predict(chemenv, i + 1)
# self.structure.forces[n][i] = float(force)
# self.structure.stds[n][i] = np.sqrt(np.abs(var))
# self.local_energies[n] = self.gp.predict_local_energy(chemenv)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can just delete these lines. Good riddance!

otf.run()
os.system('mkdir test_outputs')
os.system('mv h2_otf_qe_par* test_outputs')
cleanup_espresso_run()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great idea to add tests of parallel OTF.

@jonpvandermause jonpvandermause merged commit 8a056ad into master Sep 26, 2019
@jonpvandermause jonpvandermause deleted the dft_interface branch September 26, 2019 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

flexible interface for DFT call Predict methods in OTF should be moved outside of class
4 participants