Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ADAS
HyperLoom
Commits
e12fe38c
Commit
e12fe38c
authored
Jul 04, 2016
by
Stanislav Bohm
Browse files
ENH: Scheduling improved
parent
c510093c
Changes
21
Hide whitespace changes
Inline
Side-by-side
src/client/client.py
View file @
e12fe38c
...
...
@@ -9,16 +9,22 @@ LOOM_PROTOCOL_VERSION = 1
class
Client
(
object
):
def
__init__
(
self
,
address
,
port
):
def
__init__
(
self
,
address
,
port
,
info
=
False
):
self
.
server_address
=
address
self
.
server_port
=
port
s
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
s
.
connect
((
address
,
port
))
self
.
connection
=
Connection
(
s
)
if
info
:
self
.
info
=
[]
else
:
self
.
info
=
None
msg
=
Register
()
msg
.
type
=
Register
.
REGISTER_CLIENT
msg
.
protocol_version
=
LOOM_PROTOCOL_VERSION
msg
.
info
=
info
self
.
_send_message
(
msg
)
def
submit
(
self
,
plan
,
results
):
...
...
@@ -42,14 +48,21 @@ class Client(object):
msg
=
self
.
connection
.
receive_message
()
cmsg
=
ClientMessage
()
cmsg
.
ParseFromString
(
msg
)
assert
cmsg
.
type
==
ClientMessage
.
DATA
prologue
=
cmsg
.
data
data
[
prologue
.
id
]
=
self
.
_receive_data
()
if
cmsg
.
type
==
ClientMessage
.
DATA
:
prologue
=
cmsg
.
data
data
[
prologue
.
id
]
=
self
.
_receive_data
()
else
:
assert
cmsg
.
type
==
ClientMessage
.
INFO
self
.
add_info
(
cmsg
.
info
)
if
single_result
:
return
data
[
results
.
id
]
else
:
return
[
data
[
task
.
id
]
for
task
in
results
]
def
add_info
(
self
,
info
):
self
.
info
.
append
((
info
.
id
,
info
.
worker
))
def
_receive_data
(
self
):
msg_data
=
Data
()
msg_data
.
ParseFromString
(
self
.
connection
.
receive_message
())
...
...
src/client/loomcomm_pb2.py
View file @
e12fe38c
...
...
@@ -18,7 +18,7 @@ _sym_db = _symbol_database.Default()
DESCRIPTOR
=
_descriptor
.
FileDescriptor
(
name
=
'loomcomm.proto'
,
package
=
'loomcomm'
,
serialized_pb
=
_b
(
'
\n\x0e
loomcomm.proto
\x12\x08
loomcomm
\"\x
9f
\x01\n\x08
Register
\x12\x18\n\x10
protocol_version
\x18\x01
\x02
(
\x05\x12
%
\n\x04
type
\x18\x02
\x02
(
\x0e\x32\x17
.loomcomm.Register.Type
\x12\x0c\n\x04
port
\x18\x03
\x01
(
\x05\x12\x12\n\n
task_types
\x18\x04
\x03
(
\t\"
0
\n\x04
Type
\x12\x13\n\x0f
REGISTER_WORKER
\x10\x01\x12\x13\n\x0f
REGISTER_CLIENT
\x10\x02\"
&
\n\r
ServerMessage
\"\x15\n\x04
Type
\x12\r\n\t
START_JOB
\x10\x01\"\xc4\x01\n\r
WorkerCommand
\x12
*
\n\x04
type
\x18\x01
\x02
(
\x0e\x32\x1c
.loomcomm.WorkerCommand.Type
\x12\n\n\x02
id
\x18\x02
\x01
(
\x05\x12\x11\n\t
task_type
\x18\x03
\x01
(
\x05\x12\x13\n\x0b
task_config
\x18\x04
\x01
(
\t\x12\x13\n\x0b
task_inputs
\x18\x05
\x03
(
\x05\x12\x0f\n\x07\x61\x64\x64
ress
\x18\n
\x01
(
\t\x12\x11\n\t
with_size
\x18\x0b
\x01
(
\x08\"\x1a\n\x04
Type
\x12\x08\n\x04
TASK
\x10\x01\x12\x08\n\x04
SEND
\x10\x02\"\x1c\n\x0e
WorkerResponse
\x12\n\n\x02
id
\x18\x02
\x01
(
\x05\"\x18\n\x08\x41
nnounce
\x12\x0c\n\x04
port
\x18\x01
\x02
(
\x05\"
-
\n\x0c\x44\x61
taPrologue
\x12\n\n\x02
id
\x18\x01
\x02
(
\x05\x12\x11\n\t
data_size
\x18\x03
\x01
(
\x04\"
%
\n\x04\x44\x61
ta
\x12\x0f\n\x07
type_id
\x18\x01
\x02
(
\x05\x12\x0c\n\x04
size
\x18\x02
\x01
(
\x04\"
&
\n\x0
8\x46\x65\x65\x64\x62\x61\x63
k
\x12\n\n\x02
id
\x18\x01
\x02
(
\x05\x12\x0e\n\x06
worker
\x18\x02
\x02
(
\t\"\x
a7
\x01\n\r
ClientMessage
\x12
*
\n\x04
type
\x18\x01
\x02
(
\x0e\x32\x1c
.loomcomm.ClientMessage.Type
\x12
$
\n\x04\x64\x61
ta
\x18\x02
\x01
(
\x0b\x32\x16
.loomcomm.DataPrologue
\x12
$
\n\x08\x66\x65\x65\x64\x62\x61\x63
k
\x18\x03
\x01
(
\x0b\x32\x
12
.loomcomm.
Feedback
\"\x1
e
\n\x04
Type
\x12\x08\n\x04\x44\x41
TA
\x10\x01\x12\x0
c
\n\x0
8\x46\x45\x45\x44\x42\x41\x43
K
\x10\x02\x42\x02
H
\x03
'
)
serialized_pb
=
_b
(
'
\n\x0e
loomcomm.proto
\x12\x08
loomcomm
\"\x
bb
\x01\n\x08
Register
\x12\x18\n\x10
protocol_version
\x18\x01
\x02
(
\x05\x12
%
\n\x04
type
\x18\x02
\x02
(
\x0e\x32\x17
.loomcomm.Register.Type
\x12\x0c\n\x04
port
\x18\x03
\x01
(
\x05\x12\x12\n\n
task_types
\x18\x04
\x03
(
\t\
x12\x0c\n\x04\x63
pus
\x18\x05
\x01
(
\x05\x12\x0c\n\x04
info
\x18\n
\x01
(
\x08\
"
0
\n\x04
Type
\x12\x13\n\x0f
REGISTER_WORKER
\x10\x01\x12\x13\n\x0f
REGISTER_CLIENT
\x10\x02\"
&
\n\r
ServerMessage
\"\x15\n\x04
Type
\x12\r\n\t
START_JOB
\x10\x01\"\xc4\x01\n\r
WorkerCommand
\x12
*
\n\x04
type
\x18\x01
\x02
(
\x0e\x32\x1c
.loomcomm.WorkerCommand.Type
\x12\n\n\x02
id
\x18\x02
\x01
(
\x05\x12\x11\n\t
task_type
\x18\x03
\x01
(
\x05\x12\x13\n\x0b
task_config
\x18\x04
\x01
(
\t\x12\x13\n\x0b
task_inputs
\x18\x05
\x03
(
\x05\x12\x0f\n\x07\x61\x64\x64
ress
\x18\n
\x01
(
\t\x12\x11\n\t
with_size
\x18\x0b
\x01
(
\x08\"\x1a\n\x04
Type
\x12\x08\n\x04
TASK
\x10\x01\x12\x08\n\x04
SEND
\x10\x02\"\x1c\n\x0e
WorkerResponse
\x12\n\n\x02
id
\x18\x02
\x01
(
\x05\"\x18\n\x08\x41
nnounce
\x12\x0c\n\x04
port
\x18\x01
\x02
(
\x05\"
-
\n\x0c\x44\x61
taPrologue
\x12\n\n\x02
id
\x18\x01
\x02
(
\x05\x12\x11\n\t
data_size
\x18\x03
\x01
(
\x04\"
%
\n\x04\x44\x61
ta
\x12\x0f\n\x07
type_id
\x18\x01
\x02
(
\x05\x12\x0c\n\x04
size
\x18\x02
\x01
(
\x04\"
\"
\n\x0
4
Info
\x12\n\n\x02
id
\x18\x01
\x02
(
\x05\x12\x0e\n\x06
worker
\x18\x02
\x02
(
\t\"\x
9b
\x01\n\r
ClientMessage
\x12
*
\n\x04
type
\x18\x01
\x02
(
\x0e\x32\x1c
.loomcomm.ClientMessage.Type
\x12
$
\n\x04\x64\x61
ta
\x18\x02
\x01
(
\x0b\x32\x16
.loomcomm.DataPrologue
\x12
\x1c\n\x04
info
\x18\x03
\x01
(
\x0b\x32\x
0e
.loomcomm.
Info
\"\x1
a
\n\x04
Type
\x12\x08\n\x04\x44\x41
TA
\x10\x01\x12\x0
8
\n\x0
4
INFO
\x10\x02\x42\x02
H
\x03
'
)
)
_sym_db
.
RegisterFileDescriptor
(
DESCRIPTOR
)
...
...
@@ -41,8 +41,8 @@ _REGISTER_TYPE = _descriptor.EnumDescriptor(
],
containing_type
=
None
,
options
=
None
,
serialized_start
=
1
40
,
serialized_end
=
188
,
serialized_start
=
1
68
,
serialized_end
=
216
,
)
_sym_db
.
RegisterEnumDescriptor
(
_REGISTER_TYPE
)
...
...
@@ -59,8 +59,8 @@ _SERVERMESSAGE_TYPE = _descriptor.EnumDescriptor(
],
containing_type
=
None
,
options
=
None
,
serialized_start
=
2
07
,
serialized_end
=
2
28
,
serialized_start
=
2
35
,
serialized_end
=
2
56
,
)
_sym_db
.
RegisterEnumDescriptor
(
_SERVERMESSAGE_TYPE
)
...
...
@@ -81,8 +81,8 @@ _WORKERCOMMAND_TYPE = _descriptor.EnumDescriptor(
],
containing_type
=
None
,
options
=
None
,
serialized_start
=
4
01
,
serialized_end
=
4
27
,
serialized_start
=
4
29
,
serialized_end
=
4
55
,
)
_sym_db
.
RegisterEnumDescriptor
(
_WORKERCOMMAND_TYPE
)
...
...
@@ -97,14 +97,14 @@ _CLIENTMESSAGE_TYPE = _descriptor.EnumDescriptor(
options
=
None
,
type
=
None
),
_descriptor
.
EnumValueDescriptor
(
name
=
'
FEEDBACK
'
,
index
=
1
,
number
=
2
,
name
=
'
INFO
'
,
index
=
1
,
number
=
2
,
options
=
None
,
type
=
None
),
],
containing_type
=
None
,
options
=
None
,
serialized_start
=
7
49
,
serialized_end
=
7
7
9
,
serialized_start
=
7
65
,
serialized_end
=
79
1
,
)
_sym_db
.
RegisterEnumDescriptor
(
_CLIENTMESSAGE_TYPE
)
...
...
@@ -144,6 +144,20 @@ _REGISTER = _descriptor.Descriptor(
message_type
=
None
,
enum_type
=
None
,
containing_type
=
None
,
is_extension
=
False
,
extension_scope
=
None
,
options
=
None
),
_descriptor
.
FieldDescriptor
(
name
=
'cpus'
,
full_name
=
'loomcomm.Register.cpus'
,
index
=
4
,
number
=
5
,
type
=
5
,
cpp_type
=
1
,
label
=
1
,
has_default_value
=
False
,
default_value
=
0
,
message_type
=
None
,
enum_type
=
None
,
containing_type
=
None
,
is_extension
=
False
,
extension_scope
=
None
,
options
=
None
),
_descriptor
.
FieldDescriptor
(
name
=
'info'
,
full_name
=
'loomcomm.Register.info'
,
index
=
5
,
number
=
10
,
type
=
8
,
cpp_type
=
7
,
label
=
1
,
has_default_value
=
False
,
default_value
=
False
,
message_type
=
None
,
enum_type
=
None
,
containing_type
=
None
,
is_extension
=
False
,
extension_scope
=
None
,
options
=
None
),
],
extensions
=
[
],
...
...
@@ -157,7 +171,7 @@ _REGISTER = _descriptor.Descriptor(
oneofs
=
[
],
serialized_start
=
29
,
serialized_end
=
188
,
serialized_end
=
216
,
)
...
...
@@ -180,8 +194,8 @@ _SERVERMESSAGE = _descriptor.Descriptor(
extension_ranges
=
[],
oneofs
=
[
],
serialized_start
=
190
,
serialized_end
=
2
28
,
serialized_start
=
218
,
serialized_end
=
2
56
,
)
...
...
@@ -253,8 +267,8 @@ _WORKERCOMMAND = _descriptor.Descriptor(
extension_ranges
=
[],
oneofs
=
[
],
serialized_start
=
2
31
,
serialized_end
=
4
27
,
serialized_start
=
2
59
,
serialized_end
=
4
55
,
)
...
...
@@ -283,8 +297,8 @@ _WORKERRESPONSE = _descriptor.Descriptor(
extension_ranges
=
[],
oneofs
=
[
],
serialized_start
=
4
29
,
serialized_end
=
45
7
,
serialized_start
=
4
57
,
serialized_end
=
4
8
5
,
)
...
...
@@ -313,8 +327,8 @@ _ANNOUNCE = _descriptor.Descriptor(
extension_ranges
=
[],
oneofs
=
[
],
serialized_start
=
4
59
,
serialized_end
=
483
,
serialized_start
=
4
87
,
serialized_end
=
511
,
)
...
...
@@ -350,8 +364,8 @@ _DATAPROLOGUE = _descriptor.Descriptor(
extension_ranges
=
[],
oneofs
=
[
],
serialized_start
=
485
,
serialized_end
=
5
30
,
serialized_start
=
513
,
serialized_end
=
5
58
,
)
...
...
@@ -387,27 +401,27 @@ _DATA = _descriptor.Descriptor(
extension_ranges
=
[],
oneofs
=
[
],
serialized_start
=
5
32
,
serialized_end
=
5
6
9
,
serialized_start
=
5
60
,
serialized_end
=
59
7
,
)
_
FEEDBACK
=
_descriptor
.
Descriptor
(
name
=
'
Feedback
'
,
full_name
=
'loomcomm.
Feedback
'
,
_
INFO
=
_descriptor
.
Descriptor
(
name
=
'
Info
'
,
full_name
=
'loomcomm.
Info
'
,
filename
=
None
,
file
=
DESCRIPTOR
,
containing_type
=
None
,
fields
=
[
_descriptor
.
FieldDescriptor
(
name
=
'id'
,
full_name
=
'loomcomm.
Feedback
.id'
,
index
=
0
,
name
=
'id'
,
full_name
=
'loomcomm.
Info
.id'
,
index
=
0
,
number
=
1
,
type
=
5
,
cpp_type
=
1
,
label
=
2
,
has_default_value
=
False
,
default_value
=
0
,
message_type
=
None
,
enum_type
=
None
,
containing_type
=
None
,
is_extension
=
False
,
extension_scope
=
None
,
options
=
None
),
_descriptor
.
FieldDescriptor
(
name
=
'worker'
,
full_name
=
'loomcomm.
Feedback
.worker'
,
index
=
1
,
name
=
'worker'
,
full_name
=
'loomcomm.
Info
.worker'
,
index
=
1
,
number
=
2
,
type
=
9
,
cpp_type
=
9
,
label
=
2
,
has_default_value
=
False
,
default_value
=
_b
(
""
).
decode
(
'utf-8'
),
message_type
=
None
,
enum_type
=
None
,
containing_type
=
None
,
...
...
@@ -424,8 +438,8 @@ _FEEDBACK = _descriptor.Descriptor(
extension_ranges
=
[],
oneofs
=
[
],
serialized_start
=
5
71
,
serialized_end
=
6
09
,
serialized_start
=
5
99
,
serialized_end
=
6
33
,
)
...
...
@@ -451,7 +465,7 @@ _CLIENTMESSAGE = _descriptor.Descriptor(
is_extension
=
False
,
extension_scope
=
None
,
options
=
None
),
_descriptor
.
FieldDescriptor
(
name
=
'
feedback
'
,
full_name
=
'loomcomm.ClientMessage.
feedback
'
,
index
=
2
,
name
=
'
info
'
,
full_name
=
'loomcomm.ClientMessage.
info
'
,
index
=
2
,
number
=
3
,
type
=
11
,
cpp_type
=
10
,
label
=
1
,
has_default_value
=
False
,
default_value
=
None
,
message_type
=
None
,
enum_type
=
None
,
containing_type
=
None
,
...
...
@@ -469,8 +483,8 @@ _CLIENTMESSAGE = _descriptor.Descriptor(
extension_ranges
=
[],
oneofs
=
[
],
serialized_start
=
6
12
,
serialized_end
=
7
7
9
,
serialized_start
=
6
36
,
serialized_end
=
79
1
,
)
_REGISTER
.
fields_by_name
[
'type'
].
enum_type
=
_REGISTER_TYPE
...
...
@@ -480,7 +494,7 @@ _WORKERCOMMAND.fields_by_name['type'].enum_type = _WORKERCOMMAND_TYPE
_WORKERCOMMAND_TYPE
.
containing_type
=
_WORKERCOMMAND
_CLIENTMESSAGE
.
fields_by_name
[
'type'
].
enum_type
=
_CLIENTMESSAGE_TYPE
_CLIENTMESSAGE
.
fields_by_name
[
'data'
].
message_type
=
_DATAPROLOGUE
_CLIENTMESSAGE
.
fields_by_name
[
'
feedback
'
].
message_type
=
_
FEEDBACK
_CLIENTMESSAGE
.
fields_by_name
[
'
info
'
].
message_type
=
_
INFO
_CLIENTMESSAGE_TYPE
.
containing_type
=
_CLIENTMESSAGE
DESCRIPTOR
.
message_types_by_name
[
'Register'
]
=
_REGISTER
DESCRIPTOR
.
message_types_by_name
[
'ServerMessage'
]
=
_SERVERMESSAGE
...
...
@@ -489,7 +503,7 @@ DESCRIPTOR.message_types_by_name['WorkerResponse'] = _WORKERRESPONSE
DESCRIPTOR
.
message_types_by_name
[
'Announce'
]
=
_ANNOUNCE
DESCRIPTOR
.
message_types_by_name
[
'DataPrologue'
]
=
_DATAPROLOGUE
DESCRIPTOR
.
message_types_by_name
[
'Data'
]
=
_DATA
DESCRIPTOR
.
message_types_by_name
[
'
Feedback'
]
=
_FEEDBACK
DESCRIPTOR
.
message_types_by_name
[
'
Info'
]
=
_INFO
DESCRIPTOR
.
message_types_by_name
[
'ClientMessage'
]
=
_CLIENTMESSAGE
Register
=
_reflection
.
GeneratedProtocolMessageType
(
'Register'
,
(
_message
.
Message
,),
dict
(
...
...
@@ -541,12 +555,12 @@ Data = _reflection.GeneratedProtocolMessageType('Data', (_message.Message,), dic
))
_sym_db
.
RegisterMessage
(
Data
)
Feedback
=
_reflection
.
GeneratedProtocolMessageType
(
'
Feedback
'
,
(
_message
.
Message
,),
dict
(
DESCRIPTOR
=
_
FEEDBACK
,
Info
=
_reflection
.
GeneratedProtocolMessageType
(
'
Info
'
,
(
_message
.
Message
,),
dict
(
DESCRIPTOR
=
_
INFO
,
__module__
=
'loomcomm_pb2'
# @@protoc_insertion_point(class_scope:loomcomm.
Feedback
)
# @@protoc_insertion_point(class_scope:loomcomm.
Info
)
))
_sym_db
.
RegisterMessage
(
Feedback
)
_sym_db
.
RegisterMessage
(
Info
)
ClientMessage
=
_reflection
.
GeneratedProtocolMessageType
(
'ClientMessage'
,
(
_message
.
Message
,),
dict
(
DESCRIPTOR
=
_CLIENTMESSAGE
,
...
...
src/client/plan.py
View file @
e12fe38c
...
...
@@ -176,10 +176,21 @@ class Plan(object):
task
.
set_message
(
t
,
task_types
)
return
msg
def
write_dot
(
self
,
filename
):
def
write_dot
(
self
,
filename
,
info
=
None
):
colors
=
[
"red"
,
"green"
,
"blue"
,
"orange"
,
"violet"
]
if
info
:
w
=
sorted
(
set
(
worker
for
id
,
worker
in
info
))
workers
=
{}
for
id
,
worker
in
info
:
workers
[
id
]
=
w
.
index
(
worker
)
del
w
else
:
workers
=
None
graph
=
gv
.
Graph
()
for
task
in
self
.
tasks
:
node
=
graph
.
node
(
task
.
id
)
if
workers
:
node
.
color
=
colors
[
workers
[
task
.
id
]
%
len
(
colors
)]
node
.
label
=
"{}
\n
{}"
.
format
(
str
(
task
.
id
),
task
.
task_type
)
for
inp
in
task
.
inputs
:
graph
.
node
(
inp
.
id
).
add_arc
(
node
)
...
...
src/libloom/connection.cpp
View file @
e12fe38c
...
...
@@ -51,9 +51,10 @@ void Connection::close_and_discard_remaining_data()
}
void
Connection
::
accept
(
uv_tcp_t
*
listen_socket
)
{
{
UV_CHECK
(
uv_accept
((
uv_stream_t
*
)
listen_socket
,
(
uv_stream_t
*
)
&
socket
));
uv_read_start
((
uv_stream_t
*
)
&
socket
,
_buf_alloc
,
_on_read
);
state
=
ConnectionOpen
;
}
void
Connection
::
start_read
()
...
...
src/libloom/interconnect.cpp
View file @
e12fe38c
...
...
@@ -126,11 +126,6 @@ void InterConnection::send(Id id, std::shared_ptr<Data> &data, bool with_size)
}
}
void
InterConnection
::
send
(
std
::
unique_ptr
<
SendBuffer
>
buffer
)
{
}
std
::
string
InterConnection
::
make_address
(
const
std
::
string
&
host
,
int
port
)
{
std
::
stringstream
s
;
...
...
src/libloom/interconnect.h
View file @
e12fe38c
...
...
@@ -19,8 +19,7 @@ public:
InterConnection
(
Worker
&
worker
);
~
InterConnection
();
void
send
(
Id
id
,
std
::
shared_ptr
<
Data
>
&
data
,
bool
with_size
);
void
send
(
std
::
unique_ptr
<
SendBuffer
>
buffer
);
void
send
(
Id
id
,
std
::
shared_ptr
<
Data
>
&
data
,
bool
with_size
);
void
accept
(
uv_tcp_t
*
listen_socket
)
{
connection
.
accept
(
listen_socket
);
}
...
...
src/libloom/loomcomm.pb.cc
View file @
e12fe38c
...
...
@@ -23,7 +23,7 @@ void protobuf_ShutdownFile_loomcomm_2eproto() {
delete
Announce
::
default_instance_
;
delete
DataPrologue
::
default_instance_
;
delete
Data
::
default_instance_
;
delete
Feedback
::
default_instance_
;
delete
Info
::
default_instance_
;
delete
ClientMessage
::
default_instance_
;
}
...
...
@@ -46,7 +46,7 @@ void protobuf_AddDesc_loomcomm_2eproto() {
Announce
::
default_instance_
=
new
Announce
();
DataPrologue
::
default_instance_
=
new
DataPrologue
();
Data
::
default_instance_
=
new
Data
();
Feedback
::
default_instance_
=
new
Feedback
();
Info
::
default_instance_
=
new
Info
();
ClientMessage
::
default_instance_
=
new
ClientMessage
();
Register
::
default_instance_
->
InitAsDefaultInstance
();
ServerMessage
::
default_instance_
->
InitAsDefaultInstance
();
...
...
@@ -55,7 +55,7 @@ void protobuf_AddDesc_loomcomm_2eproto() {
Announce
::
default_instance_
->
InitAsDefaultInstance
();
DataPrologue
::
default_instance_
->
InitAsDefaultInstance
();
Data
::
default_instance_
->
InitAsDefaultInstance
();
Feedback
::
default_instance_
->
InitAsDefaultInstance
();
Info
::
default_instance_
->
InitAsDefaultInstance
();
ClientMessage
::
default_instance_
->
InitAsDefaultInstance
();
::
google
::
protobuf
::
internal
::
OnShutdown
(
&
protobuf_ShutdownFile_loomcomm_2eproto
);
}
...
...
@@ -99,6 +99,8 @@ const int Register::kProtocolVersionFieldNumber;
const
int
Register
::
kTypeFieldNumber
;
const
int
Register
::
kPortFieldNumber
;
const
int
Register
::
kTaskTypesFieldNumber
;
const
int
Register
::
kCpusFieldNumber
;
const
int
Register
::
kInfoFieldNumber
;
#endif // !_MSC_VER
Register
::
Register
()
...
...
@@ -123,6 +125,8 @@ void Register::SharedCtor() {
protocol_version_
=
0
;
type_
=
1
;
port_
=
0
;
cpus_
=
0
;
info_
=
false
;
::
memset
(
_has_bits_
,
0
,
sizeof
(
_has_bits_
));
}
...
...
@@ -161,11 +165,25 @@ Register* Register::New() const {
}
void
Register
::
Clear
()
{
if
(
_has_bits_
[
0
/
32
]
&
7
)
{
#define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \
&reinterpret_cast<Register*>(16)->f) - \
reinterpret_cast<char*>(16))
#define ZR_(first, last) do { \
size_t f = OFFSET_OF_FIELD_(first); \
size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \
::memset(&first, 0, n); \
} while (0)
if
(
_has_bits_
[
0
/
32
]
&
55
)
{
ZR_
(
port_
,
info_
);
protocol_version_
=
0
;
type_
=
1
;
port_
=
0
;
}
#undef OFFSET_OF_FIELD_
#undef ZR_
task_types_
.
Clear
();
::
memset
(
_has_bits_
,
0
,
sizeof
(
_has_bits_
));
mutable_unknown_fields
()
->
clear
();
...
...
@@ -245,6 +263,36 @@ bool Register::MergePartialFromCodedStream(
goto
handle_unusual
;
}
if
(
input
->
ExpectTag
(
34
))
goto
parse_task_types
;
if
(
input
->
ExpectTag
(
40
))
goto
parse_cpus
;
break
;
}
// optional int32 cpus = 5;
case
5
:
{
if
(
tag
==
40
)
{
parse_cpus:
DO_
((
::
google
::
protobuf
::
internal
::
WireFormatLite
::
ReadPrimitive
<
::
google
::
protobuf
::
int32
,
::
google
::
protobuf
::
internal
::
WireFormatLite
::
TYPE_INT32
>
(
input
,
&
cpus_
)));
set_has_cpus
();
}
else
{
goto
handle_unusual
;
}
if
(
input
->
ExpectTag
(
80
))
goto
parse_info
;
break
;
}
// optional bool info = 10;
case
10
:
{
if
(
tag
==
80
)
{
parse_info:
DO_
((
::
google
::
protobuf
::
internal
::
WireFormatLite
::
ReadPrimitive
<
bool
,
::
google
::
protobuf
::
internal
::
WireFormatLite
::
TYPE_BOOL
>
(
input
,
&
info_
)));
set_has_info
();
}
else
{
goto
handle_unusual
;
}
if
(
input
->
ExpectAtEnd
())
goto
success
;
break
;
}
...
...
@@ -296,6 +344,16 @@ void Register::SerializeWithCachedSizes(
4
,
this
->
task_types
(
i
),
output
);
}
// optional int32 cpus = 5;
if
(
has_cpus
())
{
::
google
::
protobuf
::
internal
::
WireFormatLite
::
WriteInt32
(
5
,
this
->
cpus
(),
output
);
}
// optional bool info = 10;
if
(
has_info
())
{
::
google
::
protobuf
::
internal
::
WireFormatLite
::
WriteBool
(
10
,
this
->
info
(),
output
);
}
output
->
WriteRaw
(
unknown_fields
().
data
(),
unknown_fields
().
size
());
// @@protoc_insertion_point(serialize_end:loomcomm.Register)
...
...
@@ -325,6 +383,18 @@ int Register::ByteSize() const {
this
->
port
());
}
// optional int32 cpus = 5;
if
(
has_cpus
())
{
total_size
+=
1
+
::
google
::
protobuf
::
internal
::
WireFormatLite
::
Int32Size
(
this
->
cpus
());
}
// optional bool info = 10;
if
(
has_info
())
{
total_size
+=
1
+
1
;
}
}
// repeated string task_types = 4;
total_size
+=
1
*
this
->
task_types_size
();
...
...
@@ -359,6 +429,12 @@ void Register::MergeFrom(const Register& from) {
if
(
from
.
has_port
())
{
set_port
(
from
.
port
());
}
if
(
from
.
has_cpus
())
{
set_cpus
(
from
.
cpus
());
}
if
(
from
.
has_info
())
{
set_info
(
from
.
info
());
}
}
mutable_unknown_fields
()
->
append
(
from
.
unknown_fields
());
}
...
...
@@ -381,6 +457,8 @@ void Register::Swap(Register* other) {
std
::
swap
(
type_
,
other
->
type_
);
std
::
swap
(
port_
,
other
->
port_
);
task_types_
.
Swap
(
&
other
->
task_types_
);
std
::
swap
(
cpus_
,
other
->
cpus_
);
std
::
swap
(
info_
,
other
->
info_
);
std
::
swap
(
_has_bits_
[
0
],
other
->
_has_bits_
[
0
]);
_unknown_fields_
.
swap
(
other
->
_unknown_fields_
);
std
::
swap
(
_cached_size_
,
other
->
_cached_size_
);
...
...
@@ -1869,27 +1947,27 @@ void Data::Swap(Data* other) {
// ===================================================================
#ifndef _MSC_VER
const
int
Feedback
::
kIdFieldNumber
;
const
int
Feedback
::
kWorkerFieldNumber
;
const
int
Info
::
kIdFieldNumber
;
const
int
Info
::
kWorkerFieldNumber
;
#endif // !_MSC_VER
Feedback
::
Feedback
()
Info
::
Info
()
:
::
google
::
protobuf
::
MessageLite
()
{
SharedCtor
();
// @@protoc_insertion_point(constructor:loomcomm.
Feedback
)
// @@protoc_insertion_point(constructor:loomcomm.
Info
)
}
void
Feedback
::
InitAsDefaultInstance
()
{
void
Info
::
InitAsDefaultInstance
()
{
}
Feedback
::
Feedback
(
const
Feedback
&
from
)
Info
::
Info
(
const
Info
&
from
)
:
::
google
::
protobuf
::
MessageLite
()
{
SharedCtor
();
MergeFrom
(
from
);
// @@protoc_insertion_point(copy_constructor:loomcomm.
Feedback
)
// @@protoc_insertion_point(copy_constructor:loomcomm.
Info
)
}
void
Feedback
::
SharedCtor
()
{
void
Info
::
SharedCtor
()
{
::
google
::
protobuf
::
internal
::
GetEmptyString
();
_cached_size_
=
0
;
id_
=
0
;
...
...
@@ -1897,12 +1975,12 @@ void Feedback::SharedCtor() {
::
memset
(
_has_bits_
,
0
,
sizeof
(
_has_bits_
));
}
Feedback
::~
Feedback
()
{
// @@protoc_insertion_point(destructor:loomcomm.
Feedback
)
Info
::~
Info
()
{
// @@protoc_insertion_point(destructor:loomcomm.
Info
)
SharedDtor
();
}
void
Feedback
::
SharedDtor
()
{
void
Info
::
SharedDtor
()
{
if
(
worker_
!=
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
())
{
delete
worker_
;
}
...
...
@@ -1914,12 +1992,12 @@ void Feedback::SharedDtor() {
}
}
void
Feedback
::
SetCachedSize
(
int
size
)
const
{
void
Info
::
SetCachedSize
(
int
size
)
const
{
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN
();
_cached_size_
=
size
;
GOOGLE_SAFE_CONCURRENT_WRITES_END
();
}
const
Feedback
&
Feedback
::
default_instance
()
{
const
Info
&
Info
::
default_instance
()
{
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
protobuf_AddDesc_loomcomm_2eproto
();
#else
...
...
@@ -1928,13 +2006,13 @@ const Feedback& Feedback::default_instance() {
return
*
default_instance_
;
}
Feedback
*
Feedback
::
default_instance_
=
NULL
;
Info
*
Info
::
default_instance_
=
NULL
;
Feedback
*
Feedback
::
New
()
const
{
return
new
Feedback
;
Info
*
Info
::
New
()
const
{
return
new
Info
;
}
void
Feedback
::
Clear
()
{
void
Info
::
Clear
()
{
if
(
_has_bits_
[
0
/
32
]
&
3
)
{
id_
=
0
;
if
(
has_worker
())
{
...
...
@@ -1947,7 +2025,7 @@ void Feedback::Clear() {
mutable_unknown_fields
()
->
clear
();
}
bool
Feedback
::
MergePartialFromCodedStream
(
bool
Info
::
MergePartialFromCodedStream
(
::
google
::
protobuf
::
io
::
CodedInputStream
*
input
)
{
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
::
google
::
protobuf
::
uint32
tag
;
...
...
@@ -1955,7 +2033,7 @@ bool Feedback::MergePartialFromCodedStream(
mutable_unknown_fields
());
::
google
::
protobuf
::
io
::
CodedOutputStream
unknown_fields_stream
(
&
unknown_fields_string
);
// @@protoc_insertion_point(parse_start:loomcomm.
Feedback
)
// @@protoc_insertion_point(parse_start:loomcomm.
Info
)
for
(;;)
{