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@uclouvain.be). Please cite our latest Lobster publication if you make use of this tutorial: R. Nelson, C. Ertural, J. George, V. L. Deringer, G. Hautier, R. Dronskowski, J Comput Chem. 2020, 41, 1931.
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-7000"
a = MPRester()
struct = a.get_structure_by_material_id(mpid)
This workflow will test all possible basis functions (we will use PBE_54 pseudopotentials by default!)
wf = get_wf_lobster_test_basis(structure=struct, user_kpoints_settings= {"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')
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".
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 wf to lpad
lpad = LaunchPad.auto_load() # loads this based on the FireWorks configuration
lpad.add_wf(wf)
How to start the jobs: 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 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