My Project
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
Functions
routing_strategies.h File Reference

Declares strategies that MSUs can use for routing to endpoints. More...

#include "msu_type.h"

Go to the source code of this file.

Functions

int default_routing (struct msu_type *type, struct local_msu *sender, struct msu_msg *msg, struct msu_endpoint *output)
 The defualt routing strategy, using the key of the MSU message to route to a pre-defined endpoint. More...
 
int shortest_queue_route (struct msu_type *type, struct local_msu *sender, struct msu_msg *msg, struct msu_endpoint *output)
 Chooses the local MSU with the shortest queue. More...
 
int route_to_id (struct msu_type *type, struct local_msu *sender, int msu_id, struct msu_endpoint *output)
 Chooses the MSU with the given ID. More...
 
int route_to_origin_runtime (struct msu_type *type, struct local_msu *sender, struct msu_msg *msg, struct msu_endpoint *output)
 Routes an MSU message to the runtime on which the message originated. More...
 

Detailed Description

Declares strategies that MSUs can use for routing to endpoints.

Definition in file routing_strategies.h.

Function Documentation

int default_routing ( struct msu_type type,
struct local_msu sender,
struct msu_msg msg,
struct msu_endpoint output 
)

The defualt routing strategy, using the key of the MSU message to route to a pre-defined endpoint.

This function can be used as-is as an entry in the msu_type struct.

Parameters
typeThe MSU type to receive the message
senderThe MSU sending the message
msgThe message to be sent
outputOutput parameter, set to the desired msu endpoint
Returns
0 on success, -1 on error

Definition at line 30 of file routing_strategies.c.

int route_to_id ( struct msu_type type,
struct local_msu sender,
int  msu_id,
struct msu_endpoint output 
)

Chooses the MSU with the given ID.

This function must be wrapped in another function to choose the appropriate ID if it is to be used in the msu_type struct.

Parameters
typeThe MSU type to receive the message
senderThe MSU sending the message
msgThe message to be sent
outputOutput parameter, set to the desired MSU endpoint
Returns
0 on success, -1 on error

Definition at line 61 of file routing_strategies.c.

int route_to_origin_runtime ( struct msu_type type,
struct local_msu sender,
struct msu_msg msg,
struct msu_endpoint output 
)

Routes an MSU message to the runtime on which the message originated.

This function can be used as-is as an entry in the msu_type struct.

Parameters
typeThe MSU type receiving the message
senderThe MSU sending the message
msgThe message to be sent
outputOutput parameter, set to the desired MSU endpoint
Returns
0 on success, -1 on error

Definition at line 76 of file routing_strategies.c.

int shortest_queue_route ( struct msu_type type,
struct local_msu sender,
struct msu_msg msg,
struct msu_endpoint output 
)

Chooses the local MSU with the shortest queue.

This function can be used as-is as an entry in the msu_type struct

Parameters
typeThe MSU type to receive the message
senderThe MSU sending the message
msgThe message to be sent
outputOutput parameter, set to the desired MSU endpoint
Returns
0 on success, -1 on error

Definition at line 46 of file routing_strategies.c.