diff --git a/docs/input.md b/docs/input.md index 6fc03bd1..d9bd7f73 100644 --- a/docs/input.md +++ b/docs/input.md @@ -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 }, { @@ -131,6 +132,8 @@ The {dargs:argument}`"stages"` defines the exploration stag The {dargs:argument}`"n_sample"` tells the number of confgiruations randomly sampled from the set picked by {dargs:argument}`"conf_idx"` from {dargs:argument}`"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"` 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 diff --git a/tests/exploration/test_make_task_group_from_config.py b/tests/exploration/test_make_task_group_from_config.py index f9fe93be..7dc66e2e 100644 --- a/tests/exploration/test_make_task_group_from_config.py +++ b/tests/exploration/test_make_task_group_from_config.py @@ -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], @@ -51,6 +53,7 @@ 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( @@ -58,6 +61,22 @@ def test_npt(self): ) 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