Skip to content

Commit 8176c53

Browse files
committed
Updated the code for extending EEXE simulations; Updated docs/conf.py
1 parent 5d1c386 commit 8176c53

File tree

2 files changed

+9
-18
lines changed

2 files changed

+9
-18
lines changed

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,4 +176,4 @@
176176
# autoclass_content = 'both'
177177
autodoc_member_order = 'bysource'
178178
napoleon_attr_annotations = True
179-
autodoc_mock_imports = ["mpi4py", "gmxapi"]
179+
autodoc_mock_imports = ["mpi4py"] # we originally included gmxapi in the old versions of ensemble_md

ensemble_md/cli/run_EEXE.py

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
####################################################################
1010
import os
1111
import sys
12-
import glob
1312
import time
1413
import copy
1514
import shutil
@@ -107,24 +106,16 @@ def main():
107106
if rank == 0:
108107
# If there is a checkpoint file, we see the execution as an extension of an EEXE simulation
109108
ckpt_data = np.load(args.ckpt)
110-
start_idx = len(ckpt_data[0])
109+
start_idx = len(ckpt_data[0]) # The length should be the same for the same axis
111110
print(f'\nGetting prepared to extend the EEXE simulation from iteration {start_idx} ...')
112111

113-
print('Deleting corrupted data ...')
114-
corrupted = glob.glob('gmxapi.commandline.cli*') # corrupted iteration
115-
corrupted.extend(glob.glob('mdrun*'))
116-
for i in corrupted:
117-
shutil.rmtree(i)
118-
if len(corrupted) == 0:
119-
corrupt_bool = False
120-
121-
for i in range(EEXE.n_sim):
122-
n_finished = len(next(os.walk(f'sim_{i}'))[1]) # number of finished iterations (the last might be initialized but corrupted though) # noqa: E501
123-
if n_finished == EEXE.n_iter and corrupt_bool is False:
124-
print('Extension aborted: The expected number of iterations have been completed!')
125-
sys.exit()
126-
else:
127-
print('Deleting data generated after the checkpoint ...')
112+
if start_idx == EEXE.n_iter:
113+
print('Extension aborted: The expected number of iterations have been completed!')
114+
sys.exit()
115+
else:
116+
print('Deleting data generated after the checkpoint ...')
117+
for i in range(EEXE.n_sim):
118+
n_finished = len(next(os.walk(f'sim_{i}'))[1]) # number of finished iterations
128119
for j in range(start_idx, n_finished):
129120
print(f' Deleting the folder sim_{i}/iteration_{j}')
130121
shutil.rmtree(f'sim_{i}/iteration_{j}')

0 commit comments

Comments
 (0)