-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathsubmit_md_using_config.py
31 lines (24 loc) · 1.03 KB
/
submit_md_using_config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
"""Example code for submitting single point calculation."""
from aiida.engine import run_get_node
from aiida.orm import load_code
from aiida.plugins import CalculationFactory
from aiida_mlip.data.config import JanusConfigfile
from aiida_mlip.helpers.help_load import load_structure
# And the required inputs for aiida
metadata = {"options": {"resources": {"num_machines": 1}}}
code = load_code("janus@localhost")
# This structure will overwrite the one in the config file if present
structure = load_structure()
# All the other paramenters we want them from the config file
# We want to pass it as a AiiDA data type for the provenance
config = JanusConfigfile(
"/home/federica/aiida-mlip/tests/calculations/configs/config_janus_md.yaml"
)
# Define calculation to run
MDCalculation = CalculationFactory("mlip.md")
# Run calculation
result, node = run_get_node(
MDCalculation, code=code, struct=structure, metadata=metadata, config=config
)
print(f"Printing results from calculation: {result}")
print(f"Printing node of calculation: {node}")