| 1 |
// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file LICENSE.md in module root |
| 2 |
// SPDX-License-Identifier: LGPL-2.1-or-later |
| 3 |
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
| 4 |
// vi: set et ts=4 sw=2 sts=2: |
| 5 |
/****************************************************************************/ |
| 6 |
/* */ |
| 7 |
/* File: ifcmds.c */ |
| 8 |
/* */ |
| 9 |
/* Purpose: routines concerning interfaces between processors */ |
| 10 |
/* part 2: usage of DDD interfaces */ |
| 11 |
/* */ |
| 12 |
/* Author: Klaus Birken */ |
| 13 |
/* Rechenzentrum Uni Stuttgart */ |
| 14 |
/* Universitaet Stuttgart */ |
| 15 |
/* Allmandring 30 */ |
| 16 |
/* 70550 Stuttgart */ |
| 17 |
/* internet: [email protected] */ |
| 18 |
/* */ |
| 19 |
/* History: 93/11/30 kb begin */ |
| 20 |
/* 94/03/03 kb complete rewrite */ |
| 21 |
/* 94/09/12 kb IFExchange & IFOneway rewrite, two bugs fixed */ |
| 22 |
/* 94/09/21 kb created from if.c */ |
| 23 |
/* 95/01/13 kb added range functionality */ |
| 24 |
/* 95/07/26 kb overlapping of gather/scatter and communication */ |
| 25 |
/* 96/01/24 kb added use of object shortcut tables */ |
| 26 |
/* */ |
| 27 |
/* Remarks: */ |
| 28 |
/* */ |
| 29 |
/****************************************************************************/ |
| 30 |
|
| 31 |
/****************************************************************************/ |
| 32 |
/* */ |
| 33 |
/* include files */ |
| 34 |
/* system include files */ |
| 35 |
/* application include files */ |
| 36 |
/* */ |
| 37 |
/****************************************************************************/ |
| 38 |
|
| 39 |
/* standard C library */ |
| 40 |
#include <config.h> |
| 41 |
#include <cstdlib> |
| 42 |
#include <cstdio> |
| 43 |
|
| 44 |
#include <iomanip> |
| 45 |
|
| 46 |
#include <dune/common/exceptions.hh> |
| 47 |
#include <dune/common/stdstreams.hh> |
| 48 |
|
| 49 |
#include <dune/uggrid/parallel/ddd/dddcontext.hh> |
| 50 |
|
| 51 |
#include <dune/uggrid/parallel/ddd/dddi.h> |
| 52 |
#include "if.h" |
| 53 |
|
| 54 |
using namespace PPIF; |
| 55 |
|
| 56 |
/****************************************************************************/ |
| 57 |
/* */ |
| 58 |
/* definition of static variables */ |
| 59 |
/* */ |
| 60 |
/****************************************************************************/ |
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
START_UGDIM_NAMESPACE |
| 66 |
|
| 67 |
/****************************************************************************/ |
| 68 |
/* */ |
| 69 |
/* routines */ |
| 70 |
/* */ |
| 71 |
/****************************************************************************/ |
| 72 |
|
| 73 |
|
| 74 |
/* |
| 75 |
description of input defines for ifcmd.ct |
| 76 |
|
| 77 |
IF_NAME: name of interface function |
| 78 |
IF_CBR: call by reference, otherwise call by address (CPP_FRONTEND) |
| 79 |
|
| 80 |
TODO: more doc! |
| 81 |
*/ |
| 82 |
|
| 83 |
|
| 84 |
/* with normal arguments for gather/scatter */ |
| 85 |
|
| 86 |
#define IF_NAME Exchange |
| 87 |
#define IF_EXCHANGE |
| 88 |
#include "ifcmd.ct" |
| 89 |
|
| 90 |
#define IF_NAME Oneway |
| 91 |
#define IF_ONEWAY |
| 92 |
#include "ifcmd.ct" |
| 93 |
|
| 94 |
#define IF_NAME ExecLocal |
| 95 |
#define IF_EXECLOCAL |
| 96 |
#include "ifcmd.ct" |
| 97 |
|
| 98 |
|
| 99 |
#define IF_NAME AExchange |
| 100 |
#define IF_EXCHANGE |
| 101 |
#define IF_WITH_ATTR |
| 102 |
#include "ifcmd.ct" |
| 103 |
|
| 104 |
#define IF_NAME AOneway |
| 105 |
#define IF_ONEWAY |
| 106 |
#define IF_WITH_ATTR |
| 107 |
#include "ifcmd.ct" |
| 108 |
|
| 109 |
#define IF_NAME AExecLocal |
| 110 |
#define IF_EXECLOCAL |
| 111 |
#define IF_WITH_ATTR |
| 112 |
#include "ifcmd.ct" |
| 113 |
|
| 114 |
|
| 115 |
/* with extended arguments for gather/scatter */ |
| 116 |
|
| 117 |
#define IF_NAME ExchangeX |
| 118 |
#define IF_EXCHANGE |
| 119 |
#define IF_WITH_XARGS |
| 120 |
#include "ifcmd.ct" |
| 121 |
|
| 122 |
#define IF_NAME OnewayX |
| 123 |
#define IF_ONEWAY |
| 124 |
#define IF_WITH_XARGS |
| 125 |
#include "ifcmd.ct" |
| 126 |
|
| 127 |
#define IF_NAME ExecLocalX |
| 128 |
#define IF_EXECLOCAL |
| 129 |
#define IF_WITH_XARGS |
| 130 |
#include "ifcmd.ct" |
| 131 |
|
| 132 |
|
| 133 |
#define IF_NAME AExchangeX |
| 134 |
#define IF_EXCHANGE |
| 135 |
#define IF_WITH_ATTR |
| 136 |
#define IF_WITH_XARGS |
| 137 |
#include "ifcmd.ct" |
| 138 |
|
| 139 |
#define IF_NAME AOnewayX |
| 140 |
#define IF_ONEWAY |
| 141 |
#define IF_WITH_ATTR |
| 142 |
#define IF_WITH_XARGS |
| 143 |
#include "ifcmd.ct" |
| 144 |
|
| 145 |
#define IF_NAME AExecLocalX |
| 146 |
#define IF_EXECLOCAL |
| 147 |
#define IF_WITH_ATTR |
| 148 |
#define IF_WITH_XARGS |
| 149 |
#include "ifcmd.ct" |
| 150 |
|
| 151 |
/****************************************************************************/ |
| 152 |
|
| 153 |
|
| 154 |
/* |
| 155 |
description of input defines for ifstd.ct |
| 156 |
|
| 157 |
IF_NAME: name of interface function |
| 158 |
|
| 159 |
These includes generate internal functions for communication |
| 160 |
on the STD_INTERFACE (IF0). The Gather/Scatter-functions for |
| 161 |
the STD_INTERFACE will get the DDD_HDR as a parameter, not the |
| 162 |
DDD_OBJ. |
| 163 |
|
| 164 |
TODO: more doc! |
| 165 |
*/ |
| 166 |
|
| 167 |
|
| 168 |
/* with normal arguments for gather/scatter */ |
| 169 |
|
| 170 |
#define IF_NAME Exchange |
| 171 |
#define IF_EXCHANGE |
| 172 |
#include "ifstd.ct" |
| 173 |
|
| 174 |
#define IF_NAME ExecLocal |
| 175 |
#define IF_EXECLOCAL |
| 176 |
#include "ifstd.ct" |
| 177 |
|
| 178 |
|
| 179 |
/* with extended arguments for gather/scatter */ |
| 180 |
|
| 181 |
#define IF_NAME ExchangeX |
| 182 |
#define IF_EXCHANGE |
| 183 |
#define IF_WITH_XARGS |
| 184 |
#include "ifstd.ct" |
| 185 |
|
| 186 |
#define IF_NAME ExecLocalX |
| 187 |
#define IF_EXECLOCAL |
| 188 |
#define IF_WITH_XARGS |
| 189 |
#include "ifstd.ct" |
| 190 |
|
| 191 |
|
| 192 |
/****************************************************************************/ |
| 193 |
|
| 194 |
END_UGDIM_NAMESPACE |