Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
seminar-breakout
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shashank Suhas
seminar-breakout
Commits
2f610df6
You need to sign in or sign up before continuing.
Commit
2f610df6
authored
Jan 28, 2018
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use abstract sockets on linux (#455)
parent
ea623424
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
9 deletions
+16
-9
tensorpack/dataflow/parallel.py
tensorpack/dataflow/parallel.py
+16
-9
No files found.
tensorpack/dataflow/parallel.py
View file @
2f610df6
# -*- coding: UTF-8 -*-
# File: parallel.py
import
sys
import
weakref
from
contextlib
import
contextmanager
import
multiprocessing
as
mp
...
...
@@ -42,15 +42,22 @@ def _bind_guard(sock, name):
def
_get_pipe_name
(
name
):
pipedir
=
os
.
environ
.
get
(
'TENSORPACK_PIPEDIR'
,
None
)
if
pipedir
is
not
None
:
logger
.
info
(
"ZMQ uses TENSORPACK_PIPEDIR={}"
.
format
(
pipedir
))
if
sys
.
platform
.
startswith
(
'linux'
):
# linux supports abstract sockets: http://api.zeromq.org/4-1:zmq-ipc
pipename
=
"ipc://@{}-pipe-{}"
.
format
(
name
,
str
(
uuid
.
uuid1
())[:
8
])
pipedir
=
os
.
environ
.
get
(
'TENSORPACK_PIPEDIR'
,
None
)
if
pipedir
is
not
None
:
logger
.
warn
(
"TENSORPACK_PIPEDIR is not used on Linux any more! Abstract sockets will be used."
)
else
:
pipedir
=
'.'
assert
os
.
path
.
isdir
(
pipedir
),
pipedir
filename
=
'{}/{}-pipe-{}'
.
format
(
pipedir
.
rstrip
(
'/'
),
name
,
str
(
uuid
.
uuid1
())[:
6
])
assert
not
os
.
path
.
exists
(
filename
),
"Pipe {} exists! You may be unlucky."
.
format
(
filename
)
pipename
=
"ipc://{}"
.
format
(
filename
)
pipedir
=
os
.
environ
.
get
(
'TENSORPACK_PIPEDIR'
,
None
)
if
pipedir
is
not
None
:
logger
.
info
(
"ZMQ uses TENSORPACK_PIPEDIR={}"
.
format
(
pipedir
))
else
:
pipedir
=
'.'
assert
os
.
path
.
isdir
(
pipedir
),
pipedir
filename
=
'{}/{}-pipe-{}'
.
format
(
pipedir
.
rstrip
(
'/'
),
name
,
str
(
uuid
.
uuid1
())[:
6
])
assert
not
os
.
path
.
exists
(
filename
),
"Pipe {} exists! You may be unlucky."
.
format
(
filename
)
pipename
=
"ipc://{}"
.
format
(
filename
)
return
pipename
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment