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
|
||||
|
||||
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
|
||||
do
|
||||
|
@ -26,12 +30,17 @@ do
|
|||
echo "Rendering ${SPIRAL} for ${ROT} rotations @ ${D}mm"
|
||||
#TMP=`mktemp`
|
||||
TMP="benchmark/${FILENAME}_${D}_${ROT}_100"
|
||||
if test -f "${TMP}.stl"; then
|
||||
echo "Benchmark for ${TMP} exists"
|
||||
else
|
||||
start=`date +%s`
|
||||
openscad -o "${TMP}.stl" -D N=${ROT} -D D=${D} -D FN=100 "${SPIRAL}"
|
||||
end=`date +%s`
|
||||
runtime=$((end-start))
|
||||
|
||||
size=`wc -c < "${TMP}.stl"`
|
||||
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}'`
|
||||
|
@ -39,7 +48,7 @@ do
|
|||
line="${VERSION},${CPU},${DATE},${FILENAME},${D},${ROT},100,$size,$facets,$volume,$runtime"
|
||||
echo $line
|
||||
echo $line >> $NOTES
|
||||
|
||||
fi
|
||||
#rm "${TMP}.stl"
|
||||
done
|
||||
done
|
||||
|
@ -50,20 +59,24 @@ do
|
|||
echo "Rendering complete ${SPIRAL} with ${C} rotations"
|
||||
#TMP=`mktemp`
|
||||
TMP="benchmark/${FILENAME}_${D}_${ROT}_100"
|
||||
if test -f "${TMP}.stl"; then
|
||||
echo "Benchmark for ${TMP} exists"
|
||||
else
|
||||
start=`date +%s`
|
||||
echo -o "${TMP}.stl" -D N=${C} -D D=47 "${SPIRAL}"
|
||||
openscad -o "${TMP}.stl" -D N=${C} -D D=47 -D FN=100 "${SPIRAL}"
|
||||
end=`date +%s`
|
||||
runtime=$((end-start))
|
||||
size=`wc -c < "${TMP}.stl"`
|
||||
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}'`
|
||||
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 >> $NOTES
|
||||
echo $line >> $NOTES
|
||||
echo $line
|
||||
|
||||
#rm "${TMP}.stl"
|
||||
fi
|
||||
done
|
||||
done
|
Loading…
Reference in New Issue