Commit 11c93b85 authored by Jonathan Jenkins's avatar Jonathan Jenkins
Browse files

Added annotated versions of model_net_*event

parent d83c4ff2
...@@ -155,6 +155,11 @@ void model_net_event_collective_rc( ...@@ -155,6 +155,11 @@ void model_net_event_collective_rc(
* - self_event: pionter to data to be used as the self event message * - self_event: pionter to data to be used as the self event message
* - sender: pointer to the tw_lp structure of the API caller. This is * - sender: pointer to the tw_lp structure of the API caller. This is
* identical to the sender argument to tw_event_new(). * identical to the sender argument to tw_event_new().
*
* The modelnet LP used for communication is the LP in the same group, same
* repetition, using net_id to differentiate different model types. If
* more than one modelnet model of the same type but different annotation exist,
* then the first one listed will be used.
*/ */
// first argument becomes the network ID // first argument becomes the network ID
void model_net_event( void model_net_event(
...@@ -168,6 +173,25 @@ void model_net_event( ...@@ -168,6 +173,25 @@ void model_net_event(
int self_event_size, int self_event_size,
const void* self_event, const void* self_event,
tw_lp *sender); tw_lp *sender);
/*
* See model_net_event for a general description.
*
* Unlike model_net_event, this function uses the annotation to differentiate
* multiple modelnet LPs with the same type but different annotation. The caller
* annotation is not consulted here.
*/
void model_net_event_annotated(
int net_id,
const char * annotation,
char* category,
tw_lpid final_dest_lp,
uint64_t message_size,
tw_stime offset,
int remote_event_size,
const void* remote_event,
int self_event_size,
const void* self_event,
tw_lp *sender);
/* model_net_find_local_device() /* model_net_find_local_device()
* *
...@@ -218,6 +242,16 @@ void model_net_pull_event( ...@@ -218,6 +242,16 @@ void model_net_pull_event(
int self_event_size, int self_event_size,
const void *self_event, const void *self_event,
tw_lp *sender); tw_lp *sender);
void model_net_pull_event_annotated(
int net_id,
const char * annotation,
char *category,
tw_lpid final_dest_lp,
uint64_t message_size,
tw_stime offset,
int self_event_size,
const void *self_event,
tw_lp *sender);
void model_net_pull_event_rc( void model_net_pull_event_rc(
int net_id, int net_id,
tw_lp *sender); tw_lp *sender);
......
...@@ -215,6 +215,8 @@ struct mn_stats* model_net_find_stats(const char* category, mn_stats mn_stats_ar ...@@ -215,6 +215,8 @@ struct mn_stats* model_net_find_stats(const char* category, mn_stats mn_stats_ar
static void model_net_event_impl_base( static void model_net_event_impl_base(
int net_id, int net_id,
const char * annotation,
int ignore_annotations,
char* category, char* category,
tw_lpid final_dest_lp, tw_lpid final_dest_lp,
uint64_t message_size, uint64_t message_size,
...@@ -235,7 +237,8 @@ static void model_net_event_impl_base( ...@@ -235,7 +237,8 @@ static void model_net_event_impl_base(
return; return;
} }
tw_lpid mn_lp = model_net_find_local_device(net_id, NULL, 1, sender); tw_lpid mn_lp = model_net_find_local_device(net_id, annotation,
ignore_annotations, sender);
tw_stime poffset = codes_local_latency(sender); tw_stime poffset = codes_local_latency(sender);
if (in_sequence){ if (in_sequence){
tw_stime tmp = mn_msg_offset; tw_stime tmp = mn_msg_offset;
...@@ -288,9 +291,26 @@ void model_net_event( ...@@ -288,9 +291,26 @@ void model_net_event(
const void* self_event, const void* self_event,
tw_lp *sender) tw_lp *sender)
{ {
model_net_event_impl_base(net_id, category, final_dest_lp, message_size, model_net_event_impl_base(net_id, NULL, 1, category, final_dest_lp,
0, offset, remote_event_size, remote_event, self_event_size, message_size, 0, offset, remote_event_size, remote_event,
self_event, sender); self_event_size, self_event, sender);
}
void model_net_event_annotated(
int net_id,
const char * annotation,
char* category,
tw_lpid final_dest_lp,
uint64_t message_size,
tw_stime offset,
int remote_event_size,
const void* remote_event,
int self_event_size,
const void* self_event,
tw_lp *sender){
model_net_event_impl_base(net_id, annotation, 0, category, final_dest_lp,
message_size, 0, offset, remote_event_size, remote_event,
self_event_size, self_event, sender);
} }
void model_net_pull_event( void model_net_pull_event(
...@@ -304,8 +324,26 @@ void model_net_pull_event( ...@@ -304,8 +324,26 @@ void model_net_pull_event(
tw_lp *sender){ tw_lp *sender){
/* NOTE: for a pull, we are filling the *remote* event - it will be remote /* NOTE: for a pull, we are filling the *remote* event - it will be remote
* from the destination's POV */ * from the destination's POV */
model_net_event_impl_base(net_id, category, final_dest_lp, message_size, model_net_event_impl_base(net_id, NULL, 0, category, final_dest_lp,
1, offset, self_event_size, self_event, 0, NULL, sender); message_size, 1, offset, self_event_size, self_event, 0, NULL,
sender);
}
void model_net_pull_event_annotated(
int net_id,
const char * annotation,
char *category,
tw_lpid final_dest_lp,
uint64_t message_size,
tw_stime offset,
int self_event_size,
const void *self_event,
tw_lp *sender){
/* NOTE: for a pull, we are filling the *remote* event - it will be remote
* from the destination's POV */
model_net_event_impl_base(net_id, annotation, 1, category, final_dest_lp,
message_size, 1, offset, self_event_size, self_event, 0, NULL,
sender);
} }
void model_net_event_rc( void model_net_event_rc(
......
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