YAC 3.20.0
Yet Another Coupler
Loading...
Searching...
No Matches
core.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Thomas Jahns <jahns@dkrz.de>
2//
3// SPDX-License-Identifier: BSD-3-Clause
4
12/*
13 * Maintainer: Thomas Jahns <jahns@dkrz.de>
14 * URL: https://www.dkrz.de/redmine/projects/scales-ppm
15 *
16 * Redistribution and use in source and binary forms, with or without
17 * modification, are permitted provided that the following conditions are
18 * met:
19 *
20 * Redistributions of source code must retain the above copyright notice,
21 * this list of conditions and the following disclaimer.
22 *
23 * Redistributions in binary form must reproduce the above copyright
24 * notice, this list of conditions and the following disclaimer in the
25 * documentation and/or other materials provided with the distribution.
26 *
27 * Neither the name of the DKRZ GmbH nor the names of its contributors
28 * may be used to endorse or promote products derived from this software
29 * without specific prior written permission.
30 *
31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
32 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
33 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
34 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
35 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
36 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
37 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
38 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
39 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
40 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
41 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
42 *
43 * Commentary:
44 *
45 * The code in this file should be restricted to handle those parts
46 * the user program should keep as much control about as possible,
47 * like
48 *
49 * - error handling
50 * - file handling
51 *
52 * Thus the facilities provided here should always come with hooks
53 * for user-provided mechanisms.
54 *
55 * Code:
56 */
57
58#ifndef PPM_CORE_H
59#define PPM_CORE_H
60
61#include <mpi.h>
62
63#include "ppm/symprefix.h"
64
65// YAC PUBLIC HEADER START
66
67/* If we're not using GNU C, elide __attribute__ */
68#ifndef __GNUC__
69# define __attribute__(x) /*NOTHING*/
70#endif
71// #define UNUSED(x) UNUSED_ ## x __attribute__((__unused__))
72#define UNUSED(x) (void)(x)
73
77typedef void (*symprefix(abort_func))(MPI_Comm comm, const char *msg,
78 const char *source, int line)
79 __attribute__((noreturn));
80
88void symprefix(abort)(MPI_Comm comm, const char *msg,
89 const char *source, int line)
90 __attribute__((noreturn));
91
99void symprefix(abort_message)(char const *msg, const char *source, int line);
100
104void
106
111void
112symprefix(set_abort_handler)(symprefix(abort_func) custom_abort);
113
118symprefix(abort_func) symprefix(get_abort_handler)(void);
119
124symprefix(abort_func) symprefix(get_default_abort_handler)(void);
125
129extern void
130symprefix(set_default_comm)(MPI_Comm comm);
131
136
137// YAC PUBLIC HEADER STOP
138
139#endif
140/*
141 * Local Variables:
142 * license-project-url: "https://www.dkrz.de/redmine/projects/scales-ppm"
143 * license-default: "bsd"
144 * license-markup: "doxygen"
145 * End:
146 */
void symprefix abort_message(char const *msg, const char *source, int line)
Definition core.c:102
int symprefix mpi_calls_are_allowed(void)
Definition core.c:128
void symprefix set_abort_handler(symprefix(abort_func) custom_abort)
Definition core.c:114
void symprefix set_default_comm(MPI_Comm comm)
Definition core.c:74
void symprefix abort(MPI_Comm comm, const char *msg, const char *source, int line) __attribute__((noreturn))
void symprefix restore_default_abort_handler(void)
Definition core.c:108
#define __attribute__(x)
Definition core.h:69
Define library-specific symbol prefix macros.
#define symprefix(symbol)
Definition symprefix.h:57