Amesos Package Browser (Single Doxygen Collection) Development
Amesos_SCALAPACK_wrappers.h
Go to the documentation of this file.
00001 
00002 // @HEADER
00003 // ***********************************************************************
00004 // 
00005 //                Amesos: Direct Sparse Solver Package
00006 //                 Copyright (2004) Sandia Corporation
00007 // 
00008 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00009 // license for use of this work by or on behalf of the U.S. Government.
00010 // 
00011 // This library is free software; you can redistribute it and/or modify
00012 // it under the terms of the GNU Lesser General Public License as
00013 // published by the Free Software Foundation; either version 2.1 of the
00014 // License, or (at your option) any later version.
00015 //  
00016 // This library is distributed in the hope that it will be useful, but
00017 // WITHOUT ANY WARRANTY; without even the implied warranty of
00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00019 // Lesser General Public License for more details.
00020 //  
00021 // You should have received a copy of the GNU Lesser General Public
00022 // License along with this library; if not, write to the Free Software
00023 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00024 // USA
00025 // Questions? Contact Michael A. Heroux (maherou@sandia.gov) 
00026 // 
00027 // ***********************************************************************
00028 // @HEADER
00029 
00030 #ifndef AMESOS_SCALAPACK_WRAPPERS_H
00031 #define AMESOS_SCALAPACK_WRAPPERS_H
00032 
00033 #include "Epetra_ConfigDefs.h"
00034 #include "Epetra_LAPACK_wrappers.h"
00035 #include <stdio.h>
00036 #include <string.h>
00037 
00038 #if defined(CRAY_T3X) || defined(INTEL_CXML) || defined(INTEL_MKL)
00039 
00040 /* All three of these machines use a simple uppercase mangling of Fortran names */
00041 
00042 /* if F77_FUNC is defined undefine it because we want to redefine */
00043 
00044 #if defined(CRAY_T3X)
00045 
00046 #define SL_INIT_F77  F77_FUNC_(sl_init,SL_INIT)
00047 #define BLACS_GRIDINFO_F77  F77_FUNC_(blacs_gridinfo,BLACS_GRIDINFO)
00048 #define PDGETRF_F77  F77_FUNC(psgetrf,PSGETRF)
00049 #define PDGETRS_F77  F77_FUNC(psgetrs,PSGETRS)
00050 #define DESCINIT_F77  F77_FUNC(descinit,DESCINIT)
00051 
00052 #endif
00053 #if defined(INTEL_CXML)
00054 
00055 #define SL_INIT_F77  F77_FUNC_(sl_init,SL_INIT)
00056 #define BLACS_GRIDINFO_F77  F77_FUNC_(blacs_gridinfo,BLACS_GRIDINFO)
00057 #define PDGETRF_F77  F77_FUNC(pdgetrf,PDGETRF)
00058 #define PDGETRS_F77  F77_FUNC(pdgetrs,PDGETRS)
00059 #define DESCINIT_F77  F77_FUNC(descinit,DESCINIT)
00060 
00061 #endif
00062 #if defined(INTEL_MKL)
00063 
00064 #define SL_INIT_F77  F77_FUNC_(sl_init,SL_INIT_)
00065 #define BLACS_GRIDINFO_F77  F77_FUNC_(blacs_gridinfo,BLACS_GRIDINFO_)
00066 #define PDGETRF_F77  F77_FUNC(pdgetrf,PDGETRF)
00067 #define PDGETRS_F77  F77_FUNC(pdgetrs,PDGETRS)
00068 #define DESCINIT_F77  F77_FUNC(descinit,DESCINIT)
00069 
00070 #endif
00071 
00072 #else
00073 
00074 /* Use autoconf's definition of F77_FUNC 
00075    unless using old make system */
00076 
00077 #define SL_INIT_F77  F77_FUNC_(sl_init,SL_INIT)
00078 #define BLACS_GRIDINFO_F77  F77_FUNC_(blacs_gridinfo,BLACS_GRIDINFO)
00079 
00080 #define PDGETRF_F77  F77_FUNC(pdgetrf,PDGETRF)
00081 #define PDGETRS_F77  F77_FUNC(pdgetrs,PDGETRS)
00082 #define DESCINIT_F77  F77_FUNC(descinit,DESCINIT)
00083 
00084 #endif
00085 
00086 #ifdef __cplusplus
00087 extern "C" {
00088 #endif
00089 
00090   /* ScaLAPACK and BLACS initialization routines */
00091   void PREFIX SL_INIT_F77(int* blacs_context, const int* nprow, const int* npcol);
00092   void PREFIX DESCINIT_F77(int *DescA, const int* m, const int* n, const int* mblock, 
00093          const int* nblock, const int* rsrc, const int* csrc, const int* blacs_context,
00094          const int* Lda, int* ierr);
00095   void PREFIX BLACS_GRIDINFO_F77(int* blacs_context, const int* nprow, const int* npcol,
00096          const int* myrow, const int* mycol);
00097   /* Double precision ScaLAPACK linear solvers */
00098   void PREFIX PDGETRF_F77(const int* m, const int* n, double* A, const int* Ai, const int* Aj, 
00099         const int* DescA, int* ipiv, int* info);
00100   void PREFIX PDGETRS_F77(Epetra_fcd, const int* n, const int* nrhs, 
00101         const double* A, const int* Ai, const int* Aj, 
00102         const int* DescA, const int* ipiv, double* X, const int* Xi, const int* Xj,
00103         const int* DescX, int* info);
00104 
00105 #ifdef __cplusplus
00106 }
00107 #endif
00108 
00109 #endif /* AMESOS_SCALAPACK_WRAPPERS_H */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines