Commit 1916b7e7 authored by Philip Carns's avatar Philip Carns

output some timing information for validation

parent 7d2a86f0
......@@ -168,6 +168,17 @@ static void client_finalize(
client_state * ns,
tw_lp * lp)
{
char buffer[256];
int ret;
/* write out some statistics (the current time of each cn as it
* shuts down)
*/
sprintf(buffer, "cn_lp:%ld\tfinalize_time:%f\n", (long)lp->gid, tw_now(lp));
ret = lp_io_write(lp->gid, "compute_nodes", strlen(buffer)+1, buffer);
assert(ret == 0);
return;
}
......@@ -312,12 +323,12 @@ static void cn_enter_barrier(tw_lp *lp, tw_lpid gid, int count)
}
void cn_op_complete(tw_lp *lp, tw_lpid gid)
void cn_op_complete(tw_lp *lp, tw_stime svc_time, tw_lpid gid)
{
tw_event *e;
client_msg *m;
e = codes_event_new(gid, codes_local_latency(lp), lp);
e = codes_event_new(gid, codes_local_latency(lp) + svc_time, lp);
m = tw_event_data(e);
m->event_type = CLIENT_OP_COMPLETE;
tw_event_send(e);
......
......@@ -12,7 +12,7 @@
extern tw_lptype client_lp;
void cn_op_complete(tw_lp *lp, tw_lpid gid);
void cn_op_complete(tw_lp *lp, tw_stime svc_time, tw_lpid gid);
void cn_op_complete_rc(tw_lp *lp);
void cn_set_params(int num_clients, int num_servers);
......
......@@ -125,32 +125,17 @@ static void svr_finalize(
svr_state * ns,
tw_lp * lp)
{
#if 0
char buffer[256];
int ret;
sprintf(buffer, "LP %ld finalize data\n", (long)lp->gid);
/* write out some statistics (the current time of each server as it
* shuts down)
*/
sprintf(buffer, "svr_lp:%ld\tfinalize_time:%f\n", (long)lp->gid, tw_now(lp));
/* test having everyone write to same identifier */
ret = lp_io_write(lp->gid, "node_state_pointers", strlen(buffer)+1, buffer);
ret = lp_io_write(lp->gid, "servers", strlen(buffer)+1, buffer);
assert(ret == 0);
/* test having only one lp write to a particular identifier */
if(lp->gid == 3)
{
ret = lp_io_write(lp->gid, "subset_example", strlen(buffer)+1, buffer);
assert(ret == 0);
}
/* test having one lp write two buffers to the same id */
if(lp->gid == 5)
{
sprintf(buffer, "LP %ld finalize data (intentional duplicate)\n", (long)lp->gid);
ret = lp_io_write(lp->gid, "node_state_pointers", strlen(buffer)+1, buffer);
assert(ret == 0);
}
#endif
return;
}
......@@ -184,10 +169,13 @@ static void handle_svr_op_event(
svr_msg * m,
tw_lp * lp)
{
/* TODO: fill in some stub service time */
/* NOTE: this isn't a real server simulator, but we do want time to
* elapse so that we can do correctness/regression testing. We pick the
* service time by using the op type as the elapsed time.
*/
/* send event back to cn to let it know the operation is done */
cn_op_complete(lp, m->src);
cn_op_complete(lp, m->op.op_type, m->src);
return;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment