aiida-vibroscopy

19 views
Skip to first unread message

Rijan Karkee

unread,
Feb 6, 2024, 3:07:17 AMFeb 6
to aiidausers
Dear Developers,

I am a new user to AiiDA.  I want to use aiida-vibroscopy. I have never been to live workshop and I have been following tutorial available on website. 

I have installed it in HPC and verdi status looks like, I hope this is ready to use.
(aiidaENV) rkarkee@ch-fe1:~> verdi status
 ✔ version:     AiiDA v2.5.1
 ✔ config:      /users/rkarkee/.aiida
 ✔ profile:     rkarkee
 ✔ storage:     Storage for 'rkarkee' [open] @ postgresql://aiida_qs_rkarkee_20554bcc4bead70a3479c4ef8d5f1f4e:***@localhost:5432/rkarkee_rkarkee_20554bcc4bead70a3479c4ef8d5f1f4e / DiskObjectStoreRepository: 7ef673c3acf444d2ac6ff9f6c839a15f | /users/rkarkee/.aiida/repository/rkarkee/container
 ✔ rabbitmq:    Connected to RabbitMQ v3.8.14 as amqp://guest:gu...@127.0.0.1:5672?heartbeat=600
 ✔ daemon:      Daemon is running with PID 196463
(aiidaENV) rkarkee@ch-fe1:~>

My first question is how do I submit job in HPC cluster for AiiDA? 
For example, whenever I run pw.x in HPC, I have the following job script. How do I run AiiDA in a job script? 
Is it like I need to create a python file and run it inside the job script?


#!/bin/bash
#SBATCH --time=6:30:00   # walltime
#SBATCH --nodes=1   # number of nodes
#SBATCH --ntasks-per-node=256   # number of tasks per node
#SBATCH --job-name=HfTe5   # job name
#SBATCH --partition=standard   # partition name
#SBATCH --no-requeue   # do not requeue when preempted and on node failure
#SBATCH --signal=30@20  # send signal to job at [seconds] before end
module swap PrgEnv-cray PrgEnv-intel
module load cmake

#srun -n 256   /users/rkarkee/q-e-qe-7.3/bin/pw.x -pd .true.    < scf.in &> scf.out


And how can I create a python file for the following pw.x input (scf.in)?
I want to use pseudopotential from /lustre/scratch4/turquoise/rkarkee/pbe_pseudo



&CONTROL
    calculation = 'scf'
    pseudo_dir  = '/lustre/scratch4/turquoise/rkarkee/pbe_pseudo'
        outdir       = './'
        prefix = 'scf'
        tprnfor = .true.
    tstress = .true.
   wf_collect=.true.
/
&SYSTEM
    ecutwfc     =  70,
    ibrav       = 0,
    nat         = 12,
    ntyp        = 2,
    lspinorb=.true.
noncolin = .true.
  vdw_corr='Grimme-D2'

/
&ELECTRONS
    conv_thr         =  1.00000e-10
    electron_maxstep = 200
    mixing_beta      =  0.2
    diagonalization  = "david"
/
K_POINTS {automatic}
4 4 2  1 1 1
ATOMIC_SPECIES
Hf     178.49  Hf.upf
Te      127.60  Te.upf
CELL_PARAMETERS (angstrom)
 1.98619742   7.132231003  0.
 -1.986197815  7.132230891  0.
  0.           0.          13.586526936

ATOMIC_POSITIONS (crystal)
Hf            0.3184997032        0.3184997302        0.7499999470
Hf            0.6815000238        0.6815000678        0.2499999640
Te            0.6625100716        0.6625100596        0.7499999470
Te            0.3374897664        0.3374897594        0.2499999640
Te            0.9351348779        0.9351349339        0.8531524632
Te            0.0648648561        0.0648648571        0.3531525342
Te            0.9351348779        0.9351349339        0.6468473588
Te            0.0648648561        0.0648648571        0.1468474118
Te            0.7919052147        0.7919052377        0.4336792513
Te            0.2080945513        0.2080945543        0.9336791443
Te            0.7919052147        0.7919052377        0.0663207087
Te            0.2080945513        0.2080945543        0.5663206417


Lorenzo Bastonero

unread,
Feb 6, 2024, 12:25:02 PMFeb 6
to aiidausers
Dear Rijan,

Thanks a lot for the interest in using AiiDA and aiida-vibroscopy.

There is also this other tutorial webpage for aiida tutorials, with more extended tutorials specific to aiida-quantumespresso: https://aiida-tutorials.readthedocs.io/en/latest/sections/running_processes/index.html
So, I'd suggest you to follow this one in case you didn't find it before, as it would answer most of your questions.

In the following some pointers that may be useful after you would follow the tutorials, but then feel free to come back again for any further explanations.

- Aiida-vibroscopy uses workflows provided by aiida-quantumespresso, which handles `pw.x` workflows with error handling features - namely the `PwBaseWorkChain`. This is the one you should use. To use it, you need to define a `computer` and a `code`.

- The  `computer`, which in you case would be your HPC, contains info regarding how to connect to that computer (e.g. ssh info, host name, etc). Please have a look here for a more details: https://aiida.readthedocs.io/projects/aiida-core/en/latest/howto/run_codes.html#computer-setup
You should achieve this with the following yaml file (save it as e.g. `computer.yaml`):
```
label: hpc # PLEASE CHANGE HERE AS YOU WISH
description: A DESCRIPTION # PLEASE CHANGE HERE AS YOU WISH
hostname: <PLEASE ADD HOSTNAME> # for example lumi.csc.fi for LUMI-G supercomputer; in your case it can also be a resolved address like 111.222.33.44
transport: core.ssh
scheduler: core.slurm
work_dir: "/scratch/path/to/my_aiida_runs/" # PLEASE CHANGE HERE AS YOU WISH
mpirun_command: "srun -n {tot_num_mpiprocs}" # leave it like this, so that `{tot_num_mpiprocs}` can be changed dynamically, e.g. in case you have other partitions on the same cluster
mpiprocs_per_machine: 256 # your default number of mpiprocs on the default partition
```
And then from the console:
```
verdi computer setup --config computer.yaml
```
Verify it work via 
```
verdi computer test hpc
```

- Second, you have to create a `code`, which instead contains the information regarding the code only itself _on a specific `computer`_, e.g. how to load the needed modules before the execution, where is the binary, etc. Please have a look here instead for how to set up a code on top of a computer: https://aiida.readthedocs.io/projects/aiida-core/en/latest/howto/run_codes.html#how-to-create-a-code
You should achieve this with the following yaml file (save it as e.g. `code.yaml`):
```
label: 'qe-7.3'
description: 'quantum_espresso v7.3'
default_calc_job_plugin: 'quantumespresso.pw'
filepath_executable: '/users/rkarkee/q-e-qe-7.3/bin/pw.x'
computer: 'hpc'
prepend_text: |

    module swap PrgEnv-cray PrgEnv-intel
    module load cmake
append_text: ' '
```
And then install it in AiiDA:
```
verdi code create core.code.installed --config code.yaml
```

You should obtain after these steps a code, in this example it would be called `pw-7.3@hpc`. You can verify you have your code using `verdi code list`. The preparation of sbatch script, input file, parsing etc is all done by AiiDA, so you don't have to worry anymore about all these details. You just need to specify the code `pw-7.3@hpc`.
 
Once you have this code, then all the other info regarding the scheduler would come later. In AiiDA, these information (e.g. walltime, number of nodes, ...) are passed to the `CalcJob` (in this case `PwCalculation`) via the `metadata.options` namespace. In your case, this can be achieved by specifying in the `PwBaseWorkChain` the `metadata.options` for the `PwCalculation`. If you are familiar with the builder, then you would have something like the following:
```
from aiida_quantumespresso.workflows.pw.base import PwBaseWorkChain
builder = PwBaseWorkChain.get_builder()
builder.pw.metadata.options = {
  'resources': {'num_machines':1, 'num_mpiprocs_per_machine': 256, 'num_cores_per_mpiproc': 1},
  'max_wallclock_seconds': 43200, # walltime in seconds
  'queue_name': 'standard',
}
```
The code would be specified via:
```
from aiida.orm import *
builder.pw.code = load_code('pw-7.3@hpc')
```

- For specific pw parallelization options, these are specified in the settings:
```
builder.pw.settings = Dict({'cmdline':['-pd', '.true.', '-nk', '4']}) # mind that everything should be a string, even numbers!
```

- For the structure, you need to create a `StructureData` instance. A possible way would be to use:
```
from aiida import load_profile
load_profile()

from ase.io import read
from aiida.orm import *

atoms = read('/path/to/input.pwi') # here I mean the QE pw.x input you just showed
structure = StructureData(ase=atoms)
structure.store()
```
This last step would print a number (the "PK"); save it somewhere so you can load again the structure information. For instance, in this way:
```
from aiida import load_profile
load_profile()

from aiida.orm import *

structure = load_node(PK) # PK is an integer number
```

- The pseudopotentials in AiiDA are not taken from some folder in the HPC, instead they are each time loaded ("copy/pasted") on the `computer`. As such, you can define a group where you store (in AiiDA) all you pseudos, like if you had them in a folder. Please, have a look here: https://aiida-pseudo.readthedocs.io/en/latest/howto.html#installing-from-archive-or-folder
For instance:
```
aiida-pseudo install family /path/to/pseudo_folder/ MyPseudos -P pseudo.upf
```
Then you would load the pseudos from you structure as follows:
```
from aiida.orm import *

structure = load_node(PK)
pseudo_family = load_group('MyPseudos')
pseudos = pseudo_family.get_pseudos(structure=structure)

builder = PwBaseWorkChain.get_builder()
builder.pw.structure = structure
builder.pw.pseudos = pseudos
```

A possible final python script would be:
```
from aiida import load_profile
from aiida.orm import *
from aiida.engine import submit

load_profile()

builder = PwBaseWorkChain.get_builder()

structure = load_node(PK)
code = load_code('pw-7.3@hpc')
pseudo_family = load_group('MyPseudos')
pseudos = pseudo_family.get_pseudos(structure=structure)
kpoints = KpointsData()
kpoints.set_kpoints_mesh([4,4,2],[0.5,0.5,0.5])

settings = {'cmdline':['-pd', '.true.', '-nk', '4']}
parameters = { # note: prefix, pseudos, and others are controlled by the plugin automatically!
  'CONTROL': {
    'tprnfor': True,
    'tstress': True,
  },
  'SYSTEM': { # note: ibrav, nat, ntyp are controlled by the plugin automatically!
    'ecutwfc': 70,
    'lspinorb': True,
    'noncolin': True,
    'vdw_corr': 'Grimme-D2',
  },
  'ELECTRONS': {
    'conv_thr': 1.0e-10
    'electron_maxstep': 200,
    'mixing_beta':  0.2,
    'diagonalization': 'david',
  },
}

builder.clean_workdir = Bool(False) # whether to remove the work directory after the run is finished
builder.kpoints = kpoints
builder.pw.structure = structure
builder.pw.pseudos = pseudos
builder.pw.code = code
builder.pw.parameters = Dict(parameters)
builder.pw.settings = Dict(settings)
builder.pw.metadata.options = {
  'resources': {'num_machines':1, 'num_mpiprocs_per_machine': 256, 'num_cores_per_mpiproc': 1},
  'max_wallclock_seconds': 43200, # walltime in seconds
  'queue_name': 'standard',
}

calc = submit(builder) # submit to aiida and run the workflow!

print(f'Launched a PwBaseWorkChain with PK = {calc.pk}') # register the PK and save it (e.g. in the same script); after it finishes, you can inspect the outputs
```
You can launch this script by simply `python script.py`, where `script.py` is a file containing the previous lines.

This can also be done via the `get_builder_from_protocol` method, which provides an easy way to fill the builder automatically, and then overrides the inputs you need (and very useful for more complex and nested inputs of aiida-vibroscopy - for vibroscopy workflows, have a look at its docs: https://aiida-vibroscopy.readthedocs.io/en/latest/howto/overrides.html):
```
from aiida import load_profile
from aiida.orm import *
from aiida.engine import submit
from aiida_quantumespresso.common.types import ElectronicType
import yaml

load_profile()

with open('/path/to/overrides.yaml', 'r') as handle:
  overrides = yaml.safe_load(handle)

structure = load_node(PK)
code = load_code('pw-7.3@hpc')
pseudo_family = load_group('MyPseudos')
pseudos = pseudo_family.get_pseudos(structure=structure)
kpoints = KpointsData()
kpoints.set_kpoints_mesh([4,4,2],[0.5,0.5,0.5])

overrides['pw']['pseudos'] = pseudos # need to specifically override pseudos
overrides['kpoints'] = kpoints # need to specifically override kpoints

kwargs = {'electronic_type': ElectronicType.INSULATOR} # this puts fixed occupations

builder = PwBaseWorkChain.get_builder_from_protocol(code=code, structure=structure, overrides=overrides, **kwargs)

submit(builder)
print(f'Launched a PwBaseWorkChain with PK = {calc.pk}') # register the PK and save it (e.g. in the same script); after it finishes, you can inspect the outputs
```
Where `overrides.yaml` is a yaml file containing your inputs :
```
clean_workdir: False
max_iterations: 10
meta_parameters:
conv_thr_per_atom: 1.e-11 
pw:
    parameters:
        SYSTEM:
            ecutwfc: 70
            ecutrho: 280
            lspinorb: True
            noncolin: True
            vdw_corr: Grimme-D2
        ELECTRONS:          
            mixing_beta: 0.2
            electron_maxstep: 200
            diagonalization: davidson
    settings:
        cmdline: ['-pd', '.true.', '-nk', '4']
    metadata:  
        options:
            resources:
                num_machines: 1
                num_mpiprocs_per_machine: 256
            max_wallclock_seconds: 43200  # Twelve hours
            queue_name: standard
```
As you see, the script will be much shorter, and you can separate better the inputs, so it's easier to change and resubmit the calculations.

Side note: please, consider to repost the same question on the Aiida Discourse channel, now the favoured communication channel, so that also other people can see this thread, thanks!

Hope this is useful.

Lorenzo

Rijan Karkee

unread,
Feb 7, 2024, 3:40:08 PMFeb 7
to aiida...@googlegroups.com
Hi Lorenzo,

Thanks for the detailed instructions. 

I was unable to configure the computer. I followed the setup process as you suggested but it looks like it is looking for ssh. 
I am working in the home directory of HPC where I have installed AiiDA, Python etc in the home directory. So can AiiDA be run in the home directory of HPC or we install in local computer and try to run via there? Any suggestions on this?

Thanks

Best
Rijan

Creating the setup:
####################################################
(aiidaENV) rkarkee@ch-fe1:~> verdi computer setup
Report: enter ? for help.
Report: enter ! to ignore the default and set no value.
Computer label: hpc
Hostname: ch-fe.lanl.gov
Description []: LANL_HPC
Transport plugin: core.ssh
Scheduler plugin: core.slurm
Shebang line (first line of each script, starting with #!) [#!/bin/bash]: #!/bin/bash
Work directory on the computer [/scratch/{username}/aiida/]: /lustre/scratch4/turquoise/rkarkee/AiiDA
Mpirun command [mpirun -np {tot_num_mpiprocs}]: srun -n {tot_num_mpiprocs}
Default number of CPUs per machine: 256
Default amount of memory per machine (kB).:
Default amount of memory per machine (kB).: 51765
Escape CLI arguments in double quotes [y/N]: y
Success: Computer<2> hpc created
Report: Note: before the computer can be used, it has to be configured with the command:
Report:   verdi -p rkarkee computer configure core.ssh hpc
##################################################################################
Configuring the setup:
##########################################################################
(aiidaENV) rkarkee@ch-fe1:~> verdi -p rkarkee computer configure core.ssh hpc
Report: enter ? for help.
Report: enter ! to ignore the default and set no value.
User name [rkarkee]:
Port number [22]:
Look for keys [Y/n]: n
SSH key file []:
Connection timeout in s [60]:
Allow ssh agent [Y/n]: y
SSH proxy jump []:
SSH proxy command []:
Compress file transfers [Y/n]: y
GSS auth [False]:
GSS kex [False]:
GSS deleg_creds [False]:
GSS host [ch-fe.lanl.gov]:
Load system host keys [Y/n]:
Key policy (RejectPolicy, WarningPolicy, AutoAddPolicy) [RejectPolicy]:
Use login shell when executing command [Y/n]:
Connection cooldown time (s) [30.0]:
Report: Configuring computer hpc for user rka...@ucmerced.edu.
Success: hpc successfully configured for rka...@ucmerced.edu
######################################################################
Testing if it works:
#############################################################
(aiidaENV) rkarkee@ch-fe1:~> verdi computer test hpc
Report: Testing computer<hpc> for user<rka...@ucmerced.edu>...
* Opening connection... Error: Error connecting to 'ch-fe.lanl.gov' through SSH: [SshTransport] Server 'ch-fe.lanl.gov' not found in known_hosts, connect_args were: {'username': 'rkarkee', 'port': 22, 'look_for_keys': False, 'key_filename': '', 'timeout': 60, 'allow_agent': True, 'proxy_jump': '', 'proxy_command': '', 'compress': True, 'gss_auth': False, 'gss_kex': False, 'gss_deleg_creds': False, 'gss_host': 'ch-fe.lanl.gov'}
[FAILED]: Error while trying to connect to the computer
  Use the `--print-traceback` option to see the full traceback.
Warning: 1 out of 0 tests failed
##############################################

--
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 https://www.aiida.net/sections/mailing_list.html#posting-guidelines
---
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/84236b32-5c08-4eeb-a26c-2fcc6b95a8c0n%40googlegroups.com.

Lorenzo Bastonero

unread,
Feb 7, 2024, 4:06:23 PMFeb 7
to aiida...@googlegroups.com
Dear Rijan,

If you have AiiDA already on the cluster, then you don’t have to configure an ssh computer configuration, but a local computer instead.

It is very simple, you should just change the following two lines:
```
hostname: localhost
transport: core.local
```

Best,
--------------------------------------

Lorenzo Bastonero



Rijan Karkee

unread,
Feb 7, 2024, 4:28:15 PMFeb 7
to aiida...@googlegroups.com
Hi Lorenzo,

I did that but now got a new error:


(aiidaENV) rkarkee@ch-fe2:~> verdi computer setup --config computer.yaml
Report: enter ? for help.
Report: enter ! to ignore the default and set no value.
Shebang line (first line of each script, starting with #!) [#!/bin/bash]: #!/bin/bash
Default amount of memory per machine (kB).: 51765
Escape CLI arguments in double quotes [y/N]: N
Critical: Could not connect to database: (psycopg2.OperationalError) connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused
        Is the server running on that host and accepting TCP/IP connections?
(Background on this error at: https://sqlalche.me/e/20/e3q8)
(aiidaENV) rkarkee@ch-fe2:~>

Lorenzo Bastonero

unread,
Feb 7, 2024, 4:39:50 PMFeb 7
to aiida...@googlegroups.com
Hello,

This seems to be Postgres that has been shut down. Could you please post this question on AiiDA Discourse (https://aiida.discourse.group/)?
This is the recommended communication channel, so that people can see also this question.

In the meantime, you might try this command:
```
pg_ctl start -l logfile
```


Since this is more of an aiida-core questions, and since I am not directly an aiida-core developer, but a plugin developer (i.e. developer of aiida-quantumespresso, aiida-vibroscopy, etc that use aiida-core), then I would recommend if you open a new thread, e.g. on AiiDA Discourse. You will get much quicker answers there as well!

Best,
--------------------------------------

Lorenzo Bastonero



Rijan Karkee

unread,
Feb 12, 2024, 1:03:26 PMFeb 12
to aiida...@googlegroups.com
Hi Lorenzo,

I talked to aiida.discourse  group and figured out the solution to that issue. 

I configured computer.yaml and code.yaml

I am creating a python file script.py

I have a few questions regarding your earlier suggestions.

I did run the following first:
First I created pk.py as
from aiida import load_profile
load_profile()

from ase.io import read
from aiida.orm import *

atoms = read('/path/to/input.pwi') # here I mean the QE pw.x input you just showed
structure = StructureData(ase=atoms)
pk=structure.store()
print(pk)

I got pk:3 as output

So I need to use this pk number right? Also do I need to do this step everytime even for same input?

Then 
I tried to setup pseudo potential using aiida-pseudo install family /path/to/pseudo_folder/ MyPseudos -P pseudo.upf
I always got some error on this (may I am doing this wrong). 

I have inside /users/rkarkee/pseudo the following pseudopotentials:
Hf.upf Te.upf Hf_FR.upf  Te_Fr.upf

I tried following but in both case got errors as:
(aiidaENV) rkarkee@ch-fe1:~/pseudo> aiida-pseudo install family /users/rkarkee/pseudo/ LDA Hf.upf
Usage: aiida-pseudo install family [OPTIONS] ARCHIVE LABEL
Try 'aiida-pseudo install family -h' for help.
Error: Got unexpected extra argument (Hf.upf)
(aiidaENV) rkarkee@ch-fe1:~/pseudo> aiida-pseudo install family /users/rkarkee/pseudo/ LDA
Report: creating a pseudopotential family from directory `/users/rkarkee/pseudo`... [FAILED]
Critical: `<class 'aiida_pseudo.data.pseudo.pseudo.PseudoPotentialData'>` constructor did not define the element and could not parse a valid element symbol from the filename `{filename}` either. It should have the format `ELEMENT.EXTENSION`

How do I do this correctly?

Thanks
Best
Rijan


Lorenzo Bastonero

unread,
Feb 12, 2024, 1:16:30 PMFeb 12
to aiida...@googlegroups.com

So I need to use this pk number right?

Exactly, that is now stored in your database with that PK. So anytime you do `load_node(3)`, this will return the structure data you just stored.

Also do I need to do this step everytime even for same input?

Thanks to the database, and the provenance, you will not have to. You can just record somewhere the PK, and reuse it in other calculations. Of course, this will _stay_ as it is. So, if you perform a vc-relax with Quantum ESPRESSO for example, you may want to take the output structure instead, which will have a new PK.

Just for you information: you can put relevant nodes that you need in “Group”s, that work more or less as folders. So, in case you lost your PK, you can still look up into the group. Moreover, it is usually wise to give some proper `label` and `description`. You can even add extra information via `node.base.extras.set(‘key’, value)` if you need to keep something. Note that extras can be modified, unlike attributes (that you can get using e.g. node.base.attributes.all).

Then 
I tried to setup pseudo potential using aiida-pseudo install family /path/to/pseudo_folder/ MyPseudos -P pseudo.upf
I always got some error on this (may I am doing this wrong). 

I have inside /users/rkarkee/pseudo the following pseudopotentials:
Hf.upf Te.upf Hf_FR.upf  Te_Fr.upf

I tried following but in both case got errors as:
(aiidaENV) rkarkee@ch-fe1:~/pseudo> aiida-pseudo install family /users/rkarkee/pseudo/ LDA Hf.upf
Usage: aiida-pseudo install family [OPTIONS] ARCHIVE LABEL
Try 'aiida-pseudo install family -h' for help.
Error: Got unexpected extra argument (Hf.upf)
(aiidaENV) rkarkee@ch-fe1:~/pseudo> aiida-pseudo install family /users/rkarkee/pseudo/ LDA
Report: creating a pseudopotential family from directory `/users/rkarkee/pseudo`... [FAILED]
Critical: `<class 'aiida_pseudo.data.pseudo.pseudo.PseudoPotentialData'>` constructor did not define the element and could not parse a valid element symbol from the filename `{filename}` either. It should have the format `ELEMENT.EXTENSION`

How do I do this correctly?

As you can see from the error message, your files need to be in the format `ELEMENT.EXTENSION`, and of course you should not have more than one pseudo per element. You should create two pseudo families, hence two folders as well. So, for instance, just rename `Hf_FR.upf` to `Hf.FR.upf` and move it in an other folder (same operation for Te). Then you should be good to go.

Lorenzo

Rijan Karkee

unread,
Feb 12, 2024, 1:59:22 PMFeb 12
to aiida...@googlegroups.com
Hi Lorenzo,

Thanks for a quick reply. 

I got confused. 

When we do the actual code, we call pseudopotential through 
pseudo_family = load_group('MyPseudos') 

In this case, MyPseudos is the label that we use in command aiida-pseudo install family <Folder_to_Hf_pseudopotential>  MyPseudo 

Then in my input file I also need to use Te.upf but 
when I did command aiida-pseudo install family <Folder_to_Te_pseudopotential>  MyPseudo
It says MyPseudo already exists. 

I am confused what exactly we're doing here. Are we copying all required pseudopotentials in a common label or do we need to call different label in  here?
pseudo_family = load_group('MyPseudos_2')  here MyPsedos_2 is for Te.upf



  



Lorenzo Bastonero

unread,
Feb 12, 2024, 3:21:00 PMFeb 12
to aiida...@googlegroups.com
So, the idea is that you have a *group* of pseudo potentials, i.e. a *pseudofamily*. In that group, in principle all the elements will have its own pseudo potential (that should be generated in the same way technically). Then, all the pseudos, e.g. needed for a structure, can be loaded from it as I already wrote:
```
structure = load_node(PK)
pseudo_family = load_group('MyPseudos')
pseudos = pseudo_family.get_pseudos(structure=structure)
```
In your case, create two folders:

- - PseudosSR
    |_ Te.upf
    |_ Hf.upf
    |_ (… in principle for all the elements, but not necessarily)
- - PseudosFR
    |_ Te.FR.upf
    |_ Hf.FR.upf 
    |_ (… in principle for all the elements, but not necessarily)

And do aiida-pseudo for each of them, e.g. calling them with the same name of the folder, or as you wish (possibly something significant to where you took the pseudos).
If they are from PseudoDojo, consider the fact that there is already the possibility of downloading and creating the pseudo family group directly. 

Please, see instruction on the aiida-pseudo docs in case.

Lorenzo


--------------------------------------

Lorenzo Bastonero



Rijan Karkee

unread,
Feb 12, 2024, 4:05:39 PMFeb 12
to aiida...@googlegroups.com
Hi Lorenzo,

Like you said I did create a folder and was successful in doing aiida-pseudo install .... 
as shown below.

(aiidaENV) rkarkee@ch-fe1:~> aiida-pseudo install family PseudosSR LDA_pseudo
Report: creating a pseudopotential family from directory `PseudosSR`... [OK]
Success: installed `LDA_pseudo` containing 2 pseudopotentials
Then I ran script.py (description shown below) but I think it has problem finding pseudopotential.

(aiidaENV) rkarkee@ch-fe1:/lustre/scratch4/turquoise/rkarkee> python script.py
Traceback (most recent call last):
  File "/lustre/scratch4/turquoise/.mdt5/rkarkee/script.py", line 40, in <module>
    builder.pw.pseudos = pseudos
    ^^^^^^^^^^^^^^^^^^
  File "/users/rkarkee/conda/envs/aiidaENV/lib/python3.11/site-packages/aiida/engine/processes/builder.py", line 120, in __setattr__
    raise ValueError(f'invalid attribute value {validation_error.message}')
ValueError: invalid attribute value Invalid type <class 'aiida_pseudo.data.pseudo.pseudo.PseudoPotentialData'> for dynamic port value: expected (<class 'aiida.orm.nodes.data.upf.UpfData'>, <class 'aiida_pseudo.data.pseudo.upf.UpfData'>)
script.py file is as:
from aiida import load_profile
from aiida.orm import *
from aiida.engine import submit
from aiida_quantumespresso.workflows.pw.base import PwBaseWorkChain
load_profile()
builder = PwBaseWorkChain.get_builder()
structure = load_node(3)
code = load_code('qe-7.3@newhpc')
pseudo_family = load_group('LDA_pseudo')
pseudos = pseudo_family.get_pseudos(structure=structure)
kpoints = KpointsData()
kpoints.set_kpoints_mesh([4,4,2],[0.5,0.5,0.5])
settings = {'cmdline':['-pd', '.true.', '-nk', '4']}
parameters = { # note: prefix, pseudos, and others are controlled by the plugin automatically!
  'CONTROL': {
    'tprnfor': True,
    'tstress': True,
  },
  'SYSTEM': { # note: ibrav, nat, ntyp are controlled by the plugin automatically!
    'ecutwfc': 70,
    'lspinorb': True,
    'noncolin': True,
    'vdw_corr': 'Grimme-D2',
  },
  'ELECTRONS': {
    'conv_thr': 1.0e-10,
    'electron_maxstep': 200,
    'mixing_beta':  0.2,
    'diagonalization': 'david',
  },
}
builder.clean_workdir = Bool(False) # whether to remove the work directory after the run is finished
builder.kpoints = kpoints
builder.pw.structure = structure
builder.pw.pseudos = pseudos
builder.pw.code = code
builder.pw.parameters = Dict(parameters)
builder.pw.settings = Dict(settings)
builder.pw.metadata.options = {
  'resources': {'num_machines':1, 'num_mpiprocs_per_machine': 256, 'num_cores_per_mpiproc': 1},
  'max_wallclock_seconds': 43200, # walltime in seconds
  'queue_name': 'standard',
}
calc = submit(builder) # submit to aiida and run the workflow!
print(f'Launched a PwBaseWorkChain with PK = {calc.pk}') # register the PK and save it (e.g. in the same script); after it finishes, you can inspect the outputs

Lorenzo Bastonero

unread,
Feb 12, 2024, 4:10:49 PMFeb 12
to aiida...@googlegroups.com
This is because Quantum ESPRESSO accepts only UPF format, and aiida-quantumespresso expects the corresponding data type, i.e. UpfData, and not PseudoPotentialData.
This is easily achieved by adding `-P pseudo.upf` when generating your family. See also here: https://aiida-pseudo.readthedocs.io/en/latest/howto.html#pseudopotential-format

I hope this time everything goes smoothly.

Lorenzo

--------------------------------------

Lorenzo Bastonero



Rijan Karkee

unread,
Feb 12, 2024, 4:17:59 PMFeb 12
to aiida...@googlegroups.com
Yes Thanks.

I think it did work. 
after python script.py

It says:
Launched a PwBaseWorkChain with PK=14

I dont see any queues in hpc. 
Where do I check if it ran successfully/ outputs?

Best
Rijan



Lorenzo Bastonero

unread,
Feb 12, 2024, 4:21:46 PMFeb 12
to aiida...@googlegroups.com
Very good!

It will give you all the information needed about running and inspecting *any* AiiDA WorkChain.

--------------------------------------

Lorenzo Bastonero



Lorenzo Bastonero

unread,
Feb 12, 2024, 4:26:43 PMFeb 12
to aiida...@googlegroups.com
PS: you can find the following commands useful to inspect `PwCalculation` (but in general any CalcJob)

verdi calcjob gotocomputer (goes to the folder where the calculation was submitted and run)
verdi calcjob outputcat (it prints the output of the main calculation, if any)
verdi calcjob inputcat (it prints the input of the main calculation - useful to see if there is what you expect)

--------------------------------------

Lorenzo Bastonero