aiida-vasp / aiida-vasp

A plugin to AiiDA for running simulations with VASP
https://aiida-vasp.readthedocs.org/en/latest
Other
44 stars 44 forks source link

[Error report] Tutorial 3 - Equilibrium volume of FCC Si, take 2 #509

Open Chengcheng-Xiao opened 3 years ago

Chengcheng-Xiao commented 3 years ago

Please check these boxes before submitting your issue, thank you!

Environment

Steps that lead to the error

Following the tutorial:

What should happen

%/$ verdi process list -a
PK  Created    Process label                 Process State      Process status
------  ---------  ----------------------------  -----------------  -----------------------------------------------------------
103573  14m ago    EosWorkChain                  ⏹ Finished [0]
103574  14m ago    VaspWorkChain                 ⏹ Finished [0]
103575  14m ago    VaspCalculation               ⏹ Finished [0]
103579  13m ago    VaspWorkChain                 ⏹ Finished [0]
103580  13m ago    VaspCalculation               ⏹ Finished [0]
103584  12m ago    VaspWorkChain                 ⏹ Finished [0]
103585  12m ago    VaspCalculation               ⏹ Finished [0]
103589  11m ago    VaspWorkChain                 ⏹ Finished [0]
103590  11m ago    VaspCalculation               ⏹ Finished [0]
103594  10m ago    VaspWorkChain                 ⏹ Finished [0]
103595  10m ago    VaspCalculation               ⏹ Finished [0]
103599  9m ago     VaspWorkChain                 ⏹ Finished [0]
103600  9m ago     VaspCalculation               ⏹ Finished [0]
103604  8m ago     VaspWorkChain                 ⏹ Finished [0]
103605  8m ago     VaspCalculation               ⏹ Finished [0]
103609  7m ago     VaspWorkChain                 ⏹ Finished [0]
103610  7m ago     VaspCalculation               ⏹ Finished [0]
103614  5m ago     VaspWorkChain                 ⏹ Finished [0]
103615  5m ago     VaspCalculation               ⏹ Finished [0]
103620  4m ago     store_total_energies          ⏹ Finished [0]
103622  4m ago     locate_minimum                ⏹ Finished [0]

What happened instead

  PK  Created    Process label    Process State    Process status
----  ---------  ---------------  ---------------  ----------------
1958  27m ago    EosWorkChain     ⨯ Excepted

specifically:

2021-07-10 10:20:45 [199 | REPORT]: [1958|EosWorkChain|on_except]: Traceback (most recent call last):
  File "/Users/chengcheng_xiao/Applications/anaconda3/envs/aiida/lib/python3.8/site-packages/plumpy/process_states.py", line 230, in execute
    result = self.run_fn(*self.args, **self.kwargs)
  File "/Users/chengcheng_xiao/Applications/anaconda3/envs/aiida/lib/python3.8/site-packages/aiida/engine/processes/workchains/workchain.py", line 214, in _do_step
    finished, stepper_result = self._stepper.step()
  File "/Users/chengcheng_xiao/Applications/anaconda3/envs/aiida/lib/python3.8/site-packages/plumpy/workchains.py", line 299, in step
    finished, result = self._child_stepper.step()
  File "/Users/chengcheng_xiao/Applications/anaconda3/envs/aiida/lib/python3.8/site-packages/plumpy/workchains.py", line 532, in step
    finished, result = self._child_stepper.step()
  File "/Users/chengcheng_xiao/Applications/anaconda3/envs/aiida/lib/python3.8/site-packages/plumpy/workchains.py", line 299, in step
    finished, result = self._child_stepper.step()
  File "/Users/chengcheng_xiao/Applications/anaconda3/envs/aiida/lib/python3.8/site-packages/plumpy/workchains.py", line 250, in step
    return True, self._fn(self._workchain)
  File "/Users/chengcheng_xiao/Downloads/test_aiida_vasp/3_Equilibrium_Volum_Si_workchain/eos.py", line 136, in run_next_workchain
    running = self.submit(self._next_workchain, **inputs)
  File "/Users/chengcheng_xiao/Applications/anaconda3/envs/aiida/lib/python3.8/site-packages/aiida/engine/processes/process.py", line 498, in submit
    return self.runner.submit(process, *args, **kwargs)
  File "/Users/chengcheng_xiao/Applications/anaconda3/envs/aiida/lib/python3.8/site-packages/aiida/engine/runners.py", line 184, in submit
    process_inited = self.instantiate_process(process, *args, **inputs)
  File "/Users/chengcheng_xiao/Applications/anaconda3/envs/aiida/lib/python3.8/site-packages/aiida/engine/runners.py", line 170, in instantiate_process
    return instantiate_process(self, process, *args, **inputs)
  File "/Users/chengcheng_xiao/Applications/anaconda3/envs/aiida/lib/python3.8/site-packages/aiida/engine/utils.py", line 65, in instantiate_process
    process = process_class(runner=runner, inputs=inputs)
  File "/Users/chengcheng_xiao/Applications/anaconda3/envs/aiida/lib/python3.8/site-packages/plumpy/base/state_machine.py", line 192, in __call__
    inst = super().__call__(*args, **kwargs)
  File "/Users/chengcheng_xiao/Applications/anaconda3/envs/aiida/lib/python3.8/site-packages/aiida_vasp/workchains/restart.py", line 64, in __init__
    super(BaseRestartWorkChain, self).__init__(*args, **kwargs)
  File "/Users/chengcheng_xiao/Applications/anaconda3/envs/aiida/lib/python3.8/site-packages/aiida/engine/processes/workchains/workchain.py", line 70, in __init__
    super().__init__(inputs, logger, runner, enable_persistence=enable_persistence)
  File "/Users/chengcheng_xiao/Applications/anaconda3/envs/aiida/lib/python3.8/site-packages/aiida/engine/processes/process.py", line 145, in __init__
    inputs=self.spec().inputs.serialize(inputs),
  File "/Users/chengcheng_xiao/Applications/anaconda3/envs/aiida/lib/python3.8/site-packages/aiida/engine/processes/ports.py", line 220, in serialize
    result[name] = port.serialize(value, breadcrumbs)
  File "/Users/chengcheng_xiao/Applications/anaconda3/envs/aiida/lib/python3.8/site-packages/aiida/engine/processes/ports.py", line 211, in serialize
    raise TypeError(f'port namespace `{port_name}` received `{type(mapping)}` instead of a dictionary')
TypeError: port namespace `inputs.dynamics` received `<class 'aiida.orm.nodes.data.dict.Dict'>` instead of a dictionary
zhubonan commented 3 years ago

Thanks for reporting, the prepare_process_inputs appears to be the cruplt. If you change this line:

        self.ctx.inputs = prepare_process_inputs(self.ctx.inputs)

to

        self.ctx.inputs = prepare_process_inputs(self.ctx.inputs, namespaces=['dynamics'])

then the EOS work chain should work. The problem is caused by not recognizing dynamics as a valid port namespace and wrongly packing it into a Dict node instead.

Chengcheng-Xiao commented 3 years ago

Thanks Bonan, it works! 🤟

lan496 commented 2 years ago

Can you re-open this issue until https://github.com/aiida-vasp/aiida-vasp/pull/516 is merged? This will make it easier for people (including me) to find this workaround.