#!/usr/bin/env bash
# Cola 5 (se encadena tras cola4): SPOT con fosas rellenas.
cd "$(dirname "$0")"; export OMP_NUM_THREADS=5
lanzar(){ n=$1; shift; while [ $(ps -eo args | grep "[s]im.py --origen" | grep -v "bash -c" | grep -vc "res/humo") -ge 3 ]; do sleep 30; done
  ( .venv/bin/python sim.py "$@" --fino 40 --salida res/$n > res/$n.log 2>&1; echo "terminó $n" >> res/barrido.log ) & sleep 20; }
while [ -n "$(ps -eo args | grep '[c]ola4.sh')" ]; do sleep 60; done
lanzar s02 --origen H1 --terreno terreno_spot_relleno.npz --vol 150000 --qp 250 --suelo glenwood2b --cv 0.40 --cfl 1.0
lanzar s03 --origen H1 --terreno terreno_spot_relleno.npz --colector 30 --vol 150000 --qp 250 --suelo glenwood2b --cv 0.40 --cfl 1.0
wait
