Skip to content

Commit

Permalink
wrote hmat profiler .sh
Browse files Browse the repository at this point in the history
  • Loading branch information
maekke97 committed Aug 8, 2017
1 parent 590e307 commit ca786b5
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tests/cluster_tree_profiler.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ if [ -f ${OUTFILE} ];
then
rm -f ${OUTFILE}
fi
for e in `seq 2 24`;
for e in `seq 12 21`;
do
python cluster_tree_profiler.py 1 $(( 2**${e} )) >> ${OUTFILE}
done
8 changes: 4 additions & 4 deletions tests/hmat_profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ def main(limit):
start = timer()
add_res = hmat + hmat
end = timer()
print "Addition with n={0} and k={1} took {2} seconds.".format(limit, rank, end - start)
print "Addition with n={0} took {1} seconds.".format(limit, end - start)
start = timer()
add_res = hmat - hmat
end = timer()
print "Subtraction with n={0} and k={1} took {2} seconds.".format(limit, rank, end - start)
print "Subtraction with n={0} and took {1} seconds.".format(limit, end - start)
start = timer()
mul_res = hmat * hmat
end = timer()
print "Multiplication with n={0} and k={1} took {2} seconds.".format(limit, rank, end - start)
print "Multiplication with n={0} and took {1} seconds.".format(limit, end - start)


if __name__ == '__main__':
Expand All @@ -51,4 +51,4 @@ def main(limit):
print '\n' + 'Finished run with n={0}'.format(args.limit)
print '\n' + '*' * 74 + '\n'
except SystemExit:
main(20)
main(10)
16 changes: 16 additions & 0 deletions tests/hmat_profiler.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
OUTFILE=/compute/nem/hmat_profiler.out
ADDCSV=/compute/nem/hmat_addition_profiler.csv
SUBCSV=/compute/nem/hmat_subtraction_profiler.csv
MULCSV=/compute/nem/hmat_multiplication_profiler.csv
if [ -f ${OUTFILE} ];
then
rm -f ${OUTFILE}
fi
for e in `seq 12 21`;
do
python cluster_tree_profiler.py 1 $(( 2**${e} )) >> ${OUTFILE}
done
awk 'BEGIN{ OFS=","; FS="[ \t]+|=|" }/Addition/{ print $4, $7, $9}' ${OUTFILE} > ${ADDCSV}
awk 'BEGIN{ OFS=","; FS="[ \t]+|=|" }/Subtraction/{ print $4, $7, $9}' ${OUTFILE} > ${SUBCSV}
awk 'BEGIN{ OFS=","; FS="[ \t]+|=|" }/Multiplication/{ print $4, $7, $9}' ${OUTFILE} > ${MULCSV}

0 comments on commit ca786b5

Please sign in to comment.