Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] main from grimme-lab:main #3

Merged
merged 1 commit into from
Jun 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion censo_qm/adf_job.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# adf_job.py

# for J and S calculation only
# for J and S calculation only
74 changes: 43 additions & 31 deletions censo_qm/censo.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def main(argv=None):
sys.exit(1)
toc = perf_counter()
ensembledata.part_info["part0"] = toc - tic
ensembledata.previous_part_info["part0"] += ensembledata.part_info["part0"]
ensembledata.previous_part_info["part0"] += ensembledata.part_info["part0"]
print(f"Ran part0 in {ensembledata.part_info['part0']:0.4f} seconds")

# RUNNING PART1
Expand All @@ -87,7 +87,9 @@ def main(argv=None):
toc = perf_counter()
ensembledata.part_info["part1"] = toc - tic
ensembledata.previous_part_info["part1"] += ensembledata.part_info["part1"]
ensembledata.previous_part_info["part1_firstsort"] += ensembledata.part_info["part1_firstsort"]
ensembledata.previous_part_info["part1_firstsort"] += ensembledata.part_info[
"part1_firstsort"
]
print(f"Ran part1 in {ensembledata.part_info['part1']:0.4f} seconds")

# RUNNING PART2
Expand All @@ -112,7 +114,9 @@ def main(argv=None):
toc = perf_counter()
ensembledata.part_info["part2"] = toc - tic
ensembledata.previous_part_info["part2"] += ensembledata.part_info["part2"]
ensembledata.previous_part_info["part2_opt"] += ensembledata.part_info["part2_opt"]
ensembledata.previous_part_info["part2_opt"] += ensembledata.part_info[
"part2_opt"
]
print(f"Ran part2 in {ensembledata.part_info['part2']:0.4f} seconds")

# RUNNING PART3
Expand Down Expand Up @@ -196,6 +200,9 @@ def main(argv=None):
config.provide_runinfo(),
)

if args.create_si:
config.create_SI(ensembledata)

# END of CENSO
timings = 0.0
prev_timings = 0.0
Expand All @@ -208,44 +215,47 @@ def main(argv=None):
tmp = []
tmp_prev = []
if config.part0:
tmp.append(ensembledata.part_info['part0'])
tmp_prev.append(ensembledata.previous_part_info['part0'])
tmp.append(ensembledata.part_info["part0"])
tmp_prev.append(ensembledata.previous_part_info["part0"])
if config.part1:
tmp.append(ensembledata.part_info['part1'])
tmp_prev.append(ensembledata.previous_part_info['part1'])
tmp_prev.append(ensembledata.previous_part_info['part1_firstsort'])
tmp.append(ensembledata.part_info["part1"])
tmp_prev.append(ensembledata.previous_part_info["part1"])
tmp_prev.append(ensembledata.previous_part_info["part1_firstsort"])
if config.part2:
tmp.append(ensembledata.part_info['part2'])
tmp_prev.append(ensembledata.previous_part_info['part2'])
tmp.append(ensembledata.part_info['part2_opt'])
tmp_prev.append(ensembledata.previous_part_info['part2_opt'])
tmp.append(ensembledata.part_info["part2"])
tmp_prev.append(ensembledata.previous_part_info["part2"])
tmp.append(ensembledata.part_info["part2_opt"])
tmp_prev.append(ensembledata.previous_part_info["part2_opt"])
if config.part3:
tmp.append(ensembledata.part_info['part3'])
tmp_prev.append(ensembledata.previous_part_info['part3'])
tmp.append(ensembledata.part_info["part3"])
tmp_prev.append(ensembledata.previous_part_info["part3"])
if config.part4:
tmp.append(ensembledata.part_info['part4'])
tmp_prev.append(ensembledata.previous_part_info['part4'])
tmp.append(ensembledata.part_info["part4"])
tmp_prev.append(ensembledata.previous_part_info["part4"])
if config.optical_rotation:
tmp.append(ensembledata.part_info['part5'])
tmp_prev.append(ensembledata.previous_part_info['part5'])
timelen = max([len(f"{float(value):.2f}") for value in tmp]) +2
prev_timelen = max([len(f"{float(value):.2f}") for value in tmp_prev]) +2
tmp.append(ensembledata.part_info["part5"])
tmp_prev.append(ensembledata.previous_part_info["part5"])
timelen = max([len(f"{float(value):.2f}") for value in tmp]) + 2
prev_timelen = max([len(f"{float(value):.2f}") for value in tmp_prev]) + 2
if timelen < 7:
timelen = 7
except Exception:
timelen = 20
prev_timelen = 20


print(f"\n\n{'Part':20}: {'#conf':>{conflength}} {'time': >{timelen}} time (including restarts)")
print("".ljust(int(PLENGTH/1.4), "-"))
print(f"{'Input':20}: {ensembledata.nconfs_per_part['starting']:{conflength}} {'-':^{timelen+2}} {'-':^{timelen+2}}")
print(
f"\n\n{'Part':20}: {'#conf':>{conflength}} {'time': >{timelen}} time (including restarts)"
)
print("".ljust(int(PLENGTH / 1.4), "-"))
print(
f"{'Input':20}: {ensembledata.nconfs_per_part['starting']:{conflength}} {'-':^{timelen+2}} {'-':^{timelen+2}}"
)
if config.part0:
print(
f"{'Part0_all':20}: {ensembledata.nconfs_per_part['part0']:{conflength}} {ensembledata.part_info['part0']:{timelen}.2f} s {ensembledata.previous_part_info['part0']:>{prev_timelen}.2f} s"
)
timings += ensembledata.part_info["part0"]
prev_timings += ensembledata.previous_part_info['part0']
prev_timings += ensembledata.previous_part_info["part0"]
if config.part1:
print(
f"{'Part1_initial_sort':20}: {ensembledata.nconfs_per_part['part1_firstsort']:{conflength}} {ensembledata.part_info['part1_firstsort']:{timelen}.2f} s {ensembledata.previous_part_info['part1_firstsort']:>{prev_timelen}.2f} s"
Expand All @@ -254,7 +264,7 @@ def main(argv=None):
f"{'Part1_all':20}: {ensembledata.nconfs_per_part['part1_firstsort']:{conflength}} {ensembledata.part_info['part1']:{timelen}.2f} s {ensembledata.previous_part_info['part1']:>{prev_timelen}.2f} s"
)
timings += ensembledata.part_info["part1"]
prev_timings += ensembledata.previous_part_info['part1']
prev_timings += ensembledata.previous_part_info["part1"]
if config.part2:
print(
f"{'Part2_opt':20}: {ensembledata.nconfs_per_part['part2_opt']:{conflength}} {ensembledata.part_info['part2_opt']:{timelen}.2f} s {ensembledata.previous_part_info['part2_opt']:>{prev_timelen}.2f} s"
Expand All @@ -263,26 +273,28 @@ def main(argv=None):
f"{'Part2_all':20}: {ensembledata.nconfs_per_part['part2']:{conflength}} {ensembledata.part_info['part2']:{timelen}.2f} s {ensembledata.previous_part_info['part2']:>{prev_timelen}.2f} s"
)
timings += ensembledata.part_info["part2"]
prev_timings += ensembledata.previous_part_info['part2']
prev_timings += ensembledata.previous_part_info["part2"]
if config.part3:
print(
f"{'Part3_all':20}: {ensembledata.nconfs_per_part['part3']:{conflength}} {ensembledata.part_info['part3']:{timelen}.2f} s {ensembledata.previous_part_info['part3']:>{prev_timelen}.2f} s"
)
timings += ensembledata.part_info["part3"]
prev_timings += ensembledata.previous_part_info['part3']
prev_timings += ensembledata.previous_part_info["part3"]
if config.part4:
print(
f"{'Part4':20}: {'':{conflength}} {ensembledata.part_info['part4']:{timelen}.2f} s {ensembledata.previous_part_info['part4']:>{prev_timelen}.2f} s"
)
timings += ensembledata.part_info["part4"]
prev_timings += ensembledata.previous_part_info['part4']
prev_timings += ensembledata.previous_part_info["part4"]
if config.optical_rotation:
print(
f"{'Part5':20}: {'':{conflength}} {ensembledata.part_info['part5']:{timelen}.2f} s {ensembledata.previous_part_info['part5']:>{prev_timelen}.2f} s"
)
timings += ensembledata.part_info["part5"]
prev_timings += ensembledata.previous_part_info['part5']
prev_timings += ensembledata.previous_part_info["part5"]
print("".ljust(int(PLENGTH / 1.4), "-"))
print(f"{'All parts':20}: {'-':>{conflength}} {timings:{timelen}.2f} s {prev_timings:{prev_timelen}.2f} s")
print(
f"{'All parts':20}: {'-':>{conflength}} {timings:{timelen}.2f} s {prev_timings:{prev_timelen}.2f} s"
)
print("\nCENSO all done!")
return 0
Loading