IFPACK Development
euclid_config.h
00001 /*@HEADER
00002 // ***********************************************************************
00003 //
00004 //       Ifpack: Object-Oriented Algebraic Preconditioner Package
00005 //                 Copyright (2009) Sandia Corporation
00006 //
00007 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00008 // license for use of this work by or on behalf of the U.S. Government.
00009 //
00010 // This library is free software; you can redistribute it and/or modify
00011 // it under the terms of the GNU Lesser General Public License as
00012 // published by the Free Software Foundation; either version 2.1 of the
00013 // License, or (at your option) any later version.
00014 //
00015 // This library is distributed in the hope that it will be useful, but
00016 // WITHOUT ANY WARRANTY; without even the implied warranty of
00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018 // Lesser General Public License for more details.
00019 //
00020 // You should have received a copy of the GNU Lesser General Public
00021 // License along with this library; if not, write to the Free Software
00022 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00023 // USA
00024 // Questions? Contact Michael A. Heroux (maherou@sandia.gov)
00025 //
00026 // ***********************************************************************
00027 //@HEADER
00028 */
00029 
00030 
00031 #ifndef EUCLID_CONF_DH
00032 #define EUCLID_CONF_DH
00033 
00034 #define MAX_MPI_TASKS 50000
00035 
00036 /* for use in printTriples functions */
00037 #define TRIPLES_FORMAT    "%i %i %1.8e\n"
00038 /* #define TRIPLES_FORMAT    "%i %i %1.19e\n" */
00039 
00040 #undef PRIVATE_TIMING_DH
00041   /* primarily for experimental purposes; if defined, TimeLog_dh
00042      marks are entered in Mat_dh and Euclid_apply modules.
00043    */
00044 
00045 
00046   /* top-level error handlers. redefine to do what you want, or don't
00047      use it at all.  Intended usage for calling Euclid functions from
00048      main is:
00049 
00050      Euclid_dhPhoo(); ERRCHKA;
00051    */
00052 
00053 #ifdef USING_MPI
00054 #define EUCLID_EXIT MPI_Abort(comm_dh, -1)
00055 #else
00056 #define EUCLID_EXIT exit(-1);
00057 #endif
00058 
00059 #define EXIT_NOW(msg) \
00060       { setError_dh(msg, __FUNC__, __FILE__, __LINE__); \
00061         ERRCHKA; \
00062       }
00063 
00064 #define ERRCHKA   \
00065     if (errFlag_dh) {  \
00066       setError_dh("", __FUNC__, __FILE__, __LINE__); \
00067       if (logFile != NULL) {  \
00068         printErrorMsg(logFile);  \
00069         closeLogfile_dh();  \
00070       } \
00071       printErrorMsg(stderr);  \
00072       if (myid_dh == 0) { \
00073         Mem_dhPrint(mem_dh, stderr, false); \
00074       } \
00075       EUCLID_EXIT; \
00076     }
00077 
00078 #define ERRCHKA_CHKERRA(ierr)   \
00079     if (errFlag_dh) {  \
00080       setError_dh("", __FUNC__, __FILE__, __LINE__); \
00081       if (logFile != NULL) {  \
00082         printErrorMsg(logFile);  \
00083         fprintf(logFile, "\n[%i] ierr = %i, errFlag_dh = %i\n", myid_dh, ierr, errFlag_dh); \
00084         closeLogfile_dh();  \
00085       } \
00086       printErrorMsg(stderr);  \
00087       fprintf(stderr, "\n[%i] ierr = %i, errFlag_dh = %i\n", myid_dh, ierr, errFlag_dh); \
00088       CHKERRA(ierr); \
00089     }
00090 
00091 
00092 #define MAX_SUBDOMAINS  20
00093   /* The maximum number of subdomains into which
00094      the matrix may be partitioned.  Rule of thumb:
00095      MAX_SUBDOMAINS >= number of threads.
00096 
00097      Note: this is only for shared-memory.
00098    */
00099 
00100 
00101 #define PIVOT_FIX_DEFAULT  1e-3
00102 
00103 /*---------------------------------------------------------------------
00104  * Memory management.  These macros work with functions in Mem_dh.c;
00105  * Change if you want to use some memory management and reporting schemes 
00106  * other than that supplied with Euclid.   These depend on the global
00107  * object "Mem_dh mem_dh" which is defined in globalObjects.c (yuck!)
00108  ---------------------------------------------------------------------*/
00109 
00110 #define MALLOC_DH(s)  Mem_dhMalloc(mem_dh, (s))
00111 #define FREE_DH(p)    Mem_dhFree(mem_dh, p)
00112 
00113 
00114   /* The actual calls used by Mem_dh objects to allocate/free memory 
00115    * from the heap.
00116    */
00117 #define PRIVATE_MALLOC  malloc
00118 #define PRIVATE_FREE    free
00119 
00120 /*------------------ Memory management end -----------------------------*/
00121 
00122 /*
00123 
00124 This is currently accomplished in the makefile system;
00125 If you're building an interface to a solver package,
00126 you need to write EUCLID_GET_ROW() functions: see src/getRow.c
00127 */
00128 
00129 #endif
 All Classes Files Functions Variables Enumerations Friends