Benchmark will only run on non-existent files to allow for the job to be discontinued.
This commit is contained in:
parent
8ca9992d48
commit
6d54a99960
|
@ -11,7 +11,11 @@ COMPLETE=( 40 60 )
|
||||||
|
|
||||||
mkdir -p benchmark
|
mkdir -p benchmark
|
||||||
|
|
||||||
echo "version,cpu,date,source,diameter,rotations,fn,size,facets,volume,time" > $NOTES
|
if test -f "${NOTES}"; then
|
||||||
|
echo "Benchmark file exists"
|
||||||
|
else
|
||||||
|
echo "version,cpu,date,source,diameter,rotations,fn,size,facets,volume,time" > $NOTES
|
||||||
|
fi
|
||||||
|
|
||||||
for SPIRAL in ./spiral/*.scad
|
for SPIRAL in ./spiral/*.scad
|
||||||
do
|
do
|
||||||
|
@ -26,20 +30,25 @@ do
|
||||||
echo "Rendering ${SPIRAL} for ${ROT} rotations @ ${D}mm"
|
echo "Rendering ${SPIRAL} for ${ROT} rotations @ ${D}mm"
|
||||||
#TMP=`mktemp`
|
#TMP=`mktemp`
|
||||||
TMP="benchmark/${FILENAME}_${D}_${ROT}_100"
|
TMP="benchmark/${FILENAME}_${D}_${ROT}_100"
|
||||||
start=`date +%s`
|
if test -f "${TMP}.stl"; then
|
||||||
openscad -o "${TMP}.stl" -D N=${ROT} -D D=${D} -D FN=100 "${SPIRAL}"
|
echo "Benchmark for ${TMP} exists"
|
||||||
end=`date +%s`
|
else
|
||||||
runtime=$((end-start))
|
start=`date +%s`
|
||||||
size=`wc -c < "${TMP}.stl"`
|
openscad -o "${TMP}.stl" -D N=${ROT} -D D=${D} -D FN=100 "${SPIRAL}"
|
||||||
size=`echo $size | xargs`
|
end=`date +%s`
|
||||||
ao=`admesh -c "${TMP}.stl"`
|
runtime=$((end-start))
|
||||||
facets=`echo "$ao" | grep "Number of facets" | awk '{print $5}'`
|
|
||||||
volume=`echo "$ao" | grep "Number of parts" | awk '{print $8}'`
|
|
||||||
|
|
||||||
line="${VERSION},${CPU},${DATE},${FILENAME},${D},${ROT},100,$size,$facets,$volume,$runtime"
|
size=`wc -c < "${TMP}.stl"`
|
||||||
echo $line
|
size=`echo $size | xargs`
|
||||||
echo $line >> $NOTES
|
|
||||||
|
|
||||||
|
ao=`admesh -c "${TMP}.stl"`
|
||||||
|
facets=`echo "$ao" | grep "Number of facets" | awk '{print $5}'`
|
||||||
|
volume=`echo "$ao" | grep "Number of parts" | awk '{print $8}'`
|
||||||
|
|
||||||
|
line="${VERSION},${CPU},${DATE},${FILENAME},${D},${ROT},100,$size,$facets,$volume,$runtime"
|
||||||
|
echo $line
|
||||||
|
echo $line >> $NOTES
|
||||||
|
fi
|
||||||
#rm "${TMP}.stl"
|
#rm "${TMP}.stl"
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
@ -50,20 +59,24 @@ do
|
||||||
echo "Rendering complete ${SPIRAL} with ${C} rotations"
|
echo "Rendering complete ${SPIRAL} with ${C} rotations"
|
||||||
#TMP=`mktemp`
|
#TMP=`mktemp`
|
||||||
TMP="benchmark/${FILENAME}_${D}_${ROT}_100"
|
TMP="benchmark/${FILENAME}_${D}_${ROT}_100"
|
||||||
start=`date +%s`
|
if test -f "${TMP}.stl"; then
|
||||||
echo -o "${TMP}.stl" -D N=${C} -D D=47 "${SPIRAL}"
|
echo "Benchmark for ${TMP} exists"
|
||||||
end=`date +%s`
|
else
|
||||||
runtime=$((end-start))
|
start=`date +%s`
|
||||||
size=`wc -c < "${TMP}.stl"`
|
openscad -o "${TMP}.stl" -D N=${C} -D D=47 -D FN=100 "${SPIRAL}"
|
||||||
size=`echo $size | xargs`
|
end=`date +%s`
|
||||||
ao=`admesh -c "${TMP}.stl"`
|
runtime=$((end-start))
|
||||||
facets=`echo $ao | grep "Number of facets" | awk '{print $5}'`
|
size=`wc -c < "${TMP}.stl"`
|
||||||
volume=`echo $ao | grep "Number of parts" | awk '{print $8}'`
|
size=`echo $size | xargs`
|
||||||
|
ao=`admesh -c "${TMP}.stl"`
|
||||||
|
facets=`echo "$ao" | grep "Number of facets" | awk '{print $5}'`
|
||||||
|
volume=`echo "$ao" | grep "Number of parts" | awk '{print $8}'`
|
||||||
|
|
||||||
line="${VERSION},${CPU},${DATE},${FILENAME},${D},${ROT},100,$size,$facets,$volume,$runtime"
|
line="${VERSION},${CPU},${DATE},${FILENAME},${D},${ROT},100,$size,$facets,$volume,$runtime"
|
||||||
#echo $line >> $NOTES
|
echo $line >> $NOTES
|
||||||
echo $line
|
echo $line
|
||||||
|
|
||||||
#rm "${TMP}.stl"
|
#rm "${TMP}.stl"
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
done
|
done
|
Loading…
Reference in New Issue