Skip to content

QuantumEspresso: Parsing of additional compilation parameters#1760

Closed
Danzelot wants to merge 9 commits intoeasybuilders:developfrom
Danzelot:quantumespresso_parameters
Closed

QuantumEspresso: Parsing of additional compilation parameters#1760
Danzelot wants to merge 9 commits intoeasybuilders:developfrom
Danzelot:quantumespresso_parameters

Conversation

@Danzelot
Copy link

@Danzelot Danzelot commented Jun 25, 2019

Adds the ability to specify compilation parameters in the easyconfig file which so far had to be changed laboriously in the source files.
These compilation parameters are specified in the QuantumEspresso user manual in section 2.5

To test it you have to specify one or multiple of the parameters in the easyconfig. Is there a way to write a test case?

PS: This is my first trail in modifying a easyblock but I think it might be useful for other users.

Copy link
Member

@boegel boegel left a comment

Choose a reason for hiding this comment

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

Thank you very much for your contribution, really appreciate your effort!

Let's try and get rid of the code style issues first?

Copy link
Member

@boegel boegel left a comment

Choose a reason for hiding this comment

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

This can be cleaned up a bit by only doing a single call to apply_regex_substitutions, since for each of these the same file is being patched.

Something like:

regex_subs = []
if self.cfg['ntypx']:
    regex_subs.append((r"ntypx\s*=\s*\d+", r"ntypx = %s" % self.cfg['ntypx']))
if self.cfg['nsx']:
    regex_subs.append(...)
...

apply_regex_substitutions(os.path.join('Modules', 'parameters.f90'), regex_subs)

@boegel boegel added this to the 3.x milestone Jun 25, 2019
@Danzelot
Copy link
Author

Thank you for the suggestions.
I fixed both issues.

@Danzelot
Copy link
Author

Danzelot commented Jun 26, 2019

I noticed that I get a compilation error when I try to change nsx to 30. q-e_building.log
I will have a look if I can fix that.

SOLVED: I noticed that ntypx should be equal or higher than nsx. So I set both to 30 and the compilation run without problems.


# patch Modules/parameter.f90 file to set compilation parameters
regex_para = []
for key in ['lmaxx', 'lqmax', 'npk', 'nsx', 'ntypx']:
Copy link
Contributor

Choose a reason for hiding this comment

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

Since we have to have ntypx >= nsx it might be worth the effort to check that it is indeed the case.
I.e., start by picking up both from parameters.f90 then verify the requirement using cfg[key].
And you need to pick up the values from parameters in case someone sets only one of them in the easyconfig file.

@akesandgren
Copy link
Contributor

@Danzelot Any progress on this?

@boegel boegel modified the milestones: 3.x, 4.x Feb 20, 2020
@ocaisa
Copy link
Member

ocaisa commented Apr 5, 2024

Since we're moving to a whole new CMake-based easyblock for QE in #3257, this PR is being closed

@ocaisa ocaisa closed this Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants