-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathsubmit_using_config.py
33 lines (26 loc) · 1.06 KB
/
submit_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
32
33
"""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
# Add 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("../tests/calculations/structures/NaCl.cif")
# 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("../tests/calculations/configs/config_janus.yaml")
# Define calculation to run
SinglepointCalc = CalculationFactory("mlip.sp")
# Run calculation
result, node = run_get_node(
SinglepointCalc,
code=code,
struct=structure,
metadata=metadata,
config=config,
)
print(f"Printing results from calculation: {result}")
print(f"Printing node of calculation: {node}")