Cnames.h
Go to the documentation of this file.
1 
11 #ifndef __SUPERLU_CNAMES /* allow multiple inclusions */
12 #define __SUPERLU_CNAMES
13 
14 /*
15  * These macros define how C routines will be called. ADD_ assumes that
16  * they will be called by fortran, which expects C routines to have an
17  * underscore postfixed to the name (Suns, and the Intel expect this).
18  * NOCHANGE indicates that fortran will be calling, and that it expects
19  * the name called by fortran to be identical to that compiled by the C
20  * (RS6K's do this). UPCASE says it expects C routines called by fortran
21  * to be in all upcase (CRAY wants this).
22  */
23 
24 #define ADD_ 0
25 #define NOCHANGE 1
26 #define UPCASE 2
27 #define C_CALL 3
28 
29 #ifdef UpCase
30 #define F77_CALL_C UPCASE
31 #endif
32 
33 #ifdef NoChange
34 #define F77_CALL_C NOCHANGE
35 #endif
36 
37 #ifdef Add_
38 #define F77_CALL_C ADD_
39 #endif
40 
41 #ifndef F77_CALL_C
42 #define F77_CALL_C ADD_
43 #endif
44 
45 #if (F77_CALL_C == ADD_)
46 /*
47  * These defines set up the naming scheme required to have a fortran 77
48  * routine call a C routine
49  * No redefinition necessary to have following Fortran to C interface:
50  * FORTRAN CALL C DECLARATION
51  * call dgemm(...) void dgemm_(...)
52  *
53  * This is the default.
54  */
55 /* These are the functions defined in F90 wraper */
56 #define f_create_gridinfo_handle f_create_gridinfo_handle_
57 #define f_create_options_handle f_create_options_handle_
58 #define f_create_ScalePerm_handle f_create_scaleperm_handle_
59 #define f_create_LUstruct_handle f_create_lustruct_handle_
60 #define f_create_SOLVEstruct_handle f_create_solvestruct_handle_
61 #define f_create_SuperMatrix_handle f_create_supermatrix_handle_
62 #define f_destroy_gridinfo_handle f_destroy_gridinfo_handle_
63 #define f_destroy_options_handle f_destroy_options_handle_
64 #define f_destroy_ScalePerm_handle f_destroy_scaleperm_handle_
65 #define f_destroy_LUstruct_handle f_destroy_lustruct_handle_
66 #define f_destroy_SOLVEstruct_handle f_destroy_solvestruct_handle_
67 #define f_destroy_SuperMatrix_handle f_destroy_supermatrix_handle_
68 #define f_create_SuperLUStat_handle f_create_superlustat_handle_
69 #define f_destroy_SuperLUStat_handle f_destroy_superlustat_handle_
70 #define f_get_gridinfo f_get_gridinfo_
71 #define f_get_SuperMatrix f_get_supermatrix_
72 #define f_set_SuperMatrix f_set_supermatrix_
73 #define f_get_CompRowLoc_Matrix f_get_comprowloc_matrix_
74 #define f_set_CompRowLoc_Matrix f_set_comprowloc_matrix_
75 #define f_get_superlu_options f_get_superlu_options_
76 #define f_set_superlu_options f_set_superlu_options_
77 #define f_set_default_options f_set_default_options_
78 #define f_superlu_gridinit f_superlu_gridinit_
79 #define f_superlu_gridexit f_superlu_gridexit_
80 #define f_ScalePermstructInit f_scalepermstructinit_
81 #define f_ScalePermstructFree f_scalepermstructfree_
82 #define f_PStatInit f_pstatinit_
83 #define f_PStatFree f_pstatfree_
84 #define f_LUstructInit f_lustructinit_
85 #define f_LUstructFree f_lustructfree_
86 #define f_Destroy_LU f_destroy_lu_
87 #define f_dCreate_CompRowLoc_Mat_dist f_dcreate_comprowloc_mat_dist_
88 #define f_Destroy_CompRowLoc_Mat_dist f_destroy_comprowloc_mat_dist_
89 #define f_Destroy_SuperMat_Store_dist f_destroy_supermat_store_dist_
90 #define f_dSolveFinalize f_dsolvefinalize_
91 #define f_pdgssvx f_pdgssvx_
92 #define f_dcreate_dist_matrix f_dcreate_dist_matrix_
93 #define f_check_malloc f_check_malloc_
94 #endif
95 
96 #if (F77_CALL_C == UPCASE)
97 /*
98  * These defines set up the naming scheme required to have a fortran 77
99  * routine call a C routine
100  * following Fortran to C interface:
101  * FORTRAN CALL C DECLARATION
102  * call dgemm(...) void DGEMM(...)
103  */
104 /* BLAS */
105 #define sasum_ SASUM
106 #define isamax_ ISAMAX
107 #define scopy_ SCOPY
108 #define sscal_ SSCAL
109 #define sger_ SGER
110 #define snrm2_ SNRM2
111 #define ssymv_ SSYMV
112 #define sdot_ SDOT
113 #define saxpy_ SAXPY
114 #define ssyr2_ SSYR2
115 #define srot_ SROT
116 #define sgemv_ SGEMV
117 #define strsv_ STRSV
118 #define sgemm_ SGEMM
119 #define strsm_ STRSM
120 
121 #define dasum_ DASUM
122 #define idamax_ IDAMAX
123 #define dcopy_ DCOPY
124 #define dscal_ DSCAL
125 #define dger_ DGER
126 #define dnrm2_ DNRM2
127 #define dsymv_ DSYMV
128 #define ddot_ DDOT
129 #define daxpy_ DAXPY
130 #define dsyr2_ DSYR2
131 #define drot_ DROT
132 #define dgemv_ DGEMV
133 #define dtrsv_ DTRSV
134 #define dgemm_ DGEMM
135 #define dtrsm_ DTRSM
136 
137 #define scasum_ SCASUM
138 #define icamax_ ICAMAX
139 #define ccopy_ CCOPY
140 #define cscal_ CSCAL
141 #define scnrm2_ SCNRM2
142 #define caxpy_ CAXPY
143 #define cgemv_ CGEMV
144 #define ctrsv_ CTRSV
145 #define cgemm_ CGEMM
146 #define ctrsm_ CTRSM
147 #define cgerc_ CGERC
148 #define chemv_ CHEMV
149 #define cher2_ CHER2
150 
151 #define dzasum_ DZASUM
152 #define izamax_ IZAMAX
153 #define zcopy_ ZCOPY
154 #define zscal_ ZSCAL
155 #define dznrm2_ DZNRM2
156 #define zaxpy_ ZAXPY
157 #define zgemv_ ZGEMV
158 #define ztrsv_ ZTRSV
159 #define zgemm_ ZGEMM
160 #define ztrsm_ ZTRSM
161 #define zgerc_ ZGERC
162 #define zhemv_ ZHEMV
163 #define zher2_ ZHER2
164 #define zgeru_ ZGERU
165 
166 /* LAPACK */
167 #define dlamch_ DLAMCH
168 #define slamch_ SLAMCH
169 #define xerbla_ XERBLA
170 #define lsame_ LSAME
171 
172 #define mc64id_ MC64ID
173 #define mc64ad_ MC64AD
174 #define c_bridge_dgssv_ C_BRIDGE_DGSSV
175 #define c_fortran_slugrid_ C_FORTRAN_SLUGRID
176 #define c_fortran_pdgssvx_ C_FORTRAN_PDGSSVX
177 #define c_fortran_pdgssvx_ABglobal_ C_FORTRAN_PDGSSVX_ABGLOBAL
178 #define c_fortran_pzgssvx_ C_FORTRAN_PZGSSVX
179 #define c_fortran_pzgssvx_ABglobal_ C_FORTRAN_PZGSSVX_ABGLOBAL
180 
181 /* These are the functions defined in F90 wraper */
182 #define f_create_gridinfo_handle F_CREATE_GRIDINFO_HANDLE
183 #define f_create_options_handle F_CREATE_OPTIONS_HANDLE
184 #define f_create_ScalePerm_handle F_CREATE_SCALEPERM_HANDLE
185 #define f_create_LUstruct_handle F_CREATE_LUSTRUCT_HANDLE
186 #define f_create_SOLVEstruct_handle F_CREATE_SOLVESTRUCT_HANDLE
187 #define f_create_SuperMatrix_handle F_CREATE_SUPERMATRIX_HANDLE
188 #define f_destroy_gridinfo_handle F_DESTROY_GRIDINFO_HANDLE
189 #define f_destroy_options_handle F_DESTROY_OPTIONS_HANDLE
190 #define f_destroy_ScalePerm_handle F_DESTROY_SCALEPERM_HANDLE
191 #define f_destroy_LUstruct_handle F_DESTROY_LUSTRUCT_HANDLE
192 #define f_destroy_SOLVEstruct_handle F_DESTROY_SOLVESTRUCT_HANDLE
193 #define f_destroy_SuperMatrix_handle F_DESTROY_SUPERMATRIX_HANDLE
194 #define f_create_SuperLUStat_handle F_CREATE_SUPERLUSTAT_HANDLE
195 #define f_destroy_SuperLUStat_handle F_DESTROY_SUPERLUSTAT_HANDLE
196 #define f_get_gridinfo F_GET_GRIDINFO
197 #define f_get_SuperMatrix F_GET_SUPERMATRIX
198 #define f_set_SuperMatrix F_SET_SUPERMATRIX
199 #define f_get_CompRowLoc_Matrix F_GET_COMPROWLOC_MATRIX
200 #define f_set_CompRowLoc_Matrix F_SET_COMPROWLOC_MATRIX
201 #define f_get_superlu_options F_GET_SUPERLU_OPTIONS
202 #define f_set_superlu_options F_SET_SUPERLU_OPTIONS
203 #define f_set_default_options F_SET_DEFAULT_OPTIONS
204 #define f_superlu_gridinit F_SUPERLU_GRIDINIT
205 #define f_superlu_gridexit F_SUPERLU_GRIDEXIT
206 #define f_ScalePermstructInit F_SCALEPERMSTRUCTINIT
207 #define f_ScalePermstructFree F_SCALEPERMSTRUCTFREE
208 #define f_PStatInit F_PSTATINIT
209 #define f_PStatFree F_PSTATFREE
210 #define f_LUstructInit F_LUSTRUCTINIT
211 #define f_LUstructFree F_LUSTRUCTFREE
212 #define f_Destroy_LU F_DESTROY_LU
213 #define f_dCreate_CompRowLoc_Mat_dist F_DCREATE_COMPROWLOC_MAT_DIST
214 #define f_Destroy_CompRowLoc_Mat_dist F_DESTROY_COMPROWLOC_MAT_DIST
215 #define f_Destroy_SuperMat_Store_dist F_DESTROY_SUPERMAT_STORE_DIST
216 #define f_dSolveFinalize F_DSOLVEFINALIZE
217 #define f_pdgssvx F_PDGSSVX
218 #define f_dcreate_dist_matrix F_DCREATE_DIST_MATRIX
219 #define f_check_malloc F_CHECK_MALLOC
220 #endif
221 
222 #if (F77_CALL_C == NOCHANGE)
223 /*
224  * These defines set up the naming scheme required to have a fortran 77
225  * routine call a C routine
226  * for following Fortran to C interface:
227  * FORTRAN CALL C DECLARATION
228  * call dgemm(...) void dgemm(...)
229  */
230 /* BLAS */
231 #define sasum_ sasum
232 #define isamax_ isamax
233 #define scopy_ scopy
234 #define sscal_ sscal
235 #define sger_ sger
236 #define snrm2_ snrm2
237 #define ssymv_ ssymv
238 #define sdot_ sdot
239 #define saxpy_ saxpy
240 #define ssyr2_ ssyr2
241 #define srot_ srot
242 #define sgemv_ sgemv
243 #define strsv_ strsv
244 #define sgemm_ sgemm
245 #define strsm_ strsm
246 
247 #define dasum_ dasum
248 #define idamax_ idamax
249 #define dcopy_ dcopy
250 #define dscal_ dscal
251 #define dger_ dger
252 #define dnrm2_ dnrm2
253 #define dsymv_ dsymv
254 #define ddot_ ddot
255 #define daxpy_ daxpy
256 #define dsyr2_ dsyr2
257 #define drot_ drot
258 #define dgemv_ dgemv
259 #define dtrsv_ dtrsv
260 #define dgemm_ dgemm
261 #define dtrsm_ dtrsm
262 
263 #define scasum_ scasum
264 #define icamax_ icamax
265 #define ccopy_ ccopy
266 #define cscal_ cscal
267 #define scnrm2_ scnrm2
268 #define caxpy_ caxpy
269 #define cgemv_ cgemv
270 #define ctrsv_ ctrsv
271 #define cgemm_ cgemm
272 #define ctrsm_ ctrsm
273 #define cgerc_ cgerc
274 #define chemv_ chemv
275 #define cher2_ cher2
276 
277 #define dzasum_ dzasum
278 #define izamax_ izamax
279 #define zcopy_ zcopy
280 #define zscal_ zscal
281 #define dznrm2_ dznrm2
282 #define zaxpy_ zaxpy
283 #define zgemv_ zgemv
284 #define ztrsv_ ztrsv
285 #define zgemm_ zgemm
286 #define ztrsm_ ztrsm
287 #define zgerc_ zgerc
288 #define zhemv_ zhemv
289 #define zher2_ zher2
290 #define zgeru_ zgeru
291 
292 /* LAPACK */
293 #define dlamch_ dlamch
294 #define slamch_ slamch
295 #define xerbla_ xerbla
296 #define lsame_ lsame
297 
298 #define mc64id_ mc64id
299 #define mc64ad_ mc64ad
300 
301 #define c_bridge_dgssv_ c_bridge_dgssv
302 #define c_fortran_slugrid_ c_fortran_slugrid
303 #define c_fortran_pdgssvx_ c_fortran_pdgssvx
304 #define c_fortran_pdgssvx_ABglobal_ c_fortran_pdgssvx_abglobal
305 #define c_fortran_pzgssvx_ c_fortran_pzgssvx
306 #define c_fortran_pzgssvx_ABglobal_ c_fortran_pzgssvx_abglobal
307 
308 /* These are the functions defined in F90 wraper */
309 #define f_create_gridinfo_handle f_create_gridinfo_handle
310 #define f_create_options_handle f_create_options_handle
311 #define f_create_ScalePerm_handle f_create_scaleperm_handle
312 #define f_create_LUstruct_handle f_create_lustruct_handle
313 #define f_create_SOLVEstruct_handle f_create_solvestruct_handle
314 #define f_create_SuperMatrix_handle f_create_supermatrix_handle
315 #define f_destroy_gridinfo_handle f_destroy_gridinfo_handle
316 #define f_destroy_options_handle f_destroy_options_handle
317 #define f_destroy_ScalePerm_handle f_destroy_scaleperm_handle
318 #define f_destroy_LUstruct_handle f_destroy_lustruct_handle
319 #define f_destroy_SOLVEstruct_handle f_destroy_solvestruct_handle
320 #define f_destroy_SuperMatrix_handle f_destroy_supermatrix_handle
321 #define f_create_SuperLUStat_handle f_create_superlustat_handle
322 #define f_destroy_SuperLUStat_handle f_destroy_superlustat_handle
323 #define f_get_gridinfo f_get_gridinfo
324 #define f_get_SuperMatrix f_get_supermatrix
325 #define f_set_SuperMatrix f_set_supermatrix
326 #define f_get_CompRowLoc_Matrix f_get_comprowloc_matrix
327 #define f_set_CompRowLoc_Matrix f_set_comprowloc_matrix
328 #define f_get_superlu_options f_get_superlu_options
329 #define f_set_superlu_options f_set_superlu_options
330 #define f_set_default_options f_set_default_options
331 #define f_superlu_gridinit f_superlu_gridinit
332 #define f_superlu_gridexit f_superlu_gridexit
333 #define f_ScalePermstructInit f_scalepermstructinit
334 #define f_ScalePermstructFree f_scalepermstructfree
335 #define f_PStatInit f_pstatinit
336 #define f_PStatFree f_pstatfree
337 #define f_LUstructInit f_lustructinit
338 #define f_LUstructFree f_lustructfree
339 #define f_Destroy_LU f_destroy_lu
340 #define f_dCreate_CompRowLoc_Mat_dist f_dcreate_comprowloc_mat_dist
341 #define f_Destroy_CompRowLoc_Mat_dist f_destroy_comprowloc_mat_dist
342 #define f_Destroy_SuperMat_Store_dist f_destroy_supermat_store_dist
343 #define f_dSolveFinalize f_dsolvefinalize
344 #define f_pdgssvx f_pdgssvx
345 #define f_dcreate_dist_matrix f_dcreate_dist_matrix
346 #define f_check_malloc f_check_malloc
347 #endif
348 
349 #endif /* __SUPERLU_CNAMES */