~ubuntu-branches/ubuntu/saucy/nwchem/saucy

« back to all changes in this revision

Viewing changes to src/tools/ga-5-1/global/src/datatypes.c

  • Committer: Package Import Robot
  • Author(s): Michael Banck, Michael Banck, Daniel Leidert
  • Date: 2012-02-09 20:02:41 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20120209200241-jgk03qfsphal4ug2
Tags: 6.1-1
* New upstream release.

[ Michael Banck ]
* debian/patches/02_makefile_flags.patch: Updated.
* debian/patches/02_makefile_flags.patch: Use internal blas and lapack code.
* debian/patches/02_makefile_flags.patch: Define GCC4 for LINUX and LINUX64
  (Closes: #632611 and LP: #791308).
* debian/control (Build-Depends): Added openssh-client.
* debian/rules (USE_SCALAPACK, SCALAPACK): Removed variables (Closes:
  #654658).
* debian/rules (LIBDIR, USE_MPIF4, ARMCI_NETWORK): New variables.
* debian/TODO: New file.
* debian/control (Build-Depends): Removed libblas-dev, liblapack-dev and
  libscalapack-mpi-dev.
* debian/patches/04_show_testsuite_diff_output.patch: New patch, shows the
  diff output for failed tests.
* debian/patches/series: Adjusted.
* debian/testsuite: Optionally run all tests if "all" is passed as option.
* debian/rules: Run debian/testsuite with "all" if DEB_BUILD_OPTIONS
  contains "checkall".

[ Daniel Leidert ]
* debian/control: Used wrap-and-sort. Added Vcs-Svn and Vcs-Browser fields.
  (Priority): Moved to extra according to policy section 2.5.
  (Standards-Version): Bumped to 3.9.2.
  (Description): Fixed a typo.
* debian/watch: Added.
* debian/patches/03_hurd-i386_define_path_max.patch: Added.
  - Define MAX_PATH if not defines to fix FTBFS on hurd.
* debian/patches/series: Adjusted.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#if HAVE_CONFIG_H
 
2
#   include "config.h"
 
3
#endif
 
4
 
 
5
/* $Id: datatypes.c,v 1.9.10.1 2006-12-14 13:24:47 manoj Exp $
 
6
 * conversion of MA identifiers between C to Fortran data types 
 
7
 * Note that ga_type_c2f(MT_F_INT) == MT_F_INT 
 
8
 */
 
9
 
 
10
#include "gacommon.h"
 
11
#include "macommon.h"
 
12
#include "ga-papi.h"
 
13
 
 
14
Integer pnga_type_f2c(Integer type)
 
15
{
 
16
Integer ctype;
 
17
   switch(type){
 
18
   case MT_F_INT: 
 
19
#       if   SIZEOF_F77_INTEGER == SIZEOF_INT
 
20
                ctype = C_INT;
 
21
#       elif SIZEOF_F77_INTEGER == SIZEOF_LONG
 
22
                ctype = C_LONG;
 
23
#       elif SIZEOF_F77_INTEGER == SIZEOF_LONG_LONG
 
24
                ctype = C_LONGLONG;
 
25
#       else
 
26
#           error SIZEOF_F77_INTEGER == SIZEOF_???
 
27
#       endif
 
28
                break;
 
29
   case MT_F_REAL: 
 
30
#       if   SIZEOF_F77_REAL == SIZEOF_FLOAT
 
31
                ctype = C_FLOAT;
 
32
#       elif SIZEOF_F77_REAL == SIZEOF_DOUBLE
 
33
                ctype = C_DBL;
 
34
#       elif SIZEOF_F77_REAL == SIZEOF_LONG_DOUBLE
 
35
#           error SIZEOF_F77_REAL == SIZEOF_LONG_DOUBLE not supported?
 
36
#       else
 
37
#           error SIZEOF_F77_REAL == SIZEOF_???
 
38
#       endif
 
39
                break;
 
40
   case MT_F_DBL: 
 
41
#       if   SIZEOF_F77_DOUBLE_PRECISION == SIZEOF_DOUBLE
 
42
                ctype = C_DBL;
 
43
#       elif SIZEOF_F77_DOUBLE_PRECISION == SIZEOF_LONG_DOUBLE
 
44
#           error SIZEOF_F77_DOUBLE_PRECISION == SIZEOF_LONG_DOUBLE not supported?
 
45
#       else
 
46
#           error SIZEOF_F77_DOUBLE_PRECISION == SIZEOF_???
 
47
#       endif
 
48
                break;
 
49
   case MT_F_DCPL: 
 
50
                ctype = C_DCPL;
 
51
                break;
 
52
   case MT_F_SCPL: 
 
53
#       if   SIZEOF_F77_REAL == SIZEOF_FLOAT
 
54
                ctype = C_SCPL;
 
55
#       elif SIZEOF_F77_REAL == SIZEOF_DOUBLE
 
56
                ctype = C_DCPL;
 
57
#       elif SIZEOF_F77_REAL == SIZEOF_LONG_DOUBLE
 
58
#           error SIZEOF_F77_REAL == SIZEOF_LONG_DOUBLE not supported?
 
59
#       else
 
60
#           error SIZEOF_F77_REAL == SIZEOF_???
 
61
#       endif
 
62
                break;
 
63
   default:     ctype = type;
 
64
                break;
 
65
   }
 
66
   
 
67
   return(ctype);
 
68
}
 
69
 
 
70
 
 
71
Integer pnga_type_c2f(Integer type)
 
72
{
 
73
Integer ftype;
 
74
   switch(type){
 
75
   case C_INT: 
 
76
                ftype = (sizeof(int) != sizeof(Integer))? -1: MT_F_INT;
 
77
                break;
 
78
   case C_LONG: 
 
79
                ftype = (sizeof(long) != sizeof(Integer))? -1: MT_F_INT;
 
80
                break;
 
81
   case C_LONGLONG: 
 
82
                ftype = (sizeof(long long) != sizeof(Integer))? -1: MT_F_INT;
 
83
                break;
 
84
   case C_FLOAT:
 
85
#       if   SIZEOF_FLOAT == SIZEOF_F77_REAL
 
86
                ftype = MT_F_REAL; 
 
87
#       elif SIZEOF_FLOAT == SIZEOF_F77_DOUBLE_PRECISION
 
88
                ftype = MT_F_DBL; 
 
89
#       else
 
90
                ftype = -1;
 
91
#       endif
 
92
                break;
 
93
   case C_DBL: 
 
94
                ftype = MT_F_DBL;
 
95
                break;
 
96
   case C_DCPL:
 
97
                ftype = MT_F_DCPL;
 
98
                break;
 
99
   case C_SCPL:
 
100
#       if   SIZEOF_FLOAT == SIZEOF_F77_REAL
 
101
                ftype = MT_F_SCPL;
 
102
#       elif SIZEOF_FLOAT == SIZEOF_F77_DOUBLE_PRECISION
 
103
                ftype = MT_F_DCPL;
 
104
#       else
 
105
                ftype = -1;
 
106
#       endif
 
107
                break;
 
108
   default:     ftype = type;
 
109
                break;
 
110
   }
 
111
   
 
112
   return(ftype);
 
113
}