Commit e200280e authored by mubarak's avatar mubarak

Adding collective modeling functions in model-net (currently only...

Adding collective modeling functions in model-net (currently only dragonfly/torus models support it)
parent 784827fc
...@@ -32,6 +32,8 @@ struct model_net_method ...@@ -32,6 +32,8 @@ struct model_net_method
int (*mn_get_msg_sz)(); int (*mn_get_msg_sz)();
void (*mn_report_stats)(); void (*mn_report_stats)();
tw_lpid (*model_net_method_find_local_device)(tw_lp *sender); tw_lpid (*model_net_method_find_local_device)(tw_lp *sender);
void (*mn_collective_call)(char* category, int message_size, int remote_event_size, const void* remote_event, tw_lp* sender);
void (*mn_collective_call_rc)(int message_size, tw_lp* sender);
}; };
extern struct model_net_method * method_array[]; extern struct model_net_method * method_array[];
......
...@@ -153,6 +153,22 @@ int model_net_setup(char* net_name, uint64_t packet_size, const void* net_params ...@@ -153,6 +153,22 @@ int model_net_setup(char* net_name, uint64_t packet_size, const void* net_params
/* utility function to get the modelnet ID post-setup */ /* utility function to get the modelnet ID post-setup */
int model_net_get_id(char *net_name); int model_net_get_id(char *net_name);
/* This event does a collective operation call for model-net */
void model_net_event_collective(
int net_id,
char* category,
int message_size,
int remote_event_size,
const void* remote_event,
tw_lp *sender);
/* reverse event of the collective operation call */
void model_net_event_collective_rc(
int net_id,
int message_size,
tw_lp *sender);
/* allocate and transmit a new event that will pass through model_net to /* allocate and transmit a new event that will pass through model_net to
* arrive at its destination: * arrive at its destination:
* *
......
...@@ -44,15 +44,24 @@ struct terminal_message ...@@ -44,15 +44,24 @@ struct terminal_message
int output_chan; int output_chan;
int is_pull; int is_pull;
uint64_t pull_size; uint64_t pull_size;
/* for reverse computation */
tw_stime saved_available_time; tw_stime saved_available_time;
tw_stime saved_credit_time; tw_stime saved_credit_time;
tw_stime saved_collective_init_time;
int intm_group_id; int intm_group_id;
short chunk_id; short chunk_id;
uint64_t packet_size; uint64_t packet_size;
int remote_event_size_bytes; int remote_event_size_bytes;
int local_event_size_bytes; int local_event_size_bytes;
/* for reverse computation of a node's fan in*/
int saved_fan_nodes;
tw_lpid sender_svr;
/* LP ID of the sending node, has to be a network node in the dragonfly */
tw_lpid sender_node;
}; };
#endif /* end of include guard: DRAGONFLY_H */ #endif /* end of include guard: DRAGONFLY_H */
......
...@@ -17,6 +17,9 @@ enum nodes_event_t ...@@ -17,6 +17,9 @@ enum nodes_event_t
ARRIVAL, ARRIVAL,
SEND, SEND,
CREDIT, CREDIT,
T_COLLECTIVE_INIT,
T_COLLECTIVE_FAN_IN,
T_COLLECTIVE_FAN_OUT
}; };
struct nodes_message struct nodes_message
...@@ -28,6 +31,9 @@ struct nodes_message ...@@ -28,6 +31,9 @@ struct nodes_message
/* for reverse event computation*/ /* for reverse event computation*/
tw_stime saved_available_time; tw_stime saved_available_time;
/* message saved collective time */
tw_stime saved_collective_init_time;
/* packet ID */ /* packet ID */
unsigned long long packet_ID; unsigned long long packet_ID;
/* event type of the message */ /* event type of the message */
...@@ -44,8 +50,12 @@ struct nodes_message ...@@ -44,8 +50,12 @@ struct nodes_message
tw_lpid final_dest_gid; tw_lpid final_dest_gid;
/* destination torus node of the message */ /* destination torus node of the message */
tw_lpid dest_lp; tw_lpid dest_lp;
/* LP ID of the sender, comes from codes, can be a server or any other I/O LP type */ /* LP ID of the sender, comes from codes, can be a server or any other I/O LP type. Should not change
tw_lpid sender_lp; during network operations. */
tw_lpid sender_svr;
/* LP ID of the sending node, has to be a network node in the torus */
tw_lpid sender_node;
/* number of hops traversed by the packet */ /* number of hops traversed by the packet */
int my_N_hop; int my_N_hop;
...@@ -57,6 +67,10 @@ struct nodes_message ...@@ -57,6 +67,10 @@ struct nodes_message
int next_stop; int next_stop;
/* size of the torus packet */ /* size of the torus packet */
uint64_t packet_size; uint64_t packet_size;
/* for reverse computation of a node's fan in*/
int saved_fan_nodes;
/* chunk id of the flit (distinguishes flits) */ /* chunk id of the flit (distinguishes flits) */
short chunk_id; short chunk_id;
......
This diff is collapsed.
...@@ -67,6 +67,12 @@ static int loggp_get_msg_sz(void); ...@@ -67,6 +67,12 @@ static int loggp_get_msg_sz(void);
/* Returns the loggp magic number */ /* Returns the loggp magic number */
static int loggp_get_magic(); static int loggp_get_magic();
/* collective network calls */
static void loggp_collective();
/* collective network calls-- rc */
static void loggp_collective_rc();
/* allocate a new event that will pass through loggp to arriave at its /* allocate a new event that will pass through loggp to arriave at its
* destination: * destination:
* *
...@@ -118,6 +124,8 @@ struct model_net_method loggp_method = ...@@ -118,6 +124,8 @@ struct model_net_method loggp_method =
.mn_get_msg_sz = loggp_get_msg_sz, .mn_get_msg_sz = loggp_get_msg_sz,
.mn_report_stats = loggp_report_stats, .mn_report_stats = loggp_report_stats,
.model_net_method_find_local_device = loggp_find_local_device, .model_net_method_find_local_device = loggp_find_local_device,
.mn_collective_call = loggp_collective,
.mn_collective_call_rc = loggp_collective_rc
}; };
static void loggp_init( static void loggp_init(
...@@ -187,6 +195,20 @@ static void loggp_report_stats() ...@@ -187,6 +195,20 @@ static void loggp_report_stats()
/* TODO: Do we have some loggp statistics to report like we have for torus and dragonfly? */ /* TODO: Do we have some loggp statistics to report like we have for torus and dragonfly? */
return; return;
} }
/* collective network calls */
static void loggp_collective()
{
/* collectives not supported */
return;
}
static void loggp_collective_rc()
{
/* collectives not supported */
return;
}
static void loggp_init( static void loggp_init(
loggp_state * ns, loggp_state * ns,
tw_lp * lp) tw_lp * lp)
......
...@@ -522,6 +522,28 @@ uint64_t model_net_get_packet_size(int net_id) ...@@ -522,6 +522,28 @@ uint64_t model_net_get_packet_size(int net_id)
return method_array[net_id]->packet_size; // TODO: where to set the packet size? return method_array[net_id]->packet_size; // TODO: where to set the packet size?
} }
/* This event does a collective operation call for model-net */
void model_net_event_collective(int net_id, char* category, int message_size, int remote_event_size, const void* remote_event, tw_lp* sender)
{
if(net_id < 0 || net_id > MAX_NETS)
{
fprintf(stderr, "%s Error: Uninitializied modelnet network, call modelnet_init first\n", __FUNCTION__);
exit(-1);
}
return method_array[net_id]->mn_collective_call(category, message_size, remote_event_size, remote_event, sender);
}
/* reverse event of the collective operation call */
void model_net_event_collective_rc(int net_id, int message_size, tw_lp* sender)
{
if(net_id < 0 || net_id > MAX_NETS)
{
fprintf(stderr, "%s Error: Uninitializied modelnet network, call modelnet_init first\n", __FUNCTION__);
exit(-1);
}
return method_array[net_id]->mn_collective_call_rc(message_size, sender);
}
/* returns lp type for modelnet */ /* returns lp type for modelnet */
const tw_lptype* model_net_get_lp_type(int net_id) const tw_lptype* model_net_get_lp_type(int net_id)
{ {
......
...@@ -62,6 +62,12 @@ static int sn_get_magic(); ...@@ -62,6 +62,12 @@ static int sn_get_magic();
static void print_msg(sn_message *m); static void print_msg(sn_message *m);
/* collective network calls */
static void simple_net_collective();
/* collective network calls-- rc */
static void simple_net_collective_rc();
/* allocate a new event that will pass through simplenet to arriave at its /* allocate a new event that will pass through simplenet to arriave at its
* destination: * destination:
* *
...@@ -111,6 +117,8 @@ struct model_net_method simplenet_method = ...@@ -111,6 +117,8 @@ struct model_net_method simplenet_method =
.mn_get_msg_sz = sn_get_msg_sz, .mn_get_msg_sz = sn_get_msg_sz,
.mn_report_stats = sn_report_stats, .mn_report_stats = sn_report_stats,
.model_net_method_find_local_device = sn_find_local_device, .model_net_method_find_local_device = sn_find_local_device,
.mn_collective_call = simple_net_collective,
.mn_collective_call_rc = simple_net_collective_rc
}; };
static void sn_init( static void sn_init(
...@@ -174,6 +182,19 @@ static int sn_get_msg_sz(void) ...@@ -174,6 +182,19 @@ static int sn_get_msg_sz(void)
{ {
return(sizeof(sn_message)); return(sizeof(sn_message));
} }
/* collective network calls */
static void simple_net_collective()
{
/* collectives not supported */
return;
}
/* collective network call -- rc*/
static void simple_net_collective_rc()
{
/* collectives not supported */
return;
}
/* lets caller specify model parameters to use */ /* lets caller specify model parameters to use */
static void sn_set_params(double net_startup_ns, double net_bw_mbs) static void sn_set_params(double net_startup_ns, double net_bw_mbs)
......
...@@ -96,6 +96,12 @@ static double sw_get_startup(int from_id, int to_id); ...@@ -96,6 +96,12 @@ static double sw_get_startup(int from_id, int to_id);
static category_idles* sw_get_category_idles( static category_idles* sw_get_category_idles(
char * category, category_idles *idles); char * category, category_idles *idles);
/* collective network calls */
static void simple_wan_collective();
/* collective network calls-- rc */
static void simple_wan_collective_rc();
/* allocate a new event that will pass through simplewan to arriave at its /* allocate a new event that will pass through simplewan to arriave at its
* destination: * destination:
* *
...@@ -144,7 +150,9 @@ struct model_net_method simplewan_method = ...@@ -144,7 +150,9 @@ struct model_net_method simplewan_method =
.mn_get_lp_type = sw_get_lp_type, .mn_get_lp_type = sw_get_lp_type,
.mn_get_msg_sz = sw_get_msg_sz, .mn_get_msg_sz = sw_get_msg_sz,
.mn_report_stats = sw_report_stats, .mn_report_stats = sw_report_stats,
.model_net_method_find_local_device = sw_find_local_device, .model_net_method_find_local_device = sw_find_local_device,
.mn_collective_call = simple_wan_collective,
.mn_collective_call_rc = simple_wan_collective_rc
}; };
static void sw_init( static void sw_init(
...@@ -195,6 +203,19 @@ static void handle_msg_start_event( ...@@ -195,6 +203,19 @@ static void handle_msg_start_event(
sw_message * m, sw_message * m,
tw_lp * lp); tw_lp * lp);
/* collective network calls */
static void simple_wan_collective()
{
/* collectives not supported */
return;
}
static void simple_wan_collective_rc()
{
/* collectives not supported */
return;
}
/* returns pointer to LP information for simplewan module */ /* returns pointer to LP information for simplewan module */
static const tw_lptype* sw_get_lp_type() static const tw_lptype* sw_get_lp_type()
{ {
......
This diff is collapsed.
check_PROGRAMS += tests/modelnet-test tests/modelnet-p2p-bw \ check_PROGRAMS += tests/modelnet-test tests/modelnet-p2p-bw \
tests/concurrent-msg-recv tests/modelnet-simplewan-test tests/concurrent-msg-recv tests/modelnet-simplewan-test \
tests/modelnet-test-collective
TESTS += tests/modelnet-test.sh \ TESTS += tests/modelnet-test.sh \
tests/modelnet-test-torus.sh \ tests/modelnet-test-torus.sh \
...@@ -31,3 +32,8 @@ tests_concurrent_msg_recv_LDFLAGS = ${CODES_BASE_LDFLAGS} ...@@ -31,3 +32,8 @@ tests_concurrent_msg_recv_LDFLAGS = ${CODES_BASE_LDFLAGS}
tests_concurrent_msg_recv_LDADD = $(testlib) ${CODES_BASE_LIBS} tests_concurrent_msg_recv_LDADD = $(testlib) ${CODES_BASE_LIBS}
tests_concurrent_msg_recv_CFLAGS = ${CODES_BASE_CFLAGS} tests_concurrent_msg_recv_CFLAGS = ${CODES_BASE_CFLAGS}
tests_concurrent_msg_recv_SOURCES = tests/concurrent-msg-recv.c tests_concurrent_msg_recv_SOURCES = tests/concurrent-msg-recv.c
tests_modelnet_test_collective_LDADD = $(testlib) ${CODES_BASE_LIBS}
tests_modelnet_test_collective_CFLAGS = ${CODES_BASE_CFLAGS}
tests_modelnet_test_collective_SOURCES = tests/modelnet-test-collective.c
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