Loading in 2 Seconds...

Mehwish Nagda, Christo Frank Devaraj, Indranil Gupta, Gul Agha University of Illinois (Urbana-Champaign)

Loading in 2 Seconds...

- 200 Views
- Uploaded on

Download Presentation
## PowerPoint Slideshow about 'Mehwish Nagda, Christo Frank Devaraj, Indranil Gupta, Gul Agha University of Illinois Urbana-Champaign' - albert

**An Image/Link below is provided (as is) to download presentation**

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript

Mehwish Nagda, Christo Frank Devaraj, Indranil Gupta, Gul Agha

University of Illinois (Urbana-Champaign)

Motivation

- Many scientific disciplines express ideas, results and phenomena through differential equations
- From competition in ecosystems to Schroedinger’s Wave Equation
- Can we translate the scalability and reliability inherent in non-Computer distributed systems into protocols for distributed systems?
- Can we generate code for such distributed protocols?
- Can we do this rigorously, rather than hand-wavily?

Approach

- DiffGen: Toolkit to systematically translate a subset of differential equation systems into equivalent distributed protocol code in C so that the protocols are guaranteed to
- show equivalent stochastic behavior as original equation system
- be probabilistically scalable
- be probabilistically reliable
- have low and scalable bandwidth at each process
- have low convergence times
- DiffGen internals are backed by rigorous translation methodologies, that guarantee provable properties of generated code.

Internals: Input Semantics

D[x] = 0.3*x^2*z^2 - 0.3*x^2*y^2

D[y] = 0.3*y^2*z^2 - 0.3*x^2*y^2

D[z] = -0.3*x^2*z^2 -0.3*y^2*z^2 + 0.3*x^2*y^2 + 0.3*x^2*y^2

- The above is a sample input into the toolkit for a system of 3 equations.
- Each equation has to be in the form D[xi] =f(x1, x2, ..., xi, ..., xn) where xi is the variable that is differentiated.
- 0.3*x^2*z^2 is a term in the first equation for variable x.
- Each term in the equation starts with a positive or negative constant value.
- Variables in the term are separated by ` * ‘.
- Exponents for each variable follow the ` ^ \' character. A variable with no exponent defined has an exponent of 1.

sample input (diffsys) file

Input system is converted to diffIR, the intermediate representation of the differential equation system

The differential system contains a list of differential equations in the system.

The differential equation contains a list of positive and negative terms as well as the differential equation variable.

The equation term contains the constant in the term, the set of variables involved in the term and their exponents, and a reference to the matching negative or positive term in the differential equation system.

Intermediate Representation, diffIRequation

variable

positive

terms

negative

terms

positive

terms

negative

terms

differential equation

constant

match

term

differential equation

variable

exp

variable

exp

equation term

differential system

Science of Protocol Design

- The toolkit then maps the equation system to a state machine which contains
- One state per basic variable in the original equation system
- Actions mapped onto these states by mapping terms to one of three actions:

Term T =

flipping

Periodically toss coin with probability p.c

If heads, switch state to state y with +c.x term

one time sampling

with

Periodically toss coin with probability p.c

If heads, sample other processes uniformly at random from across the group

If first target choices are in state x and for all j,

the jth process sampled is in the same state as the jth variable in

(when ordered lexicographically), then switch state to

state y with the +T term

Term –T =

tokenizing

with

A variable w in X’ is chosen such that

Flipping or one time sampling actions are created for processes in state w with actions modified so that instead of switching state a token is sent to a random process known to be in state x that transitions into the state of the variable with the corresponding +T term on receiving the token

Template files

- The diffIR is mapped to the above actions and the code is generated into template files. Template files implement:
- Alarm System: Timer events are used to wake nodes up to carry out protocol actions every protocol period. A node in a particular state will set a timer for each negative term in the corresponding differential equation.
- Core Probabilistic Functions: Code for flipping, one time sampling and tokenizing are written in the form of four parameterized C functions (flipping, ots, tok_flipping and tok_ots).
- Communication: The messaging subsystem is built out of an interface that has two methods send_msg and receive_msg. We provide both a simulator implementation and a UDP sockets implementation.
- Server: The server is used to register each client and to stop the protocol.

Code generated is for the Lotka Volterra model. The output protocol is for majority selection in a distributed system

Code generated consists of the header snippet (in fixedclient.h and common.h) and the initialize_states and schedule_timer_event functions (in fixedclient.c)

The header snippet defines the number of states (equations) in the input system and constants for each state

The initialize_states function initializes the number of negative terms in each equation

Generated CodeD[x] = 0.3*x*z - 0.3*x*y

D[y] = 0.3*y*z - 0.3*x*y

D[z] = -0.3*x*z -0.3*y*z + 0.3*x*y + 0.3*x*y

sample input

…

#define STATES 3

int state_terms[STATES];

#define ST_x 0

#define ST_y 1

#define ST_z 2

header snippet

fixedclient.h &

common.h

void initialize_states()

{

state_terms[ST_x] = 1;

state_terms[ST_y] = 1;

state_terms[ST_z] = 2;

}

Initialize_states snippet

fixedclient.c

The schedule_timer_event function chooses which of the four core probabilistic functions should be called depending on the process’ current state and the term associated with the current alarm. The function is written using the three mapping techniques for flipping, one time sampling and tokenizing.Generated Code

void schedule_timer_event (int nodeid,

struct pp_payload* payload)

{

int curr_term, to_state, prev_state;

int* curr_state;

float p;

curr_state = get_state();

prev_state = *curr_state;

if (*curr_state != payload->state) return;

curr_term = payload->term;

if (*curr_state == ST_x && curr_term == 0)

{

int num_states;

int *states, *exponents;

num_states = 2;

states = (int*)malloc(num_states*sizeof(int));

exponents = (int*)malloc(num_states

*sizeof(int));

states[0] = ST_y;states[1] = ST_x;

exponents[0] = 1;exponents[1] = 0;

ots (ST_z, 0.5, num_states,

states, exponents);

}

if (*curr_state == ST_y && curr_term == 0)

…

}

schedule_timer_event snippet

fixedclient.c

Additional DiffGen Capabilities

- Simple lightweight Internal Simulator for testing and performance evaluation that is
- synchronous
- based on a discrete event simulation model
- assumes a FIFO message queue

This is Continuing Work

Internal

- New rewriting techniques Develop graphical simulator
- Automated Debugging : helped by emergent knowledge of common bug classes among differential equation-based protocols
- Incorporating other Diff. Eqn based methodologies as they emerge
- Graphical Simulator

External

- Combine with auxiliary methodologies for augmenting protocol properties, e.g., topology awareness
- Combine with IDEs?

Alpha version Demo

- We have a (working!) version of the DiffGen toolkit
- Please ask for a demo!

Download Presentation

Connecting to Server..