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
4 changes: 4 additions & 0 deletions docs/input.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ The {dargs:argument}`"stages"<explore[lmp]/stages>` defines the exploration stag

The {dargs:argument}`"n_sample"<task_group[lmp-md]/n_sample>` tells the number of confgiruations randomly sampled from the set picked by {dargs:argument}`"conf_idx"<task_group[lmp-md]/conf_idx>` from {dargs:argument}`"configurations"<explore[lmp]/configurations>` for each exploration task. All configurations has the equal possibility to be sampled. The default value of `"n_sample"` is `null`, in this case all picked configurations are sampled. In the example, we have 3 samples for stage 0 task group 0 and 2 thermodynamic states (NVT, T=50 and 100K), then the task group has 3x2=6 NVT DPMD tasks.

Set `explore.config.use_hdf5` to `true` to store LAMMPS trajectories and model deviations as dflow HDF5 dataset artifacts. LAMMPS still writes the standard text `traj.dump` and `model_devi.out` files inside each task; DPGEN2 serializes their data at the artifact boundary and reads it back transparently during selection. This avoids depending on the optional LAMMPS H5MD package and preserves the frame/model-deviation alignment expected by DPGEN2.

This option is not the native LAMMPS `dump h5md` format. A custom H5MD dump cannot replace `traj.dump` in the built-in selector because its schema differs from the `lammps/dump` text consumed by dpdata. Use `extra_output_files` if a native H5MD file is needed as an additional output for another analysis tool.


### FP

Expand Down
5 changes: 4 additions & 1 deletion dpgen2/entrypoint/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,10 @@ def run_diffcsp_args():
doc_gen_tasks = "Number of DiffCSP generation tasks"
doc_gen_command = "Command for DiffCSP generation"
doc_relax_group_size = "Group size for relaxation"
doc_use_hdf5 = "Use HDF5 to store trajs and model_devis"
doc_use_hdf5 = (
"Store trajectories and model deviations as dflow HDF5 dataset "
"artifacts; this is independent of LAMMPS dump h5md."
)
return [
Argument(
"gen_tasks",
Expand Down
6 changes: 5 additions & 1 deletion dpgen2/op/run_lmp.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,11 @@ def lmp_args():
doc_shuffle_models = "Randomly pick a model from the group of models to drive theexploration MD simulation"
doc_head = "Select a head from multitask"
doc_use_ele_temp = "Whether to use electronic temperature, 0 for no, 1 for frame temperature, and 2 for atomic temperature"
doc_use_hdf5 = "Use HDF5 to store trajs and model_devis"
doc_use_hdf5 = (
"Store the standard LAMMPS dump trajectory and model-deviation "
"values in dflow HDF5 dataset artifacts. This does not enable "
"LAMMPS's native dump h5md command."
)
doc_extra_output_files = "Extra output file names, support wildcards"
return [
Argument("command", str, optional=True, default="lmp", doc=doc_lmp_cmd),
Expand Down
5 changes: 5 additions & 0 deletions tests/op/test_run_lmp.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ def tearDown(self):
if Path(self.task_name).is_dir():
shutil.rmtree(self.task_name)

def test_hdf5_storage_option_is_normalized(self):
config = RunLmp.normalize_config({"use_hdf5": True})

self.assertTrue(config["use_hdf5"])

@patch("dpgen2.op.run_lmp.run_command")
def test_success(self, mocked_run):
mocked_run.side_effect = [(0, "foo\n", "")]
Expand Down