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

Support forward files for simplify #1092

Merged
merged 3 commits into from
Dec 30, 2022
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
3 changes: 2 additions & 1 deletion dpgen/generator/lib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ def symlink_user_forward_files(mdata, task_type, work_path, task_format = None):
for task in tasks:
if os.path.isfile(os.path.join(task, os.path.basename(file))):
os.remove(os.path.join(task, os.path.basename(file)))
os.symlink(file, os.path.join(task, os.path.basename(file)))
abs_file = os.path.abspath(file)
os.symlink(abs_file, os.path.join(task, os.path.basename(file)))
return

5 changes: 5 additions & 0 deletions dpgen/simplify/simplify.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
from dpgen.generator.run import make_train, run_train, post_train, run_fp, post_fp, fp_name, model_devi_name, train_name, train_task_fmt, sys_link_fp_vasp_pp, make_fp_vasp_incar, make_fp_vasp_kp, make_fp_vasp_cp_cvasp, data_system_fmt, model_devi_task_fmt, fp_task_fmt
# TODO: maybe the following functions can be moved to dpgen.util
from dpgen.generator.lib.utils import log_iter, make_iter_name, create_path, record_iter
from dpgen.generator.lib.utils import symlink_user_forward_files
from dpgen.generator.lib.gaussian import make_gaussian_input
from dpgen.remote.decide_machine import convert_mdata
from .arginfo import simplify_jdata_arginfo
Expand Down Expand Up @@ -411,6 +412,10 @@ def make_fp(iter_index, jdata, mdata):
else:
make_fp_configs(iter_index, jdata)
make_fp_calculation(iter_index, jdata)
# Copy user defined forward_files
iter_name = make_iter_name(iter_index)
work_path = os.path.join(iter_name, fp_name)
symlink_user_forward_files(mdata=mdata, task_type="fp", work_path=work_path)


def run_iter(param_file, machine_file):
Expand Down