Commit 62564150 authored by Misbah Mubarak's avatar Misbah Mubarak

modifications to custom-dragonfly: updating header files, changing variable names in the model

parent 0ddc2e4d
...@@ -5,7 +5,7 @@ bin_PROGRAMS = ...@@ -5,7 +5,7 @@ bin_PROGRAMS =
bin_SCRIPTS = bin_SCRIPTS =
noinst_LIBRARIES = noinst_LIBRARIES =
noinst_PROGRAMS = noinst_PROGRAMS =
lib_LIBRARIES = lib_LTLIBRARIES =
noinst_HEADERS = noinst_HEADERS =
TESTS = TESTS =
check_PROGRAMS = check_PROGRAMS =
...@@ -30,7 +30,7 @@ AM_CFLAGS = ...@@ -30,7 +30,7 @@ AM_CFLAGS =
AM_CXXFLAGS = $(AM_CFLAGS) AM_CXXFLAGS = $(AM_CFLAGS)
LDADD = $(lib_LIBRARIES) $(ROSS_LIBS) LDADD = $(lib_LTLIBRARIES) $(ROSS_LIBS)
include Make.rules include Make.rules
...@@ -41,18 +41,18 @@ include $(top_srcdir)/doc/Makefile.subdir ...@@ -41,18 +41,18 @@ include $(top_srcdir)/doc/Makefile.subdir
if USE_DARSHAN if USE_DARSHAN
AM_CPPFLAGS += ${DARSHAN_CFLAGS} -DUSE_DARSHAN=1 AM_CPPFLAGS += ${DARSHAN_CFLAGS} -DUSE_DARSHAN=1
src_libcodes_a_SOURCES += src/workload/methods/codes-darshan-io-wrkld.c src_libcodes_la_SOURCES += src/workload/methods/codes-darshan-io-wrkld.c
LDADD += ${DARSHAN_LIBS} LDADD += ${DARSHAN_LIBS}
TESTS += tests/workload/darshan-dump.sh TESTS += tests/workload/darshan-dump.sh
endif endif
if USE_RECORDER if USE_RECORDER
AM_CPPFLAGS += ${RECORDER_CPPFLAGS} AM_CPPFLAGS += ${RECORDER_CPPFLAGS}
src_libcodes_a_SOURCES += src/workload/methods/codes-recorder-io-wrkld.c src_libcodes_la_SOURCES += src/workload/methods/codes-recorder-io-wrkld.c
endif endif
if USE_DUMPI if USE_DUMPI
AM_CPPFLAGS += ${DUMPI_CFLAGS} -DUSE_DUMPI=1 AM_CPPFLAGS += ${DUMPI_CFLAGS} -DUSE_DUMPI=1
src_libcodes_a_SOURCES += src/workload/methods/codes-dumpi-trace-nw-wrkld.c src_libcodes_la_SOURCES += src/workload/methods/codes-dumpi-trace-nw-wrkld.c
LDADD += ${DUMPI_LIBS} LDADD += ${DUMPI_LIBS}
endif endif
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
* *
*/ */
#ifndef DRAGONFLY_H #ifndef DRAGONFLY_CUSTOM_H
#define DRAGONFLY_H #define DRAGONFLY_CUSTOM_H
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
...@@ -13,10 +13,10 @@ extern "C" { ...@@ -13,10 +13,10 @@ extern "C" {
#include <ross.h> #include <ross.h>
typedef struct terminal_message terminal_message; typedef struct terminal_custom_message terminal_custom_message;
/* this message is used for both dragonfly compute nodes and routers */ /* this message is used for both dragonfly compute nodes and routers */
struct terminal_message struct terminal_custom_message
{ {
/* magic number */ /* magic number */
int magic; int magic;
...@@ -49,6 +49,8 @@ struct terminal_message ...@@ -49,6 +49,8 @@ struct terminal_message
short saved_channel; short saved_channel;
short saved_vc; short saved_vc;
int next_stop;
short nonmin_done; short nonmin_done;
/* Intermediate LP ID from which this message is coming */ /* Intermediate LP ID from which this message is coming */
unsigned int intm_lp_id; unsigned int intm_lp_id;
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
AC_PREREQ([2.67]) AC_PREREQ([2.67])
AC_INIT([codes], [0.5.2], [http://trac.mcs.anl.gov/projects/codes/newticket],[],[http://www.mcs.anl.gov/projects/codes/]) AC_INIT([codes], [0.5.2], [http://trac.mcs.anl.gov/projects/codes/newticket],[],[http://www.mcs.anl.gov/projects/codes/])
LT_INIT
AC_CANONICAL_TARGET AC_CANONICAL_TARGET
AC_CANONICAL_SYSTEM AC_CANONICAL_SYSTEM
...@@ -25,7 +26,6 @@ AC_PROG_CC ...@@ -25,7 +26,6 @@ AC_PROG_CC
AM_PROG_CC_C_O AM_PROG_CC_C_O
AC_PROG_CXX AC_PROG_CXX
AC_PROG_CXXCPP AC_PROG_CXXCPP
AC_PROG_RANLIB
PKG_PROG_PKG_CONFIG PKG_PROG_PKG_CONFIG
......
lib_LIBRARIES += src/libcodes.a lib_LTLIBRARIES += src/libcodes.la
BUILT_SOURCES += src/modelconfig/configparser.h \ BUILT_SOURCES += src/modelconfig/configparser.h \
src/modelconfig/configlex.h src/modelconfig/configlex.h
...@@ -98,7 +98,7 @@ nobase_include_HEADERS = \ ...@@ -98,7 +98,7 @@ nobase_include_HEADERS = \
#codes/codes-nw-workload.h #codes/codes-nw-workload.h
src_libcodes_a_SOURCES = \ src_libcodes_la_SOURCES = \
src/iokernellang/codesparser.h \ src/iokernellang/codesparser.h \
src/iokernellang/codesparser.c \ src/iokernellang/codesparser.c \
src/iokernellang/codeslexer.h \ src/iokernellang/codeslexer.h \
...@@ -155,11 +155,7 @@ src_libcodes_a_SOURCES = \ ...@@ -155,11 +155,7 @@ src_libcodes_a_SOURCES = \
src/networks/model-net/model-net-lp.c \ src/networks/model-net/model-net-lp.c \
src/networks/model-net/model-net-sched.c \ src/networks/model-net/model-net-sched.c \
src/networks/model-net/model-net-sched-impl.h \ src/networks/model-net/model-net-sched-impl.h \
src/networks/model-net/model-net-sched-impl.c \ src/networks/model-net/model-net-sched-impl.c
src/network-workloads/model-net-mpi-replay.c \
src/network-workloads/model-net-synthetic.c \
src/network-workloads/model-net-synthetic-slimfly.c \
src/network-workloads/model-net-dumpi-traces-dump.c
#codes/codes-nw-workload.h #codes/codes-nw-workload.h
...@@ -184,10 +180,11 @@ bin_PROGRAMS += src/network-workloads/model-net-synthetic-slimfly ...@@ -184,10 +180,11 @@ bin_PROGRAMS += src/network-workloads/model-net-synthetic-slimfly
src_workload_codes_workload_dump_SOURCES = \ src_workload_codes_workload_dump_SOURCES = \
src/workload/codes-workload-dump.c src/workload/codes-workload-dump.c
src_network_workloads_model_net_mpi_replay_SOURCES = src/network-workloads/model-net-mpi-replay.c src_network_workloads_model_net_mpi_replay_SOURCES = src/network-workloads/model-net-mpi-replay.c
src_network_workloads_model_net_synthetic_SOURCES = src/network-workloads/model-net-synthetic.c src_network_workloads_model_net_synthetic_SOURCES = src/network-workloads/model-net-synthetic.c
src_network_workloads_model_net_synthetic_slimfly_SOURCES = src/network-workloads/model-net-synthetic-slimfly.c src_network_workloads_model_net_synthetic_slimfly_SOURCES = src/network-workloads/model-net-synthetic-slimfly.c src/network-workloads/dummy.C
src_network_workloads_model_net_dumpi_traces_dump_SOURCES = src/network-workloads/model-net-dumpi-traces-dump.c src_network_workloads_model_net_dumpi_traces_dump_SOURCES = src/network-workloads/model-net-dumpi-traces-dump.c src/network-workloads/dummy.C
#bin_PROGRAMS += src/network-workload/codes-nw-test #bin_PROGRAMS += src/network-workload/codes-nw-test
......
...@@ -99,23 +99,23 @@ static int sample_rtr_bytes_written = 0; ...@@ -99,23 +99,23 @@ static int sample_rtr_bytes_written = 0;
static char cn_sample_file[MAX_NAME_LENGTH]; static char cn_sample_file[MAX_NAME_LENGTH];
static char router_sample_file[MAX_NAME_LENGTH]; static char router_sample_file[MAX_NAME_LENGTH];
typedef struct terminal_message_list terminal_message_list; typedef struct terminal_custom_message_list terminal_custom_message_list;
struct terminal_message_list { struct terminal_custom_message_list {
terminal_message msg; terminal_custom_message msg;
char* event_data; char* event_data;
terminal_message_list *next; terminal_custom_message_list *next;
terminal_message_list *prev; terminal_custom_message_list *prev;
}; };
void init_terminal_message_list(terminal_message_list *thisO, void init_terminal_custom_message_list(terminal_custom_message_list *thisO,
terminal_message *inmsg) { terminal_custom_message *inmsg) {
thisO->msg = *inmsg; thisO->msg = *inmsg;
thisO->event_data = NULL; thisO->event_data = NULL;
thisO->next = NULL; thisO->next = NULL;
thisO->prev = NULL; thisO->prev = NULL;
} }
void delete_terminal_message_list(terminal_message_list *thisO) { void delete_terminal_custom_message_list(terminal_custom_message_list *thisO) {
if(thisO->event_data != NULL) free(thisO->event_data); if(thisO->event_data != NULL) free(thisO->event_data);
free(thisO); free(thisO);
} }
...@@ -204,8 +204,8 @@ struct terminal_state ...@@ -204,8 +204,8 @@ struct terminal_state
int* vc_occupancy; // NUM_VC int* vc_occupancy; // NUM_VC
int num_vcs; int num_vcs;
tw_stime terminal_available_time; tw_stime terminal_available_time;
terminal_message_list **terminal_msgs; terminal_custom_message_list **terminal_msgs;
terminal_message_list **terminal_msgs_tail; terminal_custom_message_list **terminal_msgs_tail;
int in_send_loop; int in_send_loop;
struct mn_stats dragonfly_stats_array[CATEGORY_MAX]; struct mn_stats dragonfly_stats_array[CATEGORY_MAX];
...@@ -297,10 +297,10 @@ struct router_state ...@@ -297,10 +297,10 @@ struct router_state
tw_stime* busy_time; tw_stime* busy_time;
tw_stime* busy_time_sample; tw_stime* busy_time_sample;
terminal_message_list ***pending_msgs; terminal_custom_message_list ***pending_msgs;
terminal_message_list ***pending_msgs_tail; terminal_custom_message_list ***pending_msgs_tail;
terminal_message_list ***queued_msgs; terminal_custom_message_list ***queued_msgs;
terminal_message_list ***queued_msgs_tail; terminal_custom_message_list ***queued_msgs_tail;
int *in_send_loop; int *in_send_loop;
int *queued_count; int *queued_count;
struct rc_stack * st; struct rc_stack * st;
...@@ -381,7 +381,7 @@ static tw_stime bytes_to_ns(uint64_t bytes, double GB_p_s) ...@@ -381,7 +381,7 @@ static tw_stime bytes_to_ns(uint64_t bytes, double GB_p_s)
/* returns the dragonfly message size */ /* returns the dragonfly message size */
int dragonfly_custom_get_msg_sz(void) int dragonfly_custom_get_msg_sz(void)
{ {
return sizeof(terminal_message); return sizeof(terminal_custom_message);
} }
static void free_tmp(void * ptr) static void free_tmp(void * ptr)
...@@ -391,11 +391,11 @@ static void free_tmp(void * ptr) ...@@ -391,11 +391,11 @@ static void free_tmp(void * ptr)
free(dfly); free(dfly);
} }
static void append_to_terminal_message_list( static void append_to_terminal_custom_message_list(
terminal_message_list ** thisq, terminal_custom_message_list ** thisq,
terminal_message_list ** thistail, terminal_custom_message_list ** thistail,
int index, int index,
terminal_message_list *msg) { terminal_custom_message_list *msg) {
if(thisq[index] == NULL) { if(thisq[index] == NULL) {
thisq[index] = msg; thisq[index] = msg;
} else { } else {
...@@ -405,11 +405,11 @@ static void append_to_terminal_message_list( ...@@ -405,11 +405,11 @@ static void append_to_terminal_message_list(
thistail[index] = msg; thistail[index] = msg;
} }
static void prepend_to_terminal_message_list( static void prepend_to_terminal_custom_message_list(
terminal_message_list ** thisq, terminal_custom_message_list ** thisq,
terminal_message_list ** thistail, terminal_custom_message_list ** thistail,
int index, int index,
terminal_message_list *msg) { terminal_custom_message_list *msg) {
if(thisq[index] == NULL) { if(thisq[index] == NULL) {
thistail[index] = msg; thistail[index] = msg;
} else { } else {
...@@ -419,11 +419,11 @@ static void prepend_to_terminal_message_list( ...@@ -419,11 +419,11 @@ static void prepend_to_terminal_message_list(
thisq[index] = msg; thisq[index] = msg;
} }
static terminal_message_list* return_head( static terminal_custom_message_list* return_head(
terminal_message_list ** thisq, terminal_custom_message_list ** thisq,
terminal_message_list ** thistail, terminal_custom_message_list ** thistail,
int index) { int index) {
terminal_message_list *head = thisq[index]; terminal_custom_message_list *head = thisq[index];
if(head != NULL) { if(head != NULL) {
thisq[index] = head->next; thisq[index] = head->next;
if(head->next != NULL) { if(head->next != NULL) {
...@@ -436,11 +436,11 @@ static terminal_message_list* return_head( ...@@ -436,11 +436,11 @@ static terminal_message_list* return_head(
return head; return head;
} }
static terminal_message_list* return_tail( static terminal_custom_message_list* return_tail(
terminal_message_list ** thisq, terminal_custom_message_list ** thisq,
terminal_message_list ** thistail, terminal_custom_message_list ** thistail,
int index) { int index) {
terminal_message_list *tail = thistail[index]; terminal_custom_message_list *tail = thistail[index];
assert(tail); assert(tail);
if(tail->prev != NULL) { if(tail->prev != NULL) {
tail->prev->next = NULL; tail->prev->next = NULL;
...@@ -816,9 +816,9 @@ terminal_custom_init( terminal_state * s, ...@@ -816,9 +816,9 @@ terminal_custom_init( terminal_state * s,
tw_error(TW_LOC, "\n Hash table not initialized! "); tw_error(TW_LOC, "\n Hash table not initialized! ");
s->terminal_msgs = s->terminal_msgs =
(terminal_message_list**)malloc(s->num_vcs*sizeof(terminal_message_list*)); (terminal_custom_message_list**)malloc(s->num_vcs*sizeof(terminal_custom_message_list*));
s->terminal_msgs_tail = s->terminal_msgs_tail =
(terminal_message_list**)malloc(s->num_vcs*sizeof(terminal_message_list*)); (terminal_custom_message_list**)malloc(s->num_vcs*sizeof(terminal_custom_message_list*));
s->terminal_msgs[0] = NULL; s->terminal_msgs[0] = NULL;
s->terminal_msgs_tail[0] = NULL; s->terminal_msgs_tail[0] = NULL;
s->terminal_length = 0; s->terminal_length = 0;
...@@ -888,13 +888,13 @@ void router_custom_setup(router_state * r, tw_lp * lp) ...@@ -888,13 +888,13 @@ void router_custom_setup(router_state * r, tw_lp * lp)
r->vc_occupancy = (int**)malloc(p->radix * sizeof(int*)); r->vc_occupancy = (int**)malloc(p->radix * sizeof(int*));
r->in_send_loop = (int*)malloc(p->radix * sizeof(int)); r->in_send_loop = (int*)malloc(p->radix * sizeof(int));
r->pending_msgs = r->pending_msgs =
(terminal_message_list***)malloc(p->radix * sizeof(terminal_message_list**)); (terminal_custom_message_list***)malloc(p->radix * sizeof(terminal_custom_message_list**));
r->pending_msgs_tail = r->pending_msgs_tail =
(terminal_message_list***)malloc(p->radix * sizeof(terminal_message_list**)); (terminal_custom_message_list***)malloc(p->radix * sizeof(terminal_custom_message_list**));
r->queued_msgs = r->queued_msgs =
(terminal_message_list***)malloc(p->radix * sizeof(terminal_message_list**)); (terminal_custom_message_list***)malloc(p->radix * sizeof(terminal_custom_message_list**));
r->queued_msgs_tail = r->queued_msgs_tail =
(terminal_message_list***)malloc(p->radix * sizeof(terminal_message_list**)); (terminal_custom_message_list***)malloc(p->radix * sizeof(terminal_custom_message_list**));
r->queued_count = (int*)malloc(p->radix * sizeof(int)); r->queued_count = (int*)malloc(p->radix * sizeof(int));
r->last_buf_full = (tw_stime*)malloc(p->radix * sizeof(tw_stime)); r->last_buf_full = (tw_stime*)malloc(p->radix * sizeof(tw_stime));
r->busy_time = (tw_stime*)malloc(p->radix * sizeof(tw_stime)); r->busy_time = (tw_stime*)malloc(p->radix * sizeof(tw_stime));
...@@ -916,14 +916,14 @@ void router_custom_setup(router_state * r, tw_lp * lp) ...@@ -916,14 +916,14 @@ void router_custom_setup(router_state * r, tw_lp * lp)
r->queued_count[i] = 0; r->queued_count[i] = 0;
r->in_send_loop[i] = 0; r->in_send_loop[i] = 0;
r->vc_occupancy[i] = (int*)malloc(p->num_vcs * sizeof(int)); r->vc_occupancy[i] = (int*)malloc(p->num_vcs * sizeof(int));
r->pending_msgs[i] = (terminal_message_list**)malloc(p->num_vcs * r->pending_msgs[i] = (terminal_custom_message_list**)malloc(p->num_vcs *
sizeof(terminal_message_list*)); sizeof(terminal_custom_message_list*));
r->pending_msgs_tail[i] = (terminal_message_list**)malloc(p->num_vcs * r->pending_msgs_tail[i] = (terminal_custom_message_list**)malloc(p->num_vcs *
sizeof(terminal_message_list*)); sizeof(terminal_custom_message_list*));
r->queued_msgs[i] = (terminal_message_list**)malloc(p->num_vcs * r->queued_msgs[i] = (terminal_custom_message_list**)malloc(p->num_vcs *
sizeof(terminal_message_list*)); sizeof(terminal_custom_message_list*));
r->queued_msgs_tail[i] = (terminal_message_list**)malloc(p->num_vcs * r->queued_msgs_tail[i] = (terminal_custom_message_list**)malloc(p->num_vcs *
sizeof(terminal_message_list*)); sizeof(terminal_custom_message_list*));
for(int j = 0; j < p->num_vcs; j++) { for(int j = 0; j < p->num_vcs; j++) {
r->vc_occupancy[i][j] = 0; r->vc_occupancy[i][j] = 0;
r->pending_msgs[i][j] = NULL; r->pending_msgs[i][j] = NULL;
...@@ -952,7 +952,7 @@ static tw_stime dragonfly_custom_packet_event( ...@@ -952,7 +952,7 @@ static tw_stime dragonfly_custom_packet_event(
(void)sched_params; (void)sched_params;
tw_event * e_new; tw_event * e_new;
tw_stime xfer_to_nic_time; tw_stime xfer_to_nic_time;
terminal_message * msg; terminal_custom_message * msg;
char* tmp_ptr; char* tmp_ptr;
xfer_to_nic_time = codes_local_latency(sender); xfer_to_nic_time = codes_local_latency(sender);
...@@ -1005,11 +1005,11 @@ static void dragonfly_custom_packet_event_rc(tw_lp *sender) ...@@ -1005,11 +1005,11 @@ static void dragonfly_custom_packet_event_rc(tw_lp *sender)
} }
/*When a packet is sent from the current router and a buffer slot becomes available, a credit is sent back to schedule another packet event*/ /*When a packet is sent from the current router and a buffer slot becomes available, a credit is sent back to schedule another packet event*/
static void router_credit_send(router_state * s, terminal_message * msg, static void router_credit_send(router_state * s, terminal_custom_message * msg,
tw_lp * lp, int sq) { tw_lp * lp, int sq) {
tw_event * buf_e; tw_event * buf_e;
tw_stime ts; tw_stime ts;
terminal_message * buf_msg; terminal_custom_message * buf_msg;
int dest = 0, type = R_BUFFER; int dest = 0, type = R_BUFFER;
int is_terminal = 0; int is_terminal = 0;
...@@ -1055,7 +1055,7 @@ static void router_credit_send(router_state * s, terminal_message * msg, ...@@ -1055,7 +1055,7 @@ static void router_credit_send(router_state * s, terminal_message * msg,
return; return;
} }
static void packet_generate_rc(terminal_state * s, tw_bf * bf, terminal_message * msg, tw_lp * lp) static void packet_generate_rc(terminal_state * s, tw_bf * bf, terminal_custom_message * msg, tw_lp * lp)
{ {
s->packet_gen--; s->packet_gen--;
packet_gen--; packet_gen--;
...@@ -1071,7 +1071,7 @@ static void packet_generate_rc(terminal_state * s, tw_bf * bf, terminal_message ...@@ -1071,7 +1071,7 @@ static void packet_generate_rc(terminal_state * s, tw_bf * bf, terminal_message
int i; int i;
for(i = 0; i < num_chunks; i++) { for(i = 0; i < num_chunks; i++) {
delete_terminal_message_list(return_tail(s->terminal_msgs, delete_terminal_custom_message_list(return_tail(s->terminal_msgs,
s->terminal_msgs_tail, 0)); s->terminal_msgs_tail, 0));
s->terminal_length -= s->params->chunk_size; s->terminal_length -= s->params->chunk_size;
} }
...@@ -1091,7 +1091,7 @@ static void packet_generate_rc(terminal_state * s, tw_bf * bf, terminal_message ...@@ -1091,7 +1091,7 @@ static void packet_generate_rc(terminal_state * s, tw_bf * bf, terminal_message
} }
/* generates packet at the current dragonfly compute node */ /* generates packet at the current dragonfly compute node */
static void packet_generate(terminal_state * s, tw_bf * bf, terminal_message * msg, static void packet_generate(terminal_state * s, tw_bf * bf, terminal_custom_message * msg,
tw_lp * lp) { tw_lp * lp) {
packet_gen++; packet_gen++;
s->packet_gen++; s->packet_gen++;
...@@ -1124,10 +1124,10 @@ static void packet_generate(terminal_state * s, tw_bf * bf, terminal_message * m ...@@ -1124,10 +1124,10 @@ static void packet_generate(terminal_state * s, tw_bf * bf, terminal_message * m
for(uint64_t i = 0; i < num_chunks; i++) for(uint64_t i = 0; i < num_chunks; i++)
{ {
terminal_message_list *cur_chunk = (terminal_message_list*)malloc( terminal_custom_message_list *cur_chunk = (terminal_custom_message_list*)malloc(
sizeof(terminal_message_list)); sizeof(terminal_custom_message_list));
msg->origin_router_id = s->router_id; msg->origin_router_id = s->router_id;
init_terminal_message_list(cur_chunk, msg); init_terminal_custom_message_list(cur_chunk, msg);
if(msg->remote_event_size_bytes + msg->local_event_size_bytes > 0) { if(msg->remote_event_size_bytes + msg->local_event_size_bytes > 0) {
...@@ -1147,7 +1147,7 @@ static void packet_generate(terminal_state * s, tw_bf * bf, terminal_message * m ...@@ -1147,7 +1147,7 @@ static void packet_generate(terminal_state * s, tw_bf * bf, terminal_message * m
cur_chunk->msg.chunk_id = i; cur_chunk->msg.chunk_id = i;
cur_chunk->msg.origin_router_id = s->router_id; cur_chunk->msg.origin_router_id = s->router_id;
append_to_terminal_message_list(s->terminal_msgs, s->terminal_msgs_tail, append_to_terminal_custom_message_list(s->terminal_msgs, s->terminal_msgs_tail,
0, cur_chunk); 0, cur_chunk);
s->terminal_length += s->params->chunk_size; s->terminal_length += s->params->chunk_size;
} }
...@@ -1164,7 +1164,7 @@ static void packet_generate(terminal_state * s, tw_bf * bf, terminal_message * m ...@@ -1164,7 +1164,7 @@ static void packet_generate(terminal_state * s, tw_bf * bf, terminal_message * m
if(s->in_send_loop == 0) { if(s->in_send_loop == 0) {
bf->c5 = 1; bf->c5 = 1;
ts = codes_local_latency(lp); ts = codes_local_latency(lp);
terminal_message *m; terminal_custom_message *m;
tw_event* e = model_net_method_event_new(lp->gid, ts, lp, DRAGONFLY, tw_event* e = model_net_method_event_new(lp->gid, ts, lp, DRAGONFLY,
(void**)&m, NULL); (void**)&m, NULL);
m->type = T_SEND; m->type = T_SEND;
...@@ -1186,7 +1186,7 @@ static void packet_generate(terminal_state * s, tw_bf * bf, terminal_message * m ...@@ -1186,7 +1186,7 @@ static void packet_generate(terminal_state * s, tw_bf * bf, terminal_message * m
return; return;
} }
static void packet_send_rc(terminal_state * s, tw_bf * bf, terminal_message * msg, static void packet_send_rc(terminal_state * s, tw_bf * bf, terminal_custom_message * msg,
tw_lp * lp) tw_lp * lp)
{ {
if(bf->c1) { if(bf->c1) {
...@@ -1205,9 +1205,9 @@ static void packet_send_rc(terminal_state * s, tw_bf * bf, terminal_message * ms ...@@ -1205,9 +1205,9 @@ static void packet_send_rc(terminal_state * s, tw_bf * bf, terminal_message * ms
s->packet_counter--; s->packet_counter--;
s->vc_occupancy[0] -= s->params->chunk_size; s->vc_occupancy[0] -= s->params->chunk_size;
terminal_message_list* cur_entry = (terminal_message_list *)rc_stack_pop(s->st); terminal_custom_message_list* cur_entry = (terminal_custom_message_list *)rc_stack_pop(s->st);
prepend_to_terminal_message_list(s->terminal_msgs, prepend_to_terminal_custom_message_list(s->terminal_msgs,
s->terminal_msgs_tail, 0, cur_entry); s->terminal_msgs_tail, 0, cur_entry);
if(bf->c3) { if(bf->c3) {
tw_rand_reverse_unif(lp->rng); tw_rand_reverse_unif(lp->rng);
...@@ -1223,15 +1223,15 @@ static void packet_send_rc(terminal_state * s, tw_bf * bf, terminal_message * ms ...@@ -1223,15 +1223,15 @@ static void packet_send_rc(terminal_state * s, tw_bf * bf, terminal_message * ms
return; return;
} }
/* sends the packet from the current dragonfly compute node to the attached router */ /* sends the packet from the current dragonfly compute node to the attached router */
static void packet_send(terminal_state * s, tw_bf * bf, terminal_message * msg, static void packet_send(terminal_state * s, tw_bf * bf, terminal_custom_message * msg,
tw_lp * lp) { tw_lp * lp) {
tw_stime ts; tw_stime ts;
tw_event *e; tw_event *e;
terminal_message *m; terminal_custom_message *m;
tw_lpid router_id; tw_lpid router_id;
terminal_message_list* cur_entry = s->terminal_msgs[0]; terminal_custom_message_list* cur_entry = s->terminal_msgs[0];
if(s->vc_occupancy[0] + s->params->chunk_size > s->params->cn_vc_size if(s->vc_occupancy[0] + s->params->chunk_size > s->params->cn_vc_size
|| cur_entry == NULL) { || cur_entry == NULL) {
...@@ -1268,7 +1268,7 @@ static void packet_send(terminal_state * s, tw_bf * bf, terminal_message * msg, ...@@ -1268,7 +1268,7 @@ static void packet_send(terminal_state * s, tw_bf * bf, terminal_message * msg,
void * remote_event; void * remote_event;
e = model_net_method_event_new(router_id, s->terminal_available_time - tw_now(lp), lp, e = model_net_method_event_new(router_id, s->terminal_available_time - tw_now(lp), lp,
DRAGONFLY_ROUTER, (void**)&m, &remote_event); DRAGONFLY_ROUTER, (void**)&m, &remote_event);
memcpy(m, &cur_entry->msg, sizeof(terminal_message)); memcpy(m, &cur_entry->msg, sizeof(terminal_custom_message));
if (m->remote_event_size_bytes){ if (m->remote_event_size_bytes){
memcpy(remote_event, cur_entry->event_data, m->remote_event_size_bytes); memcpy(remote_event, cur_entry->event_data, m->remote_event_size_bytes);
} }
...@@ -1306,7 +1306,7 @@ static void packet_send(terminal_state * s, tw_bf * bf, terminal_message * msg, ...@@ -1306,7 +1306,7 @@ static void packet_send(terminal_state * s, tw_bf * bf, terminal_message * msg,
if(cur_entry != NULL && if(cur_entry != NULL &&
s->vc_occupancy[0] + s->params->chunk_size <= s->params->cn_vc_size) { s->vc_occupancy[0] + s->params->chunk_size <= s->params->cn_vc_size) {
bf->c3 = 1; bf->c3 = 1;
terminal_message *m_new; terminal_custom_message *m_new;
ts = g_tw_lookahead + s->params->cn_delay + tw_rand_unif(lp->rng); ts = g_tw_lookahead + s->params->cn_delay + tw_rand_unif(lp->rng);
e = model_net_method_event_new(lp->gid, ts, lp, DRAGONFLY, e = model_net_method_event_new(lp->gid, ts, lp, DRAGONFLY,
(void**)&m_new, NULL); (void**)&m_new, NULL);
...@@ -1326,7 +1326,7 @@ static void packet_send(terminal_state * s, tw_bf * bf, terminal_message * msg, ...@@ -1326,7 +1326,7 @@ static void packet_send(terminal_state * s, tw_bf * bf, terminal_message * msg,
return; return;
} }
static void packet_arrive_rc(terminal_state * s, tw_bf * bf, terminal_message * msg, tw_lp * lp) static void packet_arrive_rc(terminal_state * s, tw_bf * bf, terminal_custom_message * msg, tw_lp * lp)
{ {
if(bf->c31) if(bf->c31)
{ {
...@@ -1408,7 +1408,7 @@ static void packet_arrive_rc(terminal_state * s, tw_bf * bf, terminal_message * ...@@ -1408,7 +1408,7 @@ static void packet_arrive_rc(terminal_state * s, tw_bf * bf, terminal_message *
}*/ }*/
return; return;
} }
static void send_remote_event(terminal_state * s, terminal_message * msg, tw_lp * lp, tw_bf * bf, char * event_data, int remote_event_size) static void send_remote_event(terminal_state * s, terminal_custom_message * msg, tw_lp * lp, tw_bf * bf, char * event_data, int remote_event_size)
{ {
void * tmp_ptr = model_net_method_get_edata(DRAGONFLY, msg); void * tmp_ptr = model_net_method_get_edata(DRAGONFLY, msg);
//tw_stime ts = g_tw_lookahead + bytes_to_ns(msg->remote_event_size_bytes, (1/s->params->cn_bandwidth)); //tw_stime ts = g_tw_lookahead + bytes_to_ns(msg->remote_event_size_bytes, (1/s->params->cn_bandwidth));
...@@ -1436,7 +1436,7 @@ static void send_remote_event(terminal_state * s, terminal_message * msg, tw_lp ...@@ -1436,7 +1436,7 @@ static void send_remote_event(terminal_state * s, terminal_message * msg, tw_lp
return; return;
} }
/* packet arrives at the destination terminal */ /* packet arrives at the destination terminal */
static void packet_arrive(terminal_state * s, tw_bf * bf, terminal_message * msg, static void packet_arrive(terminal_state * s, tw_bf * bf, terminal_custom_message * msg,
tw_lp * lp) { tw_lp * lp) {
// NIC aggregation - should this be a separate function? // NIC aggregation - should this be a separate function?
...@@ -1480,7 +1480,7 @@ static void packet_arrive(terminal_state * s, tw_bf * bf, terminal_message * msg ...@@ -1480,7 +1480,7 @@ static void packet_arrive(terminal_state * s, tw_bf * bf, terminal_message * msg
// no method_event here - message going to router // no method_event here - message going to router
tw_event * buf_e; tw_event * buf_e;
terminal_message * buf_msg; terminal_custom_message * buf_msg;
buf_e = model_net_method_event_new(msg->intm_lp_id, ts, lp, buf_e = model_net_method_event_new(msg->intm_lp_id, ts, lp,
DRAGONFLY_ROUTER, (void**)&buf_msg, NULL); DRAGONFLY_ROUTER, (void**)&buf_msg, NULL);
buf_msg->magic = router_magic_num; buf_msg->magic = router_magic_num;
...@@ -1648,7 +1648,7 @@ void dragonfly_custom_rsample_init(router_state * s, ...@@ -1648,7 +1648,7 @@ void dragonfly_custom_rsample_init(router_state * s,
} }
void dragonfly_custom_rsample_rc_fn(router_state * s, void dragonfly_custom_rsample_rc_fn(router_state * s,
tw_bf * bf, tw_bf * bf,
terminal_message * msg, terminal_custom_message * msg,
tw_lp * lp) tw_lp * lp)
{ {
(void)bf; (void)bf;
...@@ -1679,7 +1679,7 @@ void dragonfly_custom_rsample_rc_fn(router_state * s, ...@@ -1679,7 +1679,7 @@ void dragonfly_custom_rsample_rc_fn(router_state * s,
void dragonfly_custom_rsample_fn(router_state * s, void dragonfly_custom_rsample_fn(router_state * s,
tw_bf * bf, tw_bf * bf,
terminal_message * msg, terminal_custom_message * msg,
tw_lp * lp) tw_lp * lp)