15#include <sys/resource.h>
64# define delete delete_qcc
65# define right right_qcc
105# define LINENO __LINE__
107#define assert(a) if (!(a)) qassert (__FILE__, LINENO, #a)
126#define p = (type *)realloc(p, (size)*sizeof(type)) p = (type *) realloc (p, (size)*sizeof(type))
127#define qmalloc(size, type) ((type *) malloc ((size)*sizeof(type)))
128#define qcalloc(size, type) ((type *) calloc (size, sizeof(type)))
135#include <extrae_user_events.h>
154 for (
int i = 0;
i <
a->len/
sizeof(
char *);
i++) {
155 char *
s = ((
char **)
a->p)[
i];
174 t->stack.len -=
sizeof(
int);
175 int value =
t->stack.len > 0 ?
176 ((
int *)
t->stack.p)[
t->stack.len/
sizeof(
int) - 1] : 0;
182 if (
t->index.len > 0) {
184 char *
names[
t->index.len/
sizeof(
char *) + 1],
185 **
func = (
char **)
t->index.p;
189 for (
int i = 0;
i <
t->index.len/
sizeof(
char *);
i++,
func++) {
199 char **
func = (
char **)
t->index.p;
200 for (
int i = 0;
i <
t->index.len/
sizeof(
char *);
i++,
func++)
214#define TRACE_TYPE(func) (strncmp (func, "mpi_", 4) ? \
215 &trace_func : &trace_func)
217#define TRACE_TYPE(func) &trace_func
246 for (
i = 0;
i < len;
i++,
t++)
262 Trace.t0 = tv.tv_sec + tv.tv_usec/1
e6;
263 double t[2] = {(tv.tv_sec -
Trace.t0) + tv.tv_usec/1
e6, 0.};
278 double te = (tv.tv_sec -
Trace.t0) + tv.tv_usec/1
e6;
279 double *
t = (
double *)
Trace.stack.p;
283 double dt =
te -
t[0];
285 fprintf (
stderr,
"end trace %s:%s:%d ts: %g te: %g dt: %g sum: %g\n",
289 if (
Trace.stack.len >= 2*
sizeof(
double)) {
301 return t1->self <
t2->self;
308 if (
t1->line !=
t2->line)
309 return t1->line <
t2->line;
339 fprintf (
fp,
" calls total self %% total function\n");
343 t->calls,
t->total,
t->self,
t->self*100./
total);
347 fprintf (
fp,
" %s():%s:%d\n",
t->func,
t->file,
t->line);
352 t->calls =
t->total =
t->self = 0.;
419 union {
int a;
float b;
double c;} global;
547 setenv (
"MALLOC_TRACE", name, 1);
633 while (
i && *
i) {
n++;
i++; }
658 if (*
i != (
FILE *) 1)
667#define pclose qpclose
678#include "../ast/symbols.h"
698 const char *
order =
"xyz")
707#define show_dimension(...) show_dimension_internal (__VA_ARGS__ + 10293847566574839201.)
void array_free(Array *a)
void * array_append(Array *a, void *elem, size_t size)
if TRASH define &&NewPid *& val(newpid, 0, 0, 0)) -> pid > 0) @else @ define is_newpid()(((NewPid *)&val(newpid, 0, 0, 0)) ->pid > 0) @endif Array *linear_tree(size_t size, scalar newpid)
define double double char flags
define double double char Reduce reductions
define m((k)==0 &&(l)==0 &&(m)==0) macro2 foreach_point(double _x=0.
if TRASH undef trash define trash(list) reset(list
macro2 foreach_face(char flags=0, Reduce reductions=None, const char *order="xyz")
define sysmalloc malloc define syscalloc calloc define sysrealloc realloc define sysfree free define systrdup strdup define line line line line type
static void qpclose_all()
else define undefined((double) DBL_MAX) @ define enable_fpe(flags) @ define disable_fpe(flags) static void set_fpe(void)
static endif FILE ** qpopen_pipes
define sysmalloc malloc define syscalloc calloc define sysrealloc realloc define sysfree free define systrdup strdup define line line line line op define mpi_all_reduce_array(v, type, op, elem) @define mpi_sum_reduce_init(s
if __APPLE__ include< stdint.h > include fp_osx h endif if _GPU define enable_fpe(flags) @else @ define enable_fpe(flags) feenableexcept(flags) @endif @ define disable_fpe(flags) fedisableexcept(flags) static void set_fpe(void)
define unmap(x, y) @define trash(x) auto macro2 BEGIN_FOREACH()
define _index(a, m)(a.i) @define val(a
define sysmalloc malloc define syscalloc calloc define sysrealloc realloc define sysfree free define systrdup strdup define s
define sysmalloc malloc define syscalloc calloc define sysrealloc realloc define sysfree free define systrdup strdup define line calloc(n, s) @ define prealloc(p
define sysmalloc malloc define syscalloc calloc define sysrealloc realloc define sysfree free define systrdup strdup define func
define macro OMP_SERIAL()
FILE * qpopen(const char *command, const char *type)
define sysmalloc malloc define syscalloc calloc define sysrealloc realloc define sysfree free define systrdup strdup define line line line line op define op
define m m double _val_higher_dimension
define sysmalloc malloc define syscalloc calloc define sysrealloc realloc define sysfree free define systrdup strdup define line line line line op define elem define mpi_sum_reduce_array(s, v, type, op, elem) macro2 OMP_PARALLEL()
define sysmalloc malloc define syscalloc calloc define sysrealloc realloc define sysfree free define systrdup strdup define file
define sysmalloc malloc define syscalloc calloc define sysrealloc realloc define sysfree free define systrdup strdup define pmalloc(s, func, file, line) malloc(s) @ define pcalloc(n
FILE * lfopen(const char *name, const char *mode)
define sysmalloc malloc define syscalloc calloc define sysrealloc realloc define sysfree free define systrdup strdup define line line line free(p) @ define pstrdup(s
define sysmalloc malloc define syscalloc calloc define sysrealloc realloc define sysfree free define systrdup strdup define line line line line op define v
define sysmalloc malloc define syscalloc calloc define sysrealloc realloc define sysfree free define systrdup strdup define line line realloc(p, s) @ define pfree(p
define sysmalloc malloc define syscalloc calloc define sysrealloc realloc define sysfree free define systrdup strdup define line line line line strdup(s) @ define tracing(...) @ define end_tracing(...) @define tid() 0 @define pid() 0 @define npe() 1 @define mpi_all_reduce(v
macro2 diagonalize(int a)
if(2.*fabs(alpha)< fabs(n.y))
We need to reconstruct the face fractions fs for the fine cells.
*cs[i, 0, 0] a *[i -1, 0, 0] j
int fedisableexcept(unsigned int excepts)
int feenableexcept(unsigned int excepts)
end_tracing(func, file, line)
ifndef tracing def tracing(func, file, line) do
static int include(char *file, FILE *fin, FILE *fout)
macro
We also redefine the "per field" (inner) traversal.
static void * pcalloc(size_t nmemb, size_t size, const char *func, const char *file, int line)
static void pfree(void *ptr, const char *func, const char *file, int line)
static char * pstrdup(const char *s, const char *func, const char *file, int line)
static void * prealloc(void *ptr, size_t size, const char *func, const char *file, int line)
def false def true def false
macro VARIABLES(Point point=point, int _ig=ig, int _jg=jg, int _kg=kg)