-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun-vlog
executable file
·105 lines (91 loc) · 2.2 KB
/
run-vlog
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#! /bin/sh
case X$# in
X2) ;;
*) echo "Usage: sh $0 [ restricted | skolem ] <data-parameter>" 1>&2
exit 1
;;
esac
CHASETYPE=$1
DATASET=params-datasets/$2
DATASET_NAME=$2
if [ ! -f $DATASET ]
then
if [ ! -f $2 ]
then
echo "$DATASET not found" 1>&2
exit 1
else
DATASET=$2
DATASET_NAME=`basename $2`
fi
fi
RESTRICTED=false
CHASE=$CHASETYPE
case X$CHASETYPE in
Xrestricted)
CHASETYPE=standard
RESTRICTED=true
;;
Xstandard)
RESTRICTED=true
CHASE=restricted
;;
Xskolem)
;;
X*)
echo "Unrecognized chase type: " $CHASETYPE 1>&2
exit 1
;;
esac
# Sets SYS and TIME command
. support-scripts/detectSystem
# Get some info on the processor we are running on
. support-scripts/get-sysinfo.$SYS
# set some environment variables describing the dataset
. $DATASET
#Do we need to rewrite rules?
case X$VLOG_REWRITE_MULTIHEAD in
X)
VLOG_REWRITE_MULTIHEAD=false
;;
esac
# VLOG_RULES is not set for the chasebench datasets. We just convert the rules to VLog format.
case X$VLOG_RULES in
X) ;;
*)
if [ -f $VLOG_RULES ]
then ::
else VLOG_RULES=
fi
;;
esac
case X$VLOG_RULES in
X)
sh support-scripts/rule-converter $RDFOX_ST_TGDS $RDFOX_T_TGDS > tmpVlogRules
VLOG_RULES=tmpVlogRules
;;
esac
#Generate edb.conf.
sh support-scripts/create-conf $DATA > edb.conf
OUT=vlog-$DATASET_NAME.$CHASETYPE.out
$TIME vlog/build/vlog mat \
-e edb.conf \
--rewriteMultihead $VLOG_REWRITE_MULTIHEAD \
--restrictedChase $RESTRICTED \
--rules $VLOG_RULES \
-l info \
> $OUT 2>&1
rm -f edb.conf tmpVlogRules
# Extracts statistics from vlog and "/usr/bin/time -l" output
echo "Program: VLog"
echo "Chase: $CHASE"
echo "Dataset: $DATASET_NAME"
echo "Date: " `date`
echo "System: " $OSTYPE
echo Processor: $MODEL
# Cores and Threads not relevant for vlog, since it only uses 1
# echo Cores: $CORES
# echo Threads: $THREADS
grep 'Runtime materialization' $OUT | sed 's/.*Runtime materialization = \(.*\) milliseconds/\1/' | awk '{printf "Time: %.0f ms\n", $1}'
grep 'Max memory used' $OUT | sed 's/.*: \(.*\) MB/\1/' | awk '{printf "Mem: %.0f MB\n", $1}'
grep 'Total # derivations:' $OUT | sed 's/.*derivations: */Generated tuples: /'