Skip to content

Commit

Permalink
Merge pull request #95 from Angel-Jia/master
Browse files Browse the repository at this point in the history
accelerate the speed of making task
  • Loading branch information
Angel-Jia committed Nov 5, 2022
2 parents 5f90dd8 + 4495f8d commit e7b38d5
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions dpgen2/entrypoint/submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,8 @@ def make_conf_list(
conf_list = []
for ii in conf_list_fname:
ss = dpdata.System(ii, type_map=type_map, fmt=fmt)
ss.to('lammps/lmp', 'tmp.lmp')
conf_list.append(Path('tmp.lmp').read_text())
if Path('tmp.lmp').is_file():
os.remove('tmp.lmp')
ss_str = dpdata.lammps.lmp.from_system_data(ss, 0)
conf_list.append(ss_str)
# generate alloy confs
elif isinstance(conf_list, dict):
conf_list['type_map'] = type_map
Expand Down Expand Up @@ -218,6 +216,10 @@ def make_naive_exploration_scheduler(
max_numb_iter = config['max_numb_iter'] if old_style else config['explore']['max_numb_iter']
fatal_at_max = config.get('fatal_at_max', True) if old_style else config['explore']['fatal_at_max']
scheduler = ExplorationScheduler()

sys_configs_lmp = []
for sys_config in sys_configs:
sys_configs_lmp.append(make_conf_list(sys_config, type_map))

for job_ in model_devi_jobs:
if not isinstance(job_, list):
Expand All @@ -236,7 +238,7 @@ def make_naive_exploration_scheduler(
sys_idx = jj.pop('conf_idx')
conf_list = []
for ii in sys_idx:
conf_list += make_conf_list(sys_configs[ii], type_map)
conf_list += sys_configs_lmp[ii]
# make task group
tgroup = make_task_group_from_config(numb_models, mass_map, jj)
# add the list to task group
Expand Down

0 comments on commit e7b38d5

Please sign in to comment.