Imported Upstream version 4.6.0
[debian/atlc] / tests / defs.h
1 /*
2 atlc - arbitrary transmission line calculator, for the analysis of
3 transmission lines are directional couplers. 
4
5 Copyright (C) 2002. Dr. David Kirkby, PhD (G8WRB).
6
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License
9 as published by the Free Software Foundation; either package_version 2
10 of the License, or (at your option) any later package_version.
11
12 This program 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 this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
20 USA.
21
22 Dr. David Kirkby, e-mail drkirkby@ntlworld.com 
23
24 */
25
26
27 #define MAX_SIZE        40 
28 #define SLEEPTIME       80
29
30 #define PROBABLY_AIX       1         /* As used on IBM's                 */
31 #define PROBABLY_FREEBSD   2         /* Runs on a number of systems      */
32 #define PROBABLY_HPUX      3         /* As used on HP's                  */
33 #define PROBABLY_IRIX      4         /* As used on SGI's                 */
34 #define PROBABLY_LINUX     5         /* Run on a number of systems       */
35 #define PROBABLY_NETBSD    6         /* Runs on a HUGE range of systems  */
36 #define PROBABLY_OPENBSD   7         /* Runs on a number of systems      */
37 #define PROBABLY_SOLARIS   8         /* Runs on Suns and PCs             */
38 #define PROBABLY_TRU64     9         /* Runs on Decs, Compaqs and HPs    */
39 #define PROBABLY_UNICOS   10         /* Runs on Cray supercomputers      */
40 #define PROBABLY_BSD      11
41
42 typedef struct computer_data{
43 char mhz[MAX_SIZE];                  /* Speed in MHz. Note its a string */
44 char cpus[MAX_SIZE];                 /* Number of CPUs running          */
45 char max_cpus[MAX_SIZE];             /* Maximum number of CPUs support by system */
46 char sysname[MAX_SIZE];              /* System name - got by uname */
47 char nodename[MAX_SIZE];             /* nodename - got via uname            */
48 char release[MAX_SIZE];              /* Got via uname, but often wrong      */
49 char version[MAX_SIZE];              /* Version of the OS. Sometimes wrong. */
50 char machine[MAX_SIZE];              /* Machine name                        */
51 char cpu_type[MAX_SIZE*3];           /* The CPU type                        */
52 char fpu_type[MAX_SIZE*3];           /* The FPU type                        */
53 char memory[MAX_SIZE];               /* The memory in Mb                    */ 
54 char hw_provider[MAX_SIZE];          /* The hardware provider - Sun, IBM etc */
55 char hw_platform[MAX_SIZE];          /* The hardware platform - eg sun4u    */
56 char t1[MAX_SIZE];                   /* Time in s to run benchmark single threaded */
57 char t2[MAX_SIZE];                   /* Time in s to run benchmark multi threaded */
58 char speedup[MAX_SIZE];              /* t1/t2 */
59 char eff[MAX_SIZE];                  /* The efficiency - t1/(t2*cpus)     */
60 char L1data[MAX_SIZE];               /* Size of level 1 data cache in kb  */
61 char L1instruction[MAX_SIZE];        /* Size of level 1 instuction cache in kb */
62 char L2[MAX_SIZE];                   /* Size of L2 cache                  */ 
63 }a;
64
65 /* The following functions try to fill in the structure above. Note the first
66 try_portable(), will use uname to get what information it can in a portable
67 manner. Any information it can't obtain it will replace with 'unknown'. The
68 fuctions below it then attempt to fill in the data for aix, solaris etc, having
69 verified the system is indeed a and AIX, Solaris or whatever machine. Note
70 that the fuctions that exist for obtaining data on Linux boxes is very
71 sparten and I could do with some help in improving the information 
72 gathered there. */
73
74 int try_portable(struct computer_data *data); /* Gather data using 'uname' */
75
76 int try_aix(struct computer_data *data); /* Gather data on IBM's AIX machines */
77 int try_bsd(struct computer_data *data); /* Gather data on BSD AIX machines */
78 int try_irix(struct computer_data *data); /*Gather data on SGI's IRIX machines*/
79 int try_hpux(struct computer_data *data); /* Gather data on HP HP-UX machines */
80 int try_linux(struct computer_data *data);  /* THIS NEEDS IMPROVING !!!! */
81 int try_solaris(struct computer_data *data); /* Get data under Sun's Solaris */
82 int try_tru64(struct computer_data *data); /*Get data on systems with Tru64 */
83 int try_unicos(struct computer_data *data); /* Get data on Cray systems */