-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathrsg.proto
200 lines (168 loc) · 4.57 KB
/
rsg.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
syntax = "proto3";
package rsg.pb;
message Actor {
int32 id = 1;
}
message Host {
string name = 1;
}
message Mailbox {
string name = 1;
}
message Comm {
uint64 address = 1;
}
message ConditionVariable {
uint64 address = 1;
}
enum ConditionVariableStatus {
no_timeout = 0;
timeout = 1;
}
message Mutex {
uint64 address = 1;
}
// This is the first message sent by any client to the RSG server.
message Command {
message AddActor {
string actorName = 1;
string hostName = 2;
}
oneof type {
AddActor addActor = 1;
bool start = 2;
string kill = 3;
bool status = 4;
Actor connect = 5;
}
}
// Server's acknowledgment to the client initial command.
message CommandAck {
message Status {
uint32 nbConnectedActors = 1;
}
bool success = 1; // Defined for all acknowledgments.
Actor actor = 2; // Only defined as ADD-ACTOR acknowledgment.
Status status = 3; // Only defined as STATUS acknowledgment.
}
// The only message sent by clients to the RSG server during the simulation.
message Decision {
message CreateActor {
string name = 1;
Host host = 2;
}
message ActorJoin {
Actor actor = 1;
double timeout = 2;
}
message MailboxPut {
Mailbox mailbox = 1;
bytes data = 2;
uint64 simulatedSize = 3;
}
message CommWaitFor {
Comm comm = 1;
double timeout = 2;
}
message CommWaitAnyFor {
repeated Comm comms = 1;
double timeout = 2;
}
message ConditionVariableWait {
ConditionVariable conditionVariable = 1;
Mutex mutex = 2;
}
message ConditionVariableWaitUntil {
ConditionVariable conditionVariable = 1;
Mutex mutex = 2;
double timeout_time = 3;
}
message ConditionVariableWaitFor {
ConditionVariable conditionVariable = 1;
Mutex mutex = 2;
double duration = 3;
}
double think_time = 40; // The amount of time the client took to take its decision (seconds)
oneof type {
bool quit = 1;
// static methods in rsg::this_actor
double thisActorExecute = 2;
double thisActorSleepFor = 3;
double thisActorSleepUntil = 4;
bool thisActorYield = 5;
// methods in rsg::Actor
Actor actorGetName = 6;
Actor actorGetHost = 7;
ActorJoin actorJoin = 32;
// static methods in rsg::Actor
CreateActor actorCreate = 8;
// methods in rsg::Comm
Comm commRefcountDecrease = 10;
// Comm commStart = 11; // commented for now, as it is not implemented in s4u for Comm
CommWaitFor commWaitFor = 12;
Comm commCancel = 13;
Comm commTest = 14;
CommWaitAnyFor commWaitAnyFor = 15;
// static methods in rsg::Engine
bool engineGetClock = 16;
// static methods in rsg::Host
string hostByNameOrNull = 17;
bool hostCurrent = 31;
// methods in rsg::Mailbox
Mailbox mailboxEmpty = 18;
Mailbox mailboxListen = 19;
Mailbox mailboxReady = 20;
MailboxPut mailboxPut = 21;
MailboxPut mailboxPutAsync = 22;
Mailbox mailboxGet = 23;
Mailbox mailboxGetAsync = 24;
// methods in rsg::Mutex
bool mutexCreate = 25;
Mutex mutexRefcountDecrease = 27;
Mutex mutexLock = 28;
Mutex mutexUnlock = 29;
Mutex mutexTryLock = 30;
// methods in rsg::ConditionVariable
bool conditionVariableCreate = 33;
ConditionVariable conditionVariableRefcountDecrease = 34;
ConditionVariableWait conditionVariableWait = 35;
ConditionVariableWaitUntil conditionVariableWaitUntil = 36;
ConditionVariableWaitFor conditionVariableWaitFor = 37;
ConditionVariable conditionVariableNotifyOne = 38;
ConditionVariable conditionVariableNotifyAll = 39;
}
}
// The only message sent by the RSG server to a client during the simulation.
message DecisionAck {
message CommWaitFor {
bool timeoutReached = 1;
bytes data = 2; // only set for async receptions
}
message CommWaitAnyFor {
int32 finishedCommIndex = 1;
bytes data = 2;
}
message CommTest {
bool isTerminated = 1;
bytes data = 2; // only set for async receptions when data needs to be transferred
}
bool success = 1;
oneof data {
string actorGetName = 2;
Host actorGetHost = 3;
Actor actorCreate = 4;
CommWaitFor commWaitFor = 5;
CommTest commTest = 6;
CommWaitAnyFor commWaitAnyFor = 7;
double engineGetClock = 8;
Host hostCurrent = 14;
Comm mailboxPutAsync = 9;
bytes mailboxGet = 10;
Comm mailboxGetAsync = 11;
Mutex mutexCreate = 12;
bool mutexTryLock = 13;
ConditionVariable conditionVariableCreate = 15;
ConditionVariableStatus conditionVariableWaitFor = 16;
ConditionVariableStatus conditionVariableWaitUntil = 17;
}
}