loomcomm.proto 1.93 KB
Newer Older
Stanislav Bohm's avatar
Stanislav Bohm committed
1 2 3
package loomcomm;

option optimize_for = LITE_RUNTIME;
4
import "loomplan.proto";
Stanislav Bohm's avatar
Stanislav Bohm committed
5 6 7 8 9 10 11 12

message Register {
	enum Type {
		REGISTER_WORKER = 1;
		REGISTER_CLIENT = 2;
	}
	required int32 protocol_version = 1;
	required Type type = 2;
Stanislav Bohm's avatar
Stanislav Bohm committed
13 14

	// Worker
Stanislav Bohm's avatar
Stanislav Bohm committed
15 16
	optional int32 port = 3;
	repeated string task_types = 4;
Stanislav Bohm's avatar
Stanislav Bohm committed
17 18
	repeated string data_types = 5;
	optional int32 cpus = 6;
Stanislav Bohm's avatar
Stanislav Bohm committed
19 20 21 22 23 24 25 26 27 28 29 30
}

message ServerMessage {
	enum Type {
		START_JOB = 1;
	}
}

message WorkerCommand {
	enum Type {
		TASK = 1;
		SEND = 2;
31
		REMOVE = 3;
32
		DICTIONARY = 4;
Stanislav Bohm's avatar
Stanislav Bohm committed
33 34 35
	}
	required Type type = 1;

36
	// ALL
Stanislav Bohm's avatar
Stanislav Bohm committed
37 38 39 40 41 42 43 44 45
	optional int32 id = 2;

	// TASK
	optional int32 task_type = 3;
	optional string task_config = 4;
	repeated int32 task_inputs = 5;

	// SEND
	optional string address = 10;
46
	optional bool with_size = 11;
47 48 49

	// DICTIONARY
	repeated string symbols = 100;
Stanislav Bohm's avatar
Stanislav Bohm committed
50 51 52
}

message WorkerResponse {
53 54 55 56 57 58 59
	enum Type {
		FINISH = 1;
		FAILED = 2;
	}
	required Type type = 1;
	required int32 id = 2;

60 61 62 63
	// FINISHED
	optional uint64 size = 3;
	optional uint64 length = 4;

64
	// FAILED
65
	optional string error_msg = 100;
Stanislav Bohm's avatar
Stanislav Bohm committed
66 67 68 69 70 71
}

message Announce {
	required int32 port = 1;
}

72
message DataPrologue {
Stanislav Bohm's avatar
Stanislav Bohm committed
73
	required int32 id = 1;
74 75 76 77 78 79
	optional uint64 data_size = 3;
}

message Data
{
	required int32 type_id = 1;
80 81 82 83
	required uint64 size = 2;
	optional uint64 length = 3;
	optional uint64 arg0_u64 = 8;
	optional uint64 arg1_u64 = 9;
Stanislav Bohm's avatar
Stanislav Bohm committed
84
}
Stanislav Bohm's avatar
Stanislav Bohm committed
85

86 87 88 89 90 91 92 93 94 95
message Event {
	enum Type {
		TASK_START = 1;
		TASK_END = 2;
		SEND_START = 3;
		SEND_END = 4;
	}
	required uint64 time = 1;
	required Type type = 2;
	required int32 id = 3;
Stanislav Bohm's avatar
Stanislav Bohm committed
96
	optional int32 worker_id = 4;
Stanislav Bohm's avatar
Stanislav Bohm committed
97 98
}

99 100 101 102 103 104
message Error {
	required int32 id = 1;
	required string worker = 2;
	required string error_msg = 3;
}

Stanislav Bohm's avatar
Stanislav Bohm committed
105 106 107
message ClientMessage {
	enum Type {
		DATA = 1;
108
		EVENT = 2;
109
		ERROR = 3;
Stanislav Bohm's avatar
Stanislav Bohm committed
110
		DICTIONARY = 4;
Stanislav Bohm's avatar
Stanislav Bohm committed
111 112 113
	}
	required Type type = 1;
	optional DataPrologue data = 2;
114
	optional Event event = 3;
115
	optional Error error = 4;
Stanislav Bohm's avatar
Stanislav Bohm committed
116
	repeated string symbols = 5;
Stanislav Bohm's avatar
Stanislav Bohm committed
117
}
118 119 120 121 122

message ClientSubmit {
	required loomplan.Plan plan = 1;
	required bool report = 2;
}