PLUTO
al_codes.h
Go to the documentation of this file.
1 /* ///////////////////////////////////////////////////////////////////// */
2 /*!
3  \file
4  \brief ArrayLib codes header file.
5 
6  Contains basic macro definitions used in ArrayLib routines.
7 
8  \author A. Malagoli (University of Chicago)
9  \author G. Muscianisi (g.muscianisi@cineca.it)
10 
11  \date Aug 29, 2012
12 */
13 /* ///////////////////////////////////////////////////////////////////// */
14 #ifndef __AL_CODES
15 #define __AL_CODES
16 
17 /* Maximum dimension of supported arrays */
18 #define AL_MAX_DIM ((int)5)
19 
20 /* Maximum number of supported arrays */
21 #define AL_MAX_ARRAYS ((int)100)
22 
23 /* Stack indicator values for stack_ptr (in al_szptr_.c) */
24 #define AL_STACK_FREE ((int)0)
25 #define AL_STACK_USED ((int)1)
26 
27 /* Success/Fail codes */
28 #define AL_TRUE ((int)1)
29 #define AL_FALSE ((int)0)
30 
31 /* Success/Fail codes */
32 #define AL_SUCCESS ((AL_Const)0)
33 #define AL_FAILURE ((AL_Const)1)
34 
35 /* Codes for array indexing styles: C or Fortran indexes */
36 #define AL_C_INDEXES ((int) 7)
37 #define AL_FORTRAN_INDEXES ((int) 8)
38 
39 /* Codes for the decomposition mode */
40 #define AL_AUTO_DECOMP ((AL_Const) 9) /* Internal decomposition */
41 #define AL_MPI_DECOMP ((AL_Const) 10) /* MPI decomposition */
42 #define AL_USER_DECOMP ((AL_Const) 11) /* User defined decomposition */
43 
44 /* Codes for al_subarray routine (derived from the romio function) */
45 #define AL_ORDER_C ((int) 56)
46 #define AL_ORDER_FORTRAN ((int) 57)
47 #define AL_DISTRIBUTE_BLOCK ((int) 121)
48 #define AL_DISTRIBUTE_CYCLIC ((int) 122)
49 #define AL_DISTRIBUTE_NONE ((int) 123)
50 
51 
52 /*
53  We duplicate here some common MPI parameters, just in
54  case we'll decide to write a non-MPI version in the
55  future.
56 */
57 
58 #define AL_CHAR MPI_CHAR
59 #define AL_UNSIGNED_CHAR MPI_UNSIGNED_CHAR
60 #define AL_BYTE MPI_BYTE
61 #define AL_SHORT MPI_SHORT
62 
63 #define AL_UNSIGNED MPI_UNSIGNED
64 #define AL_LONG MPI_LONG
65 #define AL_UNSIGNED_LONG MPI_UNSIGNED_LONG
66 #define AL_FLOAT MPI_FLOAT
67 #define AL_DOUBLE MPI_DOUBLE
68 #define AL_LONG_DOUBLE MPI_LONG_DOUBLE
69 #define AL_LONG_LONG_INT MPI_LONG_LONG_INT
70 
71 #define AL_PACKED MPI_PACKED
72 #define AL_LB MPI_LB
73 #define AL_UB MPI_UB
74 
75 /*
76  The layouts for the types MPI_DOUBLE_INT etc are simply
77  struct {
78  double var;
79  int loc;
80  }
81  This is documented in the man pages on the various datatypes.
82  */
83 #define AL_FLOAT_INT MPI_FLOAT_INT
84 #define AL_DOUBLE_INT MPI_DOUBLE_INT
85 #define AL_LONG_INT MPI_LONG_INT
86 #define AL_SHORT_INT MPI_SHORT_INT
87 #define AL__2INT MPI_2INT
88 #define AL_LONG_DOUBLE_INT MPI_LONG_DOUBLE_INT
89 
90 /* Communicators */
91 #define AL_COMM_WORLD MPI_COMM_WORLD
92 #define AL_COMM_SELF MPI_COMM_SELF
93 
94 /* Groups */
95 #define AL_GROUP_EMPTY MPI_GROUP_EMPTY
96 
97 /* Collective operations */
98 
99 #define AL_MAX MPI_MAX
100 #define AL_MIN MPI_MIN
101 #define AL_SUM MPI_SUM
102 #define AL_PROD MPI_PROD
103 #define AL_LAND MPI_LAND
104 #define AL_BAND MPI_BAND
105 #define AL_LOR MPI_LOR
106 #define AL_BOR MPI_BOR
107 #define AL_LXOR MPI_LXOR
108 #define AL_BXOR MPI_BXOR
109 #define AL_MINLOC MPI_MINLOC
110 #define AL_MAXLOC MPI_MAXLOC
111 
112 
113 /* Define some null objects */
114 #define AL_COMM_NULL MPI_COMM_NULL
115 #define AL_OP_NULL MPI_OP_NULL
116 #define AL_GROUP_NULL MPI_GROUP_NULL
117 #define AL_DATATYPE_NULL MPI_DATATYPE_NULL
118 #define AL_REQUEST_NULL MPI_REQUEST_NULL
119 #define AL_ERRHANDLER_NULL MPI_ERRHANDLER_NULL
120 
121 /* These are only guesses; make sure you change them in mpif.h as well */
122 #define AL_MAX_PROCESSOR_NAME MPI_MAX_PROCESSOR_NAME
123 #define AL_MAX_ERROR_STRING MPI_MAX_ERROR_STRING
124 #define AL_MAX_NAME_STRING MPI_MAX_NAME_STRING /* How long a name do you need ? */
125 
126 /* Pre-defined constants */
127 #define AL_UNDEFINED MPI_UNDEFINED
128 #define AL_UNDEFINED_RANK MPI_UNDEFINED_RANK
129 #define AL_KEYVAL_INVALID MPI_KEYVAL_INVALID
130 
131 #define AL_PROC_NULL MPI_PROC_NULL
132 #define AL_ANYSOURCE MPI_ANY_SOURCE
133 #define AL_ANY_TAG MPI_ANY_TAG
134 
135 #endif /* End ifdef __AL_CODES */