[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r27329 - gnunet/src/experimentation
From: |
gnunet |
Subject: |
[GNUnet-SVN] r27329 - gnunet/src/experimentation |
Date: |
Wed, 29 May 2013 15:56:29 +0200 |
Author: wachs
Date: 2013-05-29 15:56:29 +0200 (Wed, 29 May 2013)
New Revision: 27329
Modified:
gnunet/src/experimentation/Makefile.am
gnunet/src/experimentation/gnunet-daemon-experimentation.h
gnunet/src/experimentation/gnunet-daemon-experimentation_nodes.c
gnunet/src/experimentation/gnunet-daemon-experimentation_scheduler.c
Log:
changes
Modified: gnunet/src/experimentation/Makefile.am
===================================================================
--- gnunet/src/experimentation/Makefile.am 2013-05-29 13:20:41 UTC (rev
27328)
+++ gnunet/src/experimentation/Makefile.am 2013-05-29 13:56:29 UTC (rev
27329)
@@ -18,7 +18,7 @@
if HAVE_EXPERIMENTAL
- TEXT_EXP_CLIQUE = test_experimentation_clique_connect
+ TEXT_EXP_CLIQUE = test_experimentation_clique_connect
test_experimentation_clique_run
endif
check_PROGRAMS = \
@@ -51,6 +51,14 @@
$(top_builddir)/src/statistics/libgnunetstatistics.la \
$(top_builddir)/src/testbed/libgnunettestbed.la
+test_experimentation_clique_run_SOURCES = \
+ test_experimentation_clique_run.c
+test_experimentation_clique_run_LDADD = \
+ $(top_builddir)/src/util/libgnunetutil.la \
+ $(top_builddir)/src/statistics/libgnunetstatistics.la \
+ $(top_builddir)/src/testbed/libgnunettestbed.la
+
+
EXTRA_DIST = \
test_experimentation_clique.conf \
test_experiments.exp
\ No newline at end of file
Modified: gnunet/src/experimentation/gnunet-daemon-experimentation.h
===================================================================
--- gnunet/src/experimentation/gnunet-daemon-experimentation.h 2013-05-29
13:20:41 UTC (rev 27328)
+++ gnunet/src/experimentation/gnunet-daemon-experimentation.h 2013-05-29
13:56:29 UTC (rev 27329)
@@ -34,7 +34,7 @@
/**
* Timeout between request and expected response
*/
-#define EXP_RESPONSE_TIMEOUT GNUNET_TIME_relative_multiply
(GNUNET_TIME_UNIT_SECONDS, 1)
+#define EXP_RESPONSE_TIMEOUT GNUNET_TIME_relative_multiply
(GNUNET_TIME_UNIT_SECONDS, 5)
/**
* Default experiment frequency
@@ -205,7 +205,10 @@
uint32_t issuer_count;
};
+void
+GNUNET_EXPERIMENT_nodes_request_start (struct Node *n, struct Experiment *e);
+
/**
* Start the nodes management
*/
Modified: gnunet/src/experimentation/gnunet-daemon-experimentation_nodes.c
===================================================================
--- gnunet/src/experimentation/gnunet-daemon-experimentation_nodes.c
2013-05-29 13:20:41 UTC (rev 27328)
+++ gnunet/src/experimentation/gnunet-daemon-experimentation_nodes.c
2013-05-29 13:56:29 UTC (rev 27329)
@@ -304,7 +304,6 @@
get_experiments_cb (struct Node *n, struct Experiment *e)
{
static int counter = 0;
- //size_t start_size;
if (NULL == e)
{
GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Added %u
experiments for peer %s\n"),
@@ -317,10 +316,6 @@
GNUNET_i2s (&n->id));
/* Request experiment */
-/* start_size = sizeof (struct Experimentation_Start);
- GNUNET_CORE_notify_transmit_ready (ch, GNUNET_NO, 0,
EXP_RESPONSE_TIMEOUT,
- n->id, start_size, send_start_cb, n);*/
-
GNUNET_EXPERIMENTATION_scheduler_add (n, e);
counter ++;
@@ -633,7 +628,14 @@
}
+void
+GNUNET_EXPERIMENT_nodes_request_start (struct Node *n, struct Experiment *e)
+{
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Sending start request to peer
`%s' for experiment `%s'\n"),
+ GNUNET_i2s(&n->id), e->name);
+}
+
/**
* Start the nodes management
*/
Modified: gnunet/src/experimentation/gnunet-daemon-experimentation_scheduler.c
===================================================================
--- gnunet/src/experimentation/gnunet-daemon-experimentation_scheduler.c
2013-05-29 13:20:41 UTC (rev 27328)
+++ gnunet/src/experimentation/gnunet-daemon-experimentation_scheduler.c
2013-05-29 13:56:29 UTC (rev 27329)
@@ -52,6 +52,8 @@
struct ScheduledExperiment *list_head;
struct ScheduledExperiment *list_tail;
+static unsigned int experiments_scheduled;
+static unsigned int experiments_requested;
static void
request_timeout (void *cls,const struct GNUNET_SCHEDULER_TaskContext* tc)
@@ -66,6 +68,10 @@
GNUNET_free (se);
/* Remove experiment */
+
+ GNUNET_assert (experiments_requested > 0);
+ experiments_requested --;
+ GNUNET_STATISTICS_set (GSE_stats, "# experiments requested",
experiments_requested, GNUNET_NO);
}
static void run (void *cls,const struct GNUNET_SCHEDULER_TaskContext* tc)
@@ -74,15 +80,18 @@
struct GNUNET_TIME_Relative end;
se->task = GNUNET_SCHEDULER_NO_TASK;
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Executing `%s'\n", se->e->name);
-
if (NOT_RUNNING == se->state)
{
/* Send start message */
- //GNUNET_EXPERIMENT_nodes_request_start (se->e);
+ GNUNET_EXPERIMENT_nodes_request_start (se->n, se->e);
se->state = REQUESTED;
se->task = GNUNET_SCHEDULER_add_delayed
(EXP_RESPONSE_TIMEOUT, &request_timeout, se);
+
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Sending start
request to peer `%s' for `%s'\n",
+ GNUNET_i2s (&se->n->id), se->e->name);
+ experiments_requested ++;
+ GNUNET_STATISTICS_set (GSE_stats, "# experiments
requested", experiments_requested, GNUNET_NO);
return;
}
else if (REQUESTED == se->state)
@@ -93,6 +102,8 @@
else if (STARTED == se->state)
{
/* Experiment is running */
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Running experiment
`%s' peer for `%s'\n",
+ GNUNET_i2s (&se->n->id), se->e->name);
/* do work here */
@@ -124,12 +135,11 @@
start = GNUNET_TIME_absolute_get_remaining(e->start);
end = GNUNET_TIME_absolute_get_remaining(e->stop);
+ if (0 == end.rel_value)
+ return; /* End of experiment is reached */
/* Add additional checks here if required */
- if (0 == end.rel_value)
- return; /* End of experiment is reached */
-
se = GNUNET_malloc (sizeof (struct ScheduledExperiment));
se->state = NOT_RUNNING;
se->e = e;
@@ -140,8 +150,10 @@
se->task = GNUNET_SCHEDULER_add_delayed (start, &run,
se);
GNUNET_CONTAINER_DLL_insert (list_head, list_tail, se);
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Added experiment `%s' for node to
be scheduled\n",
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Added experiment `%s' for node to
be scheduled\n",
e->name, GNUNET_i2s(&se->n->id));
+ experiments_scheduled ++;
+ GNUNET_STATISTICS_set (GSE_stats, "# experiments scheduled",
experiments_scheduled, GNUNET_NO);
}
/**
@@ -150,7 +162,8 @@
void
GNUNET_EXPERIMENTATION_scheduler_start ()
{
-
+ experiments_requested = 0;
+ experiments_scheduled = 0;
}
@@ -174,6 +187,9 @@
cur->task = GNUNET_SCHEDULER_NO_TASK;
}
GNUNET_free (cur);
+ GNUNET_assert (experiments_scheduled > 0);
+ experiments_scheduled --;
+ GNUNET_STATISTICS_set (GSE_stats, "# experiments
scheduled", experiments_scheduled, GNUNET_NO);
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r27329 - gnunet/src/experimentation,
gnunet <=