1#!/bin/bash -ux
2
3cd /usr/local/google/home/yuhenglong/Desktop/spec2006/cpu2006-redhat-ia32/
4cd benchspec/CPU2006/471.omnetpp/run/build_base_test$1.0000
5
6(time ./omnetpp$1 ../../data/train/input/omnetpp.ini) 1>log-file 2>time.txt
7
8state=$?
9
10if [ $state -eq 0 ];then
11  diff ../../data/train/output/omnetpp.sca.result omnetpp.sca
12  state=$?
13  if [ $state -eq 0 ];then
14    time=$(cat time.txt | grep real | cut -f2 -s | cut -d 's' -f 1)
15    time=$(echo $time | awk -Fm '{ print ($1 * 60) + $2 }')
16    echo $time
17  else
18    echo "error"
19  fi
20else
21  echo "error"
22fi
23
24return $state