-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyscf_result.py
41 lines (30 loc) · 1.15 KB
/
pyscf_result.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
35
36
37
38
39
import os
import json
import numpy
import argparse
from orquestra.runtime import QERuntime, RayRuntime
from orquestra.runtime._config import read_config
parser = argparse.ArgumentParser(description='Parse workflow information.')
parser.add_argument('id', type=str, help='workflow id')
parser.add_argument('--cluster', type=str, default="https://ps-chemistry.orquestra.io", help="cluster url")
args = parser.parse_args()
CLUSTER_URL = args.cluster
WORKFLOW_ID = args.id
PATH_TO_RESULT = "results/"
runtime = QERuntime.from_runtime_configuration(
project_dir=".",
config=read_config(CLUSTER_URL),
)
# read outputs
workflow_results = runtime.get_workflow_run_outputs_non_blocking(WORKFLOW_ID)
energy = workflow_results[0]
ecorr = workflow_results[1]
print("pyscf energy w/ ccpv5z ", energy + ecorr)
# # write output to files
# # check if path exist
# if not os.path.exists(PATH_TO_RESULT + mol_name):
# os.makedirs(PATH_TO_RESULT + mol_name)
# # write energy
# with open ("{}{}/energy-{}.json".format(PATH_TO_RESULT, mol_name, str(n_pno)), "w") as f:
# f.write(json.dumps(result, indent=2))
# print("*** ENERGY RESULTS WRITTEN TO: energy.json ***")