Ifpack Package Browser (Single Doxygen Collection)  Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
euclid_config.h
Go to the documentation of this file.
1 /*@HEADER
2 // ***********************************************************************
3 //
4 // Ifpack: Object-Oriented Algebraic Preconditioner Package
5 // Copyright (2002) Sandia Corporation
6 //
7 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
8 // license for use of this work by or on behalf of the U.S. Government.
9 //
10 // Redistribution and use in source and binary forms, with or without
11 // modification, are permitted provided that the following conditions are
12 // met:
13 //
14 // 1. Redistributions of source code must retain the above copyright
15 // notice, this list of conditions and the following disclaimer.
16 //
17 // 2. Redistributions in binary form must reproduce the above copyright
18 // notice, this list of conditions and the following disclaimer in the
19 // documentation and/or other materials provided with the distribution.
20 //
21 // 3. Neither the name of the Corporation nor the names of the
22 // contributors may be used to endorse or promote products derived from
23 // this software without specific prior written permission.
24 //
25 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 //
37 // Questions? Contact Michael A. Heroux (maherou@sandia.gov)
38 //
39 // ***********************************************************************
40 //@HEADER
41 */
42 
43 
44 #ifndef EUCLID_CONF_DH
45 #define EUCLID_CONF_DH
46 
47 #if defined(Ifpack_SHOW_DEPRECATED_WARNINGS)
48 #ifdef __GNUC__
49 #warning "The Ifpack package is deprecated"
50 #endif
51 #endif
52 
53 #define MAX_MPI_TASKS 50000
54 
55 /* for use in printTriples functions */
56 #define TRIPLES_FORMAT "%i %i %1.8e\n"
57 /* #define TRIPLES_FORMAT "%i %i %1.19e\n" */
58 
59 #undef PRIVATE_TIMING_DH
60  /* primarily for experimental purposes; if defined, TimeLog_dh
61  marks are entered in Mat_dh and Euclid_apply modules.
62  */
63 
64 
65  /* top-level error handlers. redefine to do what you want, or don't
66  use it at all. Intended usage for calling Euclid functions from
67  main is:
68 
69  Euclid_dhPhoo(); ERRCHKA;
70  */
71 
72 #ifdef USING_MPI
73 #define EUCLID_EXIT MPI_Abort(comm_dh, -1)
74 #else
75 #define EUCLID_EXIT exit(-1);
76 #endif
77 
78 #define EXIT_NOW(msg) \
79  { setError_dh(msg, __FUNC__, __FILE__, __LINE__); \
80  ERRCHKA; \
81  }
82 
83 #define ERRCHKA \
84  if (errFlag_dh) { \
85  setError_dh("", __FUNC__, __FILE__, __LINE__); \
86  if (logFile != NULL) { \
87  printErrorMsg(logFile); \
88  closeLogfile_dh(); \
89  } \
90  printErrorMsg(stderr); \
91  if (myid_dh == 0) { \
92  Mem_dhPrint(mem_dh, stderr, false); \
93  } \
94  EUCLID_EXIT; \
95  }
96 
97 #define ERRCHKA_CHKERRA(ierr) \
98  if (errFlag_dh) { \
99  setError_dh("", __FUNC__, __FILE__, __LINE__); \
100  if (logFile != NULL) { \
101  printErrorMsg(logFile); \
102  fprintf(logFile, "\n[%i] ierr = %i, errFlag_dh = %i\n", myid_dh, ierr, errFlag_dh); \
103  closeLogfile_dh(); \
104  } \
105  printErrorMsg(stderr); \
106  fprintf(stderr, "\n[%i] ierr = %i, errFlag_dh = %i\n", myid_dh, ierr, errFlag_dh); \
107  CHKERRA(ierr); \
108  }
109 
110 
111 #define MAX_SUBDOMAINS 20
112  /* The maximum number of subdomains into which
113  the matrix may be partitioned. Rule of thumb:
114  MAX_SUBDOMAINS >= number of threads.
115 
116  Note: this is only for shared-memory.
117  */
118 
119 
120 #define PIVOT_FIX_DEFAULT 1e-3
121 
122 /*---------------------------------------------------------------------
123  * Memory management. These macros work with functions in Mem_dh.c;
124  * Change if you want to use some memory management and reporting schemes
125  * other than that supplied with Euclid. These depend on the global
126  * object "Mem_dh mem_dh" which is defined in globalObjects.c (yuck!)
127  ---------------------------------------------------------------------*/
128 
129 #define MALLOC_DH(s) Mem_dhMalloc(mem_dh, (s))
130 #define FREE_DH(p) Mem_dhFree(mem_dh, p)
131 
132 
133  /* The actual calls used by Mem_dh objects to allocate/free memory
134  * from the heap.
135  */
136 #define PRIVATE_MALLOC malloc
137 #define PRIVATE_FREE free
138 
139 /*------------------ Memory management end -----------------------------*/
140 
141 /*
142 
143 This is currently accomplished in the makefile system;
144 If you're building an interface to a solver package,
145 you need to write EUCLID_GET_ROW() functions: see src/getRow.c
146 */
147 
148 #endif