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 should_run_scf for PwBandsWorkChain #1016

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

superstar54
Copy link
Member

@superstar54 superstar54 commented Mar 19, 2024

This PR sets the scf step as an option in the PwBandsWorkChain.

Use case:

@superstar54 superstar54 changed the title add should_run_scf for PwBandsorkchain add should_run_scf for PwBandsWorkChain Mar 19, 2024
@superstar54 superstar54 requested a review from mbercx March 19, 2024 15:22
Copy link
Contributor

@sphuber sphuber left a comment

Choose a reason for hiding this comment

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

Thanks @superstar54 . Does this currently actually work? I believe if you skip the SCF step, then there won't be a parent_folder as input to the bands step, and the user also cannot specify it in the inputs since it is excluded. Besides that, as @mbercx mentioned during the meeting, if we strip out the SCF step, it is not much of a workflow anymore. If the user already has an SCF completed and wants the band structure, wouldn't they just be better off running a PwBaseWorkChain specifying the input parameters themselves? Using the get_builder_from_protocol they can get all inputs preset and then just switch the calculation to bands. The logic in PwBandsWorkChain specific to the bands is not very intricate anyway, it is just to define the total number of bands, which is just based on a top-level user input anyway.

Comment on lines +274 to +276
# override the parent_folder if the scf was run
if 'scf' in self.inputs:
inputs.pw.parent_folder = self.ctx.current_folder
Copy link
Contributor

Choose a reason for hiding this comment

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

How would the parent_folder be defined though? It is excluded from the bands input namespace, and if scf is skipped this will therefore not be set?

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for pointing out this. I didn't notice that the parent_folder is excluded. I run a simple example with Si by setting the parent_folder, it's strange that no error is reported, and the process finished successfully! Here is the process detail:

$ verdi process show 28038
Property     Value
-----------  ------------------------------------
type         PwBandsWorkChain
state        Finished [0]
pk           28038
uuid         94b2d315-6a72-4f73-ae87-5a3b50d86d07
label
description
ctime        2024-03-21 15:34:17.077194+00:00
mtime        2024-03-21 15:34:24.276367+00:00

Inputs                  PK     Type
----------------------  -----  -------------
bands
    pw
        code            216    InstalledCode
        pseudos
            Si          19     UpfData
        parameters      28034  Dict
        parent_folder   28029  RemoteData
    max_iterations      28035  Int
bands_kpoints_distance  28036  Float
clean_workdir           28037  Bool
structure               28020  StructureData

Outputs                 PK  Type
-------------------  -----  -------------
band_parameters      28054  Dict
band_structure       28052  BandsData
primitive_structure  28042  StructureData
seekpath_parameters  28040  Dict

Called       PK  Type
--------  -----  ---------------------------
seekpath  28039  seekpath_structure_analysis
bands     28046  PwBaseWorkChain

Log messages
---------------------------------------------
There are 3 log messages for this calculation
Run 'verdi process report 28038' to see them

You see that the parent_folder is set. Here is the node graph
Screenshot from 2024-03-21 16-50-37

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