The ROme OpTimistic Simulator  3.0.0
A General-Purpose Multithreaded Parallel/Distributed Simulation Platform
ROOT-Sim.h File Reference

ROOT-Sim header for model development. More...

#include <limits.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
+ Include dependency graph for ROOT-Sim.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ap_option
 A single parsable command line option. More...
 
struct  topology_settings_t
 This is declared by the model to setup the topology module. More...
 

Typedefs

typedef double simtime_t
 
typedef uint64_t lp_id_t
 

Enumerations

enum  rootsim_event {
  MODEL_INIT = 65532, LP_INIT, LP_FINI, MODEL_FINI,
  MODEL_INIT = 65532, LP_INIT, LP_FINI, MODEL_FINI
}
 
enum  ap_event_key { AP_KEY_INIT = 1 << 14, AP_KEY_FINI, AP_KEY_INIT = 1 << 14, AP_KEY_FINI }
 
enum  _topology_geometry_t {
  TOPOLOGY_HEXAGON = 1, TOPOLOGY_SQUARE, TOPOLOGY_RING, TOPOLOGY_BIDRING,
  TOPOLOGY_TORUS, TOPOLOGY_STAR, TOPOLOGY_MESH, TOPOLOGY_HEXAGON = 1,
  TOPOLOGY_SQUARE, TOPOLOGY_RING, TOPOLOGY_BIDRING, TOPOLOGY_TORUS,
  TOPOLOGY_STAR, TOPOLOGY_MESH
}
 
enum  _direction_t {
  DIRECTION_N, DIRECTION_S, DIRECTION_E, DIRECTION_W,
  DIRECTION_NE, DIRECTION_SW, DIRECTION_NW, DIRECTION_SE,
  DIRECTION_INVALID = INT_MAX, DIRECTION_N, DIRECTION_S, DIRECTION_E,
  DIRECTION_W, DIRECTION_NE, DIRECTION_SW, DIRECTION_NW,
  DIRECTION_SE, DIRECTION_INVALID = INT_MAX
}
 

Functions

 __attribute ((weak)) extern struct ap_option model_options[]
 
void ScheduleNewEvent (lp_id_t receiver, simtime_t timestamp, unsigned event_type, const void *event_content, unsigned event_size)
 
void SetState (void *new_state)
 
double Random (void)
 
uint64_t RandomU64 (void)
 
double Expent (double mean)
 
double Normal (void)
 
lp_id_t RegionsCount (void)
 
lp_id_t DirectionsCount (void)
 
lp_id_t GetReceiver (lp_id_t from, enum _direction_t direction)
 
lp_id_t FindReceiver (void)
 

Variables

const char * arg
 
lp_id_t n_lps
 The total number of LPs in the simulation.
 
struct topology_settings_t topology_settings
 

Detailed Description

ROOT-Sim header for model development.

This header defines all the symbols which are needed to develop a model to be simulated on top of ROOT-Sim.

This header is the only file which should be included when developing a simulation model. All function prototypes exposed to the application developer are exposed and defined here.

Definition in file ROOT-Sim.h.

Enumeration Type Documentation

◆ _direction_t

Enumerator
DIRECTION_N 

North direction.

DIRECTION_S 

South direction.

DIRECTION_E 

East direction.

DIRECTION_W 

West direction.

DIRECTION_NE 

North-east direction.

DIRECTION_SW 

South-west direction.

DIRECTION_NW 

North-west direction.

DIRECTION_SE 

South-east direction.

DIRECTION_INVALID 

A generic invalid direction.

DIRECTION_N 

North direction.

DIRECTION_S 

South direction.

DIRECTION_E 

East direction.

DIRECTION_W 

West direction.

DIRECTION_NE 

North-east direction.

DIRECTION_SW 

South-west direction.

DIRECTION_NW 

North-west direction.

DIRECTION_SE 

South-east direction.

DIRECTION_INVALID 

A generic invalid direction.

Definition at line 70 of file ROOT-Sim.h.

◆ _topology_geometry_t

Enumerator
TOPOLOGY_HEXAGON 

hexagonal grid topology

TOPOLOGY_SQUARE 

square grid topology

TOPOLOGY_RING 

a ring shaped topology walkable in a single direction

TOPOLOGY_BIDRING 

a ring shaped topology

TOPOLOGY_TORUS 

a torus shaped grid topology (a wrapping around square topology)

TOPOLOGY_STAR 

a star shaped topology

TOPOLOGY_MESH 

an arbitrary shaped topology

TOPOLOGY_HEXAGON 

hexagonal grid topology

TOPOLOGY_SQUARE 

square grid topology

TOPOLOGY_RING 

a ring shaped topology walkable in a single direction

TOPOLOGY_BIDRING 

a ring shaped topology

TOPOLOGY_TORUS 

a torus shaped grid topology (a wrapping around square topology)

TOPOLOGY_STAR 

a star shaped topology

TOPOLOGY_MESH 

an arbitrary shaped topology

Definition at line 60 of file ROOT-Sim.h.

◆ ap_event_key

Enumerator
AP_KEY_INIT 

Signals the start of the parsing process.

AP_KEY_FINI 

Signals the end of the parsing process.

Definition at line 40 of file ROOT-Sim.h.

Function Documentation

◆ Expent()

double Expent ( double  mean)

Return a random number according to an Exponential distribution. The mean value of the distribution must be passed as the mean value.

Parameters
meanMean value of the distribution
Returns
A random number

Definition at line 61 of file random.c.

◆ Normal()

double Normal ( void  )

Return a random number according to a Standard Normal Distribution

Returns
A random number

Definition at line 74 of file random.c.