Commit 5c98582c authored by Jonathan Jenkins's avatar Jonathan Jenkins

mv msg id into request struct; impl msg id setting

parent 96f09981
......@@ -28,7 +28,6 @@ struct model_net_method
void (*mn_register)(tw_lptype *base_type);
tw_stime (*model_net_method_packet_event)(
model_net_request const * req,
uint64_t message_id,
uint64_t message_offset, // offset in the context of the whole message
uint64_t packet_size, // needed in case message < packet
tw_stime offset,
......
......@@ -91,6 +91,9 @@ typedef struct model_net_request {
uint64_t msg_size;
uint64_t pull_size;
uint64_t packet_size;
// unique message id set, *at the modelnet LP*, for each message the
// modelnet LP processes
uint64_t msg_id;
int net_id;
int is_pull;
int remote_event_size;
......
......@@ -766,7 +766,6 @@ void router_setup(router_state * r, tw_lp * lp)
/* dragonfly packet event , generates a dragonfly packet on the compute node */
static tw_stime dragonfly_packet_event(
model_net_request const * req,
uint64_t message_id,
uint64_t message_offset,
uint64_t packet_size,
tw_stime offset,
......
......@@ -111,7 +111,6 @@ static void loggp_set_params(const char * config_file, loggp_param * params);
/* Issues a loggp packet event call */
static tw_stime loggp_packet_event(
model_net_request const * req,
uint64_t message_id,
uint64_t message_offset,
uint64_t packet_size,
tw_stime offset,
......@@ -604,7 +603,6 @@ static void handle_msg_start_event(
* It takes the packets from modelnet layer and calls underlying loggp methods*/
static tw_stime loggp_packet_event(
model_net_request const * req,
uint64_t message_id,
uint64_t message_offset,
uint64_t packet_size,
tw_stime offset,
......
......@@ -39,6 +39,9 @@ typedef struct model_net_base_state {
int net_id;
// whether scheduler loop is running
int in_sched_send_loop, in_sched_recv_loop;
// unique message id counter. This doesn't get decremented on RC to prevent
// optimistic orderings using "stale" ids
uint64_t msg_id;
// model-net schedulers
model_net_sched *sched_send, *sched_recv;
// parameters
......@@ -282,6 +285,8 @@ void model_net_base_lp_init(
codes_mapping_get_lp_info(lp->gid, NULL, &dummy,
lp_type_name, &dummy, anno, &dummy, &dummy);
ns->msg_id = 0;
// get annotation-specific parameters
for (int i = 0; i < num_params; i++){
if ((anno[0]=='\0' && annos[i] == NULL) ||
......@@ -386,6 +391,7 @@ void handle_new_msg(
model_net_request *r = &m->msg.m_base.req;
// don't forget to set packet size, now that we're responsible for it!
r->packet_size = ns->params->packet_size;
r->msg_id = ns->msg_id++;
void * m_data = m+1;
void *remote = NULL, *local = NULL;
if (r->remote_event_size > 0){
......
......@@ -264,9 +264,7 @@ int fcfs_next(
"from %lu to %lu at %1.5e (last:%d)\n",
lp->gid, psize, q->rem, q->req.src_lp, q->req.final_dest_lp,
tw_now(lp), is_last_packet);
/* TODO: Add correct message ID here */
*poffset = s->method->model_net_method_packet_event(&q->req, 0,
*poffset = s->method->model_net_method_packet_event(&q->req,
q->req.msg_size - q->rem, psize, 0.0, &q->sched_params,
q->remote_event, q->local_event, lp, is_last_packet);
}
......
......@@ -93,7 +93,6 @@ static void sn_configure();
/* Issues a simplenet packet event call */
static tw_stime simplenet_packet_event(
model_net_request const * req,
uint64_t message_id,
uint64_t message_offset,
uint64_t packet_size,
tw_stime offset,
......@@ -517,7 +516,6 @@ static void handle_msg_start_event(
* It takes the packets from modelnet layer and calls underlying simplenet methods*/
static tw_stime simplenet_packet_event(
model_net_request const * req,
uint64_t message_id,
uint64_t message_offset,
uint64_t packet_size,
tw_stime offset,
......
......@@ -125,7 +125,6 @@ static void simple_wan_collective_rc();
/* Issues a simplep2p packet event call */
static tw_stime simplep2p_packet_event(
model_net_request const * req,
uint64_t message_id,
uint64_t message_offset,
uint64_t packet_size,
tw_stime offset,
......@@ -797,7 +796,6 @@ static void handle_msg_start_event(
* It takes the packets from modelnet layer and calls underlying simplep2p methods*/
static tw_stime simplep2p_packet_event(
model_net_request const * req,
uint64_t message_id,
uint64_t message_offset,
uint64_t packet_size,
tw_stime offset,
......
......@@ -348,7 +348,6 @@ static int torus_get_msg_sz(void)
/* torus packet event , generates a torus packet on the compute node */
static tw_stime torus_packet_event(
model_net_request const * req,
uint64_t message_id,
uint64_t message_offset,
uint64_t packet_size,
tw_stime offset,
......
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