Skip to content

Commit 94fdf09

Browse files
authored
exclude no converged task for cp2k fp (#486)
* Update CP2K new example and slurm-lsf-mix machine * exclude the unconverge fp task in data set * modify the way to count failed fp * Update run.py * Update run.py
1 parent ddf39f1 commit 94fdf09

File tree

1 file changed

+21
-10
lines changed

1 file changed

+21
-10
lines changed

dpgen/generator/run.py

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2521,20 +2521,31 @@ def post_fp_cp2k (iter_index,
25212521
system_index.sort()
25222522

25232523
cwd = os.getcwd()
2524+
# tcount: num of all fp tasks
2525+
tcount = 0
2526+
# icount: num of converged fp tasks
2527+
icount = 0
25242528
for ss in system_index :
25252529
sys_output = glob.glob(os.path.join(work_path, "task.%s.*/output"%ss))
25262530
sys_output.sort()
2527-
for idx,oo in enumerate(sys_output) :
2528-
sys = dpdata.LabeledSystem(oo, fmt = 'cp2k/output')
2529-
if len(sys) > 0:
2530-
sys.check_type_map(type_map = jdata['type_map'])
2531-
if idx == 0:
2532-
all_sys = sys
2531+
tcount += len(sys_output)
2532+
all_sys = None
2533+
for oo in sys_output :
2534+
_sys = dpdata.LabeledSystem(oo, fmt = 'cp2k/output')
2535+
_sys.check_type_map(type_map = jdata['type_map'])
2536+
if all_sys is None:
2537+
all_sys = _sys
25332538
else:
2534-
all_sys.append(sys)
2535-
sys_data_path = os.path.join(work_path, 'data.%s'%ss)
2536-
all_sys.to_deepmd_raw(sys_data_path)
2537-
all_sys.to_deepmd_npy(sys_data_path, set_size = len(sys_output))
2539+
all_sys.append(_sys)
2540+
2541+
2542+
icount += len(all_sys)
2543+
if all_sys is not None:
2544+
sys_data_path = os.path.join(work_path, 'data.%s'%ss)
2545+
all_sys.to_deepmd_raw(sys_data_path)
2546+
all_sys.to_deepmd_npy(sys_data_path, set_size = len(sys_output))
2547+
dlog.info("failed frame number: %s "%(tcount-icount))
2548+
dlog.info("total frame number: %s "%tcount)
25382549

25392550

25402551
def post_fp_pwmat (iter_index,

0 commit comments

Comments
 (0)