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 configuration file #84

Merged
merged 12 commits into from
Dec 3, 2024
Merged

Add configuration file #84

merged 12 commits into from
Dec 3, 2024

Conversation

alchem0x2A
Copy link
Collaborator

@alchem0x2A alchem0x2A commented Dec 1, 2024

This PR adds support for the configuration file ~/.config/ase/config.ini to include a sparc section

An example of the ini section may be

[sparc]
; `command`: full shell command (include MPI directives) to run SPARC
command = srun -n 24 path/to/sparc

; `pp_path`: directory containing pseudopotential files (optional)
pp_path = path/to/SPARC/psps

; `doc_path`: directory for SPARC LaTeX documentation to build JSON schema on the fly (optional)
doc_path = path/to/SPARC/doc/.LaTeX/

where the configurations can be used for SPARC calculator, sparc.io, and JSON API modules

@ltimmerman3 @ajmedford please take a look if the proposed keywords in sparc configure section makes sense to you

SPARC command

Equivalent to ASE_SPARC_COMMAND

command = srun -n 24 path/to/sparc 

or mix of mpi prefix and sparc binary path

sparc_exe = path/to/sparc
mpi_prefix = srun -n 24 --more-flags

The latter is more straightforward (although not cannonical ASE), and may benefit issues like #46, but I don't know if the keywords will be meaningful in the longrun

Defining custom schema

Either specify the path to LaTeX doc (equivalent to ASE_DOC_PATH)

doc_path = ~/dev_SPARC/doc/.LaTeX

or specify the path to a custom json schema

json_schema = ~/dev_SPARC/parameters.json

Psp location

Through psp_path (equivalent to SPARC_PSP_PATH)

psp_path = ~/dev_SPARC/psps

@alchem0x2A
Copy link
Collaborator Author

This is a quick implementation of #48 using the ase.config module. Although we could restructure the current logic using the newly-introduced Profile class in ASE, I personally the major migration to ASE 3.23 can be regarded as done after this PR

@alchem0x2A alchem0x2A merged commit 0731ca6 into SPARC-X:master Dec 3, 2024
5 checks passed
@ltimmerman3
Copy link
Collaborator

I think run_command would be clearer than command Otherwise it all looks good

@alchem0x2A
Copy link
Collaborator Author

@ltimmerman3 yeah the command argument is indeed a bit misleading but the default parameter the new FileIOCalculator looks for in the config files https://gitlab.com/ase/ase/-/blob/master/ase/calculators/calculator.py#L1145. I would say let's see how end-users' feedback will be, as long as we keep the comments in the example config files shown in the documentation

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.

2 participants