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 @@ ...@@ -13,6 +13,7 @@
// for printf conversions: shorthand for cast to long long unsigned format (llu) // for printf conversions: shorthand for cast to long long unsigned format (llu)
#define LLU(x) ((unsigned long long)(x)) #define LLU(x) ((unsigned long long)(x))
#define LLD(x) ((long long)(x))
// simple deprecation attribute hacking // simple deprecation attribute hacking
#if !defined(DEPRECATED) #if !defined(DEPRECATED)
......
...@@ -51,7 +51,7 @@ struct terminal_message ...@@ -51,7 +51,7 @@ struct terminal_message
int last_hop; int last_hop;
/* For routing */ /* For routing */
int intm_group_id; int intm_group_id;
int chunk_id; uint64_t chunk_id;
uint64_t packet_size; uint64_t packet_size;
uint64_t message_id; uint64_t message_id;
uint64_t total_size; uint64_t total_size;
......
...@@ -79,7 +79,7 @@ struct nodes_message ...@@ -79,7 +79,7 @@ struct nodes_message
int saved_queue; int saved_queue;
/* chunk id of the flit (distinguishes flits) */ /* chunk id of the flit (distinguishes flits) */
int chunk_id; uint64_t chunk_id;
model_net_event_return event_rc; model_net_event_return event_rc;
int is_pull; int is_pull;
......
This diff is collapsed.
...@@ -187,22 +187,18 @@ tw_lptype loggp_lp = { ...@@ -187,22 +187,18 @@ tw_lptype loggp_lp = {
static void handle_msg_ready_rev_event( static void handle_msg_ready_rev_event(
loggp_state * ns, loggp_state * ns,
tw_bf * b,
loggp_message * m, loggp_message * m,
tw_lp * lp); tw_lp * lp);
static void handle_msg_ready_event( static void handle_msg_ready_event(
loggp_state * ns, loggp_state * ns,
tw_bf * b,
loggp_message * m, loggp_message * m,
tw_lp * lp); tw_lp * lp);
static void handle_msg_start_rev_event( static void handle_msg_start_rev_event(
loggp_state * ns, loggp_state * ns,
tw_bf * b,
loggp_message * m, loggp_message * m,
tw_lp * lp); tw_lp * lp);
static void handle_msg_start_event( static void handle_msg_start_event(
loggp_state * ns, loggp_state * ns,
tw_bf * b,
loggp_message * m, loggp_message * m,
tw_lp * lp); tw_lp * lp);
...@@ -272,15 +268,16 @@ static void loggp_event( ...@@ -272,15 +268,16 @@ static void loggp_event(
loggp_message * m, loggp_message * m,
tw_lp * lp) tw_lp * lp)
{ {
(void)b; // not using bitfields
assert(m->magic == loggp_magic); assert(m->magic == loggp_magic);
switch (m->event_type) switch (m->event_type)
{ {
case LG_MSG_START: case LG_MSG_START:
handle_msg_start_event(ns, b, m, lp); handle_msg_start_event(ns, m, lp);
break; break;
case LG_MSG_READY: case LG_MSG_READY:
handle_msg_ready_event(ns, b, m, lp); handle_msg_ready_event(ns, m, lp);
break; break;
default: default:
assert(0); assert(0);
...@@ -294,15 +291,16 @@ static void loggp_rev_event( ...@@ -294,15 +291,16 @@ static void loggp_rev_event(
loggp_message * m, loggp_message * m,
tw_lp * lp) tw_lp * lp)
{ {
(void)b; // not using bitfields
assert(m->magic == loggp_magic); assert(m->magic == loggp_magic);
switch (m->event_type) switch (m->event_type)
{ {
case LG_MSG_START: case LG_MSG_START:
handle_msg_start_rev_event(ns, b, m, lp); handle_msg_start_rev_event(ns, m, lp);
break; break;
case LG_MSG_READY: case LG_MSG_READY:
handle_msg_ready_rev_event(ns, b, m, lp); handle_msg_ready_rev_event(ns, m, lp);
break; break;
default: default:
assert(0); assert(0);
...@@ -328,7 +326,6 @@ int loggp_get_magic() ...@@ -328,7 +326,6 @@ int loggp_get_magic()
/* reverse computation for msg ready event */ /* reverse computation for msg ready event */
static void handle_msg_ready_rev_event( static void handle_msg_ready_rev_event(
loggp_state * ns, loggp_state * ns,
tw_bf * b,
loggp_message * m, loggp_message * m,
tw_lp * lp) tw_lp * lp)
{ {
...@@ -364,7 +361,6 @@ static void handle_msg_ready_rev_event( ...@@ -364,7 +361,6 @@ static void handle_msg_ready_rev_event(
*/ */
static void handle_msg_ready_event( static void handle_msg_ready_event(
loggp_state * ns, loggp_state * ns,
tw_bf * b,
loggp_message * m, loggp_message * m,
tw_lp * lp) tw_lp * lp)
{ {
...@@ -450,7 +446,6 @@ static void handle_msg_ready_event( ...@@ -450,7 +446,6 @@ static void handle_msg_ready_event(
/* reverse computation for msg start event */ /* reverse computation for msg start event */
static void handle_msg_start_rev_event( static void handle_msg_start_rev_event(
loggp_state * ns, loggp_state * ns,
tw_bf * b,
loggp_message * m, loggp_message * m,
tw_lp * lp) tw_lp * lp)
{ {
...@@ -488,7 +483,6 @@ static void handle_msg_start_rev_event( ...@@ -488,7 +483,6 @@ static void handle_msg_start_rev_event(
*/ */
static void handle_msg_start_event( static void handle_msg_start_event(
loggp_state * ns, loggp_state * ns,
tw_bf * b,
loggp_message * m, loggp_message * m,
tw_lp * lp) tw_lp * lp)
{ {
...@@ -611,6 +605,7 @@ static tw_stime loggp_packet_event( ...@@ -611,6 +605,7 @@ static tw_stime loggp_packet_event(
tw_lp *sender, tw_lp *sender,
int is_last_pckt) int is_last_pckt)
{ {
(void)message_offset;
tw_event * e_new; tw_event * e_new;
tw_stime xfer_to_nic_time; tw_stime xfer_to_nic_time;
loggp_message * msg; loggp_message * msg;
...@@ -718,7 +713,7 @@ static void loggp_configure(){ ...@@ -718,7 +713,7 @@ static void loggp_configure(){
num_params = anno_map->num_annos + (anno_map->has_unanno_lp > 0); num_params = anno_map->num_annos + (anno_map->has_unanno_lp > 0);
all_params = malloc(num_params * sizeof(*all_params)); 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; const char * anno = anno_map->annotations[i].ptr;
int rc = configuration_get_value_relpath(&config, "PARAMS", int rc = configuration_get_value_relpath(&config, "PARAMS",
"net_config_file", anno, config_file, MAX_NAME_LENGTH); "net_config_file", anno, config_file, MAX_NAME_LENGTH);
......
...@@ -463,7 +463,7 @@ void handle_sched_next( ...@@ -463,7 +463,7 @@ void handle_sched_next(
// For all others, we need to schedule the next packet // For all others, we need to schedule the next packet
// immediately // immediately
else if (ns->net_id == SIMPLEP2P || ns->net_id == TORUS){ 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); poffset+codes_local_latency(lp), lp);
model_net_wrap_msg *m_wrap = tw_event_data(e); model_net_wrap_msg *m_wrap = tw_event_data(e);
msg_set_header(model_net_base_magic, MN_BASE_SCHED_NEXT, lp->gid, msg_set_header(model_net_base_magic, MN_BASE_SCHED_NEXT, lp->gid,
......
...@@ -8,9 +8,10 @@ ...@@ -8,9 +8,10 @@
#include <assert.h> #include <assert.h>
#include "model-net-sched-impl.h" #include "model-net-sched-impl.h"
#include "codes/model-net-sched.h" #include <codes/model-net-sched.h>
#include "codes/model-net-method.h" #include <codes/model-net-method.h>
#include "codes/quicklist.h" #include <codes/quicklist.h>
#include <codes/codes.h>
#define MN_SCHED_DEBUG_VERBOSE 0 #define MN_SCHED_DEBUG_VERBOSE 0
...@@ -162,6 +163,7 @@ void fcfs_init( ...@@ -162,6 +163,7 @@ void fcfs_init(
const model_net_sched_cfg_params * params, const model_net_sched_cfg_params * params,
int is_recv_queue, int is_recv_queue,
void ** sched){ void ** sched){
(void)params; // unused for fcfs
*sched = malloc(sizeof(mn_sched_queue)); *sched = malloc(sizeof(mn_sched_queue));
mn_sched_queue *ss = *sched; mn_sched_queue *ss = *sched;
ss->method = method; ss->method = method;
...@@ -184,6 +186,7 @@ void fcfs_add ( ...@@ -184,6 +186,7 @@ void fcfs_add (
void * sched, void * sched,
model_net_sched_rc * rc, model_net_sched_rc * rc,
tw_lp * lp){ tw_lp * lp){
(void)rc; // unneeded for fcfs
mn_sched_qitem *q = malloc(sizeof(mn_sched_qitem)); mn_sched_qitem *q = malloc(sizeof(mn_sched_qitem));
q->entry_time = tw_now(lp); q->entry_time = tw_now(lp);
q->req = *req; q->req = *req;
...@@ -202,19 +205,20 @@ void fcfs_add ( ...@@ -202,19 +205,20 @@ void fcfs_add (
mn_sched_queue *s = sched; mn_sched_queue *s = sched;
s->queue_len++; s->queue_len++;
qlist_add_tail(&q->ql, &s->reqs); qlist_add_tail(&q->ql, &s->reqs);
dprintf("%lu (mn): adding %srequest from %lu to %lu, size %lu, at %lf\n", dprintf("%llu (mn): adding %srequest from %llu to %llu, size %llu, at %lf\n",
lp->gid, req->is_pull ? "pull " : "", req->src_lp, LLU(lp->gid), req->is_pull ? "pull " : "", LLU(req->src_lp),
req->final_dest_lp, req->msg_size, tw_now(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 fcfs_add_rc(void *sched, const model_net_sched_rc *rc, tw_lp *lp){
(void)rc;
mn_sched_queue *s = sched; mn_sched_queue *s = sched;
s->queue_len--; s->queue_len--;
struct qlist_head *ent = qlist_pop_back(&s->reqs); struct qlist_head *ent = qlist_pop_back(&s->reqs);
assert(ent != NULL); assert(ent != NULL);
mn_sched_qitem *q = qlist_entry(ent, mn_sched_qitem, ql); mn_sched_qitem *q = qlist_entry(ent, mn_sched_qitem, ql);
dprintf("%lu (mn): rc adding request from %lu to %lu\n", lp->gid, dprintf("%llu (mn): rc adding request from %llu to %llu\n", LLU(lp->gid),
q->req.src_lp, q->req.final_dest_lp); LLU(q->req.src_lp), LLU(q->req.final_dest_lp));
// free'ing NULLs is a no-op // free'ing NULLs is a no-op
free(q->remote_event); free(q->remote_event);
free(q->local_event); free(q->local_event);
...@@ -248,10 +252,10 @@ int fcfs_next( ...@@ -248,10 +252,10 @@ int fcfs_next(
} }
if (s->is_recv_queue){ if (s->is_recv_queue){
dprintf("%lu (mn): receiving message of size %lu (of %lu) " dprintf("%llu (mn): receiving message of size %llu (of %llu) "
"from %lu to %lu at %1.5e (last:%d)\n", "from %llu to %llu at %1.5e (last:%d)\n",
lp->gid, psize, q->rem, q->req.src_lp, q->req.final_dest_lp, LLU(lp->gid), LLU(psize), LLU(q->rem), LLU(q->req.src_lp),
tw_now(lp), is_last_packet); 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 // note: we overloaded on the dest_mn_lp field - it's the dest of the
// soruce in the case of a pull // soruce in the case of a pull
*poffset = s->method->model_net_method_recv_msg_event(q->req.category, *poffset = s->method->model_net_method_recv_msg_event(q->req.category,
...@@ -260,10 +264,10 @@ int fcfs_next( ...@@ -260,10 +264,10 @@ int fcfs_next(
q->remote_event, q->req.src_lp, lp); q->remote_event, q->req.src_lp, lp);
} }
else{ else{
dprintf("%lu (mn): issuing packet of size %lu (of %lu) " dprintf("%llu (mn): issuing packet of size %llu (of %llu) "
"from %lu to %lu at %1.5e (last:%d)\n", "from %llu to %llu at %1.5e (last:%d)\n",
lp->gid, psize, q->rem, q->req.src_lp, q->req.final_dest_lp, LLU(lp->gid), LLU(psize), q->rem, LLU(q->req.src_lp),
tw_now(lp), is_last_packet); LLU(q->req.final_dest_lp), tw_now(lp), is_last_packet);
*poffset = s->method->model_net_method_packet_event(&q->req, *poffset = s->method->model_net_method_packet_event(&q->req,
q->req.msg_size - q->rem, psize, 0.0, &q->sched_params, q->req.msg_size - q->rem, psize, 0.0, &q->sched_params,
q->remote_event, q->local_event, lp, is_last_packet); q->remote_event, q->local_event, lp, is_last_packet);
...@@ -271,10 +275,10 @@ int fcfs_next( ...@@ -271,10 +275,10 @@ int fcfs_next(
// if last packet - remove from list, free, save for rc // if last packet - remove from list, free, save for rc
if (is_last_packet){ 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 ", s->is_recv_queue ? "recv " : "send ",
lp->gid, q->req.src_lp, q->req.final_dest_lp, LLU(lp->gid), LLU(q->req.src_lp), LLU(q->req.final_dest_lp),
q->req.is_pull ? q->req.pull_size : q->req.msg_size, tw_now(lp), LLU(q->req.is_pull ? q->req.pull_size : q->req.msg_size), tw_now(lp),
q->req.is_pull); q->req.is_pull);
qlist_pop(&s->reqs); qlist_pop(&s->reqs);
s->queue_len--; s->queue_len--;
...@@ -311,11 +315,11 @@ void fcfs_next_rc( ...@@ -311,11 +315,11 @@ void fcfs_next_rc(
} }
else{ else{
if (s->is_recv_queue){ 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); s->method->model_net_method_recv_msg_event_rc(lp);
} }
else { 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); s->method->model_net_method_packet_event_rc(lp);
} }
if (rc->rtn == 0){ if (rc->rtn == 0){
...@@ -465,10 +469,10 @@ void prio_add ( ...@@ -465,10 +469,10 @@ void prio_add (
prio = ss->params.num_prios-1; prio = ss->params.num_prios-1;
} }
else if (prio >= ss->params.num_prios){ else if (prio >= ss->params.num_prios){
tw_error(TW_LOC, "sched for lp %lu: invalid prio (%d vs [%d,%d))", tw_error(TW_LOC, "sched for lp %llu: invalid prio (%d vs [%d,%d))",
lp->gid, prio, 0, ss->params.num_prios); 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, ss->sub_sched_iface->add(req, sched_params, remote_event_size,
remote_event, local_event_size, local_event, ss->sub_scheds[prio], remote_event, local_event_size, local_event, ss->sub_scheds[prio],
rc, lp); rc, lp);
...@@ -478,7 +482,7 @@ void prio_add ( ...@@ -478,7 +482,7 @@ void prio_add (
void prio_add_rc(void * sched, const model_net_sched_rc *rc, tw_lp *lp){ void prio_add_rc(void * sched, const model_net_sched_rc *rc, tw_lp *lp){
// just call the sub scheduler's add_rc // just call the sub scheduler's add_rc
mn_sched_prio *ss = sched; 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); ss->sub_sched_iface->add_rc(ss->sub_scheds[rc->prio], rc, lp);
} }
......
...@@ -480,12 +480,15 @@ void model_net_event_rc( ...@@ -480,12 +480,15 @@ void model_net_event_rc(
int net_id, int net_id,
tw_lp *sender, tw_lp *sender,
uint64_t message_size){ uint64_t message_size){
(void)net_id;
(void)message_size;
model_net_event_impl_base_rc(sender); model_net_event_impl_base_rc(sender);
} }
void model_net_pull_event_rc( void model_net_pull_event_rc(
int net_id, int net_id,
tw_lp *sender) { tw_lp *sender) {
(void)net_id;
model_net_event_impl_base_rc(sender); model_net_event_impl_base_rc(sender);
} }
...@@ -524,17 +527,18 @@ void model_net_set_msg_param( ...@@ -524,17 +527,18 @@ void model_net_set_msg_param(
/* returns the message size, can be either simplenet, dragonfly or torus message size*/ /* returns the message size, can be either simplenet, dragonfly or torus message size*/
int model_net_get_msg_sz(int net_id) int model_net_get_msg_sz(int net_id)
{ {
// TODO: Add checks on network name (void)net_id;
// TODO: Add dragonfly and torus network models // TODO: Add checks on network name
return sizeof(model_net_wrap_msg); // TODO: Add dragonfly and torus network models
return sizeof(model_net_wrap_msg);
#if 0 #if 0
if(net_id < 0 || net_id >= MAX_NETS) if(net_id < 0 || net_id >= MAX_NETS)
{ {
printf("%s Error: Uninitializied modelnet network, call modelnet_init first\n", __FUNCTION__); printf("%s Error: Uninitializied modelnet network, call modelnet_init first\n", __FUNCTION__);
exit(-1); exit(-1);
} }
return method_array[net_id]->mn_get_msg_sz(); return method_array[net_id]->mn_get_msg_sz();
#endif #endif
} }
......
...@@ -154,22 +154,18 @@ tw_lptype sn_lp = { ...@@ -154,22 +154,18 @@ tw_lptype sn_lp = {
static tw_stime rate_to_ns(uint64_t 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,
sn_message * m, sn_message * m,
tw_lp * lp); tw_lp * lp);
static void handle_msg_ready_event( static void handle_msg_ready_event(
sn_state * ns, sn_state * ns,
tw_bf * b,
sn_message * m, sn_message * m,
tw_lp * lp); tw_lp * lp);
static void handle_msg_start_rev_event( static void handle_msg_start_rev_event(
sn_state * ns, sn_state * ns,
tw_bf * b,
sn_message * m, sn_message * m,
tw_lp * lp); tw_lp * lp);
static void handle_msg_start_event( static void handle_msg_start_event(
sn_state * ns, sn_state * ns,
tw_bf * b,
sn_message * m, sn_message * m,
tw_lp * lp); tw_lp * lp);
...@@ -238,15 +234,16 @@ static void sn_event( ...@@ -238,15 +234,16 @@ static void sn_event(
sn_message * m, sn_message * m,
tw_lp * lp) tw_lp * lp)
{ {
(void)b; // bitflags aren't used in simplenet
assert(m->magic == sn_magic); assert(m->magic == sn_magic);
switch (m->event_type) switch (m->event_type)
{ {
case SN_MSG_START: case SN_MSG_START:
handle_msg_start_event(ns, b, m, lp); handle_msg_start_event(ns, m, lp);
break; break;
case SN_MSG_READY: case SN_MSG_READY:
handle_msg_ready_event(ns, b, m, lp); handle_msg_ready_event(ns, m, lp);
break; break;
default: default:
assert(0); assert(0);
...@@ -260,15 +257,16 @@ static void sn_rev_event( ...@@ -260,15 +257,16 @@ static void sn_rev_event(
sn_message * m, sn_message * m,
tw_lp * lp) tw_lp * lp)
{ {
(void)b;
assert(m->magic == sn_magic); assert(m->magic == sn_magic);
switch (m->event_type) switch (m->event_type)
{ {
case SN_MSG_START: case SN_MSG_START:
handle_msg_start_rev_event(ns, b, m, lp); handle_msg_start_rev_event(ns, m, lp);
break; break;
case SN_MSG_READY: case SN_MSG_READY:
handle_msg_ready_rev_event(ns, b, m, lp); handle_msg_ready_rev_event(ns, m, lp);
break; break;
default: default:
assert(0); assert(0);
...@@ -309,7 +307,6 @@ static tw_stime rate_to_ns(uint64_t bytes, double MB_p_s) ...@@ -309,7 +307,6 @@ static tw_stime rate_to_ns(uint64_t bytes, double MB_p_s)
/* reverse computation for msg ready event */ /* reverse computation for msg ready event */
static void handle_msg_ready_rev_event( static void handle_msg_ready_rev_event(
sn_state * ns, sn_state * ns,
tw_bf * b,
sn_message * m, sn_message * m,
tw_lp * lp) tw_lp * lp)
{ {
...@@ -334,7 +331,6 @@ static void handle_msg_ready_rev_event( ...@@ -334,7 +331,6 @@ static void handle_msg_ready_rev_event(
*/ */
static void handle_msg_ready_event( static void handle_msg_ready_event(
sn_state * ns, sn_state * ns,
tw_bf * b,
sn_message * m, sn_message * m,
tw_lp * lp) tw_lp * lp)
{ {
...@@ -397,7 +393,6 @@ static void handle_msg_ready_event( ...@@ -397,7 +393,6 @@ static void handle_msg_ready_event(
/* reverse computation for msg start event */ /* reverse computation for msg start event */
static void handle_msg_start_rev_event( static void handle_msg_start_rev_event(
sn_state * ns, sn_state * ns,
tw_bf * b,
sn_message * m, sn_message * m,
tw_lp * lp) tw_lp * lp)
{ {
...@@ -424,7 +419,6 @@ static void handle_msg_start_rev_event( ...@@ -424,7 +419,6 @@ static void handle_msg_start_rev_event(
*/ */
static void handle_msg_start_event( static void handle_msg_start_event(
sn_state * ns, sn_state * ns,
tw_bf * b,
sn_message * m, sn_message * m,
tw_lp * lp) tw_lp * lp)
{ {
...@@ -524,6 +518,9 @@ static tw_stime simplenet_packet_event( ...@@ -524,6 +518,9 @@ static tw_stime simplenet_packet_event(
tw_lp *sender, tw_lp *sender,
int is_last_pckt) int is_last_pckt)
{ {
(void)message_offset; // unused...
(void)sched_params; // unused...
tw_event * e_new; tw_event * e_new;
tw_stime xfer_to_nic_time; tw_stime xfer_to_nic_time;
sn_message * msg; sn_message * msg;
...@@ -572,7 +569,7 @@ static void sn_configure() ...@@ -572,7 +569,7 @@ static void sn_configure()
assert(anno_map); assert(anno_map);
num_params = anno_map->num_annos + (anno_map->has_unanno_lp > 0); num_params = anno_map->num_annos + (anno_map->has_unanno_lp > 0);
all_params = malloc(num_params * sizeof(*all_params)); 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; const char * anno = anno_map->annotations[i].ptr;
int rc; int rc;
rc = configuration_get_value_double(&config, "PARAMS", rc = configuration_get_value_double(&config, "PARAMS",
......
...@@ -184,22 +184,18 @@ tw_lptype sp_lp = { ...@@ -184,22 +184,18 @@ tw_lptype sp_lp = {
static tw_stime rate_to_ns(uint64_t 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(
sp_state * ns, sp_state * ns,
tw_bf * b,
sp_message * m, sp_message * m,
tw_lp * lp); tw_lp * lp);
static void handle_msg_ready_event( static void handle_msg_ready_event(
sp_state * ns, sp_state * ns,
tw_bf * b,
sp_message * m, sp_message * m,
tw_lp * lp); tw_lp * lp);
static void handle_msg_start_rev_event( static void handle_msg_start_rev_event(
sp_state * ns, sp_state * ns,
tw_bf * b,
sp_message * m, sp_message * m,
tw_lp * lp); tw_lp * lp);
static void handle_msg_start_event( static void handle_msg_start_event(
sp_state * ns, sp_state * ns,
tw_bf * b,
sp_message * m, sp_message * m,
tw_lp * lp); tw_lp * lp);
...@@ -316,16 +312,20 @@ static void sp_set_params( ...@@ -316,16 +312,20 @@ static void sp_set_params(
tw_error(TW_LOC, "simplep2p: unable to open %s", bw_fname); tw_error(TW_LOC, "simplep2p: unable to open %s", bw_fname);
fseek(sf, 0, SEEK_END); fseek(sf, 0, SEEK_END);
fsize_s = ftell(sf); fsize_s = ftell(sf);
assert(fsize_s >= 0);
fseek(sf, 0, SEEK_SET); fseek(sf, 0, SEEK_SET);
fseek(bf, 0, SEEK_END); fseek(bf, 0, SEEK_END);
fsize_b = ftell(bf); fsize_b = ftell(bf);
assert(fsize_b >= 0);
fseek(bf, 0, SEEK_SET); fseek(bf, 0, SEEK_SET);
char *sbuf = malloc(fsize_s+1); char *sbuf = malloc(fsize_s+1);
sbuf[fsize_s] = '\0'; sbuf[fsize_s] = '\0';
char *bbuf = malloc(fsize_b+1); char *bbuf = malloc(fsize_b+1);
bbuf[fsize_b] = '\0'; bbuf[fsize_b] = '\0';
assert(fread(sbuf, 1, fsize_s, sf) == fsize_s); size_t ret = fread(sbuf, 1, fsize_s, sf);
assert(fread(bbuf, 1, fsize_b, bf) == fsize_b); assert(ret == (size_t)fsize_s);