Debian Codegraph @

dune/uggrid/parallel/ddd/basic/lowcomm.h

raw
1 // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 // vi: set et ts=4 sw=2 sts=2:
3 // SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file LICENSE.md in module root
4 // SPDX-License-Identifier: LGPL-2.1-or-later
5 /****************************************************************************/
6 /* */
7 /* File: lowcomm.h */
8 /* */
9 /* Purpose: lowlevel communication layer */
10 /* */
11 /* Author: Klaus Birken */
12 /* Institut fuer Computeranwendungen III */
13 /* Universitaet Stuttgart */
14 /* Pfaffenwaldring 27 */
15 /* 70569 Stuttgart */
16 /* internet: [email protected] */
17 /* */
18 /* History: 960715 kb begin */
19 /* */
20 /* Remarks: */
21 /* */
22 /****************************************************************************/
23
24
25
26 /****************************************************************************/
27 /* */
28 /* auto include mechanism and other include files */
29 /* */
30 /****************************************************************************/
31
32 #ifndef __DDD_LOWCOMM_H__
33 #define __DDD_LOWCOMM_H__
34
35 #include <dune/uggrid/parallel/ddd/dddtypes.hh>
36
37 namespace DDD {
38
39 /****************************************************************************/
40 /* */
41 /* defines in the following order */
42 /* */
43 /* compile time constants defining static data size (i.e. arrays) */
44 /* other constants */
45 /* macros */
46 /* */
47 /****************************************************************************/
48
49 #define EXCEPTION_LOWCOMM_CONNECT -10
50
51 /* lowcomm users should use exceptions EXCEPTION_LOWCOMM_USER or lower */
52 #define EXCEPTION_LOWCOMM_USER -100
53
54
55 /****************************************************************************/
56 /* */
57 /* data structures exported by the corresponding source file */
58 /* */
59 /****************************************************************************/
60
61
62 typedef unsigned long ULONG;
63
64 using MSG_DESC = DDD::Basic::MSG_DESC;
65 using LC_MSGHANDLE = DDD::Basic::LC_MSGHANDLE;
66 using MSG_TYPE = DDD::Basic::MSG_TYPE;
67 using LC_MSGTYPE = DDD::Basic::LC_MSGTYPE;
68 using LC_MSGCOMP = DDD::Basic::LC_MSGCOMP;
69
70 /* function pointer types for alloc and free */
71 using AllocFunc = DDD::Basic::AllocFunc;
72 using FreeFunc = DDD::Basic::FreeFunc;
73
74
75 /****************************************************************************/
76 /* */
77 /* function declarations */
78 /* */
79 /****************************************************************************/
80
81
82 /* lowcomm.c */
83 void LC_Init(DDD::DDDContext& context, AllocFunc,FreeFunc);
84 void LC_Exit(DDD::DDDContext& context);
85
86 void LC_SetMemMgrSend(DDD::DDDContext&, AllocFunc,FreeFunc);
87 void LC_SetMemMgrRecv(DDD::DDDContext&, AllocFunc,FreeFunc);
88 void LC_SetMemMgrDefault(DDD::DDDContext&);
89
90
91 LC_MSGTYPE LC_NewMsgType (DDD::DDDContext& context, const char *);
92 LC_MSGCOMP LC_NewMsgTable (const char *, LC_MSGTYPE, size_t);
93 LC_MSGCOMP LC_NewMsgChunk (const char *, LC_MSGTYPE);
94
95 void LC_MsgSend (const DDD::DDDContext& context, LC_MSGHANDLE);
96
97 int LC_Connect(DDD::DDDContext& context, LC_MSGTYPE);
98 int LC_Abort(DDD::DDDContext& context, int);
99 LC_MSGHANDLE *LC_Communicate(const DDD::DDDContext& context);
100 void LC_Cleanup(DDD::DDDContext& context);
101
102
103
104 LC_MSGHANDLE LC_NewSendMsg(DDD::DDDContext& context, LC_MSGTYPE, DDD_PROC);
105 ULONG LC_GetTableLen (LC_MSGHANDLE, LC_MSGCOMP);
106 void * LC_GetPtr (LC_MSGHANDLE, LC_MSGCOMP);
107 DDD_PROC LC_MsgGetProc (LC_MSGHANDLE);
108
109 size_t LC_MsgPrepareSend(DDD::DDDContext& context, LC_MSGHANDLE);
110 size_t LC_MsgFreeze (LC_MSGHANDLE);
111 int LC_MsgAlloc(DDD::DDDContext& context, LC_MSGHANDLE);
112
113 void LC_SetTableLen (LC_MSGHANDLE, LC_MSGCOMP, ULONG);
114 void LC_SetTableSize (LC_MSGHANDLE, LC_MSGCOMP, ULONG);
115 void LC_SetChunkSize (LC_MSGHANDLE, LC_MSGCOMP, size_t);
116
117 size_t LC_GetBufferSize (LC_MSGHANDLE);
118
119
120 void LC_PrintSendMsgs(const DDD::DDDContext& context);
121 void LC_PrintRecvMsgs(const DDD::DDDContext& context);
122
123 } /* namespace DDD */
124
125 #endif