Skip to content

Commit

Permalink
autotest: rename task directory to avoid false result in a rerun (#572)
Browse files Browse the repository at this point in the history
Change-Id: Ia138ee7c31b6c41d9f41f5943affa9ebf8803c46

Co-authored-by: Zhengju Sha <jenny@bytedance.com>
  • Loading branch information
shazj99 and Zhengju Sha committed Oct 15, 2021
1 parent bb1277d commit 0cb32d6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
7 changes: 3 additions & 4 deletions dpgen/auto_test/common_equi.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
from distutils.version import LooseVersion
from dpgen.dispatcher.Dispatcher import make_submission
from dpgen.remote.decide_machine import convert_mdata
from dpgen.auto_test.lib.utils import create_path

lammps_task_type = ['deepmd', 'meam', 'eam_fs', 'eam_alloy']


Expand Down Expand Up @@ -78,10 +80,7 @@ def make_equi(confs,
if not os.path.exists(poscar):
raise FileNotFoundError('no configuration for autotest')
relax_dirs = os.path.abspath(os.path.join(ii, 'relaxation', 'relax_task')) # to be consistent with property in make dispatcher
if os.path.exists(relax_dirs):
dlog.warning('%s already exists' % relax_dirs)
else:
os.makedirs(relax_dirs)
create_path(relax_dirs)
task_dirs.append(relax_dirs)
os.chdir(relax_dirs)
# copy POSCARs to mp-xxx/relaxation/relax_task
Expand Down
6 changes: 2 additions & 4 deletions dpgen/auto_test/common_prop.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from dpgen.dispatcher.Dispatcher import make_dispatcher
from dpgen.dispatcher.Dispatcher import make_submission
from dpgen.remote.decide_machine import convert_mdata
from dpgen.auto_test.lib.utils import create_path
lammps_task_type = ['deepmd', 'meam', 'eam_fs', 'eam_alloy']


Expand Down Expand Up @@ -73,10 +74,7 @@ def make_property(confs,
path_to_equi = os.path.join(ii, 'relaxation', 'relax_task')
path_to_work = os.path.join(ii, property_type + '_' + suffix)

if os.path.exists(path_to_work):
dlog.warning('%s already exists' % path_to_work)
else:
os.makedirs(path_to_work)
create_path(path_to_work)

prop = make_property_instance(jj)
task_list = prop.make_confs(path_to_work, path_to_equi, do_refine)
Expand Down

0 comments on commit 0cb32d6

Please sign in to comment.