aboutsummaryrefslogtreecommitdiff
path: root/src/testbed/testbed_api.h
diff options
context:
space:
mode:
authorSree Harsha Totakura <totakura@in.tum.de>2013-01-01 22:44:12 +0000
committerSree Harsha Totakura <totakura@in.tum.de>2013-01-01 22:44:12 +0000
commit01e21ba6afe2d16ba45b5a73f2777152fd27ffc3 (patch)
treee4ba10669fac95d66763c8d9c8812eda9da3b7b0 /src/testbed/testbed_api.h
parent5200c6d68ff70c484c480794e5debbc50b62e2aa (diff)
downloadgnunet-01e21ba6afe2d16ba45b5a73f2777152fd27ffc3.tar.gz
gnunet-01e21ba6afe2d16ba45b5a73f2777152fd27ffc3.zip
adaptive parallelism for overlay connect operations based on SD calculations
Diffstat (limited to 'src/testbed/testbed_api.h')
-rw-r--r--src/testbed/testbed_api.h62
1 files changed, 58 insertions, 4 deletions
diff --git a/src/testbed/testbed_api.h b/src/testbed/testbed_api.h
index e850fcba2..54a622dbf 100644
--- a/src/testbed/testbed_api.h
+++ b/src/testbed/testbed_api.h
@@ -179,6 +179,30 @@ struct OperationContext
179 179
180 180
181/** 181/**
182 * Opaque handle for SD calculations
183 */
184struct SDHandle;
185
186
187/**
188 * A slot to record time taken by an overlay connect operation
189 */
190struct TimeSlot
191{
192 /**
193 * A key to identify this timeslot
194 */
195 void *key;
196
197 /**
198 * Time
199 */
200 struct GNUNET_TIME_Relative time;
201
202};
203
204
205/**
182 * Handle to interact with a GNUnet testbed controller. Each 206 * Handle to interact with a GNUnet testbed controller. Each
183 * controller has at least one master handle which is created when the 207 * controller has at least one master handle which is created when the
184 * controller is created; this master handle interacts with the 208 * controller is created; this master handle interacts with the
@@ -189,7 +213,6 @@ struct OperationContext
189 */ 213 */
190struct GNUNET_TESTBED_Controller 214struct GNUNET_TESTBED_Controller
191{ 215{
192
193 /** 216 /**
194 * The host where the controller is running 217 * The host where the controller is running
195 */ 218 */
@@ -277,10 +300,22 @@ struct GNUNET_TESTBED_Controller
277 struct OperationQueue *opq_parallel_overlay_connect_operations; 300 struct OperationQueue *opq_parallel_overlay_connect_operations;
278 301
279 /** 302 /**
303 * An array of timing slots; size should be equal to the current number of parallel
304 * overlay connects
305 */
306 struct TimeSlot *tslots;
307
308 /**
309 * Handle for SD calculations amount parallel overlay connect operation finish
310 * times
311 */
312 struct SDHandle *poc_sd;
313
314 /**
280 * The controller event mask 315 * The controller event mask
281 */ 316 */
282 uint64_t event_mask; 317 uint64_t event_mask;
283 318
284 /** 319 /**
285 * Did we start the receive loop yet? 320 * Did we start the receive loop yet?
286 */ 321 */
@@ -297,9 +332,9 @@ struct GNUNET_TESTBED_Controller
297 unsigned int num_parallel_connects; 332 unsigned int num_parallel_connects;
298 333
299 /** 334 /**
300 * The threshold for the number of parallel overlay connects we do 335 * Counter to indicate when all the available time slots are filled
301 */ 336 */
302 unsigned int num_parallel_connects_threshold; 337 unsigned int tslots_filled;
303 338
304 /** 339 /**
305 * The operation id counter. use current value and increment 340 * The operation id counter. use current value and increment
@@ -500,5 +535,24 @@ GNUNET_TESTBED_controller_link_ (void *op_cls,
500 *slave_cfg, 535 *slave_cfg,
501 int is_subordinate); 536 int is_subordinate);
502 537
538unsigned int
539GNUNET_TESTBED_get_tslot_ (struct GNUNET_TESTBED_Controller *c, void *key);
540
541
542void
543GNUNET_TESTBED_update_time_slot_ (struct GNUNET_TESTBED_Controller *c,
544 unsigned int index,
545 void *key,
546 struct GNUNET_TIME_Relative time);
547
548
549int
550GNUNET_TESTBED_release_time_slot_ (struct GNUNET_TESTBED_Controller *c,
551 unsigned int index,
552 void *key);
553
554
555
556
503#endif 557#endif
504/* end of testbed_api.h */ 558/* end of testbed_api.h */