forked from stfc/aiida-mlip
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsubmit_train.py
34 lines (27 loc) · 945 Bytes
/
submit_train.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
34
"""Example code for submitting training calculation."""
from pathlib import Path
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
# Add the required inputs for aiida
metadata = {"options": {"resources": {"num_machines": 1}}}
code = load_code("janus@localhost")
# All the other parameters we want them from the config file
# We want to pass it as a AiiDA data type for the provenance
mlip_config = JanusConfigfile(
Path("~/aiida-mlip/tests/calculations/configs/mlip_train.yml")
.expanduser()
.resolve()
)
# Define calculation to run
TrainCalc = CalculationFactory("mlip.train")
# Run calculation
result, node = run_get_node(
TrainCalc,
code=code,
metadata=metadata,
mlip_config=mlip_config,
)
print(f"Printing results from calculation: {result}")
print(f"Printing node of calculation: {node}")