IFPACK  Development
 All Classes Files Functions Variables Enumerations Friends
euclid_config.h
00001 /*@HEADER
00002 // ***********************************************************************
00003 //
00004 //       Ifpack: Object-Oriented Algebraic Preconditioner Package
00005 //                 Copyright (2002) 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 // Redistribution and use in source and binary forms, with or without
00011 // modification, are permitted provided that the following conditions are
00012 // met:
00013 //
00014 // 1. Redistributions of source code must retain the above copyright
00015 // notice, this list of conditions and the following disclaimer.
00016 //
00017 // 2. Redistributions in binary form must reproduce the above copyright
00018 // notice, this list of conditions and the following disclaimer in the
00019 // documentation and/or other materials provided with the distribution.
00020 //
00021 // 3. Neither the name of the Corporation nor the names of the
00022 // contributors may be used to endorse or promote products derived from
00023 // this software without specific prior written permission.
00024 //
00025 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
00026 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00027 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00028 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
00029 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00030 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00031 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00032 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00033 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00034 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00035 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00036 //
00037 // Questions? Contact Michael A. Heroux (maherou@sandia.gov)
00038 //
00039 // ***********************************************************************
00040 //@HEADER
00041 */
00042 
00043 
00044 #ifndef EUCLID_CONF_DH
00045 #define EUCLID_CONF_DH
00046 
00047 #define MAX_MPI_TASKS 50000
00048 
00049 /* for use in printTriples functions */
00050 #define TRIPLES_FORMAT    "%i %i %1.8e\n"
00051 /* #define TRIPLES_FORMAT    "%i %i %1.19e\n" */
00052 
00053 #undef PRIVATE_TIMING_DH
00054   /* primarily for experimental purposes; if defined, TimeLog_dh
00055      marks are entered in Mat_dh and Euclid_apply modules.
00056    */
00057 
00058 
00059   /* top-level error handlers. redefine to do what you want, or don't
00060      use it at all.  Intended usage for calling Euclid functions from
00061      main is:
00062 
00063      Euclid_dhPhoo(); ERRCHKA;
00064    */
00065 
00066 #ifdef USING_MPI
00067 #define EUCLID_EXIT MPI_Abort(comm_dh, -1)
00068 #else
00069 #define EUCLID_EXIT exit(-1);
00070 #endif
00071 
00072 #define EXIT_NOW(msg) \
00073       { setError_dh(msg, __FUNC__, __FILE__, __LINE__); \
00074         ERRCHKA; \
00075       }
00076 
00077 #define ERRCHKA   \
00078     if (errFlag_dh) {  \
00079       setError_dh("", __FUNC__, __FILE__, __LINE__); \
00080       if (logFile != NULL) {  \
00081         printErrorMsg(logFile);  \
00082         closeLogfile_dh();  \
00083       } \
00084       printErrorMsg(stderr);  \
00085       if (myid_dh == 0) { \
00086         Mem_dhPrint(mem_dh, stderr, false); \
00087       } \
00088       EUCLID_EXIT; \
00089     }
00090 
00091 #define ERRCHKA_CHKERRA(ierr)   \
00092     if (errFlag_dh) {  \
00093       setError_dh("", __FUNC__, __FILE__, __LINE__); \
00094       if (logFile != NULL) {  \
00095         printErrorMsg(logFile);  \
00096         fprintf(logFile, "\n[%i] ierr = %i, errFlag_dh = %i\n", myid_dh, ierr, errFlag_dh); \
00097         closeLogfile_dh();  \
00098       } \
00099       printErrorMsg(stderr);  \
00100       fprintf(stderr, "\n[%i] ierr = %i, errFlag_dh = %i\n", myid_dh, ierr, errFlag_dh); \
00101       CHKERRA(ierr); \
00102     }
00103 
00104 
00105 #define MAX_SUBDOMAINS  20
00106   /* The maximum number of subdomains into which
00107      the matrix may be partitioned.  Rule of thumb:
00108      MAX_SUBDOMAINS >= number of threads.
00109 
00110      Note: this is only for shared-memory.
00111    */
00112 
00113 
00114 #define PIVOT_FIX_DEFAULT  1e-3
00115 
00116 /*---------------------------------------------------------------------
00117  * Memory management.  These macros work with functions in Mem_dh.c;
00118  * Change if you want to use some memory management and reporting schemes 
00119  * other than that supplied with Euclid.   These depend on the global
00120  * object "Mem_dh mem_dh" which is defined in globalObjects.c (yuck!)
00121  ---------------------------------------------------------------------*/
00122 
00123 #define MALLOC_DH(s)  Mem_dhMalloc(mem_dh, (s))
00124 #define FREE_DH(p)    Mem_dhFree(mem_dh, p)
00125 
00126 
00127   /* The actual calls used by Mem_dh objects to allocate/free memory 
00128    * from the heap.
00129    */
00130 #define PRIVATE_MALLOC  malloc
00131 #define PRIVATE_FREE    free
00132 
00133 /*------------------ Memory management end -----------------------------*/
00134 
00135 /*
00136 
00137 This is currently accomplished in the makefile system;
00138 If you're building an interface to a solver package,
00139 you need to write EUCLID_GET_ROW() functions: see src/getRow.c
00140 */
00141 
00142 #endif
 All Classes Files Functions Variables Enumerations Friends