MeDiPack  1.3.0
A Message Differentiation Package
SciComp TU Kaiserslautern
Loading...
Searching...
No Matches
macros.h
Go to the documentation of this file.
1/*
2 * MeDiPack, a Message Differentiation Package
3 *
4 * Copyright (C) 2015-2024 Chair for Scientific Computing (SciComp), University of Kaiserslautern-Landau
5 * Homepage: http://scicomp.rptu.de
6 * Contact: Prof. Nicolas R. Gauger (codi@scicomp.uni-kl.de)
7 *
8 * Lead developers: Max Sagebaum (SciComp, University of Kaiserslautern-Landau)
9 *
10 * This file is part of MeDiPack (http://scicomp.rptu.de/software/codi).
11 *
12 * MeDiPack is free software: you can redistribute it and/or
13 * modify it under the terms of the GNU Lesser General Public
14 * License as published by the Free Software Foundation, either
15 * version 3 of the License, or (at your option) any later version.
16 *
17 * MeDiPack is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20 *
21 * See the GNU Lesser General Public License for more details.
22 * You should have received a copy of the GNU
23 * Lesser General Public License along with MeDiPack.
24 * If not, see <http://www.gnu.org/licenses/>.
25 *
26 * Authors: Max Sagebaum, Tim Albring (SciComp, University of Kaiserslautern-Landau)
27 */
28
29#pragma once
30
31#include <mpi.h>
32
33#define MEDI_MPI_VERSION_1_0 100
34#define MEDI_MPI_VERSION_1_1 101
35#define MEDI_MPI_VERSION_1_2 102
36#define MEDI_MPI_VERSION_1_3 103
37#define MEDI_MPI_VERSION_2_0 200
38#define MEDI_MPI_VERSION_2_1 201
39#define MEDI_MPI_VERSION_2_2 202
40#define MEDI_MPI_VERSION_3_0 300
41#define MEDI_MPI_VERSION_3_1 301
42
43
44#ifndef MEDI_MPI_TARGET
45# if defined(MPI_VERSION) && defined(MPI_SUBVERSION)
46# define MEDI_MPI_TARGET (MPI_VERSION * 100 + MPI_SUBVERSION)
47# else
48# warning MEDI: Could not detect MPI version please define MPI_VERSION and MPI_SUBVERSION. Using MPI 3.1 as default.
49# define MEDI_MPI_TARGET MEDI_MPI_VERSION_3_1
50# endif
51#endif
52
53#if !defined MEDI_NO_OPTIONAL_CONST
54# if defined (OPEN_MPI)
55# define OMPI_VERSION (OMPI_MAJOR_VERSION * 100 + OMPI_MINOR_VERSION * 10)
56# if (OMPI_VERSION < 170)
57# define MEDI_OPTIONAL_CONST /* const */
58# else
59# define MEDI_OPTIONAL_CONST const
60# endif
61# elif defined (MPICH2)
62# if (MPICH2_NUMVERSION < 15000000)
63# define MEDI_OPTIONAL_CONST /* const */
64# elif (MPICH2_NUMVERSION < 30000000)
65# define MEDI_OPTIONAL_CONST MPICH2_CONST
66# else
67# define MEDI_OPTIONAL_CONST const
68# endif
69# else
70# define MEDI_OPTIONAL_CONST const
71# endif
72#else
73# define MEDI_OPTIONAL_CONST /* const */
74#endif
75
76
77#ifndef MEDI_EnableAssert
78 #define MEDI_EnableAssert 1
79#endif
80#ifndef mediAssert
81 #if MEDI_EnableAssert
82
83#include <assert.h>
91 #define mediAssert(x) assert(x)
92 #else
100 #define mediAssert(x) /* disabled by MEDI_EnableAssert */
101 #endif
102#endif
103
107namespace medi {
108 #define MEDI_UNUSED(name) (void)(name)
109 #define MEDI_CHECK_ERROR(expr) (expr)
110
111 #ifdef DEV
112 #define INTERFACE_ARG(name) bool __p
113 #define INTERFACE_DEF(interface, name, ...) typedef interface<__VA_ARGS__> name;
114 #else
115 #define INTERFACE_ARG(name) typename name
116 #define INTERFACE_DEF(interface, name, ...) /* empty */
117 #endif
118}
Global namespace for MeDiPack - Message Differentiation Package.
Definition adjointInterface.hpp:37