This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
yap-6.3/packages/CLPBN/clpbn/bp/benchmarks/city/cbp_tests.sh

63 lines
1.6 KiB
Bash
Raw Normal View History

2012-03-22 11:35:54 +00:00
#!/bin/bash
cp ~/bin/yap ~/bin/city_cbp
YAP=~/bin/city_cbp
2012-03-22 11:35:54 +00:00
LOG_FILE=cbp.log
#LOG_FILE=results`date "+ %H:%M:%S %d-%m-%Y"`.log
CITY_LOCATION="'../../examples/city'"
rm -f $LOG_FILE
rm -f ignore.$LOG_FILE
2012-03-22 11:35:54 +00:00
function run_solver
{
solver=$1
network=$2
solver_flag=true
if [ -n "$3" ]; then
if [ $solver = hve ]; then
extra_flag=clpbn_horus:set_horus_flag\(elim_heuristic,$3\)
elif [ $solver = bp ]; then
extra_flag=clpbn_horus:set_horus_flag\(schedule,$3\)
elif [ $solver = cbp ]; then
extra_flag=clpbn_horus:set_horus_flag\(schedule,$3\)
else
echo "unknow flag $3"
fi
fi
/usr/bin/time -o $LOG_FILE -a -f "real:%E\tuser:%U\tsys:%S" \
$YAP << EOF >> $LOG_FILE 2>> ignore.$LOG_FILE
[$CITY_LOCATION].
[$network].
clpbn_horus:set_solver($solver).
clpbn_horus:set_horus_flag(use_logarithms, true).
$solver_flag.
is_joe_guilty(X).
open("$LOG_FILE", 'append', S), format(S, '$network: ~15+ ', []), close(S).
2012-03-22 11:35:54 +00:00
EOF
}
function run_all_graphs
{
echo -n "**********************************" >> $LOG_FILE
echo "**********************************" >> $LOG_FILE
echo "results for solver $2" >> $LOG_FILE
echo -n "**********************************" >> $LOG_FILE
echo "**********************************" >> $LOG_FILE
run_solver $1 city_5 $3
#run_solver $1 city_1000 $3
#run_solver $1 city_5000 $3
#run_solver $1 city_10000 $3
#run_solver $1 city_50000 $3
#run_solver $1 city_100000 $3
#run_solver $1 city_500000 $3
#run_solver $1 city_1000000 $3
2012-03-22 11:35:54 +00:00
}
run_all_graphs cbp "cbp(shedule=seq_fixed) " seq_fixed
2012-03-22 11:35:54 +00:00