...
 
Commits (8)
......@@ -92,8 +92,8 @@ void model_net_method_send_msg_recv_event_rc(tw_lp *sender);
// method - strange and disturbing things will happen otherwise
void model_net_method_idle_event(tw_stime offset_ts, int is_recv_queue,
tw_lp * lp);
void model_net_method_idle_event2(tw_stime offset_ts, int is_recv_queue,
int queue_offset, tw_lp * lp);
void model_net_method_idle_event_with_q(tw_stime offset_ts, int is_recv_queue,
queue_spec queue_info, tw_lp * lp);
// Get a ptr to past the message struct area, where the self/remote events
// are located, given the type of network.
......
......@@ -30,6 +30,7 @@ typedef struct mn_sched_params_s mn_sched_params;
X(MN_SCHED_FCFS_FULL, "fcfs-full", &fcfs_tab) \
X(MN_SCHED_RR, "round-robin", &rr_tab) \
X(MN_SCHED_PRIO, "priority", &prio_tab) \
X(MN_SCHED_EP, "endpoint-based", &ep_tab) \
X(MAX_SCHEDS, NULL, NULL)
#define X(a,b,c) a,
......@@ -39,25 +40,35 @@ enum sched_type {
#undef X
/// scheduler decls
typedef enum EP_type {
SRC_RANK_BASED = 0,
DST_NODE_BASED
} EP_type;
typedef struct model_net_sched_s model_net_sched;
typedef struct model_net_sched_rc_s model_net_sched_rc;
// priority scheduler configurtion parameters
// priority scheduler configuration parameters
typedef struct mn_prio_params_s {
int num_prios; // number of priorities
// sub-scheduler to use. can be any but prio
enum sched_type sub_stype;
} mn_prio_params;
// ep scheduler configuration parameters
typedef struct mn_ep_params_s {
int ep_num_queues; // number of EP queues
enum EP_type ep_type;
} mn_ep_params;
// TODO: other scheduler config params
// initialization parameter set
typedef struct model_net_sched_cfg_params_s {
enum sched_type type;
union {
mn_prio_params prio;
} u;
//no union because multiple may be enabled simulatenously
mn_prio_params prio; //params for priority sched
mn_ep_params ep; //params for endpoint-based
} model_net_sched_cfg_params;
typedef struct mn_sched_cfg_params {
......@@ -73,6 +84,7 @@ enum sched_msg_param_type {
// scheduler-specific parameter definitions must go here
struct mn_sched_params_s {
int prio; // MN_SCHED_PARAM_PRIO (currently the only one)
int ep_q;
} ;
/// interface to be implemented by schedulers
......@@ -107,6 +119,7 @@ typedef struct model_net_sched_interface {
int (*next)(
tw_stime * poffset,
void * sched,
void * sched_info,
// NOTE: copy here when deleting remote/local events for rc
void * rc_event_save,
model_net_sched_rc * rc,
......@@ -117,6 +130,8 @@ typedef struct model_net_sched_interface {
const void * rc_event_save,
const model_net_sched_rc * rc,
tw_lp * lp);
int (*isEmpty)(
void * sched);
} model_net_sched_interface;
/// overall scheduler struct - type puns the actual data structure
......@@ -141,7 +156,7 @@ struct model_net_sched_rc_s {
model_net_request req; // request gets deleted...
mn_sched_params sched_params; // along with msg params
int rtn; // return code from a sched_next
int prio; // prio when doing priority queue events
int prio_used_queue, ep_used_queue; //which queue gave us the next message/packet
};
// initialize the scheduler
......@@ -164,6 +179,7 @@ void model_net_sched_init(
int model_net_sched_next(
tw_stime *poffset,
model_net_sched *sched,
void * sched_info,
void *rc_event_save,
model_net_sched_rc *sched_rc,
tw_lp *lp);
......
......@@ -111,6 +111,11 @@ typedef int model_net_event_return;
extern char * model_net_lp_config_names[];
extern char * model_net_method_names[];
typedef struct queue_spec {
int port;
int queue;
} queue_spec;
// request structure that gets passed around (by the model-net implementation,
// not the user)
typedef struct model_net_request {
......@@ -127,7 +132,7 @@ typedef struct model_net_request {
uint64_t msg_id;
int net_id;
int is_pull;
int queue_offset;
queue_spec queue_info;
int remote_event_size;
int self_event_size;
char category[CATEGORY_NAME_MAX];
......
......@@ -1554,7 +1554,7 @@ static tw_stime fattree_packet_event(
msg->local_event_size_bytes = 0;
msg->type = T_GENERATE;
msg->dest_terminal_id = req->dest_mn_lp;
msg->rail_id = req->queue_offset;
msg->rail_id = req->queue_info.port;
msg->message_id = req->msg_id;
msg->is_pull = req->is_pull;
msg->pull_size = req->pull_size;
......@@ -1701,7 +1701,10 @@ void ft_packet_generate(ft_terminal_state * s, tw_bf * bf, fattree_message * msg
}
if(s->terminal_length[target_queue] < s->params->cn_vc_size) {
model_net_method_idle_event2(nic_ts, 0, msg->rail_id, lp);
queue_spec queue_info;
queue_info.port = msg->rail_id;
queue_info.queue = 0;
model_net_method_idle_event_with_q(nic_ts, 0, queue_info, lp);
} else {
bf->c11 = 1;
s->issueIdle[msg->rail_id] = 1;
......@@ -1885,7 +1888,10 @@ void ft_packet_send(ft_terminal_state * s, tw_bf * bf, fattree_message * msg,
if(s->issueIdle[msg->vc_index]) {
bf->c5 = 1;
s->issueIdle[msg->vc_index] = 0;
model_net_method_idle_event2(codes_local_latency(lp), 0, msg->vc_index, lp);
queue_spec queue_info;
queue_info.port = msg->vc_index;
queue_info.queue = 0;
model_net_method_idle_event_with_q(codes_local_latency(lp), 0, queue_info, lp);
}
return;
......
This diff is collapsed.
......@@ -41,10 +41,11 @@ void model_net_sched_init(
int model_net_sched_next(
tw_stime *poffset,
model_net_sched *sched,
void * sched_info,
void *rc_event_save,
model_net_sched_rc *sched_rc,
tw_lp *lp){
return sched->impl->next(poffset, sched->dat, rc_event_save, sched_rc, lp);
return sched->impl->next(poffset, sched->dat, sched_info, rc_event_save, sched_rc, lp);
}
void model_net_sched_next_rc(
......@@ -78,6 +79,7 @@ void model_net_sched_add_rc(
void model_net_sched_set_default_params(mn_sched_params *sched_params){
sched_params->prio = -1;
sched_params->ep_q = -1;
}
/*
......
......@@ -142,6 +142,7 @@ int* model_net_configure(int *id_count){
// init the per-msg params here
memset(is_msg_params_set, 0,
MAX_MN_MSG_PARAM_TYPES*sizeof(*is_msg_params_set));
model_net_sched_set_default_params(&sched_params);
ret = configuration_get_value_double(&config, "PARAMS", "intra_bandwidth", NULL,
&cn_bandwidth);
......@@ -328,10 +329,14 @@ static model_net_event_return model_net_event_impl_base(
tw_lpid dest_mn_lp = model_net_find_local_device_mctx(net_id, recv_map_ctx,
final_dest_lp);
if (src_mn_lp == dest_mn_lp && message_size < (uint64_t)codes_node_eager_limit)
if (src_mn_lp == dest_mn_lp && message_size < (uint64_t)codes_node_eager_limit) {
// params not used for local events
memset(is_msg_params_set, 0, MAX_MN_MSG_PARAM_TYPES*sizeof(*is_msg_params_set));
model_net_sched_set_default_params(&sched_params);
return model_net_noop_event(final_dest_lp, is_pull, offset, message_size,
remote_event_size, remote_event, self_event_size, self_event,
sender);
}
tw_stime poffset = codes_local_latency(sender);
if (mn_in_sequence){
......@@ -382,6 +387,7 @@ static model_net_event_return model_net_event_impl_base(
// once params are set, clear the flags
memset(is_msg_params_set, 0,
MAX_MN_MSG_PARAM_TYPES*sizeof(*is_msg_params_set));
model_net_sched_set_default_params(&sched_params);
void *e_msg = (m+1);
if (remote_event_size > 0){
......