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

fix ‘post_fp_cp2k’, add param rfailed #765

Merged
merged 2 commits into from
Jul 1, 2022
Merged
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
15 changes: 11 additions & 4 deletions dpgen/generator/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -2995,7 +2995,10 @@ def post_fp_gaussian (iter_index,


def post_fp_cp2k (iter_index,
jdata):
jdata,
rfailed=None):

ratio_failed = rfailed if rfailed else jdata.get('ratio_failed',0.10)
model_devi_jobs = jdata['model_devi_jobs']
assert (iter_index < len(model_devi_jobs))

Expand Down Expand Up @@ -3026,7 +3029,7 @@ def post_fp_cp2k (iter_index,
all_sys = None
for oo in sys_output :
_sys = dpdata.LabeledSystem(oo, fmt = 'cp2k/output')
_sys.check_type_map(type_map = jdata['type_map'])
#_sys.check_type_map(type_map = jdata['type_map'])
Comment on lines -3029 to +3032
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you explain why the check_type_map is commented out?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your comment, I have edited my comment.

if all_sys is None:
all_sys = _sys
else:
Expand All @@ -3038,8 +3041,12 @@ def post_fp_cp2k (iter_index,
sys_data_path = os.path.join(work_path, 'data.%s'%ss)
all_sys.to_deepmd_raw(sys_data_path)
all_sys.to_deepmd_npy(sys_data_path, set_size = len(sys_output))
dlog.info("failed frame number: %s "%(tcount-icount))
dlog.info("total frame number: %s "%tcount)

rfail=float(tcount - icount)/float(tcount)
dlog.info("failed frame: %6d in %6d %6.2f %% " % (tcount - icount, tcount, rfail * 100.))

if rfail>ratio_failed:
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.*.*/.\'")


def post_fp_pwmat (iter_index,
Expand Down