GNUnet  0.10.x
Data Structures | Enumerations | Functions | Variables
gnunet-solver-eval.c File Reference
#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_ats_plugin.h"
#include "gnunet_ats_service.h"
#include "ats-testing.h"
Include dependency graph for gnunet-solver-eval.c:

Go to the source code of this file.

Data Structures

struct  GNUNET_ATS_TESTING_SolverHandle
 Solver. More...
 

Enumerations

enum  GNUNET_ATS_Solvers {
  GNUNET_ATS_SOLVER_PROPORTIONAL, GNUNET_ATS_SOLVER_MLP, GNUNET_ATS_SOLVER_RIL, GNUNET_ATS_SOLVER_PROPORTIONAL,
  GNUNET_ATS_SOLVER_MLP, GNUNET_ATS_SOLVER_RIL
}
 

Functions

const char * print_op (enum OperationType op)
 Experiments. More...
 
static struct Experimentcreate_experiment ()
 
static void free_experiment (struct Experiment *e)
 
static int load_episode (struct Experiment *e, struct Episode *cur, struct GNUNET_CONFIGURATION_Handle *cfg)
 
static int load_episodes (struct Experiment *e, struct GNUNET_CONFIGURATION_Handle *cfg)
 
static void timeout_experiment (void *cls)
 
static void enforce_start_send (struct GNUNET_ATS_TEST_Operation *op)
 
static void enforce_stop_send (struct GNUNET_ATS_TEST_Operation *op)
 
static void enforce_start_preference (struct GNUNET_ATS_TEST_Operation *op)
 
static void enforce_stop_preference (struct GNUNET_ATS_TEST_Operation *op)
 
static void enforce_episode (struct Episode *ep)
 
static void timeout_episode (void *cls)
 
void GNUNET_ATS_solvers_experimentation_run (struct Experiment *e, GNUNET_ATS_TESTING_EpisodeDoneCallback ep_done_cb, GNUNET_ATS_TESTING_ExperimentDoneCallback e_done_cb)
 
struct ExperimentGNUNET_ATS_solvers_experimentation_load (char *filename)
 
void GNUNET_ATS_solvers_experimentation_stop (struct Experiment *e)
 
void GNUNET_ATS_solvers_solver_stop (struct GNUNET_ATS_TESTING_SolverHandle *sh)
 
struct GNUNET_ATS_TESTING_SolverHandleGNUNET_ATS_solvers_solver_start (enum GNUNET_ATS_Solvers type)
 
static void run (void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg)
 
int main (int argc, char *argv[])
 Main function of the benchmark. More...
 

Variables

static struct Experimente
 
static struct GNUNET_ATS_TESTING_SolverHandlesh
 
static char * opt_exp_file
 cmd option -e: experiment file More...
 
static char * opt_solver
 
static int opt_log
 cmd option -l: enable logging More...
 
static int opt_plot
 cmd option -p: enable plots More...
 
static int opt_verbose
 cmd option -v: verbose logs More...
 

Enumeration Type Documentation

◆ GNUNET_ATS_Solvers

Enumerator
GNUNET_ATS_SOLVER_PROPORTIONAL 
GNUNET_ATS_SOLVER_MLP 
GNUNET_ATS_SOLVER_RIL 
GNUNET_ATS_SOLVER_PROPORTIONAL 
GNUNET_ATS_SOLVER_MLP 
GNUNET_ATS_SOLVER_RIL 

Definition at line 784 of file gnunet-solver-eval.c.

Function Documentation

◆ print_op()

const char* print_op ( enum OperationType  op)

Experiments.

Definition at line 37 of file gnunet-solver-eval.c.

References START_PREFERENCE, START_SEND, STOP_PREFERENCE, and STOP_SEND.

Referenced by enforce_episode(), and load_episode().

38 {
39  switch (op) {
40  case START_SEND:
41  return "START_SEND";
42  case STOP_SEND:
43  return "STOP_SEND";
44  case START_PREFERENCE:
45  return "START_PREFERENCE";
46  case STOP_PREFERENCE:
47  return "STOP_PREFERENCE";
48  default:
49  break;
50  }
51  return "";
52 }
static struct GNUNET_ARM_Operation * op
Current operation.
Definition: gnunet-arm.c:139
Here is the caller graph for this function:

◆ create_experiment()

static struct Experiment* create_experiment ( )
static

Definition at line 56 of file gnunet-solver-eval.c.

References e, GNUNET_new, GNUNET_TIME_UNIT_ZERO, Experiment::name, Experiment::num_masters, Experiment::num_slaves, Experiment::start, and Experiment::total_duration.

Referenced by GNUNET_ATS_solvers_experimentation_load().

57 {
58  struct Experiment *e;
59  e = GNUNET_new (struct Experiment);
60  e->name = NULL;
61  e->num_masters = 0;
62  e->num_slaves = 0;
63  e->start = NULL;
65  return e;
66 }
struct Episode * start
unsigned long long int num_masters
Definition: ats-testing.h:525
struct GNUNET_TIME_Relative total_duration
#define GNUNET_new(type)
Allocate a struct or union of the given type.
unsigned long long int num_slaves
Definition: ats-testing.h:526
#define GNUNET_TIME_UNIT_ZERO
Relative time zero.
static struct Experiment * e
Here is the caller graph for this function:

◆ free_experiment()

static void free_experiment ( struct Experiment e)
static

Definition at line 70 of file gnunet-solver-eval.c.

References Experiment::cfg_file, GNUNET_free, GNUNET_free_non_null, Episode::head, Experiment::name, GNUNET_ATS_TEST_Operation::next, Episode::next, and Experiment::start.

Referenced by GNUNET_ATS_solvers_experimentation_load(), and GNUNET_ATS_solvers_experimentation_stop().

71 {
72  struct Episode *cur;
73  struct Episode *next;
74  struct GNUNET_ATS_TEST_Operation *cur_o;
75  struct GNUNET_ATS_TEST_Operation *next_o;
76 
77  next = e->start;
78  for (cur = next; NULL != cur; cur = next)
79  {
80  next = cur->next;
81 
82  next_o = cur->head;
83  for (cur_o = next_o; NULL != cur_o; cur_o = next_o)
84  {
85  next_o = cur_o->next;
86  GNUNET_free (cur_o);
87  }
88  GNUNET_free (cur);
89  }
90 
93  GNUNET_free (e);
94 }
struct GNUNET_ATS_TEST_Operation * next
struct Episode * start
struct Episode * next
#define GNUNET_free_non_null(ptr)
Free the memory pointed to by ptr if ptr is not NULL.
An operation in an experiment.
struct GNUNET_ATS_TEST_Operation * head
#define GNUNET_free(ptr)
Wrapper around free.
Here is the caller graph for this function:

◆ load_episode()

static int load_episode ( struct Experiment e,
struct Episode cur,
struct GNUNET_CONFIGURATION_Handle cfg 
)
static

Definition at line 98 of file gnunet-solver-eval.c.

References GNUNET_ATS_TEST_Operation::base_rate, GNUNET_ATS_TEST_Operation::dest_id, Episode::duration, GNUNET_ATS_TEST_Operation::frequency, GNUNET_ATS_TEST_Operation::gen_type, GNUNET_asprintf(), GNUNET_ATS_PREFERENCE_BANDWIDTH, GNUNET_ATS_PREFERENCE_LATENCY, GNUNET_ATS_TEST_TG_CONSTANT, GNUNET_ATS_TEST_TG_LINEAR, GNUNET_ATS_TEST_TG_RANDOM, GNUNET_ATS_TEST_TG_SINUS, GNUNET_break, GNUNET_CONFIGURATION_get_value_number(), GNUNET_CONFIGURATION_get_value_string(), GNUNET_CONFIGURATION_get_value_time(), GNUNET_CONTAINER_DLL_insert, GNUNET_free, GNUNET_free_non_null, GNUNET_new, GNUNET_OK, GNUNET_STRINGS_relative_time_to_string(), GNUNET_SYSERR, GNUNET_YES, Episode::head, Episode::id, GNUNET_ATS_TEST_Operation::max_rate, Experiment::num_masters, Experiment::num_slaves, op, GNUNET_ATS_TEST_Operation::period, GNUNET_ATS_TEST_Operation::pref_type, print_op(), GNUNET_ATS_TEST_Operation::src_id, START_PREFERENCE, START_SEND, STOP_PREFERENCE, STOP_SEND, Episode::tail, type, and GNUNET_ATS_TEST_Operation::type.

Referenced by load_episodes().

101 {
102  struct GNUNET_ATS_TEST_Operation *o;
103  char *sec_name;
104  char *op_name;
105  char *op;
106  char *type;
107  char *pref;
108  int op_counter = 0;
109  fprintf (stderr, "Parsing episode %u\n",cur->id);
110  GNUNET_asprintf(&sec_name, "episode-%u", cur->id);
111 
112  while (1)
113  {
114  /* Load operation */
115  GNUNET_asprintf(&op_name, "op-%u-operation", op_counter);
117  sec_name, op_name, &op))
118  {
119  GNUNET_free (op_name);
120  break;
121  }
123  /* operations = set_rate, start_send, stop_send, set_preference */
124  if (0 == strcmp (op, "start_send"))
125  {
126  o->type = START_SEND;
127  }
128  else if (0 == strcmp (op, "stop_send"))
129  {
130  o->type = STOP_SEND;
131  }
132  else if (0 == strcmp (op, "start_preference"))
133  {
134  o->type = START_PREFERENCE;
135  }
136  else if (0 == strcmp (op, "stop_preference"))
137  {
138  o->type = STOP_PREFERENCE;
139  }
140  else
141  {
142  fprintf (stderr, "Invalid operation %u `%s' in episode %u\n",
143  op_counter, op, cur->id);
144  GNUNET_free (op);
145  GNUNET_free (op_name);
146  GNUNET_free (sec_name);
147  GNUNET_free (o);
148  return GNUNET_SYSERR;
149  }
150  GNUNET_free (op_name);
151 
152  /* Get source */
153  GNUNET_asprintf(&op_name, "op-%u-src", op_counter);
155  sec_name, op_name, &o->src_id))
156  {
157  fprintf (stderr, "Missing src in operation %u `%s' in episode %u\n",
158  op_counter, op, cur->id);
159  GNUNET_free (op);
160  GNUNET_free (op_name);
161  GNUNET_free (sec_name);
162  GNUNET_free (o);
163  return GNUNET_SYSERR;
164  }
165  if (o->src_id > (e->num_masters - 1))
166  {
167  fprintf (stderr, "Invalid src %llu in operation %u `%s' in episode %u\n",
168  o->src_id, op_counter, op, cur->id);
169  GNUNET_free (op);
170  GNUNET_free (op_name);
171  GNUNET_free (sec_name);
172  GNUNET_free (o);
173  return GNUNET_SYSERR;
174  }
175  GNUNET_free (op_name);
176 
177  /* Get destination */
178  GNUNET_asprintf(&op_name, "op-%u-dest", op_counter);
180  sec_name, op_name, &o->dest_id))
181  {
182  fprintf (stderr, "Missing src in operation %u `%s' in episode %u\n",
183  op_counter, op, cur->id);
184  GNUNET_free (op);
185  GNUNET_free (op_name);
186  GNUNET_free (sec_name);
187  GNUNET_free (o);
188  return GNUNET_SYSERR;
189  }
190  if (o->dest_id > (e->num_slaves - 1))
191  {
192  fprintf (stderr,
193  "Invalid destination %llu in operation %u `%s' in episode %u\n",
194  o->dest_id,
195  op_counter,
196  op,
197  cur->id);
198  GNUNET_free (op);
199  GNUNET_free (op_name);
200  GNUNET_free (sec_name);
201  GNUNET_free (o);
202  return GNUNET_SYSERR;
203  }
204  GNUNET_free (op_name);
205 
206  GNUNET_asprintf(&op_name, "op-%u-type", op_counter);
207  if ( (GNUNET_SYSERR !=
209  sec_name,
210  op_name,
211  &type)) &&
212  (STOP_SEND != o->type) &&
213  (STOP_PREFERENCE != o->type) )
214  {
215  /* Load arguments for set_rate, start_send, set_preference */
216  if (0 == strcmp (type, "constant"))
217  {
219  }
220  else if (0 == strcmp (type, "linear"))
221  {
223  }
224  else if (0 == strcmp (type, "sinus"))
225  {
227  }
228  else if (0 == strcmp (type, "random"))
229  {
231  }
232  else
233  {
234  fprintf (stderr, "Invalid type %u `%s' in episode %u\n",
235  op_counter, op, cur->id);
236  GNUNET_free (type);
237  GNUNET_free (op);
238  GNUNET_free (op_name);
239  GNUNET_free (sec_name);
240  GNUNET_free (o);
241  return GNUNET_SYSERR;
242  }
243  GNUNET_free (op_name);
244 
245  /* Get base rate */
246  GNUNET_asprintf(&op_name, "op-%u-base-rate", op_counter);
248  sec_name, op_name, &o->base_rate))
249  {
250  fprintf (stderr, "Missing base rate in operation %u `%s' in episode %u\n",
251  op_counter, op, cur->id);
252  GNUNET_free (type);
253  GNUNET_free (op);
254  GNUNET_free (op_name);
255  GNUNET_free (sec_name);
256  GNUNET_free (o);
257  return GNUNET_SYSERR;
258  }
259  GNUNET_free (op_name);
260 
261  /* Get max rate */
262  GNUNET_asprintf(&op_name, "op-%u-max-rate", op_counter);
263  if (GNUNET_SYSERR ==
265  sec_name,
266  op_name,
267  &o->max_rate))
268  {
269  if ((GNUNET_ATS_TEST_TG_LINEAR == o->gen_type) ||
272  {
273  fprintf (stderr, "Missing max rate in operation %u `%s' in episode %u\n",
274  op_counter, op, cur->id);
275  GNUNET_free (type);
276  GNUNET_free (op_name);
277  GNUNET_free (op);
278  GNUNET_free (sec_name);
279  GNUNET_free (o);
280  return GNUNET_SYSERR;
281  }
282  }
283  GNUNET_free (op_name);
284 
285  /* Get period */
286  GNUNET_asprintf(&op_name, "op-%u-period", op_counter);
288  sec_name, op_name, &o->period))
289  {
290  o->period = cur->duration;
291  }
292  GNUNET_free (op_name);
293 
294  if (START_PREFERENCE == o->type)
295  {
296  /* Get frequency */
297  GNUNET_asprintf(&op_name, "op-%u-frequency", op_counter);
299  sec_name, op_name, &o->frequency))
300  {
301  fprintf (stderr, "Missing frequency in operation %u `%s' in episode %u\n",
302  op_counter, op, cur->id);
303  GNUNET_free (type);
304  GNUNET_free (op_name);
305  GNUNET_free (op);
306  GNUNET_free (sec_name);
307  GNUNET_free (o);
308  return GNUNET_SYSERR;
309  }
310  GNUNET_free (op_name);
311 
312  /* Get preference */
313  GNUNET_asprintf(&op_name, "op-%u-pref", op_counter);
315  sec_name, op_name, &pref))
316  {
317  fprintf (stderr, "Missing preference in operation %u `%s' in episode %u\n",
318  op_counter, op, cur->id);
319  GNUNET_free (type);
320  GNUNET_free (op_name);
321  GNUNET_free (op);
322  GNUNET_free (sec_name);
323  GNUNET_free_non_null (pref);
324  GNUNET_free (o);
325  return GNUNET_SYSERR;
326  }
327 
328  if (0 == strcmp(pref, "bandwidth"))
330  else if (0 == strcmp(pref, "latency"))
332  else
333  {
334  fprintf (stderr,
335  "Invalid preference in operation %u `%s' in episode %u\n",
336  op_counter,
337  op,
338  cur->id);
339  GNUNET_free (type);
340  GNUNET_free (op_name);
341  GNUNET_free (op);
342  GNUNET_free (sec_name);
343  GNUNET_free_non_null (pref);
344  GNUNET_free (o);
345  return GNUNET_SYSERR;
346  }
347  GNUNET_free (pref);
348  GNUNET_free (op_name);
349  }
350  }
351 
352  /* Safety checks */
353  if ((GNUNET_ATS_TEST_TG_LINEAR == o->gen_type) ||
355  {
356  if ((o->max_rate - o->base_rate) > o->base_rate)
357  {
358  /* This will cause an underflow */
359  GNUNET_break (0);
360  }
361  fprintf (stderr, "Selected max rate and base rate cannot be used for desired traffic form!\n");
362  }
363 
364  if ((START_SEND == o->type) || (START_PREFERENCE == o->type))
365  fprintf (stderr, "Found operation %u in episode %u: %s [%llu]->[%llu] == %s, %llu -> %llu in %s\n",
366  op_counter, cur->id, print_op (o->type), o->src_id,
367  o->dest_id, (NULL != type) ? type : "",
368  o->base_rate, o->max_rate,
370  else
371  fprintf (stderr, "Found operation %u in episode %u: %s [%llu]->[%llu]\n",
372  op_counter, cur->id, print_op (o->type), o->src_id, o->dest_id);
373 
374  GNUNET_free_non_null (type);
375  GNUNET_free (op);
376 
377  GNUNET_CONTAINER_DLL_insert (cur->head,cur->tail, o);
378  op_counter++;
379  }
380  GNUNET_free (sec_name);
381 
382  return GNUNET_OK;
383 }
int GNUNET_CONFIGURATION_get_value_time(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, struct GNUNET_TIME_Relative *time)
Get a configuration value that should be a relative time.
int GNUNET_CONFIGURATION_get_value_number(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, unsigned long long *number)
Get a configuration value that should be a number.
#define GNUNET_CONTAINER_DLL_insert(head, tail, element)
Insert an element at the head of a DLL.
unsigned long long int num_masters
Definition: ats-testing.h:525
long long unsigned int src_id
Definition: ats-testing.h:497
#define GNUNET_OK
Named constants for return values.
Definition: gnunet_common.h:78
#define GNUNET_free_non_null(ptr)
Free the memory pointed to by ptr if ptr is not NULL.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
struct GNUNET_TIME_Relative period
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur...
int GNUNET_asprintf(char **buf, const char *format,...)
Like asprintf, just portable.
long long unsigned int dest_id
Definition: ats-testing.h:498
const char * GNUNET_STRINGS_relative_time_to_string(struct GNUNET_TIME_Relative delta, int do_round)
Give relative time in human-readable fancy format.
Definition: strings.c:727
long long unsigned int base_rate
unsigned long long int num_slaves
Definition: ats-testing.h:526
enum GNUNET_ATS_PreferenceKind pref_type
struct GNUNET_TIME_Relative duration
int GNUNET_CONFIGURATION_get_value_string(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, char **value)
Get a configuration value that should be a string.
An operation in an experiment.
#define GNUNET_SYSERR
Definition: gnunet_common.h:79
Change the peer's latency value to the given amount.
struct GNUNET_ATS_TEST_Operation * head
struct GNUNET_ATS_TEST_Operation * tail
const char * print_op(enum OperationType op)
Experiments.
Change the peer's bandwidth value (value per byte of bandwidth in the goal function) to the given amo...
struct GNUNET_TIME_Relative frequency
enum GNUNET_TESTBED_UnderlayLinkModelType type
the type of this model
#define GNUNET_YES
Definition: gnunet_common.h:80
static struct GNUNET_ARM_Operation * op
Current operation.
Definition: gnunet-arm.c:139
long long unsigned int max_rate
#define GNUNET_free(ptr)
Wrapper around free.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ load_episodes()

static int load_episodes ( struct Experiment e,
struct GNUNET_CONFIGURATION_Handle cfg 
)
static

Definition at line 386 of file gnunet-solver-eval.c.

References Episode::duration, GNUNET_asprintf(), GNUNET_CONFIGURATION_get_value_time(), GNUNET_free, GNUNET_new, GNUNET_OK, GNUNET_STRINGS_relative_time_to_string(), GNUNET_SYSERR, GNUNET_TIME_relative_add(), GNUNET_YES, Episode::id, load_episode(), Episode::next, Experiment::num_episodes, Experiment::start, and Experiment::total_duration.

Referenced by GNUNET_ATS_solvers_experimentation_load().

387 {
388  int e_counter = 0;
389  char *sec_name;
390  struct GNUNET_TIME_Relative e_duration;
391  struct Episode *cur;
392  struct Episode *last;
393 
394  e_counter = 0;
395  last = NULL;
396  while (1)
397  {
398  GNUNET_asprintf(&sec_name, "episode-%u", e_counter);
400  sec_name, "duration", &e_duration))
401  {
402  GNUNET_free (sec_name);
403  break;
404  }
405 
406  cur = GNUNET_new (struct Episode);
407  cur->duration = e_duration;
408  cur->id = e_counter;
409 
410  if (GNUNET_OK != load_episode (e, cur, cfg))
411  {
412  GNUNET_free (sec_name);
413  GNUNET_free (cur);
414  return GNUNET_SYSERR;
415  }
416 
417  fprintf (stderr, "Found episode %u with duration %s \n",
418  e_counter,
420 
421  /* Update experiment */
422  e->num_episodes ++;
424  /* Put in linked list */
425  if (NULL == last)
426  e->start = cur;
427  else
428  last->next = cur;
429 
430  GNUNET_free (sec_name);
431  e_counter ++;
432  last = cur;
433  }
434  return e_counter;
435 }
struct Episode * start
int GNUNET_CONFIGURATION_get_value_time(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, struct GNUNET_TIME_Relative *time)
Get a configuration value that should be a relative time.
struct Episode * next
struct GNUNET_TIME_Relative total_duration
static int load_episode(struct Experiment *e, struct Episode *cur, struct GNUNET_CONFIGURATION_Handle *cfg)
#define GNUNET_OK
Named constants for return values.
Definition: gnunet_common.h:78
#define GNUNET_new(type)
Allocate a struct or union of the given type.
unsigned int num_episodes
int GNUNET_asprintf(char **buf, const char *format,...)
Like asprintf, just portable.
const char * GNUNET_STRINGS_relative_time_to_string(struct GNUNET_TIME_Relative delta, int do_round)
Give relative time in human-readable fancy format.
Definition: strings.c:727
struct GNUNET_TIME_Relative duration
#define GNUNET_SYSERR
Definition: gnunet_common.h:79
struct GNUNET_TIME_Relative GNUNET_TIME_relative_add(struct GNUNET_TIME_Relative a1, struct GNUNET_TIME_Relative a2)
Add relative times together.
Definition: time.c:576
#define GNUNET_YES
Definition: gnunet_common.h:80
#define GNUNET_free(ptr)
Wrapper around free.
Time for relative time used by GNUnet, in microseconds.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ timeout_experiment()

static void timeout_experiment ( void *  cls)
static

Definition at line 439 of file gnunet-solver-eval.c.

References e, Experiment::e_done_cb, Experiment::episode_timeout_task, Experiment::experiment_timeout_task, GNUNET_SCHEDULER_cancel(), GNUNET_SYSERR, GNUNET_TIME_absolute_get_duration(), and Experiment::start_time.

Referenced by GNUNET_ATS_solvers_experimentation_run().

440 {
441  struct Experiment *e = cls;
442  e->experiment_timeout_task = NULL;
443  fprintf (stderr, "Experiment timeout!\n");
444 
445  if (NULL != e->episode_timeout_task)
446  {
448  e->episode_timeout_task = NULL;
449  }
450 
452  GNUNET_SYSERR);
453 }
GNUNET_ATS_TESTING_ExperimentDoneCallback e_done_cb
struct GNUNET_SCHEDULER_Task * experiment_timeout_task
struct GNUNET_SCHEDULER_Task * episode_timeout_task
struct GNUNET_TIME_Absolute start_time
#define GNUNET_SYSERR
Definition: gnunet_common.h:79
struct GNUNET_TIME_Relative GNUNET_TIME_absolute_get_duration(struct GNUNET_TIME_Absolute whence)
Get the duration of an operation as the difference of the current time and the given start time "henc...
Definition: time.c:373
static struct Experiment * e
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.
Definition: scheduler.c:965
Here is the call graph for this function:
Here is the caller graph for this function:

◆ enforce_start_send()

static void enforce_start_send ( struct GNUNET_ATS_TEST_Operation op)
static

Definition at line 457 of file gnunet-solver-eval.c.

Referenced by enforce_episode().

458 {
459  /*
460  struct BenchmarkPeer *peer;
461  struct BenchmarkPartner *partner;
462 
463  peer = GNUNET_ATS_TEST_get_peer (op->src_id);
464  if (NULL == peer)
465  {
466  GNUNET_break (0);
467  return;
468  }
469 
470  partner = GNUNET_ATS_TEST_get_partner (op->src_id, op->dest_id);
471  if (NULL == partner)
472  {
473  GNUNET_break (0);
474  return;
475  }
476 
477  fprintf (stderr, "Found master %llu slave %llu\n",op->src_id, op->dest_id);
478 
479  if (NULL != partner->tg)
480  {
481  fprintf (stderr, "Stopping traffic between master %llu slave %llu\n",op->src_id, op->dest_id);
482  GNUNET_ATS_TEST_generate_traffic_stop(partner->tg);
483  partner->tg = NULL;
484  }
485 
486  partner->tg = GNUNET_ATS_TEST_generate_traffic_start(peer, partner,
487  op->tg_type, op->base_rate, op->max_rate, op->period,
488  GNUNET_TIME_UNIT_FOREVER_REL);
489  */
490 }
Here is the caller graph for this function:

◆ enforce_stop_send()

static void enforce_stop_send ( struct GNUNET_ATS_TEST_Operation op)
static

Definition at line 493 of file gnunet-solver-eval.c.

Referenced by enforce_episode().

494 {
495  /*
496  struct BenchmarkPartner *p;
497  p = GNUNET_ATS_TEST_get_partner (op->src_id, op->dest_id);
498  if (NULL == p)
499  {
500  GNUNET_break (0);
501  return;
502  }
503 
504  fprintf (stderr, "Found master %llu slave %llu\n",op->src_id, op->dest_id);
505 
506  if (NULL != p->tg)
507  {
508  fprintf (stderr, "Stopping traffic between master %llu slave %llu\n",
509  op->src_id, op->dest_id);
510  GNUNET_ATS_TEST_generate_traffic_stop(p->tg);
511  p->tg = NULL;
512  }
513  */
514 }
Here is the caller graph for this function:

◆ enforce_start_preference()

static void enforce_start_preference ( struct GNUNET_ATS_TEST_Operation op)
static

Definition at line 518 of file gnunet-solver-eval.c.

Referenced by enforce_episode().

519 {
520  /*
521  struct BenchmarkPeer *peer;
522  struct BenchmarkPartner *partner;
523 
524  peer = GNUNET_ATS_TEST_get_peer (op->src_id);
525  if (NULL == peer)
526  {
527  GNUNET_break (0);
528  return;
529  }
530 
531  partner = GNUNET_ATS_TEST_get_partner (op->src_id, op->dest_id);
532  if (NULL == partner)
533  {
534  GNUNET_break (0);
535  return;
536  }
537 
538  fprintf (stderr, "Found master %llu slave %llu\n",op->src_id, op->dest_id);
539 
540  if (NULL != partner->pg)
541  {
542  fprintf (stderr, "Stopping traffic between master %llu slave %llu\n",
543  op->src_id, op->dest_id);
544  GNUNET_ATS_TEST_generate_preferences_stop(partner->pg);
545  partner->pg = NULL;
546  }
547 
548  partner->pg = GNUNET_ATS_TEST_generate_preferences_start(peer, partner,
549  op->tg_type, op->base_rate, op->max_rate, op->period, op->frequency,
550  op->pref_type);
551  */
552 }
Here is the caller graph for this function:

◆ enforce_stop_preference()

static void enforce_stop_preference ( struct GNUNET_ATS_TEST_Operation op)
static

Definition at line 555 of file gnunet-solver-eval.c.

Referenced by enforce_episode().

556 {
557  /*
558  struct BenchmarkPartner *p;
559  p = GNUNET_ATS_TEST_get_partner (op->src_id, op->dest_id);
560  if (NULL == p)
561  {
562  GNUNET_break (0);
563  return;
564  }
565 
566  fprintf (stderr, "Found master %llu slave %llu\n",op->src_id, op->dest_id);
567 
568  if (NULL != p->pg)
569  {
570  fprintf (stderr, "Stopping preference between master %llu slave %llu\n",
571  op->src_id, op->dest_id);
572  GNUNET_ATS_TEST_generate_preferences_stop (p->pg);
573  p->pg = NULL;
574  }
575  */
576 }
Here is the caller graph for this function:

◆ enforce_episode()

static void enforce_episode ( struct Episode ep)
static

Definition at line 578 of file gnunet-solver-eval.c.

References GNUNET_ATS_TEST_Operation::base_rate, GNUNET_ATS_TEST_Operation::dest_id, enforce_start_preference(), enforce_start_send(), enforce_stop_preference(), enforce_stop_send(), Episode::head, GNUNET_ATS_TEST_Operation::next, print_op(), GNUNET_ATS_TEST_Operation::src_id, START_PREFERENCE, START_SEND, STOP_PREFERENCE, STOP_SEND, and GNUNET_ATS_TEST_Operation::type.

Referenced by GNUNET_ATS_solvers_experimentation_run(), and timeout_episode().

579 {
580  struct GNUNET_ATS_TEST_Operation *cur;
581  for (cur = ep->head; NULL != cur; cur = cur->next)
582  {
583 
584  fprintf (stderr, "Enforcing operation: %s [%llu]->[%llu] == %llu\n",
585  print_op (cur->type), cur->src_id, cur->dest_id, cur->base_rate);
586  switch (cur->type) {
587  case START_SEND:
588  enforce_start_send (cur);
589  break;
590  case STOP_SEND:
591  enforce_stop_send (cur);
592  break;
593  case START_PREFERENCE:
595  break;
596  case STOP_PREFERENCE:
598  break;
599  default:
600  break;
601  }
602  }
603 }
struct GNUNET_ATS_TEST_Operation * next
static void enforce_stop_preference(struct GNUNET_ATS_TEST_Operation *op)
long long unsigned int src_id
Definition: ats-testing.h:497
static void enforce_start_preference(struct GNUNET_ATS_TEST_Operation *op)
long long unsigned int dest_id
Definition: ats-testing.h:498
long long unsigned int base_rate
An operation in an experiment.
static void enforce_stop_send(struct GNUNET_ATS_TEST_Operation *op)
static void enforce_start_send(struct GNUNET_ATS_TEST_Operation *op)
struct GNUNET_ATS_TEST_Operation * head
const char * print_op(enum OperationType op)
Experiments.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ timeout_episode()

static void timeout_episode ( void *  cls)
static

Definition at line 607 of file gnunet-solver-eval.c.

References Experiment::cur, Episode::duration, e, Experiment::e_done_cb, enforce_episode(), Experiment::ep_done_cb, Experiment::episode_timeout_task, Experiment::experiment_timeout_task, GNUNET_OK, GNUNET_SCHEDULER_add_delayed(), GNUNET_SCHEDULER_cancel(), GNUNET_STRINGS_relative_time_to_string(), GNUNET_TIME_absolute_get_duration(), GNUNET_YES, Episode::id, Episode::next, and Experiment::start_time.

Referenced by GNUNET_ATS_solvers_experimentation_run().

608 {
609  struct Experiment *e = cls;
610  e->episode_timeout_task = NULL;
611  if (NULL != e->ep_done_cb)
612  e->ep_done_cb (e->cur);
613 
614  /* Scheduling next */
615  e->cur = e->cur->next;
616  if (NULL == e->cur)
617  {
618  /* done */
619  fprintf (stderr, "Last episode done!\n");
620  if (NULL != e->experiment_timeout_task)
621  {
623  e->experiment_timeout_task = NULL;
624  }
626  return;
627  }
628 
629  fprintf (stderr, "Running episode %u with timeout %s\n",
630  e->cur->id,
632  enforce_episode(e->cur);
633 
635  &timeout_episode, e);
636 }
GNUNET_ATS_TESTING_EpisodeDoneCallback ep_done_cb
GNUNET_ATS_TESTING_ExperimentDoneCallback e_done_cb
struct Episode * next
static void enforce_episode(struct Episode *ep)
#define GNUNET_OK
Named constants for return values.
Definition: gnunet_common.h:78
struct GNUNET_SCHEDULER_Task * experiment_timeout_task
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_delayed(struct GNUNET_TIME_Relative delay, GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run with a specified delay.
Definition: scheduler.c:1246
struct Episode * cur
const char * GNUNET_STRINGS_relative_time_to_string(struct GNUNET_TIME_Relative delta, int do_round)
Give relative time in human-readable fancy format.
Definition: strings.c:727
struct GNUNET_SCHEDULER_Task * episode_timeout_task
struct GNUNET_TIME_Relative duration
static void timeout_episode(void *cls)
struct GNUNET_TIME_Absolute start_time
struct GNUNET_TIME_Relative GNUNET_TIME_absolute_get_duration(struct GNUNET_TIME_Absolute whence)
Get the duration of an operation as the difference of the current time and the given start time "henc...
Definition: time.c:373
#define GNUNET_YES
Definition: gnunet_common.h:80
static struct Experiment * e
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.
Definition: scheduler.c:965
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_ATS_solvers_experimentation_run()

void GNUNET_ATS_solvers_experimentation_run ( struct Experiment e,
GNUNET_ATS_TESTING_EpisodeDoneCallback  ep_done_cb,
GNUNET_ATS_TESTING_ExperimentDoneCallback  e_done_cb 
)

Definition at line 640 of file gnunet-solver-eval.c.

References Experiment::cur, Episode::duration, Experiment::e_done_cb, enforce_episode(), Experiment::ep_done_cb, Experiment::episode_timeout_task, Experiment::experiment_timeout_task, GNUNET_SCHEDULER_add_delayed(), GNUNET_STRINGS_relative_time_to_string(), GNUNET_TIME_absolute_get(), GNUNET_YES, Episode::id, Experiment::max_duration, Experiment::name, Experiment::start, Experiment::start_time, timeout_episode(), and timeout_experiment().

643 {
644  fprintf (stderr, "Running experiment `%s' with timeout %s\n", e->name,
646  e->e_done_cb = e_done_cb;
647  e->ep_done_cb = ep_done_cb;
649 
650  /* Start total time out */
652  &timeout_experiment, e);
653 
654  /* Start */
655  e->cur = e->start;
656  fprintf (stderr, "Running episode %u with timeout %s\n",
657  e->cur->id,
659  enforce_episode(e->cur);
661  &timeout_episode, e);
662 
663 
664 }
struct Episode * start
GNUNET_ATS_TESTING_EpisodeDoneCallback ep_done_cb
GNUNET_ATS_TESTING_ExperimentDoneCallback e_done_cb
static void timeout_experiment(void *cls)
static void enforce_episode(struct Episode *ep)
struct GNUNET_SCHEDULER_Task * experiment_timeout_task
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_delayed(struct GNUNET_TIME_Relative delay, GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run with a specified delay.
Definition: scheduler.c:1246
struct Episode * cur
const char * GNUNET_STRINGS_relative_time_to_string(struct GNUNET_TIME_Relative delta, int do_round)
Give relative time in human-readable fancy format.
Definition: strings.c:727
struct GNUNET_SCHEDULER_Task * episode_timeout_task
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_get(void)
Get the current time.
Definition: time.c:118
struct GNUNET_TIME_Relative duration
static void timeout_episode(void *cls)
struct GNUNET_TIME_Absolute start_time
#define GNUNET_YES
Definition: gnunet_common.h:80
struct GNUNET_TIME_Relative max_duration
Here is the call graph for this function:

◆ GNUNET_ATS_solvers_experimentation_load()

struct Experiment* GNUNET_ATS_solvers_experimentation_load ( char *  filename)

Definition at line 668 of file gnunet-solver-eval.c.

References cfg, Experiment::cfg_file, create_experiment(), e, free_experiment(), GNUNET_CONFIGURATION_create(), GNUNET_CONFIGURATION_destroy(), GNUNET_CONFIGURATION_get_value_filename(), GNUNET_CONFIGURATION_get_value_number(), GNUNET_CONFIGURATION_get_value_string(), GNUNET_CONFIGURATION_get_value_time(), GNUNET_CONFIGURATION_load(), GNUNET_STRINGS_relative_time_to_string(), GNUNET_SYSERR, GNUNET_YES, load_episodes(), Experiment::log_freq, Experiment::max_duration, Experiment::name, Experiment::num_episodes, Experiment::num_masters, Experiment::num_slaves, and Experiment::total_duration.

Referenced by run().

669 {
670  struct Experiment *e;
672  e = NULL;
673 
676  {
677  fprintf (stderr, "Failed to load `%s'\n", filename);
679  return NULL;
680  }
681 
682  e = create_experiment ();
683 
684  if (GNUNET_SYSERR == GNUNET_CONFIGURATION_get_value_string(cfg, "experiment",
685  "name", &e->name))
686  {
687  fprintf (stderr, "Invalid %s", "name");
688  free_experiment (e);
689  return NULL;
690  }
691  else
692  fprintf (stderr, "Experiment name: `%s'\n", e->name);
693 
694  if (GNUNET_SYSERR == GNUNET_CONFIGURATION_get_value_filename (cfg, "experiment",
695  "cfg_file", &e->cfg_file))
696  {
697  fprintf (stderr, "Invalid %s", "cfg_file");
698  free_experiment (e);
699  return NULL;
700  }
701  else
702  fprintf (stderr, "Experiment name: `%s'\n", e->cfg_file);
703 
704  if (GNUNET_SYSERR == GNUNET_CONFIGURATION_get_value_number(cfg, "experiment",
705  "masters", &e->num_masters))
706  {
707  fprintf (stderr, "Invalid %s", "masters");
708  free_experiment (e);
709  return NULL;
710  }
711  else
712  fprintf (stderr, "Experiment masters: `%llu'\n",
713  e->num_masters);
714 
715  if (GNUNET_SYSERR == GNUNET_CONFIGURATION_get_value_number(cfg, "experiment",
716  "slaves", &e->num_slaves))
717  {
718  fprintf (stderr, "Invalid %s", "slaves");
719  free_experiment (e);
720  return NULL;
721  }
722  else
723  fprintf (stderr, "Experiment slaves: `%llu'\n",
724  e->num_slaves);
725 
726  if (GNUNET_SYSERR == GNUNET_CONFIGURATION_get_value_time(cfg, "experiment",
727  "log_freq", &e->log_freq))
728  {
729  fprintf (stderr, "Invalid %s", "log_freq");
730  free_experiment (e);
731  return NULL;
732  }
733  else
734  fprintf (stderr, "Experiment logging frequency: `%s'\n",
736 
737  if (GNUNET_SYSERR == GNUNET_CONFIGURATION_get_value_time(cfg, "experiment",
738  "max_duration", &e->max_duration))
739  {
740  fprintf (stderr, "Invalid %s", "max_duration");
741  free_experiment (e);
742  return NULL;
743  }
744  else
745  fprintf (stderr, "Experiment duration: `%s'\n",
747 
748  load_episodes (e, cfg);
749  fprintf (stderr, "Loaded %u episodes with total duration %s\n",
750  e->num_episodes,
752 
754  return e;
755 }
int GNUNET_CONFIGURATION_get_value_time(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, struct GNUNET_TIME_Relative *time)
Get a configuration value that should be a relative time.
int GNUNET_CONFIGURATION_get_value_number(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, unsigned long long *number)
Get a configuration value that should be a number.
unsigned long long int num_masters
Definition: ats-testing.h:525
struct GNUNET_TIME_Relative total_duration
unsigned int num_episodes
struct GNUNET_CONFIGURATION_Handle * GNUNET_CONFIGURATION_create(void)
Create a new configuration object.
int GNUNET_CONFIGURATION_load(struct GNUNET_CONFIGURATION_Handle *cfg, const char *filename)
Load configuration.
struct GNUNET_TIME_Relative log_freq
const char * GNUNET_STRINGS_relative_time_to_string(struct GNUNET_TIME_Relative delta, int do_round)
Give relative time in human-readable fancy format.
Definition: strings.c:727
void GNUNET_CONFIGURATION_destroy(struct GNUNET_CONFIGURATION_Handle *cfg)
Destroy configuration object.
unsigned long long int num_slaves
Definition: ats-testing.h:526
static char * filename
int GNUNET_CONFIGURATION_get_value_string(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, char **value)
Get a configuration value that should be a string.
static struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
Definition: gnunet-arm.c:104
#define GNUNET_SYSERR
Definition: gnunet_common.h:79
configuration data
Definition: configuration.c:85
static struct Experiment * create_experiment()
int GNUNET_CONFIGURATION_get_value_filename(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, char **value)
Get a configuration value that should be the name of a file or directory.
#define GNUNET_YES
Definition: gnunet_common.h:80
static struct Experiment * e
static void free_experiment(struct Experiment *e)
struct GNUNET_TIME_Relative max_duration
static int load_episodes(struct Experiment *e, struct GNUNET_CONFIGURATION_Handle *cfg)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_ATS_solvers_experimentation_stop()

void GNUNET_ATS_solvers_experimentation_stop ( struct Experiment e)

Definition at line 758 of file gnunet-solver-eval.c.

References Experiment::episode_timeout_task, Experiment::experiment_timeout_task, free_experiment(), and GNUNET_SCHEDULER_cancel().

759 {
760  if (NULL != e->experiment_timeout_task)
761  {
763  e->experiment_timeout_task = NULL;
764  }
765  if (NULL != e->episode_timeout_task)
766  {
768  e->episode_timeout_task = NULL;
769  }
770  free_experiment (e);
771 }
struct GNUNET_SCHEDULER_Task * experiment_timeout_task
struct GNUNET_SCHEDULER_Task * episode_timeout_task
static void free_experiment(struct Experiment *e)
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.
Definition: scheduler.c:965
Here is the call graph for this function:

◆ GNUNET_ATS_solvers_solver_stop()

void GNUNET_ATS_solvers_solver_stop ( struct GNUNET_ATS_TESTING_SolverHandle sh)

Definition at line 792 of file gnunet-solver-eval.c.

References GNUNET_free, GNUNET_PLUGIN_unload(), GNUNET_ATS_TESTING_SolverHandle::plugin, and GNUNET_ATS_TESTING_SolverHandle::solver.

793 {
795  GNUNET_free (sh->plugin);
796  GNUNET_free (sh);
797 }
void * GNUNET_PLUGIN_unload(const char *library_name, void *arg)
Unload plugin (runs the "done" callback and returns whatever "done" returned).
Definition: plugin.c:258
#define GNUNET_free(ptr)
Wrapper around free.
Here is the call graph for this function:

◆ GNUNET_ATS_solvers_solver_start()

struct GNUNET_ATS_TESTING_SolverHandle* GNUNET_ATS_solvers_solver_start ( enum GNUNET_ATS_Solvers  type)

Definition at line 800 of file gnunet-solver-eval.c.

References GNUNET_asprintf(), GNUNET_ATS_SOLVER_MLP, GNUNET_ATS_SOLVER_PROPORTIONAL, GNUNET_ATS_SOLVER_RIL, GNUNET_break, GNUNET_new, GNUNET_ATS_TESTING_SolverHandle::plugin, sh, and GNUNET_ATS_TESTING_SolverHandle::solver.

Referenced by run().

801 {
803  char * solver_str;
804 
805  switch (type) {
807  solver_str = "proportional";
808  break;
810  solver_str = "mlp";
811  break;
813  solver_str = "ril";
814  break;
815  default:
816  GNUNET_break (0);
817  return NULL;
818  break;
819  }
820 
822  GNUNET_asprintf (&sh->plugin, "libgnunet_plugin_ats_%s", solver_str);
823  //sh->solver = GNUNET_PLUGIN_load (sh->plugin, &sh->env);
824  if (NULL == sh->solver)
825  {
826  fprintf (stderr, "Failed to load solver `%s'\n", sh->plugin);
827  exit (1);
828  }
829 
830  return sh;
831 }
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur...
static struct GNUNET_ATS_TESTING_SolverHandle * sh
int GNUNET_asprintf(char **buf, const char *format,...)
Like asprintf, just portable.
enum GNUNET_TESTBED_UnderlayLinkModelType type
the type of this model
Here is the call graph for this function:
Here is the caller graph for this function:

◆ run()

static void run ( void *  cls,
char *const *  args,
const char *  cfgfile,
const struct GNUNET_CONFIGURATION_Handle cfg 
)
static

Definition at line 860 of file gnunet-solver-eval.c.

References GNUNET_ATS_SOLVER_MLP, GNUNET_ATS_SOLVER_PROPORTIONAL, GNUNET_ATS_SOLVER_RIL, GNUNET_ATS_solvers_experimentation_load(), GNUNET_ATS_solvers_solver_start(), opt_exp_file, opt_solver, and GNUNET_ATS_TESTING_SolverHandle::solver.

Referenced by main().

862 {
864 
865  if (NULL == opt_exp_file)
866  {
867  fprintf (stderr, "No experiment given ...\n");
868  exit (1);
869  }
870 
871  if (NULL == opt_solver)
872  {
873  fprintf (stderr, "No solver given ...\n");
874  exit (1);
875  }
876 
877  if (0 == strcmp(opt_solver, "mlp"))
878  {
879  solver = GNUNET_ATS_SOLVER_MLP;
880  }
881  else if (0 == strcmp(opt_solver, "proportional"))
882  {
884  }
885  else if (0 == strcmp(opt_solver, "ril"))
886  {
887  solver = GNUNET_ATS_SOLVER_RIL;
888  }
889  else
890  {
891  fprintf (stderr, "No solver given ...");
892  return;
893  }
894 
895  /* load experiment */
897  if (NULL == e)
898  {
899  fprintf (stderr, "Failed to load experiment ...\n");
900  return;
901  }
902 
903  /* load solver */
905  if (NULL == sh)
906  {
907  fprintf (stderr, "Failed to start solver ...\n");
908  return;
909  }
910 
911  /* start logging */
912 
913  /* run experiment */
914 
915  /* WAIT */
916 }
static char * opt_solver
static char * opt_exp_file
cmd option -e: experiment file
struct Experiment * GNUNET_ATS_solvers_experimentation_load(char *filename)
GNUNET_ATS_Solvers
struct GNUNET_ATS_TESTING_SolverHandle * GNUNET_ATS_solvers_solver_start(enum GNUNET_ATS_Solvers type)
static struct GNUNET_ATS_TESTING_SolverHandle * sh
static struct Experiment * e
Here is the call graph for this function:
Here is the caller graph for this function:

◆ main()

int main ( int  argc,
char *  argv[] 
)

Main function of the benchmark.

Parameters
argcargument count
argvargument values

Definition at line 926 of file gnunet-solver-eval.c.

References gettext_noop, GNUNET_GETOPT_OPTION_END, GNUNET_GETOPT_option_flag(), GNUNET_GETOPT_option_string(), GNUNET_NO, GNUNET_OK, GNUNET_PROGRAM_run(), opt_exp_file, opt_log, opt_plot, opt_solver, opt_verbose, and run().

927 {
928 
929  opt_exp_file = NULL;
930  opt_solver = NULL;
931  opt_log = GNUNET_NO;
933 
935  {
937  "solver",
938  NULL,
939  gettext_noop ("solver to use"),
940  &opt_solver),
941 
943  "experiment",
944  NULL,
945  gettext_noop ("experiment to use"),
946  &opt_exp_file),
947 
949  "experiment",
950  gettext_noop ("experiment to use"),
951  &opt_verbose),
953  };
954 
955  if (GNUNET_OK !=
956  GNUNET_PROGRAM_run (argc,
957  argv, argv[0],
958  NULL,
959  options,
960  &run, argv[0]))
961  return 1;
962 
963  return 0;
964 }
static int opt_verbose
cmd option -v: verbose logs
static char * opt_solver
struct GNUNET_GETOPT_CommandLineOption options[]
Definition: 002.c:5
static char * opt_exp_file
cmd option -e: experiment file
static int opt_plot
cmd option -p: enable plots
#define GNUNET_NO
Definition: gnunet_common.h:81
#define GNUNET_OK
Named constants for return values.
Definition: gnunet_common.h:78
Definition of a command line option.
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_OPTION_END
Definition: 002.c:13
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_string(char shortName, const char *name, const char *argumentHelp, const char *description, char **str)
Allow user to specify a string.
static int opt_log
cmd option -l: enable logging
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_flag(char shortName, const char *name, const char *description, int *val)
Allow user to specify a flag (which internally means setting an integer to 1/GNUNET_YES/GNUNET_OK.
int GNUNET_PROGRAM_run(int argc, char *const *argv, const char *binaryName, const char *binaryHelp, const struct GNUNET_GETOPT_CommandLineOption *options, GNUNET_PROGRAM_Main task, void *task_cls)
Run a standard GNUnet command startup sequence (initialize loggers and configuration, parse options).
Definition: program.c:361
static void run(void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg)
#define gettext_noop(String)
Definition: gettext.h:69
Here is the call graph for this function:

Variable Documentation

◆ e

struct Experiment* e
static

◆ sh

Definition at line 835 of file gnunet-solver-eval.c.

Referenced by GNUNET_ATS_solvers_solver_start().

◆ opt_exp_file

char* opt_exp_file
static

cmd option -e: experiment file

Definition at line 840 of file gnunet-solver-eval.c.

Referenced by main(), and run().

◆ opt_solver

char* opt_solver
static

Definition at line 842 of file gnunet-solver-eval.c.

Referenced by main(), and run().

◆ opt_log

int opt_log
static

cmd option -l: enable logging

Definition at line 847 of file gnunet-solver-eval.c.

Referenced by main().

◆ opt_plot

int opt_plot
static

cmd option -p: enable plots

Definition at line 852 of file gnunet-solver-eval.c.

Referenced by main().

◆ opt_verbose

int opt_verbose
static

cmd option -v: verbose logs

Definition at line 857 of file gnunet-solver-eval.c.

Referenced by main().