First steps with band structure workchain

281 views
Skip to first unread message

Ignacio Martin Alliati

unread,
Apr 27, 2021, 8:15:28 AM4/27/21
to aiidausers
Dear all,

I am completely new to aiida and I'm trying to follow the tutorials on readthedocs.
In particular, I get an error in the tutorial on band structure workchains.

Please find attached my "submission script" (verdirun.sh).

When I do
$ verdi run verdirun.sh

and I get

ValueError: Node with UUID 17cbae53-b585-4f9b-8c4d-332b4cd597bf is not a UpfData

However, if I test whether I have the PP with QueryBuilder(), as indicated in the tutorial, I get "1", i.e., I have the PP.

This is probably very basic, but I can't seem to get it right. Any help?

Please find attached the full error as well.

Thanks in advance,

Ignacio.


verdirun.sh
error.txt

Marnik Bercx

unread,
Apr 27, 2021, 8:30:33 AM4/27/21
to aiida...@googlegroups.com
Hi Ignacio, 👋

Did you by any chance install the pseudos with `aiida-pseudo`? The `PwBandStructureWorkChain` used in last year's tutorial is a bit outdated and uses methods that have been deprecated, which don't support the `aiida-pseudo` pseudos. Still, I'll look into fixing this temporarily until the work chain is removed from the `aiida-quantumespresso` plugin.

You can find a more recent tutorial on running a band structure workflow with AiiDA here:


Have a look and let me know if you run into any more issues, or if you have any questions!

Best,
Marnik

--
AiiDA is supported by the NCCR MARVEL (http://nccr-marvel.ch/), funded by the Swiss National Science Foundation, and by the European H2020 MaX Centre of Excellence (http://www.max-centre.eu/).
 
Before posting your first question, please see the posting guidelines at http://www.aiida.net/?page_id=356 .
---
You received this message because you are subscribed to the Google Groups "aiidausers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aiidausers+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/aiidausers/c6512880-a335-4ade-bf11-586460f36488n%40googlegroups.com.
<verdirun.sh><error.txt>

Ignacio Martin Alliati

unread,
Apr 28, 2021, 5:18:09 AM4/28/21
to aiidausers
Hi Marnik,

Thank you very much for you response.
Apologies for the delay but I wasn't able to look into it yesterday.

I tried the new link and it worked brilliantly! I do have some more questions, if you don't mind.

What I'd like to know now is how to edit some of the feature of these calculations. For example. I use an HPC resource for this, but I noticed that the workchain submitted jobs on one core. In my previous tests (single calculations), I would always use options like:

  1. builder.metadata.options.queue_name="main"
  2. builder.metadata.options.resources={'tot_num_mpiprocs': 112}
  3. builder.metadata.computer = code.get_remote_computer()
  4. builder.metadata.options.max_wallclock_seconds = 60*10

Is it possible to pass that to the workchain?

Also, if I wanted to use a different set of pseudos, or change some of the QE parameters (cutoffs, thresholds, add +U, etc). Is there a way to pass that to the protocol? Or should I get into editing the workchain itself?
I guess what I don't understand is whether the workchain is just an example and I should develop my own, or if it's meant to be used as is and thus would admit some input parameters to be passed onto it.


Thanks again for your help, greatly appreciated.
Regards,
Ignacio.
------------------------
PhD student, 
Maths and Physics, 
Queen's University Belfast.


Sebastiaan Huber

unread,
Apr 28, 2021, 7:24:26 AM4/28/21
to aiida...@googlegroups.com
Hi Ignacio,

Whether you can change the options of the calculation that a workchain runs, depends on whether that workchain "exposes" those inputs (see this section in the documentation for an explanation on what that means).
For the workchains of `aiida-quantumespresso`, which you ran in that tutorial, this is the case and so you can in principle change these inputs without having to change the workchain code.
How you change them, depends a bit on the workchain, however.

As an example, let's start with the simplest example of the `PwBaseWorkChain` (quantumespresso.pw.base) which simply wraps a `PwCalculation`.
You can change the inputs as follows:
PwBaseWorkChain = WorkflowFactory('quantumespresso.pw.base')
builder = PwBaseWorkChain.get_builder_from_protocol(code, structure)
builder.pw.metadata.options.queue_name = 'main'
Note that the inputs for the calculation are "nested" in the "namespace" called "pw".
This is not an AiiDA wide thing, but a choice made by the `PwBaseWorkChain` implementation to name that namespace "pw".
In another workchain, for example the `PwRelaxWorkChain`, the namespaces most likely are different.
In fact, the `PwRelaxWorkChain` wraps the `PwBaseWorkChain` but does so by exposing the inputs and so you can still change the inputs as you like:
PwRelaxWorkChain = WorkflowFactory('quantumespresso.pw.relax')
builder = PwRelaxWorkChain.get_builder_from_protocol(code, structure)
builder.base.pw.metadata.options.queue_name = 'main'
Note that here though, the inputs are just in a namespace `builder.base.pw` that is another level deeper.
The pseudos and the parameters are located here:
builder.base.pw.parameters = Dict(dict={})
builder.base.pw.pseudos = {}
For now there is not a super easy way of knowing where these inputs are located, other than to look in the source code of the workchain and see in the `define` method how the inputs are defined and structured.
There is the command `verdi plugin list aiida.workflows` which will give you an overview of what inputs are available, but it doesn't show all nested inputs yet.
To give an idea what the output looks like:

(aiida_dev) sph@citadel:~/code/aiida/env/dev/aiida-core$ verdi plugin list aiida.workflows quantumespresso.pw.relax
Description:

    Workchain to relax a structure using Quantum ESPRESSO pw.x.

Inputs:
                             base:  required                   Inputs for the `PwBaseWorkChain` for the main relax loop.
                        structure:  required  StructureData    The inputs structure.
                   base_final_scf:  optional                   Inputs for the `PwBaseWorkChain` for the final scf.
                    clean_workdir:  optional  Bool             If `True`, work directories of all called calculation will be cleaned at th ...
                        final_scf:  optional  Bool             If `True`, a final SCF calculation will be performed on the successfully re ...
  max_meta_convergence_iterations:  optional  Int              The maximum number of variable cell relax iterations in the meta convergenc ...
                 meta_convergence:  optional  Bool             If `True` the workchain will perform a meta-convergence on the cell volume.
                         metadata:  optional                  
                relaxation_scheme:  optional  Str              The relaxation scheme to use: choose either `relax` or `vc-relax` for varia ...
               volume_convergence:  optional  Float            The volume difference threshold between two consecutive meta convergence it ...

So you can get an idea of what inputs are where but it is not complete.

Hope that helps,

Sebastiaan

Ignacio Martin Alliati

unread,
Apr 28, 2021, 10:40:04 AM4/28/21
to aiidausers
Hi Sebastiaan,

Thank you so much for such a detailed explanation.
It is clear now, I was not including the proper 'namespace'.
I'll give it a try and let you know.

Regards,
Ignacio.
------------------------------------
Ignacio Martin Alliati
PhD student
Maths and Physics
Queen's University Belfast

Ignacio Martin Alliati

unread,
May 5, 2021, 6:52:19 AM5/5/21
to aiidausers
Hi Sebastiaan,

Thanks again for your help - what you proposed worked nicely. 
The only caveat was that at some point in the 'nesting' I had to turn to dictionaries, e.g.

builder.relax['base']['pw']['metadata']['options']['queue_name']='main'
instead of 
builder.base.pw.metadata.options.queue_name = 'main'

I'd like to ask you another question, if you don't mind.

As I said, I was able to run the WorkChain in a small local cluster that uses Torque. However, I am now having some problems when moving to another cluster that uses SGE. 
I can successfully run single calculations in either cluster, tailoring the metadata options to each scheduler. Thus, for the WorkChain, I've adapted the metadata options in the same way I did for single calculations, but this didn't work.
  1. For single calculations, the following works in the SGE cluster:  builder.metadata.options.resources={'parallel_env': 'mpi', 'tot_num_mpiprocs': 40}
  2. I tried something similar for the WorkChain (please see verdirun_young_mnps3.py), but without success. Apparently, the PwBaseWorkChain has 'num_machines'=1 by default, and it stops when validating this input as it says 'num_machines' is not valid for the SgeScheduler (please see error_1.txt).
  3. If I try to remove that 'num_machines' key with .pop('num_machines'), the workchain doesn't run because 'num_machines' and 'max_wallclock_seconds' must be specified (please see error_2.txt).
Do you have any suggestions to circumvent this error?

Thanks in advance,
Ignacio.
-------------------------------
Ignacio Martin Alliati
PhD student
Maths and Physics
Queen's University Belfast

verdirun_young_mnps3.py
error_1.txt
error_2.txt

Sebastiaan Huber

unread,
May 5, 2021, 9:26:12 AM5/5/21
to aiida...@googlegroups.com
Hi Ignacio,

Thanks a lot for the detailed report.
You have uncovered a bug in the `PwBaseWorkChain` and have opened an issue for it on the repository: https://github.com/aiidateam/aiida-quantumespresso/issues/682
The issue explains what the problem is and why it is there and how it can be fixed.
I will be submitting a fix and hopefully we can release a new patch version with the fix soon.
Feel free to respond to the issue on github such that you are notified when I merge the fix, you can then test it by checking out the develop branch of the repo.

HTH,

SPH

Ignacio Martin Alliati

unread,
May 5, 2021, 2:31:54 PM5/5/21
to aiida...@googlegroups.com
Hi Sebastiaan,

Many thanks for opening the issue on github - I'll keep an eye on it.
As you said there, a quick editing of base.py did the trick for now:

        #   if num_machines is None or max_wallclock_seconds is None:

            if max_wallclock_seconds is None:


Or at least, the first relaxation of the PwBandsWorkChain got submitted to the cluster. We'll see how it progresses.

Regards,
Ignacio.

__________________________
Ignacio Martin Alliati
PhD student
Maths and Physics
Queen's University Belfast

You received this message because you are subscribed to a topic in the Google Groups "aiidausers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/aiidausers/TlRN54vCgQ4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to aiidausers+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/aiidausers/b566fff0-9297-c6fd-3cd4-006949ef9cc3%40epfl.ch.
Reply all
Reply to author
Forward
0 new messages