Slab relaxation and MongoDB output missing

Hello !

I started to learn how to use atomate, specially for surface/adsorption calculations workflow for now.
I encountered a problem with the function get_wf_slab from the tutorial “High-throughput workflows for determining adsorption energies on solid surfaces.” (in the notebook, it is is get_wf_surface but I suppose it is an old version of atomate).
While the workflow is successfully created and the calculations also done, I can’t find the output in the tasks output repertory in MongoDB database. The file task.json is still in my calculation repertory.
For MgO bands structures, I had no problem and the output are in tasks. I tried to compare both workflows but I couldn’t find what is different in get_wf_slab function. It seems just to call OptimizeFW like MgO wf (or the Si tutorial, working fine also).

I am just optimizing Ni(111) slab without adsorbate. Did I miss something obvious ? ><

from pymatgen import Structure, Lattice, MPRester, Molecule
from pymatgen.analysis.adsorption import *
from pymatgen.core.surface import generate_all_slabs
from pymatgen.symmetry.analyzer import SpacegroupAnalyzer
from matplotlib import pyplot as plt

# Note that you must provide your own API Key, which can
# be accessed via the Dashboard at
mpr = MPRester(APIKey)

from fireworks import LaunchPad
lpad = LaunchPad.auto_load()
#lpad.reset('', require_password=False)

from atomate.vasp.workflows.base.adsorption import get_wf_slab

struct = mpr.get_structure_by_material_id("mp-23") # fcc Ni
struct = SpacegroupAnalyzer(struct).get_conventional_standard_structure()
slabs = generate_all_slabs(struct, 1, 5.0, 2.0, center_slab=True)
slab_dict = {slab.miller_index:slab for slab in slabs}

ni_slab_111 = slab_dict[(1, 1, 1)]
wf = get_wf_slab(ni_slab_111) 

Related to the slab relaxation, if I want to optimize only the top layers for example, I think I need to create the corresponding POSCAR with pymatgen/ase and use it for atomate.

Hi Florian, you might have to explicitly pass the db_file, I think you can pass the autoconfig db file using:

from atomate.vasp.config import DB_FILE

and then

wf = get_wf_slab(ni_slab_111, db_file=DB_FILE)

Thank you very much for your fast answer ! It was indeed the solution.
I saw this parameter but since OptimizeFW was called as for bands structures workflow, I didn’t think it would be the solution… Next time I will try in case of !