Commit 119d41d4 authored by Jonathan Jenkins's avatar Jonathan Jenkins

process > INT_MAX messages in modelnet

parent 959d6b26
...@@ -65,7 +65,7 @@ static tw_lpid dragonfly_find_local_device(tw_lp *sender); ...@@ -65,7 +65,7 @@ static tw_lpid dragonfly_find_local_device(tw_lp *sender);
/* dragonfly packet event method called by modelnet, this method triggers the packet /* dragonfly packet event method called by modelnet, this method triggers the packet
* generate event of dragonfly and attached remote and local events to the last packet * generate event of dragonfly and attached remote and local events to the last packet
* of the message */ * of the message */
static tw_stime dragonfly_packet_event(char* category, tw_lpid final_dest_lp, int packet_size, tw_stime offset, int remote_event_size, const void* remote_event, int self_event_size, const void* self_event, tw_lp *sender, int is_last_pckt); static tw_stime dragonfly_packet_event(char* category, tw_lpid final_dest_lp, uint64_t packet_size, tw_stime offset, int remote_event_size, const void* remote_event, int self_event_size, const void* self_event, tw_lp *sender, int is_last_pckt);
/* returns dragonfly message size */ /* returns dragonfly message size */
static int dragonfly_get_msg_sz(void); static int dragonfly_get_msg_sz(void);
...@@ -193,7 +193,7 @@ struct terminal_message ...@@ -193,7 +193,7 @@ struct terminal_message
int intm_group_id; int intm_group_id;
short chunk_id; short chunk_id;
int 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;
}; };
...@@ -216,7 +216,7 @@ int minimal_count, nonmin_count; ...@@ -216,7 +216,7 @@ int minimal_count, nonmin_count;
int adaptive_threshold; int adaptive_threshold;
int head_delay; int head_delay;
int num_packets; int num_packets;
int num_chunks; uint64_t num_chunks;
static tw_stime dragonfly_total_time = 0; static tw_stime dragonfly_total_time = 0;
static tw_stime dragonfly_max_latency = 0; static tw_stime dragonfly_max_latency = 0;
......
...@@ -12,12 +12,12 @@ ...@@ -12,12 +12,12 @@
struct model_net_method struct model_net_method
{ {
char* method_name; /* example: "dragonfly" */ char* method_name; /* example: "dragonfly" */
int packet_size; /* packet size */ uint64_t packet_size; /* packet size */
void (*mn_setup)(const void* net_params); /* For initializing the network */ void (*mn_setup)(const void* net_params); /* For initializing the network */
tw_stime (*model_net_method_packet_event)( tw_stime (*model_net_method_packet_event)(
char* category, char* category,
tw_lpid final_dest_lp, tw_lpid final_dest_lp,
int packet_size, uint64_t packet_size,
tw_stime offset, tw_stime offset,
int remote_event_size, /* 0 means don't deliver remote event */ int remote_event_size, /* 0 means don't deliver remote event */
const void* remote_event, const void* remote_event,
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "codes/lp-type-lookup.h" #include "codes/lp-type-lookup.h"
#include "codes/configuration.h" #include "codes/configuration.h"
#include "codes/lp-io.h" #include "codes/lp-io.h"
#include <stdint.h>
#define MAX_NAME_LENGTH 256 #define MAX_NAME_LENGTH 256
#define CATEGORY_NAME_MAX 16 #define CATEGORY_NAME_MAX 16
...@@ -119,7 +120,7 @@ struct torus_param ...@@ -119,7 +120,7 @@ struct torus_param
int model_net_set_params(); int model_net_set_params();
// setup the modelnet parameters // setup the modelnet parameters
int model_net_setup(char* net_name, int packet_size, const void* net_params); int model_net_setup(char* net_name, uint64_t packet_size, const void* net_params);
/* 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:
* *
...@@ -152,7 +153,7 @@ void model_net_event( ...@@ -152,7 +153,7 @@ void model_net_event(
int net_id, int net_id,
char* category, char* category,
tw_lpid final_dest_lp, tw_lpid final_dest_lp,
int message_size, uint64_t message_size,
int remote_event_size, int remote_event_size,
const void* remote_event, const void* remote_event,
int self_event_size, int self_event_size,
...@@ -178,12 +179,12 @@ tw_lpid model_net_find_local_device(int net_id, tw_lp *sender); ...@@ -178,12 +179,12 @@ tw_lpid model_net_find_local_device(int net_id, tw_lp *sender);
void model_net_event_rc( void model_net_event_rc(
int net_id, int net_id,
tw_lp *sender, tw_lp *sender,
int message_size); uint64_t message_size);
/* returns pointer to LP information for simplenet module */ /* returns pointer to LP information for simplenet module */
const tw_lptype* model_net_get_lp_type(int net_id); const tw_lptype* model_net_get_lp_type(int net_id);
int model_net_get_packet_size(int net_id); uint64_t model_net_get_packet_size(int net_id);
void model_net_add_lp_type(int net_id); void model_net_add_lp_type(int net_id);
......
...@@ -62,7 +62,7 @@ typedef struct nodes_message nodes_message; ...@@ -62,7 +62,7 @@ typedef struct nodes_message nodes_message;
static tw_stime torus_packet_event( static tw_stime torus_packet_event(
char* category, char* category,
tw_lpid final_dest_lp, tw_lpid final_dest_lp,
int packet_size, uint64_t packet_size,
tw_stime offset, tw_stime offset,
int remote_event_size, int remote_event_size,
const void* remote_event, const void* remote_event,
...@@ -166,7 +166,7 @@ struct nodes_message ...@@ -166,7 +166,7 @@ struct nodes_message
/* next torus hop that the packet will traverse */ /* next torus hop that the packet will traverse */
int next_stop; int next_stop;
/* size of the torus packet */ /* size of the torus packet */
int packet_size; uint64_t packet_size;
/* chunk id of the flit (distinguishes flits) */ /* chunk id of the flit (distinguishes flits) */
short chunk_id; short chunk_id;
...@@ -190,7 +190,7 @@ static long long N_finished_packets = 0; ...@@ -190,7 +190,7 @@ static long long N_finished_packets = 0;
static long long total_hops = 0; static long long total_hops = 0;
/* number of chunks/flits in each torus packet, calculated through the size of each flit (32 bytes by default) */ /* number of chunks/flits in each torus packet, calculated through the size of each flit (32 bytes by default) */
int num_chunks; uint64_t num_chunks;
#endif #endif
......
...@@ -56,7 +56,7 @@ static void dragonfly_report_stats() ...@@ -56,7 +56,7 @@ static void dragonfly_report_stats()
return; return;
} }
/* dragonfly packet event , generates a dragonfly packet on the compute node */ /* dragonfly packet event , generates a dragonfly packet on the compute node */
static tw_stime dragonfly_packet_event(char* category, tw_lpid final_dest_lp, int packet_size, tw_stime offset, int remote_event_size, const void* remote_event, int self_event_size, const void* self_event, tw_lp *sender, int is_last_pckt) static tw_stime dragonfly_packet_event(char* category, tw_lpid final_dest_lp, uint64_t packet_size, tw_stime offset, int remote_event_size, const void* remote_event, int self_event_size, const void* self_event, tw_lp *sender, int is_last_pckt)
{ {
tw_event * e_new; tw_event * e_new;
tw_stime xfer_to_nic_time; tw_stime xfer_to_nic_time;
......
...@@ -44,7 +44,7 @@ struct loggp_message ...@@ -44,7 +44,7 @@ struct loggp_message
enum loggp_event_type event_type; enum loggp_event_type event_type;
tw_lpid src_gid; /* who transmitted this msg? */ tw_lpid src_gid; /* who transmitted this msg? */
tw_lpid final_dest_gid; /* who is eventually targetted with this msg? */ tw_lpid final_dest_gid; /* who is eventually targetted with this msg? */
int net_msg_size_bytes; /* size of modeled network message */ uint64_t net_msg_size_bytes; /* size of modeled network message */
int event_size_bytes; /* size of simulator event message that will be tunnelled to destination */ int event_size_bytes; /* size of simulator event message that will be tunnelled to destination */
int local_event_size_bytes; /* size of simulator event message that delivered locally upon local completion */ int local_event_size_bytes; /* size of simulator event message that delivered locally upon local completion */
char category[CATEGORY_NAME_MAX]; /* category for communication */ char category[CATEGORY_NAME_MAX]; /* category for communication */
...@@ -59,7 +59,7 @@ struct loggp_message ...@@ -59,7 +59,7 @@ struct loggp_message
/* loggp parameters for a given msg size, as reported by netgauge */ /* loggp parameters for a given msg size, as reported by netgauge */
struct param_table_entry struct param_table_entry
{ {
int size; uint64_t size;
int n; int n;
double PRTT_10s; double PRTT_10s;
double PRTT_n0s; double PRTT_n0s;
...@@ -108,7 +108,7 @@ static void loggp_setup(const void* net_params); ...@@ -108,7 +108,7 @@ static void loggp_setup(const void* net_params);
static tw_stime loggp_packet_event( static tw_stime loggp_packet_event(
char* category, char* category,
tw_lpid final_dest_lp, tw_lpid final_dest_lp,
int packet_size, uint64_t packet_size,
tw_stime offset, tw_stime offset,
int remote_event_size, int remote_event_size,
const void* remote_event, const void* remote_event,
...@@ -124,7 +124,7 @@ static void loggp_report_stats(); ...@@ -124,7 +124,7 @@ static void loggp_report_stats();
static tw_lpid loggp_find_local_device(tw_lp *sender); static tw_lpid loggp_find_local_device(tw_lp *sender);
static struct param_table_entry* find_params(int msg_size); static struct param_table_entry* find_params(uint64_t msg_size);
/* data structure for model-net statistics */ /* data structure for model-net statistics */
struct model_net_method loggp_method = struct model_net_method loggp_method =
...@@ -484,7 +484,7 @@ static void handle_msg_start_event( ...@@ -484,7 +484,7 @@ static void handle_msg_start_event(
static tw_stime loggp_packet_event( static tw_stime loggp_packet_event(
char* category, char* category,
tw_lpid final_dest_lp, tw_lpid final_dest_lp,
int packet_size, uint64_t packet_size,
tw_stime offset, tw_stime offset,
int remote_event_size, int remote_event_size,
const void* remote_event, const void* remote_event,
...@@ -565,7 +565,7 @@ static void loggp_setup(const void* net_params) ...@@ -565,7 +565,7 @@ static void loggp_setup(const void* net_params)
line_nr++; line_nr++;
if(buffer[0] == '#') if(buffer[0] == '#')
continue; continue;
ret = sscanf(buffer, "%d %d %lf %lf %lf %lf %lf %lf %lf %lf %lf", ret = sscanf(buffer, "%llu %d %lf %lf %lf %lf %lf %lf %lf %lf %lf",
&param_table[param_table_size].size, &param_table[param_table_size].size,
&param_table[param_table_size].n, &param_table[param_table_size].n,
&param_table[param_table_size].PRTT_10s, &param_table[param_table_size].PRTT_10s,
...@@ -601,7 +601,7 @@ static void loggp_packet_event_rc(tw_lp *sender) ...@@ -601,7 +601,7 @@ static void loggp_packet_event_rc(tw_lp *sender)
/* find the parameters corresponding to the message size we are transmitting /* find the parameters corresponding to the message size we are transmitting
*/ */
static struct param_table_entry* find_params(int msg_size) static struct param_table_entry* find_params(uint64_t msg_size)
{ {
int i; int i;
......
...@@ -29,7 +29,7 @@ tw_stime mn_msg_offset = 0.0; ...@@ -29,7 +29,7 @@ tw_stime mn_msg_offset = 0.0;
static int model_net_get_msg_sz(int net_id); static int model_net_get_msg_sz(int net_id);
int model_net_setup(char* name, int model_net_setup(char* name,
int packet_size, uint64_t packet_size,
const void* net_params) const void* net_params)
{ {
int i; int i;
...@@ -134,7 +134,7 @@ void model_net_event( ...@@ -134,7 +134,7 @@ void model_net_event(
int net_id, int net_id,
char* category, char* category,
tw_lpid final_dest_lp, tw_lpid final_dest_lp,
int message_size, uint64_t message_size,
int remote_event_size, int remote_event_size,
const void* remote_event, const void* remote_event,
int self_event_size, int self_event_size,
...@@ -142,9 +142,9 @@ void model_net_event( ...@@ -142,9 +142,9 @@ void model_net_event(
tw_lp *sender) tw_lp *sender)
{ {
/* determine packet size for underlying method */ /* determine packet size for underlying method */
int packet_size = model_net_get_packet_size(net_id); uint64_t packet_size = model_net_get_packet_size(net_id);
int num_packets = message_size/packet_size; /* Number of packets to be issued by the API */ uint64_t num_packets = message_size/packet_size; /* Number of packets to be issued by the API */
int i; uint64_t i;
int last = 0; int last = 0;
//printf("\n number of packets %d message size %d ", num_packets, message_size); //printf("\n number of packets %d message size %d ", num_packets, message_size);
...@@ -200,18 +200,20 @@ void model_net_event( ...@@ -200,18 +200,20 @@ void model_net_event(
int model_net_set_params() int model_net_set_params()
{ {
char mn_name[MAX_NAME_LENGTH]; char mn_name[MAX_NAME_LENGTH];
int packet_size = 0; long int packet_size_l = 0;
uint64_t packet_size;
int net_id=-1; int net_id=-1;
config_lpgroups_t paramconf; config_lpgroups_t paramconf;
configuration_get_lpgroups(&config, "PARAMS", &paramconf); configuration_get_lpgroups(&config, "PARAMS", &paramconf);
configuration_get_value(&config, "PARAMS", "modelnet", mn_name, MAX_NAME_LENGTH); configuration_get_value(&config, "PARAMS", "modelnet", mn_name, MAX_NAME_LENGTH);
configuration_get_value_int(&config, "PARAMS", "packet_size", &packet_size); configuration_get_value_longint(&config, "PARAMS", "packet_size", &packet_size_l);
packet_size = packet_size_l;
if(!packet_size) if(!packet_size)
{ {
packet_size = 512; packet_size = 512;
printf("\n Warning, no packet size specified, setting packet size to %d ", packet_size); printf("\n Warning, no packet size specified, setting packet size to %llu ", packet_size);
} }
if(strcmp("simplenet",mn_name)==0) if(strcmp("simplenet",mn_name)==0)
{ {
...@@ -394,14 +396,14 @@ int model_net_set_params() ...@@ -394,14 +396,14 @@ int model_net_set_params()
void model_net_event_rc( void model_net_event_rc(
int net_id, int net_id,
tw_lp *sender, tw_lp *sender,
int message_size) uint64_t message_size)
{ {
/* this will be used for reverse computation of anything calculated /* this will be used for reverse computation of anything calculated
* within th model_net_event() function call itself (not reverse * within th model_net_event() function call itself (not reverse
* handling for the underlying methods, which will have their own events * handling for the underlying methods, which will have their own events
* and reverse handlers * and reverse handlers
*/ */
int packet_size = model_net_get_packet_size(net_id); uint64_t packet_size = model_net_get_packet_size(net_id);
int num_packets = message_size/packet_size; /* For rolling back */ int num_packets = message_size/packet_size; /* For rolling back */
int i; int i;
...@@ -431,7 +433,7 @@ static int model_net_get_msg_sz(int net_id) ...@@ -431,7 +433,7 @@ static int model_net_get_msg_sz(int net_id)
} }
/* returns the packet size in the modelnet struct */ /* returns the packet size in the modelnet struct */
int model_net_get_packet_size(int net_id) uint64_t model_net_get_packet_size(int net_id)
{ {
if(net_id < 0 || net_id >= MAX_NETS) if(net_id < 0 || net_id >= MAX_NETS)
{ {
......
...@@ -44,7 +44,7 @@ struct sn_message ...@@ -44,7 +44,7 @@ struct sn_message
enum sn_event_type event_type; enum sn_event_type event_type;
tw_lpid src_gid; /* who transmitted this msg? */ tw_lpid src_gid; /* who transmitted this msg? */
tw_lpid final_dest_gid; /* who is eventually targetted with this msg? */ tw_lpid final_dest_gid; /* who is eventually targetted with this msg? */
int net_msg_size_bytes; /* size of modeled network message */ uint64_t net_msg_size_bytes; /* size of modeled network message */
int event_size_bytes; /* size of simulator event message that will be tunnelled to destination */ int event_size_bytes; /* size of simulator event message that will be tunnelled to destination */
int local_event_size_bytes; /* size of simulator event message that delivered locally upon local completion */ int local_event_size_bytes; /* size of simulator event message that delivered locally upon local completion */
char category[CATEGORY_NAME_MAX]; /* category for communication */ char category[CATEGORY_NAME_MAX]; /* category for communication */
...@@ -101,7 +101,7 @@ static void sn_setup(const void* net_params); ...@@ -101,7 +101,7 @@ static void sn_setup(const void* net_params);
static tw_stime simplenet_packet_event( static tw_stime simplenet_packet_event(
char* category, char* category,
tw_lpid final_dest_lp, tw_lpid final_dest_lp,
int packet_size, uint64_t packet_size,
tw_stime offset, tw_stime offset,
int remote_event_size, int remote_event_size,
const void* remote_event, const void* remote_event,
...@@ -156,7 +156,7 @@ tw_lptype sn_lp = { ...@@ -156,7 +156,7 @@ tw_lptype sn_lp = {
sizeof(sn_state), sizeof(sn_state),
}; };
static tw_stime rate_to_ns(unsigned int bytes, double MB_p_s); static tw_stime rate_to_ns(uint64_t bytes, double MB_p_s);
static void handle_msg_ready_rev_event( static void handle_msg_ready_rev_event(
sn_state * ns, sn_state * ns,
tw_bf * b, tw_bf * b,
...@@ -287,7 +287,7 @@ int sn_get_magic() ...@@ -287,7 +287,7 @@ int sn_get_magic()
} }
/* convert MiB/s and bytes to ns */ /* convert MiB/s and bytes to ns */
static tw_stime rate_to_ns(unsigned int bytes, double MB_p_s) static tw_stime rate_to_ns(uint64_t bytes, double MB_p_s)
{ {
tw_stime time; tw_stime time;
...@@ -480,7 +480,7 @@ static void handle_msg_start_event( ...@@ -480,7 +480,7 @@ static void handle_msg_start_event(
static tw_stime simplenet_packet_event( static tw_stime simplenet_packet_event(
char* category, char* category,
tw_lpid final_dest_lp, tw_lpid final_dest_lp,
int packet_size, uint64_t packet_size,
tw_stime offset, tw_stime offset,
int remote_event_size, int remote_event_size,
const void* remote_event, const void* remote_event,
......
...@@ -69,7 +69,7 @@ struct sw_message ...@@ -69,7 +69,7 @@ struct sw_message
/* relative ID of the sending simplewan message (for latency/bandwidth lookup) */ /* relative ID of the sending simplewan message (for latency/bandwidth lookup) */
int src_mn_rel_id; int src_mn_rel_id;
int dest_mn_rel_id; /* included to make rc easier */ int dest_mn_rel_id; /* included to make rc easier */
int net_msg_size_bytes; /* size of modeled network message */ uint64_t net_msg_size_bytes; /* size of modeled network message */
int event_size_bytes; /* size of simulator event message that will be tunnelled to destination */ int event_size_bytes; /* size of simulator event message that will be tunnelled to destination */
int local_event_size_bytes; /* size of simulator event message that delivered locally upon local completion */ int local_event_size_bytes; /* size of simulator event message that delivered locally upon local completion */
char category[CATEGORY_NAME_MAX]; /* category for communication */ char category[CATEGORY_NAME_MAX]; /* category for communication */
...@@ -142,7 +142,7 @@ static void sw_setup(const void* net_params); ...@@ -142,7 +142,7 @@ static void sw_setup(const void* net_params);
static tw_stime simplewan_packet_event( static tw_stime simplewan_packet_event(
char* category, char* category,
tw_lpid final_dest_lp, tw_lpid final_dest_lp,
int packet_size, uint64_t packet_size,
tw_stime offset, tw_stime offset,
int remote_event_size, int remote_event_size,
const void* remote_event, const void* remote_event,
...@@ -197,7 +197,7 @@ tw_lptype sw_lp = { ...@@ -197,7 +197,7 @@ tw_lptype sw_lp = {
sizeof(sw_state), sizeof(sw_state),
}; };
static tw_stime rate_to_ns(unsigned int bytes, double MB_p_s); static tw_stime rate_to_ns(uint64_t bytes, double MB_p_s);
static void handle_msg_ready_rev_event( static void handle_msg_ready_rev_event(
sw_state * ns, sw_state * ns,
tw_bf * b, tw_bf * b,
...@@ -451,7 +451,7 @@ int sw_get_magic() ...@@ -451,7 +451,7 @@ int sw_get_magic()
} }
/* convert MiB/s and bytes to ns */ /* convert MiB/s and bytes to ns */
static tw_stime rate_to_ns(unsigned int bytes, double MB_p_s) static tw_stime rate_to_ns(uint64_t bytes, double MB_p_s)
{ {
tw_stime time; tw_stime time;
...@@ -742,7 +742,7 @@ static void handle_msg_start_event( ...@@ -742,7 +742,7 @@ static void handle_msg_start_event(
static tw_stime simplewan_packet_event( static tw_stime simplewan_packet_event(
char* category, char* category,
tw_lpid final_dest_lp, tw_lpid final_dest_lp,
int packet_size, uint64_t packet_size,
tw_stime offset, tw_stime offset,
int remote_event_size, int remote_event_size,
const void* remote_event, const void* remote_event,
......
...@@ -38,7 +38,7 @@ static void torus_packet_event_rc(tw_lp *sender) ...@@ -38,7 +38,7 @@ static void torus_packet_event_rc(tw_lp *sender)
} }
/* torus packet event , generates a torus packet on the compute node */ /* torus packet event , generates a torus packet on the compute node */
static tw_stime torus_packet_event(char* category, tw_lpid final_dest_lp, int packet_size, tw_stime offset, int remote_event_size, const void* remote_event, int self_event_size, const void* self_event, tw_lp *sender, int is_last_pckt) static tw_stime torus_packet_event(char* category, tw_lpid final_dest_lp, uint64_t packet_size, tw_stime offset, int remote_event_size, const void* remote_event, int self_event_size, const void* self_event, tw_lp *sender, int is_last_pckt)
{ {
tw_event * e_new; tw_event * e_new;
tw_stime xfer_to_nic_time; tw_stime xfer_to_nic_time;
......
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