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
3 changes: 3 additions & 0 deletions docs/input.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ This section defines how the configuration space is explored.
"_comment" : "stage 0, task group 0",
"type" : "lmp-md",
"ensemble": "nvt", "nsteps": 50, "temps": [50, 100], "trj_freq": 10,
"input_extra_files": ["assets/dp/SiC_ZBL.txt"],
"conf_idx": [0], "n_sample" : 3
},
{
Expand Down Expand Up @@ -131,6 +132,8 @@ 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.

The {dargs:argument}`"input_extra_files"<task_group[lmp-md]/input_extra_files>` list copies each named file into every exploration task directory. The file is available there by its basename. For example, a DP-ZBL model using `use_srtab` should list its ZBL table here and reference `SiC_ZBL.txt` from the model configuration.


### FP

Expand Down
19 changes: 19 additions & 0 deletions tests/exploration/test_make_task_group_from_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@

class TestMakeLmpTaskGroupFromConfig(unittest.TestCase):
def setUp(self):
self.extra_file = Path("SiC_ZBL.txt")
self.extra_file.write_text("ZBL table content\n")
self.config_npt = {
"type": "lmp-md",
"Ts": [100],
Expand All @@ -51,13 +53,30 @@ def setUp(self):

def tearDown(self):
os.remove(self.config_template["lmp_template_fname"])
self.extra_file.unlink()

def test_npt(self):
tgroup = make_lmp_task_group_from_config(
self.numb_models, self.mass_map, self.config_npt
)
self.assertTrue(isinstance(tgroup, NPTTaskGroup))

def test_npt_copies_input_extra_files_to_each_task(self):
config = {
**self.config_npt,
"input_extra_files": [str(self.extra_file)],
}
tgroup = make_lmp_task_group_from_config(
self.numb_models, self.mass_map, config
)
tgroup.set_conf(["LAMMPS configuration"])
tgroup.make_task()

self.assertEqual(
tgroup[0].files()[self.extra_file.name],
"ZBL table content\n",
)

def test_template(self):
tgroup = make_lmp_task_group_from_config(
self.numb_models, self.mass_map, self.config_template
Expand Down