Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
HyperLoom
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ADAS
HyperLoom
Commits
3f33f0ed
Commit
3f33f0ed
authored
8 years ago
by
Ada Böhm
Browse files
Options
Downloads
Patches
Plain Diff
ENH: loom.client.wait added
parent
f6225913
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
python/loom/client/client.py
+2
-2
2 additions, 2 deletions
python/loom/client/client.py
python/loom/client/wait/__init__.py
+0
-0
0 additions, 0 deletions
python/loom/client/wait/__init__.py
python/loom/client/wait/__main__.py
+63
-0
63 additions, 0 deletions
python/loom/client/wait/__main__.py
with
65 additions
and
2 deletions
python/loom/client/client.py
+
2
−
2
View file @
3f33f0ed
...
...
@@ -159,8 +159,8 @@ class Client(object):
self
.
symbols
=
{}
for
i
,
s
in
enumerate
(
cmsg
.
symbols
):
self
.
symbols
[
s
]
=
i
self
.
array_id
=
self
.
symbols
[
"
loom/array
"
]
self
.
rawdata_id
=
self
.
symbols
[
"
loom/data
"
]
self
.
array_id
=
self
.
symbols
.
get
(
"
loom/array
"
)
self
.
rawdata_id
=
self
.
symbols
.
get
(
"
loom/data
"
)
def
process_error
(
self
,
cmsg
):
assert
cmsg
.
HasField
(
"
error
"
)
...
...
This diff is collapsed.
Click to expand it.
python/loom/client/wait/__init__.py
0 → 100644
+
0
−
0
View file @
3f33f0ed
This diff is collapsed.
Click to expand it.
python/loom/client/wait/__main__.py
0 → 100644
+
63
−
0
View file @
3f33f0ed
#
# This program waits for X workers in server
#
import
argparse
import
sys
import
time
from
..client
import
Client
def
parse_args
():
parser
=
argparse
.
ArgumentParser
(
description
=
"
Wait
"
"
-- waits for workers in server
"
)
parser
.
add_argument
(
"
server
"
,
metavar
=
"
SERVER
"
,
type
=
str
,
help
=
"
Server hostname
"
)
parser
.
add_argument
(
"
port
"
,
metavar
=
"
PORT
"
,
type
=
int
,
help
=
"
Server TCP port
"
)
parser
.
add_argument
(
"
n_workers
"
,
metavar
=
"
N_WORKERS
"
,
type
=
int
,
help
=
"
Number of workers
"
)
parser
.
add_argument
(
"
timeout
"
,
metavar
=
"
TIMEOUT
"
,
type
=
int
,
help
=
"
timeout (in seconds)
"
)
args
=
parser
.
parse_args
()
return
args
def
main
():
args
=
parse_args
()
client
=
Client
(
args
.
server
,
args
.
port
)
t
=
0
workers
=
-
1
while
True
:
if
t
>
args
.
timeout
:
print
(
"
Timeouted
"
)
sys
.
exit
(
1
)
n_workers
=
client
.
get_stats
()[
"
n_workers
"
]
if
workers
!=
n_workers
:
workers
=
n_workers
print
(
"
Workers in server: {}/{}
"
.
format
(
workers
,
args
.
n_workers
))
if
workers
==
args
.
n_workers
:
return
time
.
sleep
(
1
)
t
+=
1
if
__name__
==
"
__main__
"
:
main
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment