Commit 959d6b26 authored by Jonathan Jenkins's avatar Jonathan Jenkins

sequence markers to make multiple model_net_event's FCFS

parent 793b36de
......@@ -16,6 +16,23 @@
#define CATEGORY_NAME_MAX 16
#define CATEGORY_MAX 12
/* HACK: there is currently no scheduling fidelity across multiple
* model_net_event calls. Hence, problems arise when some LP sends multiple
* messages as part of an event and expects FCFS ordering. A proper fix which
* involves model-net LP-level scheduling of requests is ideal, but not
* feasible for now (would basically have to redesign model-net), so expose
* explicit start-sequence and stop-sequence markers as a workaround */
extern int in_sequence;
extern tw_stime mn_msg_offset;
#define MN_START_SEQ() do {\
in_sequence = 1; \
mn_msg_offset = 0.0; \
} while (0)
#define MN_END_SEQ() do {\
in_sequence = 0;\
} while (0)
typedef struct simplenet_param simplenet_param;
typedef struct simplewan_param simplewan_param;
typedef struct dragonfly_param dragonfly_param;
......
......@@ -23,6 +23,9 @@ extern struct model_net_method loggp_method;
static struct model_net_method* method_array[] =
{&simplenet_method, &simplewan_method, &torus_method, &dragonfly_method, &loggp_method, NULL};
int in_sequence = 0;
tw_stime mn_msg_offset = 0.0;
static int model_net_get_msg_sz(int net_id);
int model_net_setup(char* name,
......@@ -175,7 +178,7 @@ void model_net_event(
* passed along through network hops and delivered to final_dest_lp
*/
tw_stime offset = 0.0;
tw_stime offset = (in_sequence) ? mn_msg_offset : 0.0;
for( i = 0; i < num_packets; i++ )
{
/*Mark the last packet to the net method API*/
......@@ -190,6 +193,7 @@ void model_net_event(
final_dest_lp, packet_size, offset, remote_event_size, remote_event,
self_event_size, self_event, sender, last);
}
if (in_sequence) mn_msg_offset = offset;
return;
}
......
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