#!/bin/bash
# waits for the open box's 18 clouds (made by fcp_2710_tests' make_clouds.py), then runs every bench for the new set
P=/home/joao/code/data/meshes/fcp_2710_tests/pointclouds
until [ "$(ls $P | grep -c '^open_box_')" -ge 18 ] && ! pgrep -f make_clouds.py >/dev/null; do sleep 20; done
cd /home/joao/code/fcp_devel
B=/home/joao/code/data/meshes/fcp_2810_gwn/scripts/bench.py
ALL=clean_10000,clean_2048,noise0p2_10000,noise0p2_2048,noise0p6_10000,noise0p6_2048,noise1_10000,noise1_2048,pn0p12_10000,pn0p12_2048,pn0p6_10000,pn0p6_2048,pn1p2_10000,pn1p2_2048,dgrad_10000,dgrad_2048,dstripe_10000,dstripe_2048
run() { env -u PYTHONPATH PYTHONWARNINGS=ignore .venv/bin/python "$@" 2>&1 | grep -E "FAIL|Traceback|Error" ; }
run $B "package,eps,local,gwn" $ALL open_box
run $B "gwn:c=0.5:CLOSE=0.5:v=7,gwn:c=0.5:CLOSE=0.75:v=7,gwn:c=0.5:CLOSE=1:v=7,gwn:c=0.5:CLOSE=1.5:v=7,gwn:c=0.5:CLOSE3=1:CLOSE=0.75:v=7,gwn:c=0.5:CLOSE3=1.5:v=7" clean_10000,clean_2048 open_box
FCP_LAYERS=256 run $B "package,gwn,gwn:c=0.5:CLOSE=0.75:v=7,gwn:c=0.5:CLOSE3=1:CLOSE=0.75:v=7" clean_10000,clean_2048 open_box
for o in battery_stepped dress elephant bowl_of bowl_gso mug dino shoe open_box horse; do
  run $B "gwn:c=0.5:sigma=1:orient=auto:CLOSE=0.75:v=8" $ALL $o
done
echo ALL DONE
