Defines strategies that MSUs can use for routing to endpoints. More...
#include "routing_strategies.h"
#include "local_msu.h"
#include "logging.h"
#include "msu_message.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... | |
Defines strategies that MSUs can use for routing to endpoints.
Definition in file routing_strategies.c.
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.
type | The MSU type to receive the message |
sender | The MSU sending the message |
msg | The message to be sent |
output | Output parameter, set to the desired msu endpoint |
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.
type | The MSU type to receive the message |
sender | The MSU sending the message |
msg | The message to be sent |
output | Output parameter, set to the desired MSU endpoint |
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.
type | The MSU type receiving the message |
sender | The MSU sending the message |
msg | The message to be sent |
output | Output parameter, set to the desired MSU endpoint |
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
type | The MSU type to receive the message |
sender | The MSU sending the message |
msg | The message to be sent |
output | Output parameter, set to the desired MSU endpoint |
Definition at line 46 of file routing_strategies.c.