Skip to content

Commit

Permalink
Merge pull request #440 from JaGeo/lobster_parallelization_docu
Browse files Browse the repository at this point in the history
Add clearer documentation on lobster worker
  • Loading branch information
janosh authored Jul 28, 2023
2 parents ff60708 + 824f0d2 commit 59fd0b4
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions docs/user/codes/vasp.md
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,42 @@ run_locally(lobster, create_folders=True, store=SETTINGS.JOB_STORE)
It is, however, computationally very beneficial to define two different types of job scripts for the VASP and Lobster runs, as VASP and Lobster runs are parallelized differently (MPI vs. OpenMP).
[FireWorks](https://github.com/materialsproject/fireworks) allows to run the VASP and Lobster jobs with different job scripts. Please check out the [jobflow documentation on FireWorks](https://materialsproject.github.io/jobflow/tutorials/8-fireworks.html#setting-the-manager-configs) for more information.

Specifically, you might want to change the `_fworker` for the LOBSTER runs and define a separate `lobster` worker within FireWorks:

```python
from pymatgen.core.structure import Structure
from fireworks import LaunchPad

from atomate2.vasp.flows.lobster import VaspLobsterMaker
from atomate2.vasp.powerups import update_user_incar_settings
from jobflow.managers.fireworks import flow_to_workflow

structure = Structure(
lattice=[[0, 2.13, 2.13], [2.13, 0, 2.13], [2.13, 2.13, 0]],
species=["Mg", "O"],
coords=[[0, 0, 0], [0.5, 0.5, 0.5]],
)

lobster = VaspLobsterMaker().make(structure)
lobster = update_user_incar_settings(lobster, {"NPAR": 4})

# update the fireworker of the Lobster jobs
for job, _ in lobster.iterflow():
if "get_lobster" in job.name:
job.update_config(
{"manager_config": {"_fworker": "worker"}, "response_manager_config": {"_fworker": "lobster"}}
)
else:
job.update_config({"manager_config": {"_fworker": "worker"}})

# convert the flow to a fireworks WorkFlow object
wf = flow_to_workflow(lobster)

# submit the workflow to the FireWorks launchpad
lpad = LaunchPad.auto_load()
lpad.add_wf(wf)
```

Outputs from the automatic analysis with LobsterPy can easily be extracted from the database and also plotted:

```python
Expand Down

0 comments on commit 59fd0b4

Please sign in to comment.