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 796 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  {
41  case START_SEND:
42  return "START_SEND";
43 
44  case STOP_SEND:
45  return "STOP_SEND";
46 
47  case START_PREFERENCE:
48  return "START_PREFERENCE";
49 
50  case STOP_PREFERENCE:
51  return "STOP_PREFERENCE";
52 
53  default:
54  break;
55  }
56  return "";
57 }
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 61 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().

62 {
63  struct Experiment *e;
64 
65  e = GNUNET_new(struct Experiment);
66  e->name = NULL;
67  e->num_masters = 0;
68  e->num_slaves = 0;
69  e->start = NULL;
71  return e;
72 }
struct Episode * start
unsigned long long int num_masters
Definition: ats-testing.h:513
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:514
#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 76 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().

77 {
78  struct Episode *cur;
79  struct Episode *next;
80  struct GNUNET_ATS_TEST_Operation *cur_o;
81  struct GNUNET_ATS_TEST_Operation *next_o;
82 
83  next = e->start;
84  for (cur = next; NULL != cur; cur = next)
85  {
86  next = cur->next;
87 
88  next_o = cur->head;
89  for (cur_o = next_o; NULL != cur_o; cur_o = next_o)
90  {
91  next_o = cur_o->next;
92  GNUNET_free(cur_o);
93  }
94  GNUNET_free(cur);
95  }
96 
99  GNUNET_free(e);
100 }
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 104 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().

107 {
108  struct GNUNET_ATS_TEST_Operation *o;
109  char *sec_name;
110  char *op_name;
111  char *op;
112  char *type;
113  char *pref;
114  int op_counter = 0;
115 
116  fprintf(stderr, "Parsing episode %u\n", cur->id);
117  GNUNET_asprintf(&sec_name, "episode-%u", cur->id);
118 
119  while (1)
120  {
121  /* Load operation */
122  GNUNET_asprintf(&op_name, "op-%u-operation", op_counter);
124  sec_name, op_name, &op))
125  {
126  GNUNET_free(op_name);
127  break;
128  }
130  /* operations = set_rate, start_send, stop_send, set_preference */
131  if (0 == strcmp(op, "start_send"))
132  {
133  o->type = START_SEND;
134  }
135  else if (0 == strcmp(op, "stop_send"))
136  {
137  o->type = STOP_SEND;
138  }
139  else if (0 == strcmp(op, "start_preference"))
140  {
141  o->type = START_PREFERENCE;
142  }
143  else if (0 == strcmp(op, "stop_preference"))
144  {
145  o->type = STOP_PREFERENCE;
146  }
147  else
148  {
149  fprintf(stderr, "Invalid operation %u `%s' in episode %u\n",
150  op_counter, op, cur->id);
151  GNUNET_free(op);
152  GNUNET_free(op_name);
153  GNUNET_free(sec_name);
154  GNUNET_free(o);
155  return GNUNET_SYSERR;
156  }
157  GNUNET_free(op_name);
158 
159  /* Get source */
160  GNUNET_asprintf(&op_name, "op-%u-src", op_counter);
162  sec_name, op_name, &o->src_id))
163  {
164  fprintf(stderr, "Missing src in operation %u `%s' in episode %u\n",
165  op_counter, op, cur->id);
166  GNUNET_free(op);
167  GNUNET_free(op_name);
168  GNUNET_free(sec_name);
169  GNUNET_free(o);
170  return GNUNET_SYSERR;
171  }
172  if (o->src_id > (e->num_masters - 1))
173  {
174  fprintf(stderr, "Invalid src %llu in operation %u `%s' in episode %u\n",
175  o->src_id, op_counter, op, cur->id);
176  GNUNET_free(op);
177  GNUNET_free(op_name);
178  GNUNET_free(sec_name);
179  GNUNET_free(o);
180  return GNUNET_SYSERR;
181  }
182  GNUNET_free(op_name);
183 
184  /* Get destination */
185  GNUNET_asprintf(&op_name, "op-%u-dest", op_counter);
187  sec_name, op_name, &o->dest_id))
188  {
189  fprintf(stderr, "Missing src in operation %u `%s' in episode %u\n",
190  op_counter, op, cur->id);
191  GNUNET_free(op);
192  GNUNET_free(op_name);
193  GNUNET_free(sec_name);
194  GNUNET_free(o);
195  return GNUNET_SYSERR;
196  }
197  if (o->dest_id > (e->num_slaves - 1))
198  {
199  fprintf(stderr,
200  "Invalid destination %llu in operation %u `%s' in episode %u\n",
201  o->dest_id,
202  op_counter,
203  op,
204  cur->id);
205  GNUNET_free(op);
206  GNUNET_free(op_name);
207  GNUNET_free(sec_name);
208  GNUNET_free(o);
209  return GNUNET_SYSERR;
210  }
211  GNUNET_free(op_name);
212 
213  GNUNET_asprintf(&op_name, "op-%u-type", op_counter);
214  if ((GNUNET_SYSERR !=
216  sec_name,
217  op_name,
218  &type)) &&
219  (STOP_SEND != o->type) &&
220  (STOP_PREFERENCE != o->type))
221  {
222  /* Load arguments for set_rate, start_send, set_preference */
223  if (0 == strcmp(type, "constant"))
224  {
226  }
227  else if (0 == strcmp(type, "linear"))
228  {
230  }
231  else if (0 == strcmp(type, "sinus"))
232  {
234  }
235  else if (0 == strcmp(type, "random"))
236  {
238  }
239  else
240  {
241  fprintf(stderr, "Invalid type %u `%s' in episode %u\n",
242  op_counter, op, cur->id);
243  GNUNET_free(type);
244  GNUNET_free(op);
245  GNUNET_free(op_name);
246  GNUNET_free(sec_name);
247  GNUNET_free(o);
248  return GNUNET_SYSERR;
249  }
250  GNUNET_free(op_name);
251 
252  /* Get base rate */
253  GNUNET_asprintf(&op_name, "op-%u-base-rate", op_counter);
255  sec_name, op_name, &o->base_rate))
256  {
257  fprintf(stderr, "Missing base rate in operation %u `%s' in episode %u\n",
258  op_counter, op, cur->id);
259  GNUNET_free(type);
260  GNUNET_free(op);
261  GNUNET_free(op_name);
262  GNUNET_free(sec_name);
263  GNUNET_free(o);
264  return GNUNET_SYSERR;
265  }
266  GNUNET_free(op_name);
267 
268  /* Get max rate */
269  GNUNET_asprintf(&op_name, "op-%u-max-rate", op_counter);
270  if (GNUNET_SYSERR ==
272  sec_name,
273  op_name,
274  &o->max_rate))
275  {
276  if ((GNUNET_ATS_TEST_TG_LINEAR == o->gen_type) ||
279  {
280  fprintf(stderr, "Missing max rate in operation %u `%s' in episode %u\n",
281  op_counter, op, cur->id);
282  GNUNET_free(type);
283  GNUNET_free(op_name);
284  GNUNET_free(op);
285  GNUNET_free(sec_name);
286  GNUNET_free(o);
287  return GNUNET_SYSERR;
288  }
289  }
290  GNUNET_free(op_name);
291 
292  /* Get period */
293  GNUNET_asprintf(&op_name, "op-%u-period", op_counter);
295  sec_name, op_name, &o->period))
296  {
297  o->period = cur->duration;
298  }
299  GNUNET_free(op_name);
300 
301  if (START_PREFERENCE == o->type)
302  {
303  /* Get frequency */
304  GNUNET_asprintf(&op_name, "op-%u-frequency", op_counter);
306  sec_name, op_name, &o->frequency))
307  {
308  fprintf(stderr, "Missing frequency in operation %u `%s' in episode %u\n",
309  op_counter, op, cur->id);
310  GNUNET_free(type);
311  GNUNET_free(op_name);
312  GNUNET_free(op);
313  GNUNET_free(sec_name);
314  GNUNET_free(o);
315  return GNUNET_SYSERR;
316  }
317  GNUNET_free(op_name);
318 
319  /* Get preference */
320  GNUNET_asprintf(&op_name, "op-%u-pref", op_counter);
322  sec_name, op_name, &pref))
323  {
324  fprintf(stderr, "Missing preference in operation %u `%s' in episode %u\n",
325  op_counter, op, cur->id);
326  GNUNET_free(type);
327  GNUNET_free(op_name);
328  GNUNET_free(op);
329  GNUNET_free(sec_name);
330  GNUNET_free_non_null(pref);
331  GNUNET_free(o);
332  return GNUNET_SYSERR;
333  }
334 
335  if (0 == strcmp(pref, "bandwidth"))
337  else if (0 == strcmp(pref, "latency"))
339  else
340  {
341  fprintf(stderr,
342  "Invalid preference in operation %u `%s' in episode %u\n",
343  op_counter,
344  op,
345  cur->id);
346  GNUNET_free(type);
347  GNUNET_free(op_name);
348  GNUNET_free(op);
349  GNUNET_free(sec_name);
350  GNUNET_free_non_null(pref);
351  GNUNET_free(o);
352  return GNUNET_SYSERR;
353  }
354  GNUNET_free(pref);
355  GNUNET_free(op_name);
356  }
357  }
358 
359  /* Safety checks */
360  if ((GNUNET_ATS_TEST_TG_LINEAR == o->gen_type) ||
362  {
363  if ((o->max_rate - o->base_rate) > o->base_rate)
364  {
365  /* This will cause an underflow */
366  GNUNET_break(0);
367  }
368  fprintf(stderr, "Selected max rate and base rate cannot be used for desired traffic form!\n");
369  }
370 
371  if ((START_SEND == o->type) || (START_PREFERENCE == o->type))
372  fprintf(stderr, "Found operation %u in episode %u: %s [%llu]->[%llu] == %s, %llu -> %llu in %s\n",
373  op_counter, cur->id, print_op(o->type), o->src_id,
374  o->dest_id, (NULL != type) ? type : "",
375  o->base_rate, o->max_rate,
377  else
378  fprintf(stderr, "Found operation %u in episode %u: %s [%llu]->[%llu]\n",
379  op_counter, cur->id, print_op(o->type), o->src_id, o->dest_id);
380 
381  GNUNET_free_non_null(type);
382  GNUNET_free(op);
383 
384  GNUNET_CONTAINER_DLL_insert(cur->head, cur->tail, o);
385  op_counter++;
386  }
387  GNUNET_free(sec_name);
388 
389  return GNUNET_OK;
390 }
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:513
long long unsigned int src_id
Definition: ats-testing.h:487
#define GNUNET_OK
Named constants for return values.
Definition: gnunet_common.h:75
#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:488
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:686
long long unsigned int base_rate
unsigned long long int num_slaves
Definition: ats-testing.h:514
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:76
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:77
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 393 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().

394 {
395  int e_counter = 0;
396  char *sec_name;
397  struct GNUNET_TIME_Relative e_duration;
398  struct Episode *cur;
399  struct Episode *last;
400 
401  e_counter = 0;
402  last = NULL;
403  while (1)
404  {
405  GNUNET_asprintf(&sec_name, "episode-%u", e_counter);
407  sec_name, "duration", &e_duration))
408  {
409  GNUNET_free(sec_name);
410  break;
411  }
412 
413  cur = GNUNET_new(struct Episode);
414  cur->duration = e_duration;
415  cur->id = e_counter;
416 
417  if (GNUNET_OK != load_episode(e, cur, cfg))
418  {
419  GNUNET_free(sec_name);
420  GNUNET_free(cur);
421  return GNUNET_SYSERR;
422  }
423 
424  fprintf(stderr, "Found episode %u with duration %s \n",
425  e_counter,
427 
428  /* Update experiment */
429  e->num_episodes++;
431  /* Put in linked list */
432  if (NULL == last)
433  e->start = cur;
434  else
435  last->next = cur;
436 
437  GNUNET_free(sec_name);
438  e_counter++;
439  last = cur;
440  }
441  return e_counter;
442 }
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:75
#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:686
struct GNUNET_TIME_Relative duration
#define GNUNET_SYSERR
Definition: gnunet_common.h:76
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:577
#define GNUNET_YES
Definition: gnunet_common.h:77
#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 446 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().

447 {
448  struct Experiment *e = cls;
449 
450  e->experiment_timeout_task = NULL;
451  fprintf(stderr, "Experiment timeout!\n");
452 
453  if (NULL != e->episode_timeout_task)
454  {
456  e->episode_timeout_task = NULL;
457  }
458 
460  GNUNET_SYSERR);
461 }
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:76
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:956
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 465 of file gnunet-solver-eval.c.

Referenced by enforce_episode().

466 {
467  /*
468  struct BenchmarkPeer *peer;
469  struct BenchmarkPartner *partner;
470 
471  peer = GNUNET_ATS_TEST_get_peer (op->src_id);
472  if (NULL == peer)
473  {
474  GNUNET_break (0);
475  return;
476  }
477 
478  partner = GNUNET_ATS_TEST_get_partner (op->src_id, op->dest_id);
479  if (NULL == partner)
480  {
481  GNUNET_break (0);
482  return;
483  }
484 
485  fprintf (stderr, "Found master %llu slave %llu\n",op->src_id, op->dest_id);
486 
487  if (NULL != partner->tg)
488  {
489  fprintf (stderr, "Stopping traffic between master %llu slave %llu\n",op->src_id, op->dest_id);
490  GNUNET_ATS_TEST_generate_traffic_stop(partner->tg);
491  partner->tg = NULL;
492  }
493 
494  partner->tg = GNUNET_ATS_TEST_generate_traffic_start(peer, partner,
495  op->tg_type, op->base_rate, op->max_rate, op->period,
496  GNUNET_TIME_UNIT_FOREVER_REL);
497  */
498 }
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 501 of file gnunet-solver-eval.c.

Referenced by enforce_episode().

502 {
503  /*
504  struct BenchmarkPartner *p;
505  p = GNUNET_ATS_TEST_get_partner (op->src_id, op->dest_id);
506  if (NULL == p)
507  {
508  GNUNET_break (0);
509  return;
510  }
511 
512  fprintf (stderr, "Found master %llu slave %llu\n",op->src_id, op->dest_id);
513 
514  if (NULL != p->tg)
515  {
516  fprintf (stderr, "Stopping traffic between master %llu slave %llu\n",
517  op->src_id, op->dest_id);
518  GNUNET_ATS_TEST_generate_traffic_stop(p->tg);
519  p->tg = NULL;
520  }
521  */
522 }
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 526 of file gnunet-solver-eval.c.

Referenced by enforce_episode().

527 {
528  /*
529  struct BenchmarkPeer *peer;
530  struct BenchmarkPartner *partner;
531 
532  peer = GNUNET_ATS_TEST_get_peer (op->src_id);
533  if (NULL == peer)
534  {
535  GNUNET_break (0);
536  return;
537  }
538 
539  partner = GNUNET_ATS_TEST_get_partner (op->src_id, op->dest_id);
540  if (NULL == partner)
541  {
542  GNUNET_break (0);
543  return;
544  }
545 
546  fprintf (stderr, "Found master %llu slave %llu\n",op->src_id, op->dest_id);
547 
548  if (NULL != partner->pg)
549  {
550  fprintf (stderr, "Stopping traffic between master %llu slave %llu\n",
551  op->src_id, op->dest_id);
552  GNUNET_ATS_TEST_generate_preferences_stop(partner->pg);
553  partner->pg = NULL;
554  }
555 
556  partner->pg = GNUNET_ATS_TEST_generate_preferences_start(peer, partner,
557  op->tg_type, op->base_rate, op->max_rate, op->period, op->frequency,
558  op->pref_type);
559  */
560 }
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 563 of file gnunet-solver-eval.c.

Referenced by enforce_episode().

564 {
565  /*
566  struct BenchmarkPartner *p;
567  p = GNUNET_ATS_TEST_get_partner (op->src_id, op->dest_id);
568  if (NULL == p)
569  {
570  GNUNET_break (0);
571  return;
572  }
573 
574  fprintf (stderr, "Found master %llu slave %llu\n",op->src_id, op->dest_id);
575 
576  if (NULL != p->pg)
577  {
578  fprintf (stderr, "Stopping preference between master %llu slave %llu\n",
579  op->src_id, op->dest_id);
580  GNUNET_ATS_TEST_generate_preferences_stop (p->pg);
581  p->pg = NULL;
582  }
583  */
584 }
Here is the caller graph for this function:

◆ enforce_episode()

static void enforce_episode ( struct Episode ep)
static

Definition at line 586 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().

587 {
588  struct GNUNET_ATS_TEST_Operation *cur;
589 
590  for (cur = ep->head; NULL != cur; cur = cur->next)
591  {
592  fprintf(stderr, "Enforcing operation: %s [%llu]->[%llu] == %llu\n",
593  print_op(cur->type), cur->src_id, cur->dest_id, cur->base_rate);
594  switch (cur->type)
595  {
596  case START_SEND:
597  enforce_start_send(cur);
598  break;
599 
600  case STOP_SEND:
601  enforce_stop_send(cur);
602  break;
603 
604  case START_PREFERENCE:
606  break;
607 
608  case STOP_PREFERENCE:
610  break;
611 
612  default:
613  break;
614  }
615  }
616 }
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:487
static void enforce_start_preference(struct GNUNET_ATS_TEST_Operation *op)
long long unsigned int dest_id
Definition: ats-testing.h:488
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 620 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().

621 {
622  struct Experiment *e = cls;
623 
624  e->episode_timeout_task = NULL;
625  if (NULL != e->ep_done_cb)
626  e->ep_done_cb(e->cur);
627 
628  /* Scheduling next */
629  e->cur = e->cur->next;
630  if (NULL == e->cur)
631  {
632  /* done */
633  fprintf(stderr, "Last episode done!\n");
634  if (NULL != e->experiment_timeout_task)
635  {
637  e->experiment_timeout_task = NULL;
638  }
640  return;
641  }
642 
643  fprintf(stderr, "Running episode %u with timeout %s\n",
644  e->cur->id,
646  enforce_episode(e->cur);
647 
649  &timeout_episode, e);
650 }
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:75
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:1237
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:686
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:77
static struct Experiment * e
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.
Definition: scheduler.c:956
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 654 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().

657 {
658  fprintf(stderr, "Running experiment `%s' with timeout %s\n", e->name,
660  e->e_done_cb = e_done_cb;
661  e->ep_done_cb = ep_done_cb;
663 
664  /* Start total time out */
666  &timeout_experiment, e);
667 
668  /* Start */
669  e->cur = e->start;
670  fprintf(stderr, "Running episode %u with timeout %s\n",
671  e->cur->id,
673  enforce_episode(e->cur);
675  &timeout_episode, e);
676 }
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:1237
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:686
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:77
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 680 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().

681 {
682  struct Experiment *e;
684 
685  e = NULL;
686 
689  {
690  fprintf(stderr, "Failed to load `%s'\n", filename);
692  return NULL;
693  }
694 
695  e = create_experiment();
696 
697  if (GNUNET_SYSERR == GNUNET_CONFIGURATION_get_value_string(cfg, "experiment",
698  "name", &e->name))
699  {
700  fprintf(stderr, "Invalid %s", "name");
701  free_experiment(e);
702  return NULL;
703  }
704  else
705  fprintf(stderr, "Experiment name: `%s'\n", e->name);
706 
708  "cfg_file", &e->cfg_file))
709  {
710  fprintf(stderr, "Invalid %s", "cfg_file");
711  free_experiment(e);
712  return NULL;
713  }
714  else
715  fprintf(stderr, "Experiment name: `%s'\n", e->cfg_file);
716 
717  if (GNUNET_SYSERR == GNUNET_CONFIGURATION_get_value_number(cfg, "experiment",
718  "masters", &e->num_masters))
719  {
720  fprintf(stderr, "Invalid %s", "masters");
721  free_experiment(e);
722  return NULL;
723  }
724  else
725  fprintf(stderr, "Experiment masters: `%llu'\n",
726  e->num_masters);
727 
728  if (GNUNET_SYSERR == GNUNET_CONFIGURATION_get_value_number(cfg, "experiment",
729  "slaves", &e->num_slaves))
730  {
731  fprintf(stderr, "Invalid %s", "slaves");
732  free_experiment(e);
733  return NULL;
734  }
735  else
736  fprintf(stderr, "Experiment slaves: `%llu'\n",
737  e->num_slaves);
738 
739  if (GNUNET_SYSERR == GNUNET_CONFIGURATION_get_value_time(cfg, "experiment",
740  "log_freq", &e->log_freq))
741  {
742  fprintf(stderr, "Invalid %s", "log_freq");
743  free_experiment(e);
744  return NULL;
745  }
746  else
747  fprintf(stderr, "Experiment logging frequency: `%s'\n",
749 
750  if (GNUNET_SYSERR == GNUNET_CONFIGURATION_get_value_time(cfg, "experiment",
751  "max_duration", &e->max_duration))
752  {
753  fprintf(stderr, "Invalid %s", "max_duration");
754  free_experiment(e);
755  return NULL;
756  }
757  else
758  fprintf(stderr, "Experiment duration: `%s'\n",
760 
761  load_episodes(e, cfg);
762  fprintf(stderr, "Loaded %u episodes with total duration %s\n",
763  e->num_episodes,
765 
767  return e;
768 }
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:513
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:686
void GNUNET_CONFIGURATION_destroy(struct GNUNET_CONFIGURATION_Handle *cfg)
Destroy configuration object.
unsigned long long int num_slaves
Definition: ats-testing.h:514
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:76
configuration data
Definition: configuration.c:83
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:77
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 771 of file gnunet-solver-eval.c.

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

772 {
773  if (NULL != e->experiment_timeout_task)
774  {
776  e->experiment_timeout_task = NULL;
777  }
778  if (NULL != e->episode_timeout_task)
779  {
781  e->episode_timeout_task = NULL;
782  }
783  free_experiment(e);
784 }
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:956
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 803 of file gnunet-solver-eval.c.

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

804 {
806  GNUNET_free(sh->plugin);
807  GNUNET_free(sh);
808 }
void * GNUNET_PLUGIN_unload(const char *library_name, void *arg)
Unload plugin (runs the "done" callback and returns whatever "done" returned).
Definition: plugin.c:255
#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 811 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().

812 {
814  char * solver_str;
815 
816  switch (type)
817  {
819  solver_str = "proportional";
820  break;
821 
823  solver_str = "mlp";
824  break;
825 
827  solver_str = "ril";
828  break;
829 
830  default:
831  GNUNET_break(0);
832  return NULL;
833  break;
834  }
835 
837  GNUNET_asprintf(&sh->plugin, "libgnunet_plugin_ats_%s", solver_str);
838  //sh->solver = GNUNET_PLUGIN_load (sh->plugin, &sh->env);
839  if (NULL == sh->solver)
840  {
841  fprintf(stderr, "Failed to load solver `%s'\n", sh->plugin);
842  exit(1);
843  }
844 
845  return sh;
846 }
#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 875 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().

877 {
879 
880  if (NULL == opt_exp_file)
881  {
882  fprintf(stderr, "No experiment given ...\n");
883  exit(1);
884  }
885 
886  if (NULL == opt_solver)
887  {
888  fprintf(stderr, "No solver given ...\n");
889  exit(1);
890  }
891 
892  if (0 == strcmp(opt_solver, "mlp"))
893  {
894  solver = GNUNET_ATS_SOLVER_MLP;
895  }
896  else if (0 == strcmp(opt_solver, "proportional"))
897  {
899  }
900  else if (0 == strcmp(opt_solver, "ril"))
901  {
902  solver = GNUNET_ATS_SOLVER_RIL;
903  }
904  else
905  {
906  fprintf(stderr, "No solver given ...");
907  return;
908  }
909 
910  /* load experiment */
912  if (NULL == e)
913  {
914  fprintf(stderr, "Failed to load experiment ...\n");
915  return;
916  }
917 
918  /* load solver */
920  if (NULL == sh)
921  {
922  fprintf(stderr, "Failed to start solver ...\n");
923  return;
924  }
925 
926  /* start logging */
927 
928  /* run experiment */
929 
930  /* WAIT */
931 }
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 941 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().

942 {
943  opt_exp_file = NULL;
944  opt_solver = NULL;
945  opt_log = GNUNET_NO;
947 
949  {
951  "solver",
952  NULL,
953  gettext_noop("solver to use"),
954  &opt_solver),
955 
957  "experiment",
958  NULL,
959  gettext_noop("experiment to use"),
960  &opt_exp_file),
961 
963  "experiment",
964  gettext_noop("experiment to use"),
965  &opt_verbose),
967  };
968 
969  if (GNUNET_OK !=
970  GNUNET_PROGRAM_run(argc,
971  argv, argv[0],
972  NULL,
973  options,
974  &run, argv[0]))
975  return 1;
976 
977  return 0;
978 }
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:78
#define GNUNET_OK
Named constants for return values.
Definition: gnunet_common.h:75
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:367
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 850 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 855 of file gnunet-solver-eval.c.

Referenced by main(), and run().

◆ opt_solver

char* opt_solver
static

Definition at line 857 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 862 of file gnunet-solver-eval.c.

Referenced by main().

◆ opt_plot

int opt_plot
static

cmd option -p: enable plots

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

Referenced by main().

◆ opt_verbose

int opt_verbose
static

cmd option -v: verbose logs

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

Referenced by main().