From a5575de02642a4dd06e1c9c7d88c2acfe408de1f Mon Sep 17 00:00:00 2001 From: ms705 Date: Sun, 22 Jan 2012 19:36:15 +0000 Subject: [PATCH] Fix latency data generation. --- all_lat.sh | 29 ++++++++++++++++++----------- run.py | 2 +- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/all_lat.sh b/all_lat.sh index cf118f7..6c0ef4c 100755 --- a/all_lat.sh +++ b/all_lat.sh @@ -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}" @@ -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 diff --git a/run.py b/run.py index e9c1c98..db0f557 100755 --- a/run.py +++ b/run.py @@ -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: