aboutsummaryrefslogtreecommitdiff
path: root/src/experimentation
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2013-08-01 15:26:33 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2013-08-01 15:26:33 +0000
commit1a5f8627f57db2ce715154499a5a9648aa35d6b4 (patch)
tree74d881ed20697d5ceddb76b523179d0401825c35 /src/experimentation
parent7ca429a0bf105474981e283fc0e2b3af8e81fea6 (diff)
downloadgnunet-1a5f8627f57db2ce715154499a5a9648aa35d6b4.tar.gz
gnunet-1a5f8627f57db2ce715154499a5a9648aa35d6b4.zip
fixed stat counters
reduced logging
Diffstat (limited to 'src/experimentation')
-rw-r--r--src/experimentation/gnunet-daemon-experimentation.h2
-rw-r--r--src/experimentation/gnunet-daemon-experimentation_capabilities.c2
-rw-r--r--src/experimentation/gnunet-daemon-experimentation_experiments.c6
-rw-r--r--src/experimentation/gnunet-daemon-experimentation_nodes.c38
-rw-r--r--src/experimentation/gnunet-daemon-experimentation_scheduler.c45
-rw-r--r--src/experimentation/test_experimentation_clique_run.c47
6 files changed, 83 insertions, 57 deletions
diff --git a/src/experimentation/gnunet-daemon-experimentation.h b/src/experimentation/gnunet-daemon-experimentation.h
index 73499301a..838d06b69 100644
--- a/src/experimentation/gnunet-daemon-experimentation.h
+++ b/src/experimentation/gnunet-daemon-experimentation.h
@@ -271,7 +271,7 @@ int
271GED_nodes_rts (struct Node *n); 271GED_nodes_rts (struct Node *n);
272 272
273int 273int
274GED_nodes_request_start (struct Node *n, struct Experiment *e); 274GED_nodes_send_start (struct Node *n, struct Experiment *e);
275 275
276/** 276/**
277 * Confirm a experiment START with a node 277 * Confirm a experiment START with a node
diff --git a/src/experimentation/gnunet-daemon-experimentation_capabilities.c b/src/experimentation/gnunet-daemon-experimentation_capabilities.c
index a92d2d4bc..a59f59969 100644
--- a/src/experimentation/gnunet-daemon-experimentation_capabilities.c
+++ b/src/experimentation/gnunet-daemon-experimentation_capabilities.c
@@ -154,7 +154,7 @@ GED_capabilities_start ()
154 index = index << c1; 154 index = index << c1;
155 if (GNUNET_YES == GED_capabilities_have (GSE_node_capabilities, index)) 155 if (GNUNET_YES == GED_capabilities_have (GSE_node_capabilities, index))
156 { 156 {
157 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "We have `%s'\n", 157 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "We have `%s'\n",
158 GED_capability_to_str(index)); 158 GED_capability_to_str(index));
159 } 159 }
160 } 160 }
diff --git a/src/experimentation/gnunet-daemon-experimentation_experiments.c b/src/experimentation/gnunet-daemon-experimentation_experiments.c
index 28becc42d..343544ba8 100644
--- a/src/experimentation/gnunet-daemon-experimentation_experiments.c
+++ b/src/experimentation/gnunet-daemon-experimentation_experiments.c
@@ -306,7 +306,7 @@ void exp_file_iterator (void *cls,
306 struct GNUNET_TIME_Relative frequency; 306 struct GNUNET_TIME_Relative frequency;
307 struct GNUNET_TIME_Relative duration; 307 struct GNUNET_TIME_Relative duration;
308 308
309 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Parsing section `%s'\n", name); 309 //GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Parsing section `%s'\n", name);
310 310
311 /* Mandatory fields */ 311 /* Mandatory fields */
312 312
@@ -430,7 +430,7 @@ GED_experiments_start ()
430 } 430 }
431 else 431 else
432 { 432 {
433 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "`%s' is a valid issuer \n", GNUNET_i2s (&issuer_ID)); 433 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "`%s' is a valid issuer \n", GNUNET_i2s (&issuer_ID));
434 i = GNUNET_malloc (sizeof (struct Issuer)); 434 i = GNUNET_malloc (sizeof (struct Issuer));
435 GNUNET_CONTAINER_multihashmap_put (valid_issuers, &issuer_ID.hashPubKey, 435 GNUNET_CONTAINER_multihashmap_put (valid_issuers, &issuer_ID.hashPubKey,
436 i, GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST); 436 i, GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST);
@@ -468,7 +468,7 @@ GED_experiments_start ()
468 GSE_my_issuer_count = GNUNET_CONTAINER_multihashmap_size (valid_issuers); 468 GSE_my_issuer_count = GNUNET_CONTAINER_multihashmap_size (valid_issuers);
469 GSE_my_issuer = GNUNET_malloc (GSE_my_issuer_count * sizeof (struct Experimentation_Issuer)); 469 GSE_my_issuer = GNUNET_malloc (GSE_my_issuer_count * sizeof (struct Experimentation_Issuer));
470 GNUNET_CONTAINER_multihashmap_iterate (valid_issuers, &create_issuer, GSE_my_issuer); 470 GNUNET_CONTAINER_multihashmap_iterate (valid_issuers, &create_issuer, GSE_my_issuer);
471 GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Daemon has %u issuers\n"), GSE_my_issuer_count); 471 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Daemon has %u issuers\n", GSE_my_issuer_count);
472 472
473 experiments = GNUNET_CONTAINER_multihashmap_create (10, GNUNET_NO); 473 experiments = GNUNET_CONTAINER_multihashmap_create (10, GNUNET_NO);
474 /* Load experiments from file */ 474 /* Load experiments from file */
diff --git a/src/experimentation/gnunet-daemon-experimentation_nodes.c b/src/experimentation/gnunet-daemon-experimentation_nodes.c
index 3d2868df7..0590a1dec 100644
--- a/src/experimentation/gnunet-daemon-experimentation_nodes.c
+++ b/src/experimentation/gnunet-daemon-experimentation_nodes.c
@@ -217,7 +217,7 @@ schedule_transmisson (struct NodeComCtx *e_ctx)
217 &e_ctx->n->id, e_ctx->size, transmit_read_wrapper, e_ctx); 217 &e_ctx->n->id, e_ctx->size, transmit_read_wrapper, e_ctx);
218 if (NULL == e_ctx->n->cth) 218 if (NULL == e_ctx->n->cth)
219 { 219 {
220 GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Cannot send message to peer `%s' for experiment `%s'\n"), 220 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, _("Cannot send message to peer `%s' for experiment `%s'\n"),
221 GNUNET_i2s(&e_ctx->n->id), e_ctx->e->name); 221 GNUNET_i2s(&e_ctx->n->id), e_ctx->e->name);
222 GNUNET_free (e_ctx); 222 GNUNET_free (e_ctx);
223 } 223 }
@@ -236,7 +236,7 @@ remove_request (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
236{ 236{
237 struct Node *n = cls; 237 struct Node *n = cls;
238 238
239 GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Removing request for peer %s due to timeout\n"), 239 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Removing request for peer %s due to timeout\n",
240 GNUNET_i2s (&n->id)); 240 GNUNET_i2s (&n->id));
241 241
242 if (GNUNET_YES == GNUNET_CONTAINER_multihashmap_contains (nodes_requested, &n->id.hashPubKey)) 242 if (GNUNET_YES == GNUNET_CONTAINER_multihashmap_contains (nodes_requested, &n->id.hashPubKey))
@@ -287,7 +287,7 @@ size_t send_experimentation_request_cb (void *cls, size_t bufsize, void *buf)
287 memcpy (buf, &msg, msg_size); 287 memcpy (buf, &msg, msg_size);
288 memcpy (&((char *) buf)[msg_size], GSE_my_issuer, ri_size); 288 memcpy (&((char *) buf)[msg_size], GSE_my_issuer, ri_size);
289 289
290 GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Sending request to peer %s\n"), 290 GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Sending experimentation request to peer %s\n"),
291 GNUNET_i2s (&n->id)); 291 GNUNET_i2s (&n->id));
292 return total_size; 292 return total_size;
293} 293}
@@ -361,7 +361,7 @@ size_t send_response_cb (void *cls, size_t bufsize, void *buf)
361 memcpy (buf, &msg, msg_size); 361 memcpy (buf, &msg, msg_size);
362 memcpy (&((char *) buf)[msg_size], GSE_my_issuer, ri_size); 362 memcpy (&((char *) buf)[msg_size], GSE_my_issuer, ri_size);
363 363
364 GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Sending response to peer %s\n"), 364 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending response to peer %s\n",
365 GNUNET_i2s (&n->id)); 365 GNUNET_i2s (&n->id));
366 return total_size; 366 return total_size;
367} 367}
@@ -372,15 +372,7 @@ get_experiments_cb (struct Node *n, struct Experiment *e)
372{ 372{
373 static int counter = 0; 373 static int counter = 0;
374 if (NULL == e) 374 if (NULL == e)
375 { 375 return; /* Done */
376 GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Added %u experiments for peer %s\n"),
377 counter, GNUNET_i2s (&n->id));
378 return;
379 }
380
381 GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Starting experiment `%s' with peer %s\n"),
382 e->name,
383 GNUNET_i2s (&n->id));
384 376
385 /* Tell the scheduler to add a node with an experiment */ 377 /* Tell the scheduler to add a node with an experiment */
386 GED_scheduler_add (n, e, GNUNET_YES); 378 GED_scheduler_add (n, e, GNUNET_YES);
@@ -509,7 +501,7 @@ static void handle_request (const struct GNUNET_PeerIdentity *peer,
509 if (GNUNET_YES == GED_experiments_issuer_accepted(&rmi[c1].issuer_id)) 501 if (GNUNET_YES == GED_experiments_issuer_accepted(&rmi[c1].issuer_id))
510 ic_accepted ++; 502 ic_accepted ++;
511 } 503 }
512 GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Request from peer `%s' with %u issuers, we accepted %u issuer \n"), 504 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Request from peer `%s' with %u issuers, we accepted %u issuer \n",
513 GNUNET_i2s (peer), ic, ic_accepted); 505 GNUNET_i2s (peer), ic, ic_accepted);
514 GNUNET_free_non_null (n->issuer_id); 506 GNUNET_free_non_null (n->issuer_id);
515 n->issuer_id = GNUNET_malloc (ic_accepted * sizeof (struct GNUNET_PeerIdentity)); 507 n->issuer_id = GNUNET_malloc (ic_accepted * sizeof (struct GNUNET_PeerIdentity));
@@ -573,12 +565,12 @@ static void handle_response (const struct GNUNET_PeerIdentity *peer,
573 make_active = GNUNET_NO; 565 make_active = GNUNET_NO;
574 if (NULL != (n = GNUNET_CONTAINER_multihashmap_get (nodes_active, &peer->hashPubKey))) 566 if (NULL != (n = GNUNET_CONTAINER_multihashmap_get (nodes_active, &peer->hashPubKey)))
575 { 567 {
576 GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Received %s from %s peer `%s'\n"), 568 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received %s from %s peer `%s'\n",
577 "RESPONSE", "active", GNUNET_i2s (peer)); 569 "RESPONSE", "active", GNUNET_i2s (peer));
578 } 570 }
579 else if (NULL != (n = GNUNET_CONTAINER_multihashmap_get (nodes_requested, &peer->hashPubKey))) 571 else if (NULL != (n = GNUNET_CONTAINER_multihashmap_get (nodes_requested, &peer->hashPubKey)))
580 { 572 {
581 GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Received %s from %s peer `%s'\n"), 573 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received %s from %s peer `%s'\n",
582 "RESPONSE", "requested", GNUNET_i2s (peer)); 574 "RESPONSE", "requested", GNUNET_i2s (peer));
583 GNUNET_CONTAINER_multihashmap_remove (nodes_requested, &peer->hashPubKey, n); 575 GNUNET_CONTAINER_multihashmap_remove (nodes_requested, &peer->hashPubKey, n);
584 if (GNUNET_SCHEDULER_NO_TASK != n->timeout_task) 576 if (GNUNET_SCHEDULER_NO_TASK != n->timeout_task)
@@ -591,7 +583,7 @@ static void handle_response (const struct GNUNET_PeerIdentity *peer,
591 } 583 }
592 else if (NULL != (n = GNUNET_CONTAINER_multihashmap_get (nodes_inactive, &peer->hashPubKey))) 584 else if (NULL != (n = GNUNET_CONTAINER_multihashmap_get (nodes_inactive, &peer->hashPubKey)))
593 { 585 {
594 GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Received %s from peer `%s'\n"), 586 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received %s from peer `%s'\n",
595 "RESPONSE", "inactive", GNUNET_i2s (peer)); 587 "RESPONSE", "inactive", GNUNET_i2s (peer));
596 GNUNET_CONTAINER_multihashmap_remove (nodes_inactive, &peer->hashPubKey, n); 588 GNUNET_CONTAINER_multihashmap_remove (nodes_inactive, &peer->hashPubKey, n);
597 update_stats (nodes_inactive); 589 update_stats (nodes_inactive);
@@ -599,7 +591,7 @@ static void handle_response (const struct GNUNET_PeerIdentity *peer,
599 } 591 }
600 else 592 else
601 { 593 {
602 GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Received %s from %s peer `%s'\n"), 594 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received %s from %s peer `%s'\n",
603 "RESPONSE", "unknown", GNUNET_i2s (peer)); 595 "RESPONSE", "unknown", GNUNET_i2s (peer));
604 return; 596 return;
605 } 597 }
@@ -614,7 +606,7 @@ static void handle_response (const struct GNUNET_PeerIdentity *peer,
614 if (GNUNET_YES == GED_experiments_issuer_accepted(&rmi[c1].issuer_id)) 606 if (GNUNET_YES == GED_experiments_issuer_accepted(&rmi[c1].issuer_id))
615 ic_accepted ++; 607 ic_accepted ++;
616 } 608 }
617 GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Response from peer `%s' with %u issuers, we accepted %u issuer \n"), 609 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Response from peer `%s' with %u issuers, we accepted %u issuer \n",
618 GNUNET_i2s (peer), ic, ic_accepted); 610 GNUNET_i2s (peer), ic, ic_accepted);
619 GNUNET_free_non_null (n->issuer_id); 611 GNUNET_free_non_null (n->issuer_id);
620 n->issuer_id = GNUNET_malloc (ic_accepted * sizeof (struct GNUNET_PeerIdentity)); 612 n->issuer_id = GNUNET_malloc (ic_accepted * sizeof (struct GNUNET_PeerIdentity));
@@ -1003,7 +995,8 @@ GED_nodes_send_start_ack (struct Node *n, struct Experiment *e)
1003{ 995{
1004 struct NodeComCtx *e_ctx; 996 struct NodeComCtx *e_ctx;
1005 997
1006 GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Sending %s for experiment request to peer `%s' for experiment `%s'\n"), 998 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
999 "Sending %s for experiment request to peer `%s' for experiment `%s'\n",
1007 "START_ACK" ,GNUNET_i2s(&n->id), e->name); 1000 "START_ACK" ,GNUNET_i2s(&n->id), e->name);
1008 1001
1009 e_ctx = GNUNET_malloc (sizeof (struct NodeComCtx)); 1002 e_ctx = GNUNET_malloc (sizeof (struct NodeComCtx));
@@ -1025,11 +1018,12 @@ GED_nodes_send_start_ack (struct Node *n, struct Experiment *e)
1025 * @return GNUNET_NO if core was busy with sending, GNUNET_OK otherwise 1018 * @return GNUNET_NO if core was busy with sending, GNUNET_OK otherwise
1026 */ 1019 */
1027int 1020int
1028GED_nodes_request_start (struct Node *n, struct Experiment *e) 1021GED_nodes_send_start (struct Node *n, struct Experiment *e)
1029{ 1022{
1030 struct NodeComCtx *e_ctx; 1023 struct NodeComCtx *e_ctx;
1031 1024
1032 GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Sending %s for experiment request to peer `%s' for experiment `%s'\n"), 1025 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1026 "Sending %s for experiment request to peer `%s' for experiment `%s'\n",
1033 "START", GNUNET_i2s(&n->id), e->name); 1027 "START", GNUNET_i2s(&n->id), e->name);
1034 1028
1035 e_ctx = GNUNET_malloc (sizeof (struct NodeComCtx)); 1029 e_ctx = GNUNET_malloc (sizeof (struct NodeComCtx));
diff --git a/src/experimentation/gnunet-daemon-experimentation_scheduler.c b/src/experimentation/gnunet-daemon-experimentation_scheduler.c
index c1a948efe..784baa4d4 100644
--- a/src/experimentation/gnunet-daemon-experimentation_scheduler.c
+++ b/src/experimentation/gnunet-daemon-experimentation_scheduler.c
@@ -82,7 +82,8 @@ struct ScheduledExperiment *running_out_tail;
82 82
83 83
84static unsigned int experiments_scheduled; 84static unsigned int experiments_scheduled;
85static unsigned int experiments_running; 85static unsigned int experiments_outbound_running;
86static unsigned int experiments_inbound_running;
86static unsigned int experiments_requested; 87static unsigned int experiments_requested;
87 88
88 89
@@ -105,7 +106,7 @@ request_timeout (void *cls,const struct GNUNET_SCHEDULER_TaskContext* tc)
105 struct ScheduledExperiment *se = cls; 106 struct ScheduledExperiment *se = cls;
106 se->task = GNUNET_SCHEDULER_NO_TASK; 107 se->task = GNUNET_SCHEDULER_NO_TASK;
107 108
108 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Peer `%s' did not respond to request for experiment `%s'\n", 109 GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Peer `%s' did not respond to request for experiment `%s'\n"),
109 GNUNET_i2s (&se->n->id), se->e->name); 110 GNUNET_i2s (&se->n->id), se->e->name);
110 111
111 GNUNET_CONTAINER_DLL_remove (waiting_out_head, waiting_out_tail, se); 112 GNUNET_CONTAINER_DLL_remove (waiting_out_head, waiting_out_tail, se);
@@ -138,8 +139,14 @@ static void run_experiment_inbound (void *cls,const struct GNUNET_SCHEDULER_Task
138 se->task = GNUNET_SCHEDULER_add_delayed (start, &run_experiment_inbound, se); 139 se->task = GNUNET_SCHEDULER_add_delayed (start, &run_experiment_inbound, se);
139 break; 140 break;
140 case REQUESTED: 141 case REQUESTED:
141 case STARTED: 142 experiments_inbound_running ++;
143 GNUNET_STATISTICS_set (GED_stats, "# experiments inbound running", experiments_inbound_running, GNUNET_NO);
144 GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Starting inbound experiment `%s' with peer `%s'\n"),
145 se->e->name, GNUNET_i2s (&se->n->id));
142 se->state = STARTED; 146 se->state = STARTED;
147 se->task = GNUNET_SCHEDULER_add_now (&run_experiment_inbound, se);
148 break;
149 case STARTED:
143 /* Experiment is running */ 150 /* Experiment is running */
144 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Running %s experiment `%s' peer for `%s'\n", 151 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Running %s experiment `%s' peer for `%s'\n",
145 "inbound", GNUNET_i2s (&se->n->id), se->e->name); 152 "inbound", GNUNET_i2s (&se->n->id), se->e->name);
@@ -175,7 +182,7 @@ static void run_experiment_outbound (void *cls,const struct GNUNET_SCHEDULER_Tas
175 switch (se->state) { 182 switch (se->state) {
176 case NOT_RUNNING: 183 case NOT_RUNNING:
177 /* Send START message */ 184 /* Send START message */
178 GED_nodes_request_start (se->n, se->e); 185 GED_nodes_send_start (se->n, se->e);
179 se->state = REQUESTED; 186 se->state = REQUESTED;
180 se->task = GNUNET_SCHEDULER_add_delayed (EXP_RESPONSE_TIMEOUT, &request_timeout, se); 187 se->task = GNUNET_SCHEDULER_add_delayed (EXP_RESPONSE_TIMEOUT, &request_timeout, se);
181 experiments_requested ++; 188 experiments_requested ++;
@@ -225,13 +232,11 @@ GED_scheduler_handle_start (struct Node *n, struct Experiment *e)
225 if ((NULL != (se = find_experiment (waiting_in_head, waiting_in_tail, n, e, GNUNET_NO))) || 232 if ((NULL != (se = find_experiment (waiting_in_head, waiting_in_tail, n, e, GNUNET_NO))) ||
226 (NULL != (se = find_experiment (running_in_head, running_in_tail, n, e, GNUNET_NO)))) 233 (NULL != (se = find_experiment (running_in_head, running_in_tail, n, e, GNUNET_NO))))
227 { 234 {
228 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Received duplicate %s message from peer %s for experiment `%s'\n"),
229 "START", GNUNET_i2s (&n->id), e->name);
230 GNUNET_break_op (0); 235 GNUNET_break_op (0);
231 return; 236 return;
232 } 237 }
233 238
234 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Received %s message from peer %s for experiment `%s'\n"), 239 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received %s message from peer %s for experiment `%s'\n",
235 "START", GNUNET_i2s (&n->id), e->name); 240 "START", GNUNET_i2s (&n->id), e->name);
236 241
237 GED_scheduler_add (n, e, GNUNET_NO); 242 GED_scheduler_add (n, e, GNUNET_NO);
@@ -254,7 +259,7 @@ GED_scheduler_handle_start_ack (struct Node *n, struct Experiment *e)
254 return; 259 return;
255 } 260 }
256 261
257 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Received %s message from peer %s for requested experiment `%s'\n"), 262 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received %s message from peer %s for requested experiment `%s'\n",
258 "START_ACK", GNUNET_i2s (&n->id), e->name); 263 "START_ACK", GNUNET_i2s (&n->id), e->name);
259 264
260 if (GNUNET_SCHEDULER_NO_TASK != se->task) 265 if (GNUNET_SCHEDULER_NO_TASK != se->task)
@@ -268,6 +273,10 @@ GED_scheduler_handle_start_ack (struct Node *n, struct Experiment *e)
268 GNUNET_CONTAINER_DLL_insert (running_out_head, running_out_tail, se); 273 GNUNET_CONTAINER_DLL_insert (running_out_head, running_out_tail, se);
269 274
270 /* Change state and schedule to run */ 275 /* Change state and schedule to run */
276 experiments_outbound_running ++;
277 GNUNET_STATISTICS_set (GED_stats, "# experiments outbound running", experiments_outbound_running, GNUNET_NO);
278 GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Starting outbound experiment `%s' with peer `%s'\n"),
279 e->name, GNUNET_i2s (&n->id));
271 se->state = STARTED; 280 se->state = STARTED;
272 se->task = GNUNET_SCHEDULER_add_now (&run_experiment_outbound, se); 281 se->task = GNUNET_SCHEDULER_add_now (&run_experiment_outbound, se);
273} 282}
@@ -284,18 +293,18 @@ GED_scheduler_handle_stop (struct Node *n, struct Experiment *e)
284{ 293{
285 struct ScheduledExperiment *se; 294 struct ScheduledExperiment *se;
286 295
287 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Received %s message from peer %s for experiment `%s'\n"), 296 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, _("Received %s message from peer %s for experiment `%s'\n"),
288 "STOP", GNUNET_i2s (&n->id), e->name); 297 "STOP", GNUNET_i2s (&n->id), e->name);
289 298
290 if (NULL != (se = find_experiment (waiting_in_head, waiting_in_tail, n, e, GNUNET_NO))) 299 if (NULL != (se = find_experiment (waiting_in_head, waiting_in_tail, n, e, GNUNET_NO)))
291 { 300 {
292 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Received %s message from peer %s for waiting experiment `%s'\n"), 301 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received %s message from peer %s for waiting experiment `%s'\n",
293 "STOP", GNUNET_i2s (&n->id), e->name); 302 "STOP", GNUNET_i2s (&n->id), e->name);
294 } 303 }
295 304
296 if (NULL != (se = find_experiment (running_in_head, running_in_tail, n, e, GNUNET_NO))) 305 if (NULL != (se = find_experiment (running_in_head, running_in_tail, n, e, GNUNET_NO)))
297 { 306 {
298 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Received %s message from peer %s for running experiment `%s'\n"), 307 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received %s message from peer %s for running experiment `%s'\n",
299 "STOP", GNUNET_i2s (&n->id), e->name); 308 "STOP", GNUNET_i2s (&n->id), e->name);
300 } 309 }
301 310
@@ -346,7 +355,7 @@ GED_scheduler_add (struct Node *n, struct Experiment *e, int outbound)
346 GNUNET_CONTAINER_DLL_insert (waiting_in_head, waiting_in_tail, se); 355 GNUNET_CONTAINER_DLL_insert (waiting_in_head, waiting_in_tail, se);
347 } 356 }
348 357
349 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Added %s experiment `%s' for node to be scheduled\n", 358 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Added %s experiment `%s' for node to be scheduled\n",
350 (GNUNET_YES == outbound) ? "outbound" : "inbound", e->name, GNUNET_i2s(&se->n->id)); 359 (GNUNET_YES == outbound) ? "outbound" : "inbound", e->name, GNUNET_i2s(&se->n->id));
351 experiments_scheduled ++; 360 experiments_scheduled ++;
352 GNUNET_STATISTICS_set (GED_stats, "# experiments scheduled", experiments_scheduled, GNUNET_NO); 361 GNUNET_STATISTICS_set (GED_stats, "# experiments scheduled", experiments_scheduled, GNUNET_NO);
@@ -400,9 +409,9 @@ GED_scheduler_stop ()
400 cur->task = GNUNET_SCHEDULER_NO_TASK; 409 cur->task = GNUNET_SCHEDULER_NO_TASK;
401 } 410 }
402 GNUNET_free (cur); 411 GNUNET_free (cur);
403 GNUNET_assert (experiments_running > 0); 412 GNUNET_assert (experiments_outbound_running > 0);
404 experiments_running --; 413 experiments_inbound_running --;
405 GNUNET_STATISTICS_set (GED_stats, "# experiments running", experiments_running, GNUNET_NO); 414 GNUNET_STATISTICS_set (GED_stats, "# experiments inbound running", experiments_inbound_running, GNUNET_NO);
406 } 415 }
407 416
408 next = waiting_out_head; 417 next = waiting_out_head;
@@ -432,9 +441,9 @@ GED_scheduler_stop ()
432 cur->task = GNUNET_SCHEDULER_NO_TASK; 441 cur->task = GNUNET_SCHEDULER_NO_TASK;
433 } 442 }
434 GNUNET_free (cur); 443 GNUNET_free (cur);
435 GNUNET_assert (experiments_running > 0); 444 GNUNET_assert (experiments_outbound_running > 0);
436 experiments_running --; 445 experiments_outbound_running --;
437 GNUNET_STATISTICS_set (GED_stats, "# experiments running", experiments_running, GNUNET_NO); 446 GNUNET_STATISTICS_set (GED_stats, "# experiments outbound running", experiments_outbound_running, GNUNET_NO);
438 } 447 }
439} 448}
440 449
diff --git a/src/experimentation/test_experimentation_clique_run.c b/src/experimentation/test_experimentation_clique_run.c
index bc325c5c9..b6329bb8e 100644
--- a/src/experimentation/test_experimentation_clique_run.c
+++ b/src/experimentation/test_experimentation_clique_run.c
@@ -91,7 +91,8 @@ struct ExperimentationPeer
91 unsigned int inactive_nodes; 91 unsigned int inactive_nodes;
92 unsigned int issuer; 92 unsigned int issuer;
93 unsigned int experiments_active; 93 unsigned int experiments_active;
94 unsigned int experiments_running; 94 unsigned int experiments_outbound_running;
95 unsigned int experiments_inbound_running;
95}; 96};
96 97
97 98
@@ -162,21 +163,31 @@ controller_event_cb (void *cls,
162static void 163static void
163check_end () 164check_end ()
164{ 165{
165 166 static int last_in_experiments_value = 0;
166 static int last_experiments_value = 0; 167 static int last_out_experiments_value = 0;
167 unsigned int peer; 168 unsigned int peer;
168 unsigned int t_running_experiments = 0; 169 unsigned int t_running_outbound_experiments = 0;
170 unsigned int t_running_inbound_experiments = 0;
169 171
170 for (peer = 0; peer < NUM_PEERS; peer++) 172 for (peer = 0; peer < NUM_PEERS; peer++)
171 { 173 {
172 t_running_experiments += ph[peer].experiments_running; 174 t_running_outbound_experiments += ph[peer].experiments_outbound_running;
175 t_running_inbound_experiments += ph[peer].experiments_inbound_running;
176
173 } 177 }
174 178
175 if (last_experiments_value < t_running_experiments) 179 //fprintf (stderr, "%u %u \n", t_running_outbound_experiments, t_running_inbound_experiments);
180 if (last_in_experiments_value < t_running_inbound_experiments)
176 fprintf (stderr, "."); 181 fprintf (stderr, ".");
177 last_experiments_value = t_running_experiments; 182 last_in_experiments_value = t_running_inbound_experiments;
183 if (last_out_experiments_value < t_running_outbound_experiments)
184 fprintf (stderr, ".");
185 last_out_experiments_value = t_running_outbound_experiments;
186
178 187
179 if (t_running_experiments == (NUM_PEERS * NUM_EXPERIMENTS)) 188
189 if ((t_running_inbound_experiments == (NUM_PEERS * NUM_EXPERIMENTS)) &&
190 (t_running_outbound_experiments == (NUM_PEERS * NUM_EXPERIMENTS)))
180 { 191 {
181 fprintf (stderr, "\n"); 192 fprintf (stderr, "\n");
182 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "All %u peers are running experiments\n", NUM_PEERS); 193 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "All %u peers are running experiments\n", NUM_PEERS);
@@ -207,11 +218,17 @@ stat_iterator (void *cls, const char *subsystem, const char *name,
207 peer->experiments_active = value; 218 peer->experiments_active = value;
208 } 219 }
209 220
210 if (0 == strcmp (name, "# experiments running")) 221 if (0 == strcmp (name, "# experiments outbound running"))
211 { 222 {
212 peer->experiments_running = value; 223 peer->experiments_outbound_running = value;
213 } 224 }
214 225
226 if (0 == strcmp (name, "# experiments inbound running"))
227 {
228 peer->experiments_inbound_running = value;
229 }
230
231
215 check_end (); 232 check_end ();
216 233
217 return GNUNET_OK; 234 return GNUNET_OK;
@@ -244,7 +261,10 @@ stat_comp_cb (void *cls, struct GNUNET_TESTBED_Operation *op,
244 (peer->sh, "experimentation", "# experiments active", 261 (peer->sh, "experimentation", "# experiments active",
245 stat_iterator, peer)); 262 stat_iterator, peer));
246 GNUNET_break (GNUNET_OK == GNUNET_STATISTICS_watch 263 GNUNET_break (GNUNET_OK == GNUNET_STATISTICS_watch
247 (peer->sh, "experimentation", "# experiments running", 264 (peer->sh, "experimentation", "# experiments outbound running",
265 stat_iterator, peer));
266 GNUNET_break (GNUNET_OK == GNUNET_STATISTICS_watch
267 (peer->sh, "experimentation", "# experiments inbound running",
248 stat_iterator, peer)); 268 stat_iterator, peer));
249} 269}
250 270
@@ -283,7 +303,10 @@ stat_disconnect_adapter (void *cls, void *op_result)
283 (peer->sh, "experimentation", "# experiments active", 303 (peer->sh, "experimentation", "# experiments active",
284 stat_iterator, peer)); 304 stat_iterator, peer));
285 GNUNET_break (GNUNET_OK == GNUNET_STATISTICS_watch_cancel 305 GNUNET_break (GNUNET_OK == GNUNET_STATISTICS_watch_cancel
286 (peer->sh, "experimentation", "# experiments running", 306 (peer->sh, "experimentation", "# experiments outbound running",
307 stat_iterator, peer));
308 GNUNET_break (GNUNET_OK == GNUNET_STATISTICS_watch_cancel
309 (peer->sh, "experimentation", "# experiments inbound running",
287 stat_iterator, peer)); 310 stat_iterator, peer));
288 GNUNET_STATISTICS_destroy (op_result, GNUNET_NO); 311 GNUNET_STATISTICS_destroy (op_result, GNUNET_NO);
289 peer->sh = NULL; 312 peer->sh = NULL;