Skip to content

Commit

Permalink
Fix latency data generation.
Browse files Browse the repository at this point in the history
  • Loading branch information
ms705 committed Jan 22, 2012
1 parent 148b1c4 commit a5575de
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
29 changes: 18 additions & 11 deletions all_lat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,15 @@ COUNT=10000
LAT_TESTS="pipe_lat tcp_lat unix_lat mempipe_lat tcp_nodelay_lat"
TESTS="${LAT_TESTS}"

MAX_COREID=$2
echo "cores: ${MAX_COREID}"
NUM_CORES=$2

ODIR=$1
rm -rf ${ODIR}
mkdir -p ${ODIR}

for SIZE in ${SIZES}; do
for c1 in $(jot ${MAX_COREID}); do
for c2 in $(jot ${MAX_COREID}); do
for c1 in $(jot ${NUM_CORES} 0); do
for c2 in $(jot ${NUM_CORES} 0); do
echo ${c1} to ${c2}
for t in ${TESTS}; do
d="${ODIR}/${SIZE}/${c1}-${c2}-${t}"
Expand All @@ -25,14 +24,22 @@ for c1 in $(jot ${MAX_COREID}); do
count=${COUNT}
fi
./${t} -t -s ${SIZE} -c ${count} -a ${c1} -b ${c2} -o ${d}

# post-processing
ofile=${ODIR}/${t}.csv
d="${ODIR}/${SIZE}/${c1}-${c2}-${t}/01-${t}-headline.log"
speed=`tail -1 ${d} | awk '{print $4}' | sed -e 's/s//g'`
echo -n "${speed} " >> ${ofile}
rm ${ODIR}/${SIZE}/${c1}-${c2}-${t}/01-${t}-raw_tsc.log
done
done
done

# post-processing
for t in ${TESTS}; do
ofile=${ODIR}/${t}.csv
for c1 in $(jot ${NUM_CORES} 0); do
for c2 in $(jot ${NUM_CORES} 0); do
d="${ODIR}/${SIZE}/${c1}-${c2}-${t}/01-${t}-headline.log"
speed=`tail -1 ${d} | awk '{print $4}' | sed -e 's/s//g'`
echo -n "${speed} " >> ${ofile}
# rm ${ODIR}/${SIZE}/${c1}-${c2}-${t}/01-${t}-raw_tsc.log
done
echo "" >> ${ofile}
done
done

done
2 changes: 1 addition & 1 deletion run.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def parse_list(s):

try:
print >>sys.stderr, "Running latency tests... (over %d CPUs)" % n_cpus
argv = ["./all_lat.sh", resultdir + "/lat", str(n_cpus - 1)]
argv = ["./all_lat.sh", resultdir + "/lat", str(n_cpus)]
print argv
subprocess.check_call(argv)
except:
Expand Down

0 comments on commit a5575de

Please sign in to comment.