Commit 3059a209 authored by Jonathan Jenkins's avatar Jonathan Jenkins

warning squash modelnet (didn't touch the workload programs)

parent aa8aca21
......@@ -13,6 +13,7 @@
// for printf conversions: shorthand for cast to long long unsigned format (llu)
#define LLU(x) ((unsigned long long)(x))
#define LLD(x) ((long long)(x))
// simple deprecation attribute hacking
#if !defined(DEPRECATED)
......
......@@ -51,7 +51,7 @@ struct terminal_message
int last_hop;
/* For routing */
int intm_group_id;
int chunk_id;
uint64_t chunk_id;
uint64_t packet_size;
uint64_t message_id;
uint64_t total_size;
......
......@@ -79,7 +79,7 @@ struct nodes_message
int saved_queue;
/* chunk id of the flit (distinguishes flits) */
int chunk_id;
uint64_t chunk_id;
model_net_event_return event_rc;
int is_pull;
......
This diff is collapsed.
......@@ -187,22 +187,18 @@ tw_lptype loggp_lp = {
static void handle_msg_ready_rev_event(
loggp_state * ns,
tw_bf * b,
loggp_message * m,
tw_lp * lp);
static void handle_msg_ready_event(
loggp_state * ns,
tw_bf * b,
loggp_message * m,
tw_lp * lp);
static void handle_msg_start_rev_event(
loggp_state * ns,
tw_bf * b,
loggp_message * m,
tw_lp * lp);
static void handle_msg_start_event(
loggp_state * ns,
tw_bf * b,
loggp_message * m,
tw_lp * lp);
......@@ -272,15 +268,16 @@ static void loggp_event(
loggp_message * m,
tw_lp * lp)
{
(void)b; // not using bitfields
assert(m->magic == loggp_magic);
switch (m->event_type)
{
case LG_MSG_START:
handle_msg_start_event(ns, b, m, lp);
handle_msg_start_event(ns, m, lp);
break;
case LG_MSG_READY:
handle_msg_ready_event(ns, b, m, lp);
handle_msg_ready_event(ns, m, lp);
break;
default:
assert(0);
......@@ -294,15 +291,16 @@ static void loggp_rev_event(
loggp_message * m,
tw_lp * lp)
{
(void)b; // not using bitfields
assert(m->magic == loggp_magic);
switch (m->event_type)
{
case LG_MSG_START:
handle_msg_start_rev_event(ns, b, m, lp);
handle_msg_start_rev_event(ns, m, lp);
break;
case LG_MSG_READY:
handle_msg_ready_rev_event(ns, b, m, lp);
handle_msg_ready_rev_event(ns, m, lp);
break;
default:
assert(0);
......@@ -328,7 +326,6 @@ int loggp_get_magic()
/* reverse computation for msg ready event */
static void handle_msg_ready_rev_event(
loggp_state * ns,
tw_bf * b,
loggp_message * m,
tw_lp * lp)
{
......@@ -364,7 +361,6 @@ static void handle_msg_ready_rev_event(
*/
static void handle_msg_ready_event(
loggp_state * ns,
tw_bf * b,
loggp_message * m,
tw_lp * lp)
{
......@@ -450,7 +446,6 @@ static void handle_msg_ready_event(
/* reverse computation for msg start event */
static void handle_msg_start_rev_event(
loggp_state * ns,
tw_bf * b,
loggp_message * m,
tw_lp * lp)
{
......@@ -488,7 +483,6 @@ static void handle_msg_start_rev_event(
*/
static void handle_msg_start_event(
loggp_state * ns,
tw_bf * b,
loggp_message * m,
tw_lp * lp)
{
......@@ -611,6 +605,7 @@ static tw_stime loggp_packet_event(
tw_lp *sender,
int is_last_pckt)
{
(void)message_offset;
tw_event * e_new;
tw_stime xfer_to_nic_time;
loggp_message * msg;
......@@ -718,7 +713,7 @@ static void loggp_configure(){
num_params = anno_map->num_annos + (anno_map->has_unanno_lp > 0);
all_params = malloc(num_params * sizeof(*all_params));
for (uint64_t i = 0; i < anno_map->num_annos; i++){
for (int i = 0; i < anno_map->num_annos; i++){
const char * anno = anno_map->annotations[i].ptr;
int rc = configuration_get_value_relpath(&config, "PARAMS",
"net_config_file", anno, config_file, MAX_NAME_LENGTH);
......
......@@ -463,7 +463,7 @@ void handle_sched_next(
// For all others, we need to schedule the next packet
// immediately
else if (ns->net_id == SIMPLEP2P || ns->net_id == TORUS){
tw_event *e = codes_event_new(lp->gid,
tw_event *e = tw_event_new(lp->gid,
poffset+codes_local_latency(lp), lp);
model_net_wrap_msg *m_wrap = tw_event_data(e);
msg_set_header(model_net_base_magic, MN_BASE_SCHED_NEXT, lp->gid,
......
......@@ -8,9 +8,10 @@
#include <assert.h>
#include "model-net-sched-impl.h"
#include "codes/model-net-sched.h"
#include "codes/model-net-method.h"
#include "codes/quicklist.h"
#include <codes/model-net-sched.h>
#include <codes/model-net-method.h>
#include <codes/quicklist.h>
#include <codes/codes.h>
#define MN_SCHED_DEBUG_VERBOSE 0
......@@ -162,6 +163,7 @@ void fcfs_init(
const model_net_sched_cfg_params * params,
int is_recv_queue,
void ** sched){
(void)params; // unused for fcfs
*sched = malloc(sizeof(mn_sched_queue));
mn_sched_queue *ss = *sched;
ss->method = method;
......@@ -184,6 +186,7 @@ void fcfs_add (
void * sched,
model_net_sched_rc * rc,
tw_lp * lp){
(void)rc; // unneeded for fcfs
mn_sched_qitem *q = malloc(sizeof(mn_sched_qitem));
q->entry_time = tw_now(lp);
q->req = *req;
......@@ -202,19 +205,20 @@ void fcfs_add (
mn_sched_queue *s = sched;
s->queue_len++;
qlist_add_tail(&q->ql, &s->reqs);
dprintf("%lu (mn): adding %srequest from %lu to %lu, size %lu, at %lf\n",
lp->gid, req->is_pull ? "pull " : "", req->src_lp,
req->final_dest_lp, req->msg_size, tw_now(lp));
dprintf("%llu (mn): adding %srequest from %llu to %llu, size %llu, at %lf\n",
LLU(lp->gid), req->is_pull ? "pull " : "", LLU(req->src_lp),
LLU(req->final_dest_lp), LLU(req->msg_size), tw_now(lp));
}
void fcfs_add_rc(void *sched, const model_net_sched_rc *rc, tw_lp *lp){
(void)rc;
mn_sched_queue *s = sched;
s->queue_len--;
struct qlist_head *ent = qlist_pop_back(&s->reqs);
assert(ent != NULL);
mn_sched_qitem *q = qlist_entry(ent, mn_sched_qitem, ql);
dprintf("%lu (mn): rc adding request from %lu to %lu\n", lp->gid,
q->req.src_lp, q->req.final_dest_lp);
dprintf("%llu (mn): rc adding request from %llu to %llu\n", LLU(lp->gid),
LLU(q->req.src_lp), LLU(q->req.final_dest_lp));
// free'ing NULLs is a no-op
free(q->remote_event);
free(q->local_event);
......@@ -248,10 +252,10 @@ int fcfs_next(
}
if (s->is_recv_queue){
dprintf("%lu (mn): receiving message of size %lu (of %lu) "
"from %lu to %lu at %1.5e (last:%d)\n",
lp->gid, psize, q->rem, q->req.src_lp, q->req.final_dest_lp,
tw_now(lp), is_last_packet);
dprintf("%llu (mn): receiving message of size %llu (of %llu) "
"from %llu to %llu at %1.5e (last:%d)\n",
LLU(lp->gid), LLU(psize), LLU(q->rem), LLU(q->req.src_lp),
LLU(q->req.final_dest_lp), tw_now(lp), is_last_packet);
// note: we overloaded on the dest_mn_lp field - it's the dest of the
// soruce in the case of a pull
*poffset = s->method->model_net_method_recv_msg_event(q->req.category,
......@@ -260,10 +264,10 @@ int fcfs_next(
q->remote_event, q->req.src_lp, lp);
}
else{
dprintf("%lu (mn): issuing packet of size %lu (of %lu) "
"from %lu to %lu at %1.5e (last:%d)\n",
lp->gid, psize, q->rem, q->req.src_lp, q->req.final_dest_lp,
tw_now(lp), is_last_packet);
dprintf("%llu (mn): issuing packet of size %llu (of %llu) "
"from %llu to %llu at %1.5e (last:%d)\n",
LLU(lp->gid), LLU(psize), q->rem, LLU(q->req.src_lp),
LLU(q->req.final_dest_lp), tw_now(lp), is_last_packet);
*poffset = s->method->model_net_method_packet_event(&q->req,
q->req.msg_size - q->rem, psize, 0.0, &q->sched_params,
q->remote_event, q->local_event, lp, is_last_packet);
......@@ -271,10 +275,10 @@ int fcfs_next(
// if last packet - remove from list, free, save for rc
if (is_last_packet){
dprintf("last %spkt: %lu (%lu) to %lu, size %lu at %1.5e (pull:%d)\n",
dprintf("last %spkt: %llu (%llu) to %llu, size %llu at %1.5e (pull:%d)\n",
s->is_recv_queue ? "recv " : "send ",
lp->gid, q->req.src_lp, q->req.final_dest_lp,
q->req.is_pull ? q->req.pull_size : q->req.msg_size, tw_now(lp),
LLU(lp->gid), LLU(q->req.src_lp), LLU(q->req.final_dest_lp),
LLU(q->req.is_pull ? q->req.pull_size : q->req.msg_size), tw_now(lp),
q->req.is_pull);
qlist_pop(&s->reqs);
s->queue_len--;
......@@ -311,11 +315,11 @@ void fcfs_next_rc(
}
else{
if (s->is_recv_queue){
dprintf("%lu (mn): rc receiving message\n", lp->gid);
dprintf("%llu (mn): rc receiving message\n", LLU(lp->gid));
s->method->model_net_method_recv_msg_event_rc(lp);
}
else {
dprintf("%lu (mn): rc issuing packet\n", lp->gid);
dprintf("%llu (mn): rc issuing packet\n", LLU(lp->gid));
s->method->model_net_method_packet_event_rc(lp);
}
if (rc->rtn == 0){
......@@ -465,10 +469,10 @@ void prio_add (
prio = ss->params.num_prios-1;
}
else if (prio >= ss->params.num_prios){
tw_error(TW_LOC, "sched for lp %lu: invalid prio (%d vs [%d,%d))",
lp->gid, prio, 0, ss->params.num_prios);
tw_error(TW_LOC, "sched for lp %llu: invalid prio (%d vs [%d,%d))",
LLU(lp->gid), prio, 0, ss->params.num_prios);
}
dprintf("%lu (mn): adding with prio %d\n", lp->gid, prio);
dprintf("%llu (mn): adding with prio %d\n", LLU(lp->gid), prio);
ss->sub_sched_iface->add(req, sched_params, remote_event_size,
remote_event, local_event_size, local_event, ss->sub_scheds[prio],
rc, lp);
......@@ -478,7 +482,7 @@ void prio_add (
void prio_add_rc(void * sched, const model_net_sched_rc *rc, tw_lp *lp){
// just call the sub scheduler's add_rc
mn_sched_prio *ss = sched;
dprintf("%lu (mn): rc adding with prio %d\n", lp->gid, rc->prio);
dprintf("%llu (mn): rc adding with prio %d\n", LLU(lp->gid), rc->prio);
ss->sub_sched_iface->add_rc(ss->sub_scheds[rc->prio], rc, lp);
}
......
......@@ -480,12 +480,15 @@ void model_net_event_rc(
int net_id,
tw_lp *sender,
uint64_t message_size){
(void)net_id;
(void)message_size;
model_net_event_impl_base_rc(sender);
}
void model_net_pull_event_rc(
int net_id,
tw_lp *sender) {
(void)net_id;
model_net_event_impl_base_rc(sender);
}
......@@ -524,6 +527,7 @@ void model_net_set_msg_param(
/* returns the message size, can be either simplenet, dragonfly or torus message size*/
int model_net_get_msg_sz(int net_id)
{
(void)net_id;
// TODO: Add checks on network name
// TODO: Add dragonfly and torus network models
return sizeof(model_net_wrap_msg);
......
......@@ -154,22 +154,18 @@ tw_lptype sn_lp = {
static tw_stime rate_to_ns(uint64_t bytes, double MB_p_s);
static void handle_msg_ready_rev_event(
sn_state * ns,
tw_bf * b,
sn_message * m,
tw_lp * lp);
static void handle_msg_ready_event(
sn_state * ns,
tw_bf * b,
sn_message * m,
tw_lp * lp);
static void handle_msg_start_rev_event(
sn_state * ns,
tw_bf * b,
sn_message * m,
tw_lp * lp);
static void handle_msg_start_event(
sn_state * ns,
tw_bf * b,
sn_message * m,
tw_lp * lp);
......@@ -238,15 +234,16 @@ static void sn_event(
sn_message * m,
tw_lp * lp)
{
(void)b; // bitflags aren't used in simplenet
assert(m->magic == sn_magic);
switch (m->event_type)
{
case SN_MSG_START:
handle_msg_start_event(ns, b, m, lp);
handle_msg_start_event(ns, m, lp);
break;
case SN_MSG_READY:
handle_msg_ready_event(ns, b, m, lp);
handle_msg_ready_event(ns, m, lp);
break;
default:
assert(0);
......@@ -260,15 +257,16 @@ static void sn_rev_event(
sn_message * m,
tw_lp * lp)
{
(void)b;
assert(m->magic == sn_magic);
switch (m->event_type)
{
case SN_MSG_START:
handle_msg_start_rev_event(ns, b, m, lp);
handle_msg_start_rev_event(ns, m, lp);
break;
case SN_MSG_READY:
handle_msg_ready_rev_event(ns, b, m, lp);
handle_msg_ready_rev_event(ns, m, lp);
break;
default:
assert(0);
......@@ -309,7 +307,6 @@ static tw_stime rate_to_ns(uint64_t bytes, double MB_p_s)
/* reverse computation for msg ready event */
static void handle_msg_ready_rev_event(
sn_state * ns,
tw_bf * b,
sn_message * m,
tw_lp * lp)
{
......@@ -334,7 +331,6 @@ static void handle_msg_ready_rev_event(
*/
static void handle_msg_ready_event(
sn_state * ns,
tw_bf * b,
sn_message * m,
tw_lp * lp)
{
......@@ -397,7 +393,6 @@ static void handle_msg_ready_event(
/* reverse computation for msg start event */
static void handle_msg_start_rev_event(
sn_state * ns,
tw_bf * b,
sn_message * m,
tw_lp * lp)
{
......@@ -424,7 +419,6 @@ static void handle_msg_start_rev_event(
*/
static void handle_msg_start_event(
sn_state * ns,
tw_bf * b,
sn_message * m,
tw_lp * lp)
{
......@@ -524,6 +518,9 @@ static tw_stime simplenet_packet_event(
tw_lp *sender,
int is_last_pckt)
{
(void)message_offset; // unused...
(void)sched_params; // unused...
tw_event * e_new;
tw_stime xfer_to_nic_time;
sn_message * msg;
......@@ -572,7 +569,7 @@ static void sn_configure()
assert(anno_map);
num_params = anno_map->num_annos + (anno_map->has_unanno_lp > 0);
all_params = malloc(num_params * sizeof(*all_params));
for (uint64_t i = 0; i < anno_map->num_annos; i++){
for (int i = 0; i < anno_map->num_annos; i++){
const char * anno = anno_map->annotations[i].ptr;
int rc;
rc = configuration_get_value_double(&config, "PARAMS",
......
......@@ -184,22 +184,18 @@ tw_lptype sp_lp = {
static tw_stime rate_to_ns(uint64_t bytes, double MB_p_s);
static void handle_msg_ready_rev_event(
sp_state * ns,
tw_bf * b,
sp_message * m,
tw_lp * lp);
static void handle_msg_ready_event(
sp_state * ns,
tw_bf * b,
sp_message * m,
tw_lp * lp);
static void handle_msg_start_rev_event(
sp_state * ns,
tw_bf * b,
sp_message * m,
tw_lp * lp);
static void handle_msg_start_event(
sp_state * ns,
tw_bf * b,
sp_message * m,
tw_lp * lp);
......@@ -316,16 +312,20 @@ static void sp_set_params(
tw_error(TW_LOC, "simplep2p: unable to open %s", bw_fname);
fseek(sf, 0, SEEK_END);
fsize_s = ftell(sf);
assert(fsize_s >= 0);
fseek(sf, 0, SEEK_SET);
fseek(bf, 0, SEEK_END);
fsize_b = ftell(bf);
assert(fsize_b >= 0);
fseek(bf, 0, SEEK_SET);
char *sbuf = malloc(fsize_s+1);
sbuf[fsize_s] = '\0';
char *bbuf = malloc(fsize_b+1);
bbuf[fsize_b] = '\0';
assert(fread(sbuf, 1, fsize_s, sf) == fsize_s);
assert(fread(bbuf, 1, fsize_b, bf) == fsize_b);
size_t ret = fread(sbuf, 1, fsize_s, sf);
assert(ret == (size_t)fsize_s);
ret = fread(bbuf, 1, fsize_b, bf);
assert(ret == (size_t)fsize_b);
fclose(sf);
fclose(bf);
......@@ -413,15 +413,16 @@ static void sp_event(
sp_message * m,
tw_lp * lp)
{
(void)b;
assert(m->magic == sp_magic);
switch (m->event_type)
{
case SP_MSG_START:
handle_msg_start_event(ns, b, m, lp);
handle_msg_start_event(ns, m, lp);
break;
case SP_MSG_READY:
handle_msg_ready_event(ns, b, m, lp);
handle_msg_ready_event(ns, m, lp);
break;
default:
assert(0);
......@@ -435,15 +436,16 @@ static void sp_rev_event(
sp_message * m,
tw_lp * lp)
{
(void)b;
assert(m->magic == sp_magic);
switch (m->event_type)
{
case SP_MSG_START:
handle_msg_start_rev_event(ns, b, m, lp);
handle_msg_start_rev_event(ns, m, lp);
break;
case SP_MSG_READY:
handle_msg_ready_rev_event(ns, b, m, lp);
handle_msg_ready_rev_event(ns, m, lp);
break;
default:
assert(0);
......@@ -496,7 +498,6 @@ static tw_stime rate_to_ns(uint64_t bytes, double MB_p_s)
/* reverse computation for msg ready event */
static void handle_msg_ready_rev_event(
sp_state * ns,
tw_bf * b,
sp_message * m,
tw_lp * lp)
{
......@@ -525,7 +526,6 @@ static void handle_msg_ready_rev_event(
*/
static void handle_msg_ready_event(
sp_state * ns,
tw_bf * b,
sp_message * m,
tw_lp * lp)
{
......@@ -542,8 +542,8 @@ static void handle_msg_ready_event(
// printf("\n LP %d outgoing bandwidth with LP %d is %f ", ns->id, m->src_mn_rel_id, bw);
if (bw <= 0.0 || latency < 0.0){
fprintf(stderr,
"Invalid link from Rel. id %d to LP %lu (rel. id %d)\n",
m->src_mn_rel_id, lp->gid, ns->id);
"Invalid link from Rel. id %d to LP %llu (rel. id %d)\n",
m->src_mn_rel_id, LLU(lp->gid), ns->id);
abort();
}
......@@ -633,7 +633,6 @@ static void handle_msg_ready_event(
/* reverse computation for msg start event */
static void handle_msg_start_rev_event(
sp_state * ns,
tw_bf * b,
sp_message * m,
tw_lp * lp)
{
......@@ -662,7 +661,6 @@ static void handle_msg_start_rev_event(
*/
static void handle_msg_start_event(
sp_state * ns,
tw_bf * b,
sp_message * m,
tw_lp * lp)
{
......@@ -689,8 +687,8 @@ static void handle_msg_start_event(
//printf("\n LP %d incoming bandwidth with LP %d is %f ", ns->id, dest_rel_id, bw);
if (bw <= 0.0 || latency < 0.0){
fprintf(stderr,
"Invalid link from LP %lu (rel. id %d) to LP %lu (rel. id %d)\n",
lp->gid, ns->id, m->dest_mn_lp, dest_rel_id);
"Invalid link from LP %llu (rel. id %d) to LP %llu (rel. id %d)\n",
LLU(lp->gid), ns->id, LLU(m->dest_mn_lp), dest_rel_id);
abort();
}
......@@ -804,6 +802,8 @@ static tw_stime simplep2p_packet_event(
tw_lp *sender,
int is_last_pckt)
{
(void)message_offset;
(void)sched_params;
tw_event * e_new;
tw_stime xfer_to_nic_time;
sp_message * msg;
......@@ -896,7 +896,7 @@ static void sp_configure(){
assert(anno_map);
num_params = anno_map->num_annos + (anno_map->has_unanno_lp > 0);
all_params = malloc(num_params * sizeof(*all_params));
for (uint64_t i = 0; i < anno_map->num_annos; i++){
for (int i = 0; i < anno_map->num_annos; i++){
sp_read_config(anno_map->annotations[i].ptr, &all_params[i]);
}
if (anno_map->has_unanno_lp > 0){
......
This diff is collapsed.
......@@ -56,6 +56,7 @@ struct testsvr_msg {
int idx_src;
tw_lpid lp_src;
int req_num;
model_net_event_return ret[NUM_REQS];
#if TEST_DEBUG
/* event count that produced this message in the first place */
int src_event_ctr;
......@@ -95,24 +96,20 @@ static void handle_testsvr_req(
tw_lp * lp);
static void handle_testsvr_ack(
testsvr_state * ns,
testsvr_msg * m,
tw_lp * lp);
testsvr_msg * m);
static void handle_testsvr_local(
testsvr_state * ns,
testsvr_msg * m,
tw_lp * lp);
static void handle_testsvr_kickoff_rev(
testsvr_state * ns,
testsvr_msg * m,
tw_lp * lp);
static void handle_testsvr_req_rev(
testsvr_state * ns,
testsvr_msg * m,
tw_lp * lp);
static void handle_testsvr_ack_rev(
testsvr_state * ns,
testsvr_msg * m,
tw_lp * lp);
testsvr_msg * m);
static void handle_testsvr_local_rev(
testsvr_state * ns,
testsvr_msg * m,
......@@ -158,7 +155,7 @@ void testsvr_lp_init(
memset(ns->req_stat, 0x0, NUM_REQS*sizeof(int));
/* create kickoff event only if we're a request server */
if (ns->idx == 0 || ns->idx == 2){
tw_event *e = codes_event_new(lp->gid, codes_local_latency(lp), lp);
tw_event *e = tw_event_new(lp->gid, codes_local_latency(lp), lp);
testsvr_msg *m_local = tw_event_data(e);
m_local->magic = testsvr_magic;
m_local->event_type = KICKOFF;
......@@ -170,7 +167,7 @@ void testsvr_lp_init(
}
#if TEST_DEBUG
char name[32];
sprintf(name, "testsvr.%d.%lu", ns->idx, lp->gid);
sprintf(name, "testsvr.%d.%llu", ns->idx, LLU(lp->gid));
ns->fdebug = fopen(name, "w");
setvbuf(ns->fdebug, NULL, _IONBF, 0);
assert(ns->fdebug != NULL);
......@@ -205,6 +202,7 @@ void testsvr_event_handler(
tw_bf * b,
testsvr_msg * m,
tw_lp * lp){
(void)b;
assert(m->magic == testsvr_magic);
switch (m->event_type){
......@@ -220,7 +218,7 @@ void testsvr_event_handler(
break;
case ACK:
DUMP_PRE(lp,ns,m,"== pre ack ==\n");
handle_testsvr_ack(ns, m, lp);
handle_testsvr_ack(ns, m);
DUMP_POST(lp,ns,"== post ack ==\n");
break;
case LOCAL:
......@@ -240,22 +238,23 @@ void testsvr_rev_handler(
tw_bf * b,
testsvr_msg * m,
tw_lp * lp){
(void)b;
assert(m->magic == testsvr_magic);
switch (m->event_type){
case KICKOFF:
DUMP_PRE(lp,ns,m,"== pre kickoff rev == ");
handle_testsvr_kickoff_rev(ns, m, lp);
handle_testsvr_kickoff_rev(m, lp);
DUMP_POST(lp,ns,"== post kickoff rev ==\n");
break;
case REQ:
DUMP_PRE(lp,ns,m,"== pre req rev ==\n");
handle_testsvr_req_rev(ns, m, lp);
handle_testsvr_req_rev(ns, lp);
DUMP_POST(lp,ns,"== post req rev ==\n");
break;
case ACK:
DUMP_PRE(lp,ns,m,"== pre ack rev ==\n");
handle_testsvr_ack_rev(ns, m, lp);
handle_testsvr_ack_rev(ns, m);
DUMP_POST(lp,ns,"== post ack rev ==\n");
break;
case LOCAL:
......@@ -272,7 +271,8 @@ void testsvr_rev_handler(
void testsvr_finalize(
testsvr_state * ns,
tw_lp * lp){
tw_lp * lp) {
(void)lp;
/* ensure that all requests are accounted for */
int req_expected = (ns->idx == 1) ? 2 : 1;
int req;
......@@ -287,8 +287,7 @@ void handle_testsvr_kickoff(
tw_lp * lp){
assert(ns->idx == 0 || ns->idx == 2);
int req;
for (req = 0; req < NUM_REQS; req++){
for (int req = 0; req < NUM_REQS; req++){
tw_lpid dest_lp = (1) * 2; /* send to server 1 */
testsvr_msg m_net;
m_net.magic = testsvr_magic;
......@@ -299,7 +298,7 @@ void handle_testsvr_kickoff(
m_net.src_event_ctr = ns->event_ctr++;
#endif
m_net.req_num = req;
model_net_event(net_id, "req", dest_lp, 1, 0.0, sizeof(m_net), &m_net, 0, NULL, lp);
m->ret[req] = model_net_event(net_id, "req", dest_lp, 1, 0.0, sizeof(m_net), &m_net, 0, NULL, lp);
}
#if TEST_DEBUG
ns->event_ctr++;
......@@ -314,7 +313,7 @@ void handle_testsvr_req(
/* only server 1 processes requests */
assert(ns->idx == 1);
/* add a random amount of time to it */
tw_event *e = codes_event_new(lp->gid, codes_local_latency(lp), lp);
tw_event *e = tw_event_new(lp->gid, codes_local_latency(lp), lp);
testsvr_msg *m_local = tw_event_data(e);
*m_local = *m;
m_local->event_type = LOCAL;
......@@ -331,8 +330,7 @@ void handle_testsvr_req(
void handle_testsvr_ack(
testsvr_state * ns,
testsvr_msg * m,
tw_lp * lp){
testsvr_msg * m){
/* only servers 0 and 2 handle acks */
assert(ns->idx == 0 || ns->idx == 2);
......@@ -362,7 +360,7 @@ void handle_testsvr_local(
#if TEST_DEBUG
m_net.src_event_ctr = ns->event_ctr;
#endif
model_net_event(net_id, "ack", dest_lp,
m->ret[0] = model_net_event(net_id, "ack", dest_lp,
1, 0.0, sizeof(m_net), &m_net, 0, NULL, lp);
ns->req_stat[m->req_num]++;
/* we are handling exactly two reqs per slot */
......@@ -374,18 +372,16 @@ void handle_testsvr_local(