p4est 2.8.6
p4est is a software library for parallel adaptive mesh refinement.
p4est_base.h
Go to the documentation of this file.
1/*
2 This file is part of p4est.
3 p4est is a C library to manage a collection (a forest) of multiple
4 connected adaptive quadtrees or octrees in parallel.
5
6 Copyright (C) 2010 The University of Texas System
7 Additional copyright (C) 2011 individual authors
8 Written by Carsten Burstedde, Lucas C. Wilcox, and Tobin Isaac
9
10 p4est is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
14
15 p4est is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with p4est; if not, write to the Free Software Foundation, Inc.,
22 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23*/
24
30#ifndef P4EST_BASE_H
31#define P4EST_BASE_H
32
33/* include config headers */
34#include <p4est_config.h>
35#include <sc_config.h>
36#if \
37 (defined (P4EST_ENABLE_MPI) && !defined (SC_ENABLE_MPI)) || \
38 (!defined (P4EST_ENABLE_MPI) && defined (SC_ENABLE_MPI))
39#error "MPI configured differently in p4est and libsc"
40#endif
41#if \
42 (defined (P4EST_ENABLE_MPIIO) && !defined (SC_ENABLE_MPIIO)) || \
43 (!defined (P4EST_ENABLE_MPIIO) && defined (SC_ENABLE_MPIIO))
44#error "MPI I/O configured differently in p4est and libsc"
45#endif
46
47/* indirectly also include sc.h */
48#include <sc_containers.h>
49#define _p4est_const _sc_const
50
51/*--------------------------------------------------------------------*/
52/*------------------------ QUERY API CHANGES -------------------------*/
53/*---- definitions to allow user code to query the p4est library -----*/
54
56#define P4EST_COMM_TRANSFER_NULL
57
60#define P4EST_CONN_DISK_PERIODIC
61
63#define P4EST_CONN_REORDER_NEWID
64
71#define P4EST_SEARCH_LOCAL
72
74#define P4EST_VTK_CELL_DATAV
75
76/*--------------------------------------------------------------------*/
77
78SC_EXTERN_C_BEGIN;
79
81typedef int32_t p4est_qcoord_t;
82#define p4est_qcoord_compare sc_int32_compare
83#define P4EST_QCOORD_BITS 32
84#define P4EST_MPI_QCOORD sc_MPI_INT
85#define P4EST_VTK_QCOORD "Int32"
86#define P4EST_F90_QCOORD INTEGER(KIND=C_INT32_T)
87#define P4EST_QCOORD_MIN INT32_MIN
88#define P4EST_QCOORD_MAX INT32_MAX
89#define P4EST_QCOORD_1 ((p4est_qcoord_t) 1)
90#define P4EST_QCOORD_ABS(x) ((p4est_qcoord_t) labs ((long) (x)))
91
93typedef int32_t p4est_topidx_t;
94#define p4est_topidx_compare sc_int32_compare
95#define P4EST_TOPIDX_BITS 32
96#define P4EST_MPI_TOPIDX sc_MPI_INT
97#define P4EST_VTK_TOPIDX "Int32"
98#define P4EST_F90_TOPIDX INTEGER(KIND=C_INT32_T)
99#define P4EST_TOPIDX_MIN INT32_MIN
100#define P4EST_TOPIDX_MAX INT32_MAX
101#define P4EST_TOPIDX_FITS_32 1
102#define P4EST_TOPIDX_1 ((p4est_topidx_t) 1)
103#define P4EST_TOPIDX_ABS(x) ((p4est_topidx_t) labs ((long) (x)))
104
106typedef int32_t p4est_locidx_t;
107#define p4est_locidx_compare sc_int32_compare
108#define P4EST_LOCIDX_BITS 32
109#define P4EST_MPI_LOCIDX sc_MPI_INT
110#define P4EST_VTK_LOCIDX "Int32"
111#define P4EST_F90_LOCIDX INTEGER(KIND=C_INT32_T)
112#define P4EST_LOCIDX_MIN INT32_MIN
113#define P4EST_LOCIDX_MAX INT32_MAX
114#define P4EST_LOCIDX_1 ((p4est_locidx_t) 1)
115#define P4EST_LOCIDX_ABS(x) ((p4est_locidx_t) labs ((long) (x)))
116
118typedef int64_t p4est_gloidx_t;
119#define p4est_gloidx_compare sc_int64_compare
120#define P4EST_GLOIDX_BITS 64
121#define P4EST_MPI_GLOIDX sc_MPI_LONG_LONG_INT
122#define P4EST_VTK_GLOIDX "Int64"
123#define P4EST_F90_GLOIDX INTEGER(KIND=C_INT64_T)
124#define P4EST_GLOIDX_MIN INT64_MIN
125#define P4EST_GLOIDX_MAX INT64_MAX
126#define P4EST_GLOIDX_1 ((p4est_gloidx_t) 1)
127#define P4EST_GLOIDX_ABS(x) ((p4est_gloidx_t) llabs ((long long) (x)))
128
130typedef enum p4est_comm_tag
131{
132 P4EST_COMM_TAG_FIRST = SC_TAG_FIRST,
133 P4EST_COMM_COUNT_PERTREE = SC_TAG_LAST,
134 P4EST_COMM_BALANCE_FIRST_COUNT,
135 P4EST_COMM_BALANCE_FIRST_LOAD,
136 P4EST_COMM_BALANCE_SECOND_COUNT,
137 P4EST_COMM_BALANCE_SECOND_LOAD,
138 P4EST_COMM_PARTITION_GIVEN,
139 P4EST_COMM_PARTITION_WEIGHTED_LOW,
140 P4EST_COMM_PARTITION_WEIGHTED_HIGH,
141 P4EST_COMM_PARTITION_CORRECTION,
142 P4EST_COMM_GHOST_COUNT,
143 P4EST_COMM_GHOST_LOAD,
144 P4EST_COMM_GHOST_EXCHANGE,
145 P4EST_COMM_GHOST_EXPAND_COUNT,
146 P4EST_COMM_GHOST_EXPAND_LOAD,
147 P4EST_COMM_GHOST_SUPPORT_COUNT,
148 P4EST_COMM_GHOST_SUPPORT_LOAD,
149 P4EST_COMM_GHOST_CHECKSUM,
150 P4EST_COMM_NODES_QUERY,
151 P4EST_COMM_NODES_REPLY,
152 P4EST_COMM_SAVE,
153 P4EST_COMM_LNODES_TEST,
154 P4EST_COMM_LNODES_PASS,
155 P4EST_COMM_LNODES_OWNED,
156 P4EST_COMM_LNODES_ALL,
157 P4EST_COMM_TAG_LAST
158}
160
161/* some error checking possibly specific to p4est */
162#ifdef P4EST_ENABLE_DEBUG
163#define P4EST_ASSERT(c) SC_CHECK_ABORT ((c), "Assertion '" #c "'")
164#define P4EST_EXECUTE_ASSERT_FALSE(expression) \
165 do { int _p4est_i = (int) (expression); \
166 SC_CHECK_ABORT (!_p4est_i, "Expected false: '" #expression "'"); \
167 } while (0)
168#define P4EST_EXECUTE_ASSERT_TRUE(expression) \
169 do { int _p4est_i = (int) (expression); \
170 SC_CHECK_ABORT (_p4est_i, "Expected true: '" #expression "'"); \
171 } while (0)
172#define P4EST_EXECUTE_ASSERT_INT(expression,ival) \
173 do { int _p4est_i = (int) (expression); \
174 SC_CHECK_ABORT ((ival) == _p4est_i, \
175 "Expected '" #ival "': '" #expression "'"); \
176 } while (0)
177#define P4EST_EXECUTE_ASSERT_TOPIDX(expression,tval) \
178 do { p4est_topidx_t _p4est_t = (p4est_topidx_t) (expression); \
179 SC_CHECK_ABORT ((tval) == _p4est_t, \
180 "Expected '" #tval "': '" #expression "'"); \
181 } while (0)
182#define P4EST_DEBUG_EXECUTE(expression) \
183 do { (void) (expression); } while (0)
184#else
185#define P4EST_ASSERT(c) SC_NOOP ()
186#define P4EST_EXECUTE_ASSERT_FALSE(expression) \
187 do { (void) (expression); } while (0)
188#define P4EST_EXECUTE_ASSERT_TRUE(expression) \
189 do { (void) (expression); } while (0)
190#define P4EST_EXECUTE_ASSERT_INT(expression,ival) \
191 do { (void) (expression); } while (0)
192#define P4EST_EXECUTE_ASSERT_TOPIDX(expression,tval) \
193 do { (void) (expression); } while (0)
194#define P4EST_DEBUG_EXECUTE(expression) SC_NOOP ()
195#endif
196
197/* macros for memory allocation, will abort if out of memory */
199#define P4EST_ALLOC(t,n) (t *) sc_malloc (p4est_package_id, \
200 (n) * sizeof(t))
202#define P4EST_ALLOC_ZERO(t,n) (t *) sc_calloc (p4est_package_id, \
203 (size_t) (n), sizeof(t))
205#define P4EST_REALLOC(p,t,n) (t *) sc_realloc (p4est_package_id, \
206 (p), (n) * sizeof(t))
208#define P4EST_STRDUP(s) sc_strdup (p4est_package_id, (s))
210#define P4EST_FREE(p) sc_free (p4est_package_id, (p))
211
212/* log helper macros */
213#define P4EST_GLOBAL_LOG(p,s) \
214 SC_GEN_LOG (p4est_package_id, SC_LC_GLOBAL, (p), (s))
215#define P4EST_LOG(p,s) \
216 SC_GEN_LOG (p4est_package_id, SC_LC_NORMAL, (p), (s))
217void P4EST_GLOBAL_LOGF (int priority, const char *fmt, ...)
218 __attribute__ ((format (printf, 2, 3)));
219void P4EST_LOGF (int priority, const char *fmt, ...)
220 __attribute__ ((format (printf, 2, 3)));
221#ifndef __cplusplus
222#define P4EST_GLOBAL_LOGF(p,f,...) \
223 SC_GEN_LOGF (p4est_package_id, SC_LC_GLOBAL, (p), (f), __VA_ARGS__)
224#define P4EST_LOGF(p,f,...) \
225 SC_GEN_LOGF (p4est_package_id, SC_LC_NORMAL, (p), (f), __VA_ARGS__)
226#endif
227
228/* convenience global log macros will only print if identifier <= 0 */
229#define P4EST_GLOBAL_TRACE(s) P4EST_GLOBAL_LOG (SC_LP_TRACE, (s))
230#define P4EST_GLOBAL_LDEBUG(s) P4EST_GLOBAL_LOG (SC_LP_DEBUG, (s))
231#define P4EST_GLOBAL_VERBOSE(s) P4EST_GLOBAL_LOG (SC_LP_VERBOSE, (s))
232#define P4EST_GLOBAL_INFO(s) P4EST_GLOBAL_LOG (SC_LP_INFO, (s))
233#define P4EST_GLOBAL_STATISTICS(s) P4EST_GLOBAL_LOG (SC_LP_STATISTICS, (s))
234#define P4EST_GLOBAL_PRODUCTION(s) P4EST_GLOBAL_LOG (SC_LP_PRODUCTION, (s))
235#define P4EST_GLOBAL_ESSENTIAL(s) P4EST_GLOBAL_LOG (SC_LP_ESSENTIAL, (s))
236#define P4EST_GLOBAL_LERROR(s) P4EST_GLOBAL_LOG (SC_LP_ERROR, (s))
237void P4EST_GLOBAL_TRACEF (const char *fmt, ...)
238 __attribute__ ((format (printf, 1, 2)));
239void P4EST_GLOBAL_LDEBUGF (const char *fmt, ...)
240 __attribute__ ((format (printf, 1, 2)));
241void P4EST_GLOBAL_VERBOSEF (const char *fmt, ...)
242 __attribute__ ((format (printf, 1, 2)));
243void P4EST_GLOBAL_INFOF (const char *fmt, ...)
244 __attribute__ ((format (printf, 1, 2)));
245void P4EST_GLOBAL_STATISTICSF (const char *fmt, ...)
246 __attribute__ ((format (printf, 1, 2)));
247void P4EST_GLOBAL_PRODUCTIONF (const char *fmt, ...)
248 __attribute__ ((format (printf, 1, 2)));
249void P4EST_GLOBAL_ESSENTIALF (const char *fmt, ...)
250 __attribute__ ((format (printf, 1, 2)));
251void P4EST_GLOBAL_LERRORF (const char *fmt, ...)
252 __attribute__ ((format (printf, 1, 2)));
253#ifndef __cplusplus
254#define P4EST_GLOBAL_TRACEF(f,...) \
255 P4EST_GLOBAL_LOGF (SC_LP_TRACE, (f), __VA_ARGS__)
256#define P4EST_GLOBAL_LDEBUGF(f,...) \
257 P4EST_GLOBAL_LOGF (SC_LP_DEBUG, (f), __VA_ARGS__)
258#define P4EST_GLOBAL_VERBOSEF(f,...) \
259 P4EST_GLOBAL_LOGF (SC_LP_VERBOSE, (f), __VA_ARGS__)
260#define P4EST_GLOBAL_INFOF(f,...) \
261 P4EST_GLOBAL_LOGF (SC_LP_INFO, (f), __VA_ARGS__)
262#define P4EST_GLOBAL_STATISTICSF(f,...) \
263 P4EST_GLOBAL_LOGF (SC_LP_STATISTICS, (f), __VA_ARGS__)
264#define P4EST_GLOBAL_PRODUCTIONF(f,...) \
265 P4EST_GLOBAL_LOGF (SC_LP_PRODUCTION, (f), __VA_ARGS__)
266#define P4EST_GLOBAL_ESSENTIALF(f,...) \
267 P4EST_GLOBAL_LOGF (SC_LP_ESSENTIAL, (f), __VA_ARGS__)
268#define P4EST_GLOBAL_LERRORF(f,...) \
269 P4EST_GLOBAL_LOGF (SC_LP_ERROR, (f), __VA_ARGS__)
270#endif
271#define P4EST_GLOBAL_NOTICE P4EST_GLOBAL_STATISTICS
272#define P4EST_GLOBAL_NOTICEF P4EST_GLOBAL_STATISTICSF
273
274/* convenience log macros that are active on every processor */
275#define P4EST_TRACE(s) P4EST_LOG (SC_LP_TRACE, (s))
276#define P4EST_LDEBUG(s) P4EST_LOG (SC_LP_DEBUG, (s))
277#define P4EST_VERBOSE(s) P4EST_LOG (SC_LP_VERBOSE, (s))
278#define P4EST_INFO(s) P4EST_LOG (SC_LP_INFO, (s))
279#define P4EST_STATISTICS(s) P4EST_LOG (SC_LP_STATISTICS, (s))
280#define P4EST_PRODUCTION(s) P4EST_LOG (SC_LP_PRODUCTION, (s))
281#define P4EST_ESSENTIAL(s) P4EST_LOG (SC_LP_ESSENTIAL, (s))
282#define P4EST_LERROR(s) P4EST_LOG (SC_LP_ERROR, (s))
283void P4EST_TRACEF (const char *fmt, ...)
284 __attribute__ ((format (printf, 1, 2)));
285void P4EST_LDEBUGF (const char *fmt, ...)
286 __attribute__ ((format (printf, 1, 2)));
287void P4EST_VERBOSEF (const char *fmt, ...)
288 __attribute__ ((format (printf, 1, 2)));
289void P4EST_INFOF (const char *fmt, ...)
290 __attribute__ ((format (printf, 1, 2)));
291void P4EST_STATISTICSF (const char *fmt, ...)
292 __attribute__ ((format (printf, 1, 2)));
293void P4EST_PRODUCTIONF (const char *fmt, ...)
294 __attribute__ ((format (printf, 1, 2)));
295void P4EST_ESSENTIALF (const char *fmt, ...)
296 __attribute__ ((format (printf, 1, 2)));
297void P4EST_LERRORF (const char *fmt, ...)
298 __attribute__ ((format (printf, 1, 2)));
299#ifndef __cplusplus
300#define P4EST_TRACEF(f,...) \
301 P4EST_LOGF (SC_LP_TRACE, (f), __VA_ARGS__)
302#define P4EST_LDEBUGF(f,...) \
303 P4EST_LOGF (SC_LP_DEBUG, (f), __VA_ARGS__)
304#define P4EST_VERBOSEF(f,...) \
305 P4EST_LOGF (SC_LP_VERBOSE, (f), __VA_ARGS__)
306#define P4EST_INFOF(f,...) \
307 P4EST_LOGF (SC_LP_INFO, (f), __VA_ARGS__)
308#define P4EST_STATISTICSF(f,...) \
309 P4EST_LOGF (SC_LP_STATISTICS, (f), __VA_ARGS__)
310#define P4EST_PRODUCTIONF(f,...) \
311 P4EST_LOGF (SC_LP_PRODUCTION, (f), __VA_ARGS__)
312#define P4EST_ESSENTIALF(f,...) \
313 P4EST_LOGF (SC_LP_ESSENTIAL, (f), __VA_ARGS__)
314#define P4EST_LERRORF(f,...) \
315 P4EST_LOGF (SC_LP_ERROR, (f), __VA_ARGS__)
316#endif
317#define P4EST_NOTICE P4EST_STATISTICS
318#define P4EST_NOTICEF P4EST_STATISTICSF
319
320/* extern declarations */
322extern int p4est_package_id;
323
324static inline void
325p4est_log_indent_push (void)
326{
327 sc_log_indent_push_count (p4est_package_id, 1);
328}
329
330static inline void
331p4est_log_indent_pop (void)
332{
333 sc_log_indent_pop_count (p4est_package_id, 1);
334}
335
345void p4est_init (sc_log_handler_t log_handler,
346 int log_threshold);
347
360
365
371
376/*@unused@*/
377static inline unsigned
378p4est_topidx_hash2 (const p4est_topidx_t * tt)
379{
380 uint32_t a, b, c;
381
382#if (P4EST_TOPIDX_FITS_32)
383 a = (uint32_t) tt[0];
384 b = (uint32_t) tt[1];
385 c = 0;
386#else
387 a = (uint32_t) (tt[0] && 0xFFFFFFFF);
388 b = (uint32_t) (tt[0] >> 32);
389 c = (uint32_t) (tt[1] && 0xFFFFFFFF);
390 sc_hash_mix (a, b, c);
391 a += (uint32_t) (tt[1] >> 32);
392#endif
393 sc_hash_final (a, b, c);
394
395 return (unsigned) c;
396}
397
402/*@unused@*/
403static inline unsigned
404p4est_topidx_hash3 (const p4est_topidx_t * tt)
405{
406 uint32_t a, b, c;
407
408#if (P4EST_TOPIDX_FITS_32)
409 a = (uint32_t) tt[0];
410 b = (uint32_t) tt[1];
411 c = (uint32_t) tt[2];
412#else
413 a = (uint32_t) (tt[0] && 0xFFFFFFFF);
414 b = (uint32_t) (tt[0] >> 32);
415 c = (uint32_t) (tt[1] && 0xFFFFFFFF);
416 sc_hash_mix (a, b, c);
417 a += (uint32_t) (tt[1] >> 32);
418 b += (uint32_t) (tt[2] && 0xFFFFFFFF);
419 c += (uint32_t) (tt[2] >> 32);
420#endif
421 sc_hash_final (a, b, c);
422
423 return (unsigned) c;
424}
425
430/*@unused@*/
431static inline unsigned
432p4est_topidx_hash4 (const p4est_topidx_t * tt)
433{
434 uint32_t a, b, c;
435
436#if (P4EST_TOPIDX_FITS_32)
437 a = (uint32_t) tt[0];
438 b = (uint32_t) tt[1];
439 c = (uint32_t) tt[2];
440 sc_hash_mix (a, b, c);
441 a += (uint32_t) tt[3];
442#else
443 a = (uint32_t) (tt[0] && 0xFFFFFFFF);
444 b = (uint32_t) (tt[0] >> 32);
445 c = (uint32_t) (tt[1] && 0xFFFFFFFF);
446 sc_hash_mix (a, b, c);
447 a += (uint32_t) (tt[1] >> 32);
448 b += (uint32_t) (tt[2] && 0xFFFFFFFF);
449 c += (uint32_t) (tt[2] >> 32);
450 sc_hash_mix (a, b, c);
451 a += (uint32_t) (tt[3] && 0xFFFFFFFF);
452 b += (uint32_t) (tt[3] >> 32);
453#endif
454 sc_hash_final (a, b, c);
455
456 return (unsigned) c;
457}
458
459/*@unused@*/
460static inline int
461p4est_topidx_is_sorted (p4est_topidx_t * t, int length)
462{
463 int i;
464
465 for (i = 1; i < length; ++i) {
466 if (t[i - 1] > t[i]) {
467 return 0;
468 }
469 }
470 return 1;
471}
472
473/*@unused@*/
474static inline void
475p4est_topidx_bsort (p4est_topidx_t * t, int length)
476{
477 int i, j;
478 p4est_topidx_t tswap;
479
480 /* go through all elements except the last */
481 for (i = length - 1; i > 0; --i) {
482 /* bubble up the first element until before position i */
483 for (j = 0; j < i; ++j) {
484 if (t[j] > t[j + 1]) {
485 tswap = t[j + 1];
486 t[j + 1] = t[j];
487 t[j] = tswap;
488 }
489 }
490 }
491 P4EST_ASSERT (p4est_topidx_is_sorted (t, length));
492}
493
494/*@unused@*/
495static inline uint64_t
496p4est_partition_cut_uint64 (uint64_t global_num, int p, int num_procs)
497{
498 uint64_t result;
499
500 /* In theory, a double * double product should never overflow
501 due to the 15-bit exponent used internally on x87 and above.
502 Also in theory, 80-bit floats should be used internally,
503 and multiply/divide associativity goes left-to-right.
504 Still checking for funny stuff just to be sure. */
505
506 P4EST_ASSERT (0 <= p && p <= num_procs);
507
508 if (p == num_procs) {
509 /* prevent roundoff error and division by zero */
510 return global_num;
511 }
512
513 result = (uint64_t)
514 (((long double) global_num * (double) p) / (double) num_procs);
515
516 P4EST_ASSERT (result <= global_num);
517
518 return result;
519}
520
521/*@unused@*/
522static inline p4est_gloidx_t
523p4est_partition_cut_gloidx (p4est_gloidx_t global_num, int p, int num_procs)
524{
525 p4est_gloidx_t result;
526
527 /* In theory, a double * double product should never overflow
528 due to the 15-bit exponent used internally on x87 and above.
529 Also in theory, 80-bit floats should be used internally,
530 and multiply/divide associativity goes left-to-right.
531 Still checking for funny stuff just to be sure. */
532
533 P4EST_ASSERT (global_num >= 0);
534 P4EST_ASSERT (0 <= p && p <= num_procs);
535
536 if (p == num_procs) {
537 /* prevent roundoff error and division by zero */
538 return global_num;
539 }
540
541 result = (p4est_gloidx_t)
542 (((long double) global_num * (double) p) / (double) num_procs);
543
544 P4EST_ASSERT (0 <= result && result <= global_num);
545
546 return result;
547}
548
557const char *p4est_version (void);
558
564
570
571SC_EXTERN_C_END;
572
573#endif /* !P4EST_BASE_H */
int32_t p4est_qcoord_t
Typedef for quadrant coordinates.
Definition: p4est_base.h:81
enum p4est_comm_tag p4est_comm_tag_t
Tags for MPI messages.
int p4est_version_major(void)
Return the major version of p4est.
int p4est_have_zlib(void)
Check for a sufficiently recent zlib installation.
int p4est_package_id
the libsc package id for p4est (set in p4est_init())
int32_t p4est_topidx_t
Typedef for counting topological entities (trees, tree vertices).
Definition: p4est_base.h:93
int p4est_get_package_id(void)
Query the package identity as registered in libsc.
const char * p4est_version(void)
Return the full version of p4est.
p4est_comm_tag
Tags for MPI messages.
Definition: p4est_base.h:131
int32_t p4est_locidx_t
Typedef for processor-local indexing of quadrants and nodes.
Definition: p4est_base.h:106
void p4est_init(sc_log_handler_t log_handler, int log_threshold)
Registers p4est with the SC Library and sets the logging behavior.
int p4est_version_minor(void)
Return the minor version of p4est.
int64_t p4est_gloidx_t
Typedef for globally unique indexing of quadrants.
Definition: p4est_base.h:118
int p4est_is_initialized(void)
Return whether p4est has been initialized or not.