Commit 25b032ed authored by Jonathan Jenkins's avatar Jonathan Jenkins

put network workload ops in workload dump util

parent 94a3f248
......@@ -54,10 +54,40 @@ int main(int argc, char *argv[])
double total_delay = 0.0;
int64_t num_barriers = 0;
int64_t num_opens = 0;
int64_t num_closes = 0;
int64_t num_reads = 0;
int64_t read_size = 0;
int64_t num_writes = 0;
int64_t write_size = 0;
int64_t num_sends = 0;
int64_t send_size = 0;
int64_t num_recvs = 0;
int64_t recv_size = 0;
int64_t num_isends = 0;
int64_t isend_size = 0;
int64_t num_irecvs = 0;
int64_t irecv_size = 0;
int64_t num_bcasts = 0;
int64_t bcast_size = 0;
int64_t num_allgathers = 0;
int64_t allgather_size = 0;
int64_t num_allgathervs = 0;
int64_t allgatherv_size = 0;
int64_t num_alltoalls = 0;
int64_t alltoall_size = 0;
int64_t num_alltoallvs = 0;
int64_t alltoallv_size = 0;
int64_t num_reduces = 0;
int64_t reduce_size = 0;
int64_t num_allreduces = 0;
int64_t allreduce_size = 0;
int64_t num_collectives = 0;
int64_t collective_size = 0;
int64_t num_waitalls = 0;
int64_t num_waits = 0;
int64_t num_waitsomes = 0;
int64_t num_waitanys = 0;
int64_t num_testalls = 0;
char ch;
while ((ch = getopt_long(argc, argv, "t:n:l:a:m:b:r:sp", long_opts, NULL)) != -1){
......@@ -185,25 +215,94 @@ int main(int argc, char *argv[])
switch(op.op_type)
{
case CODES_WK_OPEN:
num_opens++;
case CODES_WK_DELAY:
total_delay += op.u.delay.seconds;
break;
case CODES_WK_BARRIER:
num_barriers++;
break;
case CODES_WK_DELAY:
total_delay += op.u.delay.seconds;
case CODES_WK_OPEN:
num_opens++;
break;
case CODES_WK_READ:
num_reads++;
read_size += op.u.write.size;
case CODES_WK_CLOSE:
num_closes++;
break;
case CODES_WK_WRITE:
num_writes++;
write_size += op.u.write.size;
break;
default:
case CODES_WK_READ:
num_reads++;
read_size += op.u.write.size;
break;
case CODES_WK_SEND:
num_sends++;
send_size += op.u.send.num_bytes;
break;
case CODES_WK_RECV:
num_recvs++;
recv_size += op.u.recv.num_bytes;
break;
case CODES_WK_ISEND:
num_irecvs++;
irecv_size += op.u.send.num_bytes;
break;
case CODES_WK_IRECV:
num_irecvs++;
irecv_size += op.u.recv.num_bytes;
break;
/* NOTE: all collectives are currently represented as the
* generic "collective" type */
case CODES_WK_BCAST:
num_bcasts++;
bcast_size += op.u.collective.num_bytes;
case CODES_WK_ALLGATHER:
num_allgathers++;
allgather_size += op.u.collective.num_bytes;
break;
case CODES_WK_ALLGATHERV:
num_allgathervs++;
allgatherv_size += op.u.collective.num_bytes;
break;
case CODES_WK_ALLTOALL:
num_alltoalls++;
alltoall_size += op.u.collective.num_bytes;
break;
case CODES_WK_ALLTOALLV:
num_alltoallvs++;
alltoallv_size += op.u.collective.num_bytes;
break;
case CODES_WK_REDUCE:
num_reduces++;
reduce_size += op.u.collective.num_bytes;
break;
case CODES_WK_ALLREDUCE:
num_allreduces++;
allreduce_size += op.u.collective.num_bytes;
break;
case CODES_WK_COL:
num_collectives++;
collective_size += op.u.collective.num_bytes;
break;
case CODES_WK_WAITALL:
num_waitalls++;
break;
case CODES_WK_WAIT:
num_waits++;
break;
case CODES_WK_WAITSOME:
num_waitsomes++;
break;
case CODES_WK_WAITANY:
num_waitanys++;
break;
case CODES_WK_TESTALL:
num_testalls++;
break;
default:
fprintf(stderr,
"WARNING: unknown workload op type (code %d)\n",
op.op_type);
}
} while (op.op_type != CODES_WK_END);
}
......@@ -211,13 +310,43 @@ int main(int argc, char *argv[])
if (print_stats)
{
fprintf(stderr, "\n* * * * * FINAL STATS * * * * * *\n");
fprintf(stderr, "NUM_OPENS:\t%"PRId64"\n", num_opens);
fprintf(stderr, "NUM_BARRIERS:\t%"PRId64"\n", num_barriers);
fprintf(stderr, "TOTAL_DELAY:\t%.4lf\n", total_delay);
fprintf(stderr, "NUM_READS:\t%"PRId64"\n", num_reads);
fprintf(stderr, "READ_SIZE:\t%"PRId64"\n", read_size);
fprintf(stderr, "NUM_WRITES:\t%"PRId64"\n", num_writes);
fprintf(stderr, "WRITE_SIZE:\t%"PRId64"\n", write_size);
fprintf(stderr, "NUM_OPENS: %"PRId64"\n", num_opens);
fprintf(stderr, "NUM_CLOSES: %"PRId64"\n", num_closes);
fprintf(stderr, "NUM_BARRIERS: %"PRId64"\n", num_barriers);
fprintf(stderr, "TOTAL_DELAY: %.4lf\n", total_delay);
fprintf(stderr, "NUM_READS: %"PRId64"\n", num_reads);
fprintf(stderr, "READ_SIZE: %"PRId64"\n", read_size);
fprintf(stderr, "NUM_WRITES: %"PRId64"\n", num_writes);
fprintf(stderr, "WRITE_SIZE: %"PRId64"\n", write_size);
fprintf(stderr, "NUM_SENDS: %"PRId64"\n", num_sends);
fprintf(stderr, "SEND_SIZE: %"PRId64"\n", send_size);
fprintf(stderr, "NUM_RECVS: %"PRId64"\n", num_recvs);
fprintf(stderr, "RECV_SIZE: %"PRId64"\n", recv_size);
fprintf(stderr, "NUM_ISENDS: %"PRId64"\n", num_isends);
fprintf(stderr, "ISEND_SIZE: %"PRId64"\n", isend_size);
fprintf(stderr, "NUM_IRECVS: %"PRId64"\n", num_irecvs);
fprintf(stderr, "IRECV_SIZE: %"PRId64"\n", irecv_size);
fprintf(stderr, "NUM_BCASTS: %"PRId64"\n", num_bcasts);
fprintf(stderr, "BCAST_SIZE: %"PRId64"\n", bcast_size);
fprintf(stderr, "NUM_ALLGATHERS: %"PRId64"\n", num_allgathers);
fprintf(stderr, "ALLGATHER_SIZE: %"PRId64"\n", allgather_size);
fprintf(stderr, "NUM_ALLGATHERVS: %"PRId64"\n", num_allgathervs);
fprintf(stderr, "ALLGATHERV_SIZE: %"PRId64"\n", allgatherv_size);
fprintf(stderr, "NUM_ALLTOALLS: %"PRId64"\n", num_alltoalls);
fprintf(stderr, "ALLTOALL_SIZE: %"PRId64"\n", alltoall_size);
fprintf(stderr, "NUM_ALLTOALLVS: %"PRId64"\n", num_alltoallvs);
fprintf(stderr, "ALLTOALLV_SIZE: %"PRId64"\n", alltoallv_size);
fprintf(stderr, "NUM_REDUCES: %"PRId64"\n", num_reduces);
fprintf(stderr, "REDUCE_SIZE: %"PRId64"\n", reduce_size);
fprintf(stderr, "NUM_ALLREDUCE: %"PRId64"\n", num_allreduces);
fprintf(stderr, "ALLREDUCE_SIZE: %"PRId64"\n", allreduce_size);
fprintf(stderr, "NUM_COLLECTIVE: %"PRId64"\n", num_collectives);
fprintf(stderr, "COLLECTIVE_SIZE: %"PRId64"\n", collective_size);
fprintf(stderr, "NUM_WAITALLS: %"PRId64"\n", num_waitalls);
fprintf(stderr, "NUM_WAITS: %"PRId64"\n", num_waits);
fprintf(stderr, "NUM_WAITSOMES: %"PRId64"\n", num_waitsomes);
fprintf(stderr, "NUM_WAITANYS: %"PRId64"\n", num_waitanys);
fprintf(stderr, "NUM_TESTALLS: %"PRId64"\n", num_testalls);
}
return 0;
......
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