Skip to content
Open
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
5 changes: 4 additions & 1 deletion dpgen/generator/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -1881,7 +1881,10 @@ def _make_model_devi_native_gromacs(iter_index, jdata, mdata, conf_systems):
# input.json for DP-Gromacs
with open(os.path.join(cc, "input.json")) as f:
input_json = json.load(f)
input_json["graph_file"] = models[0]
# Tasks run in a remote staging directory, so a local absolute
# training path would not resolve after DPDispatcher transfers
# the model into the model-deviation work directory.
input_json["graph_file"] = task_model_list[0]
input_json["lambda"] = ll
with open(os.path.join(task_path, "input.json"), "w") as _outfile:
json.dump(input_json, _outfile, indent=4)
Expand Down
5 changes: 5 additions & 0 deletions tests/generator/test_gromacs_engine.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import importlib
import json
import os
import shutil
import sys
Expand Down Expand Up @@ -94,6 +95,10 @@ def _check_dir(self, wdir, post=True):
)
)

with open(os.path.join(wdir, "input.json")) as f:
input_json = json.load(f)
self.assertEqual(input_json["graph_file"], "../graph.000.pb")

def _copy_outputs(self, path_1, path_2):
shutil.copy(
os.path.join(path_1, "deepmd_traj.gro"),
Expand Down