#!/bin/bash

# Uruchamia liczenie podbienstwa

njobs=12
tmpfile=tmp-entailment.job

rm -f ${tmpfile}
for relfile in `ls /mnt/dane_eksperymenty/entailment/new-2015-09/not-sampled-separated/*.rel.xml`
do
  bname=`basename $relfile`
  echo $bname
  echo "python entailment.py \
    -f /mnt/dane_eksperymenty/entailment/new-2015-09/not-sampled-separated/output.xml \
    -r $relfile \
    -c ~/repos/grafon/cfg/grafon.ini > ${bname}-sim.csv" >> ${tmpfile}
done;

if [ -e ${tmpfile} ]
then
  parallel -j$njobs -a ${tmpfile}
  rm -f ${tmpfile}
  rm -f allres.csv && for i in `ls *.csv`; do echo "\n$i" >> allres.csv && cat $i >> allres.csv; done
fi
