Skip to content

Commit

Permalink
args: add shuffle_poscar to run jdata (#806)
Browse files Browse the repository at this point in the history
* args: add `shuffle_poscar` to run jdata

* Update arginfo.py

* add default to shuffle_poscar

Co-authored-by: Han Wang <92130845+wanghan-iapcm@users.noreply.github.com>
  • Loading branch information
njzjz and wanghan-iapcm authored Jul 21, 2022
1 parent 902c1fe commit 8750a83
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions dpgen/generator/arginfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ def model_devi_lmp_args() -> List[Argument]:
doc_model_devi_clean_traj = 'If type of model_devi_clean_traj is bool type then it denote whether to clean traj folders in MD since they are too large. If it is Int type, then the most recent n iterations of traj folders will be retained, others will be removed.'
doc_model_devi_nopbc = 'Assume open boundary condition in MD simulations.'
doc_model_devi_activation_func = 'Set activation functions for models, length of the list should be the same as numb_models, and two elements in the list of string respectively assign activation functions to the embedding and fitting nets within each model. Backward compatibility: the orginal "list of String" format is still supported, where embedding and fitting nets of one model use the same activation function, and the length of the list should be the same as numb_models.'
doc_shuffle_poscar = 'Shuffle atoms of each frame before running simulations. The purpose is to sample the element occupation of alloys.'

return [
model_devi_jobs_args(),
Expand Down Expand Up @@ -171,6 +172,7 @@ def model_devi_lmp_args() -> List[Argument]:
doc=doc_model_devi_nopbc),
Argument("model_devi_activation_func", list, optional=True,
doc=doc_model_devi_activation_func),
Argument("shuffle_poscar", bool, optional=True, default=False, doc=doc_shuffle_poscar),
]


Expand Down
2 changes: 1 addition & 1 deletion dpgen/generator/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,7 @@ def make_model_devi (iter_index,
sys_configs.append(temp_sys_list)
else:
sys_configs = jdata['sys_configs']
shuffle_poscar = jdata['shuffle_poscar']
shuffle_poscar = jdata.get('shuffle_poscar', False)

if model_devi_engine != 'calypso':
cur_job = model_devi_jobs[iter_index]
Expand Down

0 comments on commit 8750a83

Please sign in to comment.