File: try_unicos.c

package info (click to toggle)
atlc 4.6.1-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 134,508 kB
  • sloc: ansic: 8,452; sh: 4,862; makefile: 1,055; cpp: 64
file content (75 lines) | stat: -rw-r--r-- 2,065 bytes parent folder | download | duplicates (5)
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
/*
atlc - arbitrary transmission line calculator, for the analysis of
transmission lines are directional couplers. 

Copyright (C) 2002. Dr. David Kirkby, PhD (G8WRB).

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either package_version 2
of the License, or (at your option) any later package_version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
USA.

Dr. David Kirkby, e-mail drkirkby@ntlworld.com 

*/
#include "config.h"

#include "defs.h"

#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif

int try_unicos(struct computer_data *data)
{
#ifdef _SC_CRAY_NCPU
  static char *mftype[] = {"?", "?", "?", "X-MP", "?", \
  "Y-MP", "2","C90???","C90_or_Y16","T4_or_T16_or_T32"};

  long CPUs_online=0, cpu_cycle_time_in_ps;
  double clock_speed_in_MHz;
  double ram;

  /* Obtain the maximum number of CPUs supported on the UNICOS system */

  /* Obtain the number of CPUs online on the UNICOS system */
  CPUs_online=0;
  CPUs_online=sysconf(_SC_CRAY_NCPU);
  if( CPUs_online >= 1 )
    sprintf(data->cpus,"%ld",CPUs_online);


  /* Obtain the speed of the Cray machine. */
#ifdef _SC_CRAY_CPCYCLE
  if((cpu_cycle_time_in_ps=sysconf(_SC_CRAY_CPCYCLE)) > 0)
  {
      sprintf(data->mhz,"%.1f",1e6/cpu_cycle_time_in_ps);
  }
#endif

  /* Obtain the RAM on the UNICOS system */


  /* Obtain the manufacturer */
  strcpy(data->hw_provider,"Cray");

  /* Obtain the Platform */
#ifdef _SC_CRAY_MFTYPE
  if (sysconf(_SC_CRAY_MFTYPE) <= 9L)
    strcpy(data->hw_platform,mftype[sysconf(_SC_CRAY_MFTYPE)] );
#endif

  return(PROBABLY_UNICOS);
#endif
  return(-1);
}