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

init_reaction: fix compatibility with new dpdispatcher #755

Merged
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
7 changes: 5 additions & 2 deletions dpgen/data/reaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,18 @@ def link_trj(jdata):

def run_build_dataset(jdata, mdata, log_file="build_log"):
work_path = build_path
# compatible with new dpdispatcher and old dpgen.dispatcher
build_ntasks = mdata["build_resources"].get("cpu_per_node", mdata["build_resources"]["task_per_node"])
fp_ntasks = mdata["fp_resources"].get("cpu_per_node", mdata["fp_resources"]["task_per_node"])
build_command = "{cmd} -n {dataset_name} -a {type_map} -d {lammpstrj} -c {cutoff} -s {dataset_size} -k \"{qmkeywords}\" --nprocjob {nprocjob} --nproc {nproc}".format(
cmd=mdata["build_command"],
type_map=" ".join(jdata["type_map"]),
lammpstrj=trj_path,
cutoff=jdata["cutoff"],
dataset_size=jdata["dataset_size"],
qmkeywords=jdata["qmkeywords"],
nprocjob=mdata["fp_resources"]["task_per_node"],
nproc=mdata["build_resources"]["task_per_node"],
nprocjob=fp_ntasks,
nproc=build_ntasks,
dataset_name=dataset_name
)
run_tasks = glob.glob(os.path.join(work_path, 'task.*'))
Expand Down