Commit 9afa57d1 authored by Jonathan Jenkins's avatar Jonathan Jenkins

squash warnings

parent 790aa397
...@@ -71,12 +71,12 @@ struct codes_cb_params { ...@@ -71,12 +71,12 @@ struct codes_cb_params {
#define SANITY_CHECK_CB(_cb_info_ptr, _ret_type) \ #define SANITY_CHECK_CB(_cb_info_ptr, _ret_type) \
do { \ do { \
int _total_size = sizeof(_ret_type) + sizeof(int) + sizeof(msg_header);\ assert((_cb_info_ptr)->event_size > 0 && \
int _esize = (_cb_info_ptr)->event_size; \
assert(_esize > 0 && \
(_cb_info_ptr)->header_offset >= 0 && \ (_cb_info_ptr)->header_offset >= 0 && \
(_cb_info_ptr)->tag_offset >= 0 && \ (_cb_info_ptr)->tag_offset >= 0 && \
(_cb_info_ptr)->cb_ret_offset >= 0); \ (_cb_info_ptr)->cb_ret_offset >= 0); \
size_t _total_size = sizeof(_ret_type) + sizeof(int) + sizeof(msg_header);\
size_t _esize = (_cb_info_ptr)->event_size; \
assert(_esize >= _total_size); \ assert(_esize >= _total_size); \
assert(_esize >= (_cb_info_ptr)->header_offset + sizeof(msg_header)); \ assert(_esize >= (_cb_info_ptr)->header_offset + sizeof(msg_header)); \
assert(_esize >= (_cb_info_ptr)->tag_offset + sizeof(int)); \ assert(_esize >= (_cb_info_ptr)->tag_offset + sizeof(int)); \
......
...@@ -11,6 +11,9 @@ ...@@ -11,6 +11,9 @@
#include <ross.h> #include <ross.h>
#include <assert.h> #include <assert.h>
// for printf conversions: shorthand for cast to long long unsigned format (llu)
#define LLU(x) ((unsigned long long)(x))
// simple deprecation attribute hacking // simple deprecation attribute hacking
#if !defined(DEPRECATED) #if !defined(DEPRECATED)
# if defined(__GNUC__) || defined(__GNUG__) || defined(__clang__) # if defined(__GNUC__) || defined(__GNUG__) || defined(__clang__)
......
...@@ -308,7 +308,7 @@ static void check_add_lp_type_anno( ...@@ -308,7 +308,7 @@ static void check_add_lp_type_anno(
int lp_name_offset, int lp_name_offset,
int anno_offset, int anno_offset,
config_lpgroups_t *lpgroups){ config_lpgroups_t *lpgroups){
uint64_t lpt_anno = 0; int lpt_anno = 0;
for (; lpt_anno < lpgroups->lpannos_count; lpt_anno++){ for (; lpt_anno < lpgroups->lpannos_count; lpt_anno++){
config_anno_map_t *map = &lpgroups->lpannos[lpt_anno]; config_anno_map_t *map = &lpgroups->lpannos[lpt_anno];
if (map->lp_name.offset == lp_name_offset){ if (map->lp_name.offset == lp_name_offset){
...@@ -381,7 +381,7 @@ int configuration_get_lpgroups (ConfigHandle *handle, ...@@ -381,7 +381,7 @@ int configuration_get_lpgroups (ConfigHandle *handle,
SectionEntry subse[10]; SectionEntry subse[10];
size_t se_count = 10; size_t se_count = 10;
size_t subse_count = 10; size_t subse_count = 10;
int i, j, lpt; size_t i, j, lpt;
char data[256]; char data[256];
// buffer mgmt vars // buffer mgmt vars
int num_uniq_group_names = 0; int num_uniq_group_names = 0;
...@@ -591,7 +591,7 @@ int configuration_get_lpgroups (ConfigHandle *handle, ...@@ -591,7 +591,7 @@ int configuration_get_lpgroups (ConfigHandle *handle,
int configuration_get_annotation_index(const char * anno, int configuration_get_annotation_index(const char * anno,
const config_anno_map_t * anno_map){ const config_anno_map_t * anno_map){
if (anno == NULL) return -1; if (anno == NULL) return -1;
for (uint64_t i = 0; i < anno_map->num_annos; i++){ for (int i = 0; i < anno_map->num_annos; i++){
if (!strcmp(anno, anno_map->annotations[i].ptr)){ if (!strcmp(anno, anno_map->annotations[i].ptr)){
return (int)i; return (int)i;
} }
......
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
/* number of LPs assigned to the current PE (abstraction of MPI rank). /* number of LPs assigned to the current PE (abstraction of MPI rank).
* for lp counts which are not divisible by the number of ranks, keep * for lp counts which are not divisible by the number of ranks, keep
* modulus around */ * modulus around */
static int lps_per_pe_floor = 0; static tw_lpid lps_per_pe_floor = 0;
static int lps_leftover = 0; static tw_lpid lps_leftover = 0;
static int mem_factor = 256; static int mem_factor = 256;
...@@ -71,13 +71,13 @@ int codes_mapping_get_lps_for_pe() ...@@ -71,13 +71,13 @@ int codes_mapping_get_lps_for_pe()
#if CODES_MAPPING_DEBUG #if CODES_MAPPING_DEBUG
printf("%d lps for rank %d\n", lps_per_pe_floor+(g_tw_mynode < lps_leftover), rank); printf("%d lps for rank %d\n", lps_per_pe_floor+(g_tw_mynode < lps_leftover), rank);
#endif #endif
return lps_per_pe_floor + (g_tw_mynode < lps_leftover); return lps_per_pe_floor + ((tw_lpid)g_tw_mynode < lps_leftover);
} }
/* Takes the global LP ID and returns the rank (PE id) on which the LP is mapped */ /* Takes the global LP ID and returns the rank (PE id) on which the LP is mapped */
tw_peid codes_mapping( tw_lpid gid) tw_peid codes_mapping( tw_lpid gid)
{ {
int lps_on_pes_with_leftover = lps_leftover * (lps_per_pe_floor+1); tw_lpid lps_on_pes_with_leftover = lps_leftover * (lps_per_pe_floor+1);
if (gid < lps_on_pes_with_leftover){ if (gid < lps_on_pes_with_leftover){
return gid / (lps_per_pe_floor+1); return gid / (lps_per_pe_floor+1);
} }
...@@ -453,7 +453,7 @@ static void codes_mapping_init(void) ...@@ -453,7 +453,7 @@ static void codes_mapping_init(void)
tw_lpid ross_gid, ross_lid; /* ross global and local IDs */ tw_lpid ross_gid, ross_lid; /* ross global and local IDs */
tw_pe * pe; tw_pe * pe;
char lp_type_name[MAX_NAME_LENGTH]; char lp_type_name[MAX_NAME_LENGTH];
int nkp_per_pe = g_tw_nkp; tw_lpid nkp_per_pe = g_tw_nkp;
tw_lpid lpid, kpid; tw_lpid lpid, kpid;
const tw_lptype *lptype; const tw_lptype *lptype;
...@@ -461,9 +461,9 @@ static void codes_mapping_init(void) ...@@ -461,9 +461,9 @@ static void codes_mapping_init(void)
for(kpid = 0; kpid < nkp_per_pe; kpid++) for(kpid = 0; kpid < nkp_per_pe; kpid++)
tw_kp_onpe(kpid, g_tw_pe[0]); tw_kp_onpe(kpid, g_tw_pe[0]);
int lp_start = tw_lpid lp_start =
g_tw_mynode * lps_per_pe_floor + mini(g_tw_mynode,lps_leftover); g_tw_mynode * lps_per_pe_floor + mini(g_tw_mynode,lps_leftover);
int lp_end = tw_lpid lp_end =
(g_tw_mynode+1) * lps_per_pe_floor + mini(g_tw_mynode+1,lps_leftover); (g_tw_mynode+1) * lps_per_pe_floor + mini(g_tw_mynode+1,lps_leftover);
for (lpid = lp_start; lpid < lp_end; lpid++) for (lpid = lp_start; lpid < lp_end; lpid++)
...@@ -549,7 +549,7 @@ void codes_mapping_setup_with_seed_offset(int offset) ...@@ -549,7 +549,7 @@ void codes_mapping_setup_with_seed_offset(int offset)
// an "offset" < 0 is ignored // an "offset" < 0 is ignored
if (offset > 0){ if (offset > 0){
for (tw_lpid l = 0; l < g_tw_nlp; l++){ for (tw_lpid l = 0; l < g_tw_nlp; l++){
for (int i = 0; i < g_tw_nRNG_per_lp; i++){ for (unsigned int i = 0; i < g_tw_nRNG_per_lp; i++){
tw_rand_initial_seed(&g_tw_lp[l]->rng[i], (g_tw_lp[l]->gid + tw_rand_initial_seed(&g_tw_lp[l]->rng[i], (g_tw_lp[l]->gid +
global_nlps * offset) * g_tw_nRNG_per_lp + i); global_nlps * offset) * g_tw_nRNG_per_lp + i);
} }
...@@ -597,7 +597,7 @@ const char* codes_mapping_get_annotation_by_lpid(tw_lpid gid){ ...@@ -597,7 +597,7 @@ const char* codes_mapping_get_annotation_by_lpid(tw_lpid gid){
*/ */
const config_anno_map_t * const config_anno_map_t *
codes_mapping_get_lp_anno_map(const char *lp_name){ codes_mapping_get_lp_anno_map(const char *lp_name){
for (uint64_t i = 0; i < lpconf.lpannos_count; i++){ for (int i = 0; i < lpconf.lpannos_count; i++){
if (strcmp(lp_name, lpconf.lpannos[i].lp_name.ptr) == 0){ if (strcmp(lp_name, lpconf.lpannos[i].lp_name.ptr) == 0){
return &lpconf.lpannos[i]; return &lpconf.lpannos[i];
} }
......
...@@ -56,6 +56,7 @@ static int jobmap_identity_to_global(struct codes_jobmap_id id, void const * ctx ...@@ -56,6 +56,7 @@ static int jobmap_identity_to_global(struct codes_jobmap_id id, void const * ctx
int jobmap_identity_get_num_jobs(void const * ctx) int jobmap_identity_get_num_jobs(void const * ctx)
{ {
(void)ctx;
return 1; return 1;
} }
......
...@@ -192,7 +192,7 @@ static tw_stime transfer_time_table (lsm_state_t *ns, ...@@ -192,7 +192,7 @@ static tw_stime transfer_time_table (lsm_state_t *ns,
double disk_rate; double disk_rate;
double disk_seek; double disk_seek;
double disk_overhead; double disk_overhead;
int i; unsigned int i;
/* find nearest size rounded down. */ /* find nearest size rounded down. */
for (i = 0; i < ns->model->bins; i++) for (i = 0; i < ns->model->bins; i++)
...@@ -600,6 +600,7 @@ static void handle_io_request(lsm_state_t *ns, ...@@ -600,6 +600,7 @@ static void handle_io_request(lsm_state_t *ns,
lsm_message_t *m_in, lsm_message_t *m_in,
tw_lp *lp) tw_lp *lp)
{ {
(void)b;
tw_stime queue_time, t_time; tw_stime queue_time, t_time;
tw_event *e; tw_event *e;
lsm_message_t *m_out; lsm_message_t *m_out;
...@@ -670,6 +671,8 @@ static void handle_rev_io_request(lsm_state_t *ns, ...@@ -670,6 +671,8 @@ static void handle_rev_io_request(lsm_state_t *ns,
lsm_message_t *m_in, lsm_message_t *m_in,
tw_lp *lp) tw_lp *lp)
{ {
(void)b;
(void)lp;
lsm_stats_t *stat; lsm_stats_t *stat;
stat = find_stats(data->category, ns); stat = find_stats(data->category, ns);
...@@ -808,7 +811,7 @@ static void read_config(ConfigHandle *ch, char const * anno, disk_model_t *model ...@@ -808,7 +811,7 @@ static void read_config(ConfigHandle *ch, char const * anno, disk_model_t *model
model->request_sizes = (unsigned int*)malloc(sizeof(int)*length); model->request_sizes = (unsigned int*)malloc(sizeof(int)*length);
assert(model->request_sizes); assert(model->request_sizes);
model->bins = length; model->bins = length;
for (int i = 0; i < length; i++) for (size_t i = 0; i < length; i++)
{ {
model->request_sizes[i] = atoi(values[i]); model->request_sizes[i] = atoi(values[i]);
} }
...@@ -821,7 +824,7 @@ static void read_config(ConfigHandle *ch, char const * anno, disk_model_t *model ...@@ -821,7 +824,7 @@ static void read_config(ConfigHandle *ch, char const * anno, disk_model_t *model
model->write_rates = (double*)malloc(sizeof(double)*length); model->write_rates = (double*)malloc(sizeof(double)*length);
assert(model->write_rates); assert(model->write_rates);
assert(length == model->bins); assert(length == model->bins);
for (int i = 0; i < length; i++) for (size_t i = 0; i < length; i++)
{ {
model->write_rates[i] = strtod(values[i], NULL); model->write_rates[i] = strtod(values[i], NULL);
} }
...@@ -834,7 +837,7 @@ static void read_config(ConfigHandle *ch, char const * anno, disk_model_t *model ...@@ -834,7 +837,7 @@ static void read_config(ConfigHandle *ch, char const * anno, disk_model_t *model
model->read_rates = (double*)malloc(sizeof(double)*length); model->read_rates = (double*)malloc(sizeof(double)*length);
assert(model->read_rates); assert(model->read_rates);
assert(model->bins == length); assert(model->bins == length);
for (int i = 0; i < length; i++) for (size_t i = 0; i < length; i++)
{ {
model->read_rates[i] = strtod(values[i], NULL); model->read_rates[i] = strtod(values[i], NULL);
} }
...@@ -847,7 +850,7 @@ static void read_config(ConfigHandle *ch, char const * anno, disk_model_t *model ...@@ -847,7 +850,7 @@ static void read_config(ConfigHandle *ch, char const * anno, disk_model_t *model
model->write_overheads = (double*)malloc(sizeof(double)*length); model->write_overheads = (double*)malloc(sizeof(double)*length);
assert(model->write_overheads); assert(model->write_overheads);
assert(model->bins == length); assert(model->bins == length);
for (int i = 0; i < length; i++) for (size_t i = 0; i < length; i++)
{ {
model->write_overheads[i] = strtod(values[i], NULL); model->write_overheads[i] = strtod(values[i], NULL);
} }
...@@ -860,7 +863,7 @@ static void read_config(ConfigHandle *ch, char const * anno, disk_model_t *model ...@@ -860,7 +863,7 @@ static void read_config(ConfigHandle *ch, char const * anno, disk_model_t *model
model->read_overheads = (double*)malloc(sizeof(double)*length); model->read_overheads = (double*)malloc(sizeof(double)*length);
assert(model->read_overheads); assert(model->read_overheads);
assert(model->bins == length); assert(model->bins == length);
for (int i = 0; i < length; i++) for (size_t i = 0; i < length; i++)
{ {
model->read_overheads[i] = strtod(values[i], NULL); model->read_overheads[i] = strtod(values[i], NULL);
} }
...@@ -873,7 +876,7 @@ static void read_config(ConfigHandle *ch, char const * anno, disk_model_t *model ...@@ -873,7 +876,7 @@ static void read_config(ConfigHandle *ch, char const * anno, disk_model_t *model
model->write_seeks = (double*)malloc(sizeof(double)*length); model->write_seeks = (double*)malloc(sizeof(double)*length);
assert(model->write_seeks); assert(model->write_seeks);
assert(model->bins == length); assert(model->bins == length);
for (int i = 0; i < length; i++) for (size_t i = 0; i < length; i++)
{ {
model->write_seeks[i] = strtod(values[i], NULL); model->write_seeks[i] = strtod(values[i], NULL);
} }
...@@ -886,7 +889,7 @@ static void read_config(ConfigHandle *ch, char const * anno, disk_model_t *model ...@@ -886,7 +889,7 @@ static void read_config(ConfigHandle *ch, char const * anno, disk_model_t *model
model->read_seeks = (double*)malloc(sizeof(double)*length); model->read_seeks = (double*)malloc(sizeof(double)*length);
assert(model->read_seeks); assert(model->read_seeks);
assert(model->bins == length); assert(model->bins == length);
for (int i = 0; i < length; i++) for (size_t i = 0; i < length; i++)
{ {
model->read_seeks[i] = strtod(values[i], NULL); model->read_seeks[i] = strtod(values[i], NULL);
} }
...@@ -914,7 +917,7 @@ void lsm_configure(void) ...@@ -914,7 +917,7 @@ void lsm_configure(void)
read_config(&config, NULL, &model_unanno); read_config(&config, NULL, &model_unanno);
} }
for (uint64_t i = 0; i < anno_map->num_annos; i++){ for (int i = 0; i < anno_map->num_annos; i++){
char const * anno = anno_map->annotations[i].ptr; char const * anno = anno_map->annotations[i].ptr;
read_config(&config, anno, &models_anno[i]); read_config(&config, anno, &models_anno[i]);
} }
......
...@@ -8,7 +8,8 @@ ...@@ -8,7 +8,8 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/types.h> #include <sys/types.h>
#include "codes/lp-io.h" #include <codes/lp-io.h>
#include <codes/codes.h>
struct io_buffer struct io_buffer
{ {
...@@ -116,8 +117,8 @@ int lp_io_write_rev(tw_lpid gid, char* identifier){ ...@@ -116,8 +117,8 @@ int lp_io_write_rev(tw_lpid gid, char* identifier){
id = id->next; id = id->next;
} }
if (!id){ if (!id){
fprintf(stderr, "Error: identifier %s not found on reverse for LP %lu.", fprintf(stderr, "Error: identifier %s not found on reverse for LP %llu.",
identifier,gid); identifier,LLU(gid));
return(-1); return(-1);
} }
...@@ -131,7 +132,7 @@ int lp_io_write_rev(tw_lpid gid, char* identifier){ ...@@ -131,7 +132,7 @@ int lp_io_write_rev(tw_lpid gid, char* identifier){
buf = buf->next; buf = buf->next;
} }
if (!buf){ if (!buf){
fprintf(stderr, "Error: no lp-io write buffer found for LP %lu (reverse write)\n", gid); fprintf(stderr, "Error: no lp-io write buffer found for LP %llu (reverse write)\n", LLU(gid));
return(-1); return(-1);
} }
......
...@@ -237,9 +237,10 @@ static void handle_resource_free( ...@@ -237,9 +237,10 @@ static void handle_resource_free(
tw_bf * b, tw_bf * b,
resource_msg * m, resource_msg * m,
tw_lp * lp){ tw_lp * lp){
(void)b;
assert(!resource_free(m->i.req, m->i.tok, &ns->r)); assert(!resource_free(m->i.req, m->i.tok, &ns->r));
/* create an event to pop the next queue item */ /* create an event to pop the next queue item */
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);
resource_msg *m_deq = (resource_msg*)tw_event_data(e); resource_msg *m_deq = (resource_msg*)tw_event_data(e);
msg_set_header(resource_magic, RESOURCE_DEQ, lp->gid, &m_deq->i.h); msg_set_header(resource_magic, RESOURCE_DEQ, lp->gid, &m_deq->i.h);
m_deq->i.tok = m->i.tok; /* only tok is needed, all others grabbed from q */ m_deq->i.tok = m->i.tok; /* only tok is needed, all others grabbed from q */
...@@ -250,6 +251,7 @@ static void handle_resource_free_rc( ...@@ -250,6 +251,7 @@ static void handle_resource_free_rc(
tw_bf * b, tw_bf * b,
resource_msg * m, resource_msg * m,
tw_lp * lp){ tw_lp * lp){
(void)b;
assert(!resource_get(m->i.req, m->i.tok, &ns->r)); assert(!resource_get(m->i.req, m->i.tok, &ns->r));
codes_local_latency_reverse(lp); codes_local_latency_reverse(lp);
} }
...@@ -281,7 +283,7 @@ static void handle_resource_deq( ...@@ -281,7 +283,7 @@ static void handle_resource_deq(
resource_response(&p->m.cb, lp, ret, TOKEN_DUMMY); resource_response(&p->m.cb, lp, ret, TOKEN_DUMMY);
free(p); free(p);
/* additionally attempt to dequeue next one down */ /* additionally attempt to dequeue next one down */
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);
resource_msg *m_deq = (resource_msg*)tw_event_data(e); resource_msg *m_deq = (resource_msg*)tw_event_data(e);
msg_set_header(resource_magic, RESOURCE_DEQ, lp->gid, &m_deq->i.h); msg_set_header(resource_magic, RESOURCE_DEQ, lp->gid, &m_deq->i.h);
/* only tok is needed, all others grabbed from q */ /* only tok is needed, all others grabbed from q */
...@@ -320,6 +322,7 @@ static void handle_resource_reserve( ...@@ -320,6 +322,7 @@ static void handle_resource_reserve(
tw_bf * b, tw_bf * b,
resource_msg * m, resource_msg * m,
tw_lp * lp){ tw_lp * lp){
(void)b;
resource_token_t tok; resource_token_t tok;
int ret = resource_reserve(m->i.req, &tok, &ns->r); int ret = resource_reserve(m->i.req, &tok, &ns->r);
assert(!ret); assert(!ret);
...@@ -330,6 +333,7 @@ static void handle_resource_reserve_rc( ...@@ -330,6 +333,7 @@ static void handle_resource_reserve_rc(
tw_bf * b, tw_bf * b,
resource_msg * m, resource_msg * m,
tw_lp * lp){ tw_lp * lp){
(void)b;
/* this reversal method is essentially a hack that relies on each /* this reversal method is essentially a hack that relies on each
* sequential reserve appending to the end of the list * sequential reserve appending to the end of the list
* - we expect reserves to happen strictly at the beginning of the * - we expect reserves to happen strictly at the beginning of the
...@@ -395,8 +399,8 @@ void resource_finalize( ...@@ -395,8 +399,8 @@ void resource_finalize(
struct qlist_head *ent; struct qlist_head *ent;
for (int i = 0; i < MAX_RESERVE+1; i++){ for (int i = 0; i < MAX_RESERVE+1; i++){
qlist_for_each(ent, &ns->pending[i]){ qlist_for_each(ent, &ns->pending[i]){
fprintf(stderr, "WARNING: resource LP %lu has a pending allocation\n", fprintf(stderr, "WARNING: resource LP %llu has a pending allocation\n",
lp->gid); LLU(lp->gid));
} }
} }
...@@ -408,12 +412,12 @@ void resource_finalize( ...@@ -408,12 +412,12 @@ void resource_finalize(
"# format: <LP> <max used general> <max used token...>\n"); "# format: <LP> <max used general> <max used token...>\n");
lp_io_write(lp->gid, RESOURCE_LP_NM, written, out_buf); lp_io_write(lp->gid, RESOURCE_LP_NM, written, out_buf);
} }
written = sprintf(out_buf, "%lu", lp->gid); written = sprintf(out_buf, "%llu", LLU(lp->gid));
// compute peak resource usage // compute peak resource usage
// TODO: wrap this up in the resource interface // TODO: wrap this up in the resource interface
for (int i = 0; i < ns->r.num_tokens+1; i++){ for (unsigned i = 0; i < ns->r.num_tokens+1; i++){
written += sprintf(out_buf+written, " %lu", ns->r.max[i]-ns->r.min_avail[i]); written += sprintf(out_buf+written, " %llu", LLU(ns->r.max[i]-ns->r.min_avail[i]));
} }
written += sprintf(out_buf+written, "\n"); written += sprintf(out_buf+written, "\n");
lp_io_write(lp->gid, RESOURCE_LP_NM, written, out_buf); lp_io_write(lp->gid, RESOURCE_LP_NM, written, out_buf);
...@@ -452,7 +456,7 @@ void resource_lp_configure(){ ...@@ -452,7 +456,7 @@ void resource_lp_configure(){
assert(avail > 0); assert(avail > 0);
avail_unanno = (uint64_t)avail; avail_unanno = (uint64_t)avail;
} }
for (uint64_t i = 0; i < anno_map->num_annos; i++){ for (int i = 0; i < anno_map->num_annos; i++){
ret = configuration_get_value_longint(&config, RESOURCE_LP_NM, ret = configuration_get_value_longint(&config, RESOURCE_LP_NM,
"available", anno_map->annotations[i].ptr, &avail); "available", anno_map->annotations[i].ptr, &avail);
if (ret){ if (ret){
......
...@@ -60,18 +60,22 @@ static void template_finalize( ...@@ -60,18 +60,22 @@ static void template_finalize(
/* event type handlers */ /* event type handlers */
static void handle_template_a( static void handle_template_a(
template_state * ns, template_state * ns,
tw_bf * b,
template_msg * m, template_msg * m,
tw_lp * lp); tw_lp * lp);
static void handle_template_b( static void handle_template_b(
template_state * ns, template_state * ns,
tw_bf * b,
template_msg * m, template_msg * m,
tw_lp * lp); tw_lp * lp);
static void handle_template_a_rev( static void handle_template_a_rev(
template_state * ns, template_state * ns,
tw_bf * b,
template_msg * m, template_msg * m,
tw_lp * lp); tw_lp * lp);
static void handle_template_b_rev( static void handle_template_b_rev(
template_state * ns, template_state * ns,
tw_bf * b,
template_msg * m, template_msg * m,
tw_lp * lp); tw_lp * lp);
...@@ -102,6 +106,8 @@ void template_init(){ ...@@ -102,6 +106,8 @@ void template_init(){
void template_lp_init( void template_lp_init(
template_state * ns, template_state * ns,
tw_lp * lp){ tw_lp * lp){
(void)ns; // avoid warnings...
(void)lp;
/* Fill me in... */ /* Fill me in... */
} }
...@@ -114,10 +120,10 @@ void template_event_handler( ...@@ -114,10 +120,10 @@ void template_event_handler(
switch (m->event_type){ switch (m->event_type){
case TEMPLATE_A: case TEMPLATE_A:
handle_template_a(ns, m, lp); handle_template_a(ns, b, m, lp);
break; break;
case TEMPLATE_B: case TEMPLATE_B:
handle_template_b(ns, m, lp); handle_template_b(ns, b, m, lp);
break; break;
/* ... */ /* ... */
default: default:
...@@ -135,10 +141,10 @@ void template_rev_handler( ...@@ -135,10 +141,10 @@ void template_rev_handler(
switch (m->event_type){ switch (m->event_type){
case TEMPLATE_A: case TEMPLATE_A:
handle_template_a_rev(ns, m, lp); handle_template_a_rev(ns, b, m, lp);
break; break;
case TEMPLATE_B: case TEMPLATE_B:
handle_template_b_rev(ns, m, lp); handle_template_b_rev(ns, b, m, lp);
break; break;
/* ... */ /* ... */
default: default:
...@@ -150,33 +156,55 @@ void template_rev_handler( ...@@ -150,33 +156,55 @@ void template_rev_handler(
void template_finalize( void template_finalize(
template_state * ns, template_state * ns,
tw_lp * lp){ tw_lp * lp){
(void)ns; // avoid warnings...
(void)lp;
/* Fill me in... */ /* Fill me in... */
} }
/* event type handlers */ /* event type handlers */
void handle_template_a( void handle_template_a(
template_state * ns, template_state * ns,
tw_bf * b,
template_msg * m, template_msg * m,
tw_lp * lp){ tw_lp * lp){
(void)ns; // avoid warnings...
(void)b;
(void)m;
(void)lp;
} }
void handle_template_b( void handle_template_b(
template_state * ns, template_state * ns,
tw_bf * b,
template_msg * m, template_msg * m,
tw_lp * lp){ tw_lp * lp){
(void)ns; // avoid warnings...
(void)b;
(void)m;
(void)lp;
} }
void handle_template_a_rev( void handle_template_a_rev(
template_state * ns, template_state * ns,
tw_bf * b,
template_msg * m, template_msg * m,
tw_lp * lp){ tw_lp * lp){
(void)ns; // avoid warnings...
(void)b;
(void)m;
(void)lp;
} }
void handle_template_b_rev( void handle_template_b_rev(
template_state * ns, template_state * ns,
tw_bf * b,
template_msg * m, template_msg * m,
tw_lp * lp){ tw_lp * lp){
(void)ns; // avoid warnings...
(void)b;
(void)m;
(void)lp;
} }
/**** END IMPLEMENTATIONS ****/ /**** END IMPLEMENTATIONS ****/
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
*/ */
#include "lp_template.h" #include "lp_template.h"
int main(int argc, char *argv[]) int main()
{ {
/* won't actually be called - just here to make linker happy */ /* won't actually be called - just here to make linker happy */
template_init(); template_init();
......
...@@ -7,7 +7,8 @@ ...@@ -7,7 +7,8 @@
#include <assert.h> #include <assert.h>
#include <getopt.h> #include <getopt.h>
#include <stdio.h> #include <stdio.h>
#include "codes/codes-workload.h" #include <codes/codes-workload.h>
#include <codes/codes.h>
#include <inttypes.h> #include <inttypes.h>
static char type[128] = {'\0'}; static char type[128] = {'\0'};
......
...@@ -6,8 +6,9 @@ ...@@ -6,8 +6,9 @@
#include <assert.h>