Skip to content

Commit 9cace60

Browse files
HuangJiamengZLI-afk
authored andcommitted
fix ‘post_fp_cp2k’, add param rfailed (deepmodeling#765)
* fix ‘post_fp_cp2k’, add param rfailed * Update run.py
1 parent 3dec4b8 commit 9cace60

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

dpgen/generator/run.py

+11-4
Original file line numberDiff line numberDiff line change
@@ -3342,7 +3342,10 @@ def post_fp_gaussian (iter_index,
33423342

33433343

33443344
def post_fp_cp2k (iter_index,
3345-
jdata):
3345+
jdata,
3346+
rfailed=None):
3347+
3348+
ratio_failed = rfailed if rfailed else jdata.get('ratio_failed',0.10)
33463349
model_devi_jobs = jdata['model_devi_jobs']
33473350
assert (iter_index < len(model_devi_jobs))
33483351

@@ -3373,7 +3376,7 @@ def post_fp_cp2k (iter_index,
33733376
all_sys = None
33743377
for oo in sys_output :
33753378
_sys = dpdata.LabeledSystem(oo, fmt = 'cp2k/output')
3376-
_sys.check_type_map(type_map = jdata['type_map'])
3379+
#_sys.check_type_map(type_map = jdata['type_map'])
33773380
if all_sys is None:
33783381
all_sys = _sys
33793382
else:
@@ -3385,8 +3388,12 @@ def post_fp_cp2k (iter_index,
33853388
sys_data_path = os.path.join(work_path, 'data.%s'%ss)
33863389
all_sys.to_deepmd_raw(sys_data_path)
33873390
all_sys.to_deepmd_npy(sys_data_path, set_size = len(sys_output))
3388-
dlog.info("failed frame number: %s "%(tcount-icount))
3389-
dlog.info("total frame number: %s "%tcount)
3391+
3392+
rfail=float(tcount - icount)/float(tcount)
3393+
dlog.info("failed frame: %6d in %6d %6.2f %% " % (tcount - icount, tcount, rfail * 100.))
3394+
3395+
if rfail>ratio_failed:
3396+
raise RuntimeError("find too many unsuccessfully terminated jobs. Too many FP tasks are not converged. Please check your files in directories \'iter.*.*/02.fp/task.*.*/.\'")
33903397

33913398

33923399
def post_fp_pwmat (iter_index,

0 commit comments

Comments
 (0)