~ubuntu-branches/ubuntu/trusty/rheolef/trusty-proposed

« back to all changes in this revision

Viewing changes to skit/tst/ssk_cpu.sh

  • Committer: Bazaar Package Importer
  • Author(s): Christophe Prud'homme
  • Date: 2010-06-12 09:08:59 UTC
  • Revision ID: james.westby@ubuntu.com-20100612090859-8gpm2gc7j3ab43et
Tags: upstream-5.89
ImportĀ upstreamĀ versionĀ 5.89

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
#
 
3
# This file is part of Rheolef.
 
4
#
 
5
# Copyright (C) 2000-2009 Pierre Saramito 
 
6
#
 
7
# Rheolef is free software; you can redistribute it and/or modify
 
8
# it under the terms of the GNU General Public License as published by
 
9
# the Free Software Foundation; either version 2 of the License, or
 
10
# (at your option) any later version.
 
11
#
 
12
# Rheolef is distributed in the hope that it will be useful,
 
13
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
# GNU General Public License for more details.
 
16
#
 
17
# You should have received a copy of the GNU General Public License
 
18
# along with Rheolef; if not, write to the Free Software
 
19
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
20
#
 
21
# -------------------------------------------------------------------------
 
22
BIN=./ssk_tst
 
23
if test x"$1" = x"-3d"; then
 
24
    flag_3d=$1;
 
25
    shift
 
26
fi
 
27
k_max=$1
 
28
k_step=$2
 
29
 
 
30
echo "# size    cpu_fact        cpu_solve"
 
31
echo "# size    cpu_fact        cpu_solve" 1>&2
 
32
k=${k_step}
 
33
while test ${k} -le ${k_max}; do
 
34
    ${BIN} ${flag_3d} ${k} 2> spooles_tst.log
 
35
    status=$?
 
36
    if test $status -ne 0; then
 
37
        echo "${BIN}: error." 1>&2
 
38
        exit 1
 
39
    fi
 
40
    problem_size=`grep problem_size spooles_tst.log | awk '{print $3}' `
 
41
    cpu_fact=`grep cpu_fact spooles_tst.log | awk '{print $3}' `
 
42
    cpu_solve=`grep cpu_solve spooles_tst.log | awk '{print $3}' `
 
43
    /bin/rm -f spooles_tst.log
 
44
    echo "${problem_size}       ${cpu_fact}     ${cpu_solve}"
 
45
    echo "${problem_size}       ${cpu_fact}     ${cpu_solve}" 1>&2
 
46
    k=`echo "${k}+${k_step}" | bc -l`
 
47
done
 
48
exit 0
 
49