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

Add JDFTx jobs.py to run JDFTx using atomate2/jobflow #349

Merged
merged 15 commits into from
Oct 23, 2024

Conversation

soge8904
Copy link
Contributor

Summary

Hi,
This PR is to add jobs.py for JDFTx. We have a draft PR open on atomate2 to integrate JDFTx, but it seems that this script belongs here. Jobs.py was created using the CP2K template, with only the basic functionalities for now (just enough to run a job).

Todos

If this is work in progress, what else needs to be done?

  • feature 2: ...
  • fix 2:

Checklist

  • Google format doc strings added. Check with ruff.
  • Type annotations included. Check with mypy.
  • Tests added for new features/fixes.
  • If applicable, new classes/functions/modules have duecredit @due.dcite decorators to reference relevant papers by DOI (example)

Tip: Install pre-commit hooks to auto-check types and linting before every commit:

pip install -U pre-commit
pre-commit install

Copy link
Member

@computron computron left a comment

Choose a reason for hiding this comment

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

Added some comments.

Also missing are unit tests for JDFTx (see "tests" module). Don't think this can be merged in without tests.

stderr_file="std_err.txt",
) -> None:
"""
This constructor is necessarily complex due to the need for
Copy link
Member

Choose a reason for hiding this comment

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

I think you can remove the note about the constructor being "complex", it doesn't seem to be complex. I believe this note is copy-pasted from another constructor that is complex

):
# use line buffering for stderr
return subprocess.run(
cmd.split(),
Copy link
Member

Choose a reason for hiding this comment

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

should prefer shlex.split()

for cmd in self.jdftx_cmd:
if "jdftx" in cmd:
try:
os.system(f"killall {cmd}")
Copy link
Member

Choose a reason for hiding this comment

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

See implementation of terminate() in VASP job to avoid killing all JDFTx processes when possible

@soge8904
Copy link
Contributor Author

Hi,
Checking in on this!

@computron
Copy link
Member

@shyuep this looks ready from my side. I didn't check the tests in detail but rather just confirmed that they were there.

Any issues with merging?

@shyuep
Copy link
Member

shyuep commented Oct 23, 2024

@computron I don't have a problem with this, but I am puzzled why this is needed since there are no error handlers?

@soge8904
Copy link
Contributor Author

@shyuep I wrote the atomate2 scripts using Custodian to run the processes to keep things consistent with the other codes. I'm working on the handlers and will add them once they're ready and I start running calculations using the workflows.

@shyuep shyuep merged commit f47d74b into materialsproject:master Oct 23, 2024
8 checks passed
@shyuep
Copy link
Member

shyuep commented Oct 23, 2024

MErged

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.

3 participants