materialsproject / atomate2

atomate2 is a library of computational materials science workflows
https://materialsproject.github.io/atomate2/
Other
156 stars 88 forks source link

BUG:Could not resolve reference #836

Open lihaojie87 opened 4 months ago

lihaojie87 commented 4 months ago

Describe the bug I am running the example of Using atomate2 with FireWorks

from fireworks import LaunchPad
from atomate2.vasp.flows.core import RelaxBandStructureMaker
from atomate2.vasp.powerups import add_metadata_to_flow
from jobflow.managers.fireworks import flow_to_workflow
from pymatgen.core import Structure

# construct a rock salt MgO structure
mgo_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]],
)

# make a band structure flow to optimise the structure and obtain the band structure
bandstructure_flow = RelaxBandStructureMaker().make(mgo_structure)

# (Optional) add metadata to the flow task document.
# Could be useful to filter specific results from the database.
# For e.g., adding material project ID for the compound, use following lines
bandstructure_flow = add_metadata_to_flow(
    flow=bandstructure_flow,
    additional_fields={"mp_id": "mp-190"},
)

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

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

then I launch the firework to slurm the relax 1 is good but relax 2 is FIZZLED here is the slurm log output

successfully loaded your custom FW_config.yaml!
2024-05-08 12:22:42,276 INFO Hostname/IP lookup (this will take a few seconds)
2024-05-08 12:22:42,289 INFO Launching Rocket
2024-05-08 12:22:50,078 INFO RUNNING fw_id: 4 in directory: /home/lhj/fireworks_job/block_2024-05-08-03-17-33-711137/launcher_2024-05-08-04-22-10-600268
2024-05-08 12:22:50,139 INFO Task started: {{jobflow.managers.fireworks.JobFiretask}}.
2024-05-08 12:22:50,157 INFO Starting job - relax 2 (e9f116fe-9978-4149-b948-b684f56cd70a)
Traceback (most recent call last):
  File "/opt/venv/atomate2/lib/python3.10/site-packages/fireworks/core/rocket.py", line 261, in run
    m_action = t.run_task(my_spec)
  File "/opt/venv/atomate2/lib/python3.10/site-packages/jobflow/managers/fireworks.py", line 175, in run_task
    response = job.run(store=store)
  File "/opt/venv/atomate2/lib/python3.10/site-packages/jobflow/core/job.py", line 572, in run
    self.resolve_args(store=store)
  File "/opt/venv/atomate2/lib/python3.10/site-packages/jobflow/core/job.py", line 678, in resolve_args
    resolved_args = find_and_resolve_references(
  File "/opt/venv/atomate2/lib/python3.10/site-packages/jobflow/core/reference.py", line 473, in find_and_resolve_references
    resolved_references = resolve_references(
  File "/opt/venv/atomate2/lib/python3.10/site-packages/jobflow/core/reference.py", line 361, in resolve_references
    resolved_references[ref] = ref.resolve(
  File "/opt/venv/atomate2/lib/python3.10/site-packages/jobflow/core/reference.py", line 166, in resolve
    raise ValueError(
ValueError: Could not resolve reference - cbb683d0-bcdc-4084-a3fa-40c98435dc47 not in store or index=None, cache={'cbb683d0-bcdc-4084-a3fa-40c98435dc47': {}}
2024-05-08 12:22:50,356 INFO Rocket finished

To Reproduce Steps to reproduce the behavior: follow the example of Using atomate2 with FireWorks

Provide any example files that are needed to reproduce the error, especially if the bug pertains to parsing of a file.

Expected behavior A clear and concise description of what you expected to happen. Run successfully Screenshots If applicable, add screenshots to help explain your problem.

JaGeo commented 4 months ago

Thank you for reporting the bug. Does it work with jobflow alone amd without using fireworks?

lihaojie87 commented 4 months ago

Thank you for reporting the bug. Does it work with jobflow alone amd without using fireworks?

It cannot work in local env

JaGeo commented 4 months ago

I am not sure ai understand. Can you use a jobscript to test the workflow? just for testing

lihaojie87 commented 3 months ago

I am just fllow the guide totally

QuantumChemist commented 3 months ago

Did you check that relax 1 really finished and generated the .gz files?