Commit b98deb14 authored by Jonathan Jenkins's avatar Jonathan Jenkins

lsm api switch to use annotations

parent 5af2ef2b
......@@ -43,7 +43,10 @@ typedef enum lsm_event_e
*/
/* given LP sender, find the LSM device LP in the same group */
tw_lpid lsm_find_local_device(tw_lp *sender);
tw_lpid lsm_find_local_device(
const char * annotation,
int ignore_annotations,
tw_lpid sender_gid);
/*
* lsm_event_new
......@@ -69,6 +72,21 @@ tw_event* lsm_event_new(const char* category,
size_t message_bytes,
tw_lp *sender,
tw_stime delay);
/* equivalent to lsm_event_new, except it allows to specify an annotation to
* filter by. If ignore_annotations is nonzero, A null annotation parameter
* indicates that the lsm LP to issue to has no annotation */
tw_event* lsm_event_new_annotated(
const char* category,
tw_lpid dest_gid,
uint64_t io_object,
int64_t io_offset,
uint64_t io_size_bytes,
int io_type,
size_t message_bytes,
tw_lp *sender,
tw_stime delay,
const char * annotation,
int ignore_annotations);
void lsm_event_new_reverse(tw_lp *sender);
......
......@@ -266,42 +266,26 @@ static tw_lpid lsm_find_local_device_default(
return rtn;
}
/*
* lsm_find_local_device()
*
* returns the LP id of the lsm device connected to the caller
*
* TODO: currently ignores annotations
*/
tw_lpid lsm_find_local_device(tw_lp *sender)
{
return lsm_find_local_device_default(NULL, 1, sender->gid);
tw_lpid lsm_find_local_device(
const char * annotation,
int ignore_annotations,
tw_lpid sender_gid) {
return lsm_find_local_device_default(annotation, ignore_annotations,
sender_gid);
}
/*
* lsm_event_new
* - creates a new event that is targeted for the corresponding
* LSM LP.
* - this event will allow wrapping the callers completion event
* - category: string name to identify the traffic category
* - dest_gid: the gid to send the callers event to
* - gid_offset: relative offset of the LSM LP to the originating LP
* - io_object: id of byte stream the caller will modify
* - io_offset: offset into byte stream
* - io_size_bytes: size in bytes of IO request
* - io_type: read or write request
* - message_bytes: size of the event message the caller will have
* - sender: id of the sender
*/
tw_event* lsm_event_new(const char* category,
tw_lpid dest_gid,
uint64_t io_object,
int64_t io_offset,
uint64_t io_size_bytes,
int io_type,
size_t message_bytes,
tw_lp *sender,
tw_stime delay)
static tw_event* lsm_event_new_base(
const char* category,
tw_lpid dest_gid,
uint64_t io_object,
int64_t io_offset,
uint64_t io_size_bytes,
int io_type,
size_t message_bytes,
tw_lp *sender,
tw_stime delay,
const char * annotation,
int ignore_annotations)
{
tw_event *e;
lsm_message_t *m;
......@@ -314,7 +298,7 @@ tw_event* lsm_event_new(const char* category,
/* Generate an event for the local storage model, and send the
* event to an lsm LP.
*/
lsm_gid = lsm_find_local_device(sender);
lsm_gid = lsm_find_local_device(annotation, ignore_annotations, sender->gid);
delta = codes_local_latency(sender) + delay;
if (lsm_in_sequence) {
......@@ -338,6 +322,51 @@ tw_event* lsm_event_new(const char* category,
return e;
}
/*
* lsm_event_new
* - creates a new event that is targeted for the corresponding
* LSM LP.
* - this event will allow wrapping the callers completion event
* - category: string name to identify the traffic category
* - dest_gid: the gid to send the callers event to
* - gid_offset: relative offset of the LSM LP to the originating LP
* - io_object: id of byte stream the caller will modify
* - io_offset: offset into byte stream
* - io_size_bytes: size in bytes of IO request
* - io_type: read or write request
* - message_bytes: size of the event message the caller will have
* - sender: id of the sender
*/
tw_event* lsm_event_new(
const char* category,
tw_lpid dest_gid,
uint64_t io_object,
int64_t io_offset,
uint64_t io_size_bytes,
int io_type,
size_t message_bytes,
tw_lp *sender,
tw_stime delay) {
return lsm_event_new_base(category, dest_gid, io_object, io_offset,
io_size_bytes, io_type, message_bytes, sender, delay, NULL, 1);
}
tw_event* lsm_event_new_annotated(
const char* category,
tw_lpid dest_gid,
uint64_t io_object,
int64_t io_offset,
uint64_t io_size_bytes,
int io_type,
size_t message_bytes,
tw_lp *sender,
tw_stime delay,
const char * annotation,
int ignore_annotations) {
return lsm_event_new_base(category, dest_gid, io_object, io_offset,
io_size_bytes, io_type, message_bytes, sender, delay, annotation,
ignore_annotations);
}
/*
* lsm_event_data
* - returns the pointer to the message data for the callers data
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment