Amesos Package Browser (Single Doxygen Collection)  Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Amesos_SCALAPACK_wrappers.h
Go to the documentation of this file.
1 
2 // @HEADER
3 // ***********************************************************************
4 //
5 // Amesos: Direct Sparse Solver Package
6 // Copyright (2004) Sandia Corporation
7 //
8 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
9 // license for use of this work by or on behalf of the U.S. Government.
10 //
11 // This library is free software; you can redistribute it and/or modify
12 // it under the terms of the GNU Lesser General Public License as
13 // published by the Free Software Foundation; either version 2.1 of the
14 // License, or (at your option) any later version.
15 //
16 // This library is distributed in the hope that it will be useful, but
17 // WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 // Lesser General Public License for more details.
20 //
21 // You should have received a copy of the GNU Lesser General Public
22 // License along with this library; if not, write to the Free Software
23 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
24 // USA
25 // Questions? Contact Michael A. Heroux (maherou@sandia.gov)
26 //
27 // ***********************************************************************
28 // @HEADER
29 
30 #ifndef AMESOS_SCALAPACK_WRAPPERS_H
31 #define AMESOS_SCALAPACK_WRAPPERS_H
32 
33 #include "Epetra_ConfigDefs.h"
34 #include "Epetra_LAPACK_wrappers.h"
35 #include <stdio.h>
36 #include <string.h>
37 
38 #if defined(CRAY_T3X) || defined(INTEL_CXML) || defined(INTEL_MKL)
39 
40 /* All three of these machines use a simple uppercase mangling of Fortran names */
41 
42 /* if F77_FUNC is defined undefine it because we want to redefine */
43 
44 #if defined(CRAY_T3X)
45 
46 #define SL_INIT_F77 F77_FUNC_(sl_init,SL_INIT)
47 #define BLACS_GRIDINFO_F77 F77_FUNC_(blacs_gridinfo,BLACS_GRIDINFO)
48 #define PDGETRF_F77 F77_FUNC(psgetrf,PSGETRF)
49 #define PDGETRS_F77 F77_FUNC(psgetrs,PSGETRS)
50 #define DESCINIT_F77 F77_FUNC(descinit,DESCINIT)
51 
52 #endif
53 #if defined(INTEL_CXML)
54 
55 #define SL_INIT_F77 F77_FUNC_(sl_init,SL_INIT)
56 #define BLACS_GRIDINFO_F77 F77_FUNC_(blacs_gridinfo,BLACS_GRIDINFO)
57 #define PDGETRF_F77 F77_FUNC(pdgetrf,PDGETRF)
58 #define PDGETRS_F77 F77_FUNC(pdgetrs,PDGETRS)
59 #define DESCINIT_F77 F77_FUNC(descinit,DESCINIT)
60 
61 #endif
62 #if defined(INTEL_MKL)
63 
64 #define SL_INIT_F77 F77_FUNC_(sl_init,SL_INIT_)
65 #define BLACS_GRIDINFO_F77 F77_FUNC_(blacs_gridinfo,BLACS_GRIDINFO_)
66 #define PDGETRF_F77 F77_FUNC(pdgetrf,PDGETRF)
67 #define PDGETRS_F77 F77_FUNC(pdgetrs,PDGETRS)
68 #define DESCINIT_F77 F77_FUNC(descinit,DESCINIT)
69 
70 #endif
71 
72 #else
73 
74 /* Use autoconf's definition of F77_FUNC
75  unless using old make system */
76 
77 #define SL_INIT_F77 F77_FUNC_(sl_init,SL_INIT)
78 #define BLACS_GRIDINFO_F77 F77_FUNC_(blacs_gridinfo,BLACS_GRIDINFO)
79 
80 #define PDGETRF_F77 F77_FUNC(pdgetrf,PDGETRF)
81 #define PDGETRS_F77 F77_FUNC(pdgetrs,PDGETRS)
82 #define DESCINIT_F77 F77_FUNC(descinit,DESCINIT)
83 
84 #endif
85 
86 #ifdef __cplusplus
87 extern "C" {
88 #endif
89 
90  /* ScaLAPACK and BLACS initialization routines */
91  void PREFIX SL_INIT_F77(int* blacs_context, const int* nprow, const int* npcol);
92  void PREFIX DESCINIT_F77(int *DescA, const int* m, const int* n, const int* mblock,
93  const int* nblock, const int* rsrc, const int* csrc, const int* blacs_context,
94  const int* Lda, int* ierr);
95  void PREFIX BLACS_GRIDINFO_F77(int* blacs_context, const int* nprow, const int* npcol,
96  const int* myrow, const int* mycol);
97  /* Double precision ScaLAPACK linear solvers */
98  void PREFIX PDGETRF_F77(const int* m, const int* n, double* A, const int* Ai, const int* Aj,
99  const int* DescA, int* ipiv, int* info);
100  void PREFIX PDGETRS_F77(Epetra_fcd, const int* n, const int* nrhs,
101  const double* A, const int* Ai, const int* Aj,
102  const int* DescA, const int* ipiv, double* X, const int* Xi, const int* Xj,
103  const int* DescX, int* info);
104 
105 #ifdef __cplusplus
106 }
107 #endif
108 
109 #endif /* AMESOS_SCALAPACK_WRAPPERS_H */
#define PREFIX
#define DESCINIT_F77
#define SL_INIT_F77
#define BLACS_GRIDINFO_F77
#define Epetra_fcd
#define PDGETRS_F77
#define PDGETRF_F77
int n