Skip to content

Commit 8dfcb40

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents c924f33 + c618c28 commit 8dfcb40

File tree

8 files changed

+51
-103
lines changed

8 files changed

+51
-103
lines changed

.github/workflows/mirror_gitee.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Mirror to Gitee Repo
2+
3+
on: [ push, delete, create ]
4+
5+
# Ensures that only one mirror task will run at a time.
6+
concurrency:
7+
group: git-mirror
8+
9+
jobs:
10+
git-mirror:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: wearerequired/git-mirror-action@v1
14+
env:
15+
ORGANIZATION: deepmodeling
16+
SSH_PRIVATE_KEY: ${{ secrets.SYNC_GITEE_PRIVATE_KEY }}
17+
with:
18+
source-repo: "https://github.com/deepmodeling/dpdispatcher.git"
19+
destination-repo: "git@gitee.com:deepmodeling/dpdispatcher.git"

doc/api.rst

Lines changed: 0 additions & 91 deletions
This file was deleted.

doc/conf.py

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,16 @@
1010
# add these directories to sys.path here. If the directory is relative to the
1111
# documentation root, use os.path.abspath to make it absolute, like shown here.
1212
#
13-
# import os
14-
# import sys
13+
import os
14+
import sys
15+
from datetime import date
1516
# sys.path.insert(0, os.path.abspath('.'))
1617

1718

1819
# -- Project information -----------------------------------------------------
1920

2021
project = 'DPDispatcher'
21-
copyright = '2020, Deep Modeling'
22+
copyright = '2020-%d, Deep Modeling' % date.today().year
2223
author = 'Deep Modeling'
2324

2425

@@ -30,6 +31,9 @@
3031
extensions = [
3132
'recommonmark',
3233
"sphinx_rtd_theme",
34+
'sphinx.ext.viewcode',
35+
'sphinx.ext.intersphinx',
36+
'numpydoc',
3337
'sphinx.ext.autosummary'
3438
]
3539

@@ -58,3 +62,18 @@
5862
autodoc_default_flags = ['members']
5963
autosummary_generate = True
6064
master_doc = 'index'
65+
66+
def run_apidoc(_):
67+
from sphinx.ext.apidoc import main
68+
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
69+
cur_dir = os.path.abspath(os.path.dirname(__file__))
70+
module = os.path.join(cur_dir, "..", "dpdispatcher")
71+
main(['-M', '--tocfile', 'api', '-H', 'DPDispatcher API', '-o', os.path.join(cur_dir, "api"), module, '--force'])
72+
73+
def setup(app):
74+
app.connect('builder-inited', run_apidoc)
75+
76+
77+
intersphinx_mapping = {
78+
"python": ("https://docs.python.org/", None),
79+
}

doc/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ DPDispatcher will monitor (poke) until these jobs finish and download the result
2020
machine
2121
resources
2222
task
23-
api
23+
api/api
2424

2525

2626
Indices and tables

dpdispatcher/slurm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def do_submit(self, job, retry=0, max_retry=3):
4242
ret, stdin, stdout, stderr = self.context.block_call('cd %s && %s %s' % (self.context.remote_root, 'sbatch', script_file_name))
4343
if ret != 0:
4444
err_str = stderr.read().decode('utf-8')
45-
if "Socket timed out on send/recv operation" in err_str:
45+
if "Socket timed out on send/recv operation" in err_str or "Unable to contact slurm controller" in err_str:
4646
# server network error, retry 3 times
4747
if retry < max_retry:
4848
dlog.warning("Get error code %d in submitting through ssh with job: %s . message: %s" %
@@ -81,7 +81,7 @@ def check_status(self, job, retry=0, max_retry=3):
8181
return JobStatus.finished
8282
else :
8383
return JobStatus.terminated
84-
elif "Socket timed out on send/recv operation" in err_str:
84+
elif "Socket timed out on send/recv operation" in err_str or "Unable to contact slurm controller" in err_str:
8585
# retry 3 times
8686
if retry < max_retry:
8787
dlog.warning("Get error code %d in checking status through ssh with job: %s . message: %s" %

dpdispatcher/ssh_context.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -526,18 +526,18 @@ def _get_files(self,
526526
per_nfile = 100
527527
ntar = len(files) // per_nfile + 1
528528
if ntar <= 1:
529-
self.block_checkcall('tar czf %s %s' % (of, " ".join(files)))
529+
self.block_checkcall('tar czfh %s %s' % (of, " ".join(files)))
530530
else:
531531
of_tar = self.submission.submission_hash + '.tar'
532532
for ii in range(ntar):
533533
ff = files[per_nfile * ii : per_nfile * (ii+1)]
534534
if ii == 0:
535535
# tar cf for the first time
536-
self.block_checkcall('tar cf %s %s' % (of_tar, " ".join(ff)))
536+
self.block_checkcall('tar cfh %s %s' % (of_tar, " ".join(ff)))
537537
else:
538538
# append using tar rf
539539
# -r, --append append files to the end of an archive
540-
self.block_checkcall('tar rf %s %s' % (of_tar, " ".join(ff)))
540+
self.block_checkcall('tar rfh %s %s' % (of_tar, " ".join(ff)))
541541
# compress the tar file using gzip, and will get a tar.gz file
542542
# overwrite considering dpgen may stop and restart
543543
# -f, --force force overwrite of output file and compress links

dpdispatcher/submission.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -554,11 +554,12 @@ def handle_unexpected_job_state(self):
554554
self.handle_unexpected_job_state()
555555

556556
if job_state == JobStatus.unsubmitted:
557-
dlog.info(f"job: {self.job_hash} unsubmitted; submit it")
557+
dlog.debug(f"job: {self.job_hash} unsubmitted; submit it")
558558
# if self.fail_count > 3:
559559
# raise RuntimeError("job:job {job} failed 3 times".format(job=self))
560560
self.submit_job()
561-
dlog.info("job: {job_hash} submit; job_id is {job_id}".format(job_hash=self.job_hash, job_id=self.job_id))
561+
if self.job_state != JobStatus.unsubmitted:
562+
dlog.info("job: {job_hash} submit; job_id is {job_id}".format(job_hash=self.job_hash, job_id=self.job_id))
562563
# self.get_job_state()
563564

564565
def get_hash(self):

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
keywords='deep potential generator active learning deepmd-kit',
4141
install_requires=install_requires,
4242
extras_require={
43-
'docs': ['sphinx', 'recommonmark', 'sphinx_rtd_theme'],
43+
'docs': ['sphinx', 'recommonmark', 'sphinx_rtd_theme>=1.0.0rc1', 'numpydoc'],
4444
"cloudserver": ["oss2"],
4545
":python_version<'3.7'": ["typing_extensions"],
4646
},

0 commit comments

Comments
 (0)