This tutorial will show you how Lobster calculations can be run with atomate (https://atomate.org/) and pymatgen (https://pymatgen.org/). Written by Janine George (janine.george@bam.de) and Aakash Naik (aakash.naik@bam.de).
Please cite our latest Lobster publication if you make use of this tutorial:
First load all important classes, methods
from pymatgen.ext.matproj import MPRester
from atomate.vasp.powerups import add_additional_fields_to_taskdocs, set_execution_options
from atomate.vasp.workflows.base.lobster import get_wf_lobster_test_basis
from fireworks import LaunchPad
Get a structure from the Materials Project that you would like to run (or from elsewhere)
mpid="mp-573697"
a = MPRester()
struct = a.get_structure_by_material_id(mpid)
(We use PBE_54 pseudopotentials by default!)
For this tutorial we would be using get_wf_lobster_test_basis
workflow from atomate.
This workflow at present is flexible and can be tuned as per users needs. However, there are some limitations and further options will be added soon in near future. Following are the list of arguments applicable to get_wf_lobster_test_basis
workflow:
wf = get_wf_lobster_test_basis(structure=struct,
user_kpoints_settings={"grid_density": 6000},
user_incar_settings={"LCHARG": False, "ISPIN": 1, "MAGMOM": None},
delete_all_wavecars=True,
additional_optimization=True,
user_incar_settings_optimization={"ISMEAR": 1, "EDIFFG": 1e-5,
"EDIFF": 1e-6, "NELM": 3000,
"ISPIN": 1,"MAGMOM": None},
user_kpoints_settings_optimization={"grid_density": 6000})
Add additional information to the database (e.g., name of the material)
update_dict={"material-id": mpid}
#This is a powerup to add the material-id to the database
wf=add_additional_fields_to_taskdocs(wf,update_dict=update_dict, task_name_constraint='VaspToDb')
wf=add_additional_fields_to_taskdocs(wf,update_dict=update_dict, task_name_constraint='LobsterRunToDb')
It is better to use different "workers" for different job types, we will use a powerup to set this.
The standard one should be used for VASP. Then, you need one for lobster and for deleting the WAVECARs. The name of those workers should be corresponding to "fworker_name".
Here, it would be "manneback_lobster" and "manneback_delete".
(One can rename this tags to own liking, just need to make sure you change the corresponding fworker_name in my_fworker_lobster.yaml and my_fworker_delete.yaml respectively)
Sample my_fworker_lobster.yaml file looks like this
name: 'manneback_lobster'
category: ''
query: '{}'
env:
db_file: /path/to/db.json
vasp_cmd: mpirun -np 48 /path/to/vasp/
lobster_cmd: /path/to/Lobster/
scratch_dir: null
auto_npar: True
wf=set_execution_options(wf, fworker_name="manneback_lobster", category=None, fw_name_constraint="lobster_calculation", task_name_constraint=None)
wf=set_execution_options(wf, fworker_name="manneback_delete", category=None, fw_name_constraint="DelteWavecar", task_name_constraint=None)
Adds workflows to launchpad (lpad)
lpad = LaunchPad.auto_load() # loads this based on the FireWorks configuration
lpad.add_wf(wf)
You have to write my_fworker_lobster.yaml and my_fworker_delete.yaml files and correspnding queueadapter files that are called "my_qadapter_lobster.yaml" and "my_qadapter_delete.yaml" here.
And then, use the following commands in your shell:
qlaunch -r rapidfire
qlaunch -r --fworker_file ~/.fireworks/my_fworker_lobster.yaml --queueadapter_file ~/.fireworks/my_qadapter_lobster.yaml rapidfire
qlaunch -r --fworker_file ~/.fireworks/my_fworker_delete.yaml --queueadapter_file ~/.fireworks/my_qadapter_delete.yaml rapidfire