This file is indexed.

/usr/include/ug/pargm.h is in libug-dev 3.12.1-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
/*! \file pargm.h
 * \ingroup gm
 */


/****************************************************************************/
/*                                                                                                                                                      */
/* File:          pargm.h                                                                                                               */
/*                                                                                                                                                      */
/* Purpose:   defines for parallel grid manager                                                         */
/*                                                                                                                                                      */
/* Author:        Stefan Lang, Klaus Birken                                                             */
/*                        Institut fuer Computeranwendungen III                                                 */
/*                        Universitaet Stuttgart                                                                                */
/*                        Pfaffenwaldring 27                                                                                    */
/*                        70550 Stuttgart                                                                                               */
/*                        email: stefan@ica3.uni-stuttgart.de                                                   */
/*                        phone: 0049-(0)711-685-7003                                                                   */
/*                        fax  : 0049-(0)711-685-7000                                                                   */
/*                                                                                                                                                      */
/* History:   960410 kb  created from parallel.h                                                */
/*                                                                                                                                                      */
/* Remarks:                                                                                                                             */
/*                                                                                                                                                      */
/****************************************************************************/


/****************************************************************************/
/*                                                                                                                                                      */
/* auto include mechanism and other include files                                                       */
/*                                                                                                                                                      */
/****************************************************************************/

#ifndef __PARGM_H__
#define __PARGM_H__

#include "ugtypes.h"

#ifdef ModelP
#include "ppif.h"
#include "ddd.h"
#endif

#include "namespace.h"

START_UGDIM_NAMESPACE

/****************************************************************************/
/*                                                                                                                                                      */
/* defines in the following order                                                                                       */
/*                                                                                                                                                      */
/*                compile time constants defining static data size (i.e. arrays)        */
/*                other constants                                                                                                       */
/*                macros                                                                                                                        */
/*                                                                                                                                                      */
/****************************************************************************/

/* object priorities */
enum Priorities
{
  PrioNone     = 0,
  PrioHGhost   = 1,
  PrioVGhost   = 2,
  PrioVHGhost  = 3,
  PrioBorder   = 4,
  PrioMaster   = 5
};

/* define dynamic lists ids */
enum DynamicListId {ELEMENT_LIST,
                    NODE_LIST,
                    VECTOR_LIST,
                    VERTEX_LIST};

#ifdef ModelP

/* define number of priorities for objects */
enum {MAX_PRIOS     = 6};
enum {ELEMENT_PRIOS = 4};
enum {NODE_PRIOS    = 5};
enum {VECTOR_PRIOS  = 5};
enum {VERTEX_PRIOS  = 5};

/* define number of listparts for objects */
enum {MAX_LISTPARTS     = 8};
enum {ELEMENT_LISTPARTS = 2};
enum {NODE_LISTPARTS    = 3};
enum {VECTOR_LISTPARTS  = 3};
enum {VERTEX_LISTPARTS  = 3};

/* define mapping from object priority to position in linked list */
#define PRIO2LISTPART(listtype,prio)                                         \
  ((listtype == ELEMENT_LIST) ? ((prio == PrioHGhost) ? 0 :                \
                                 (prio == PrioVGhost) ? 0 : (prio == PrioVHGhost) ? 0 :               \
                                 (prio == PrioMaster) ? 1 : -1) :                                 \
   ((prio == PrioHGhost) ? 0 : (prio ==PrioVGhost) ? 0 :            \
      (prio == PrioVHGhost) ? 0 :                                  \
      (prio == PrioBorder) ? 2 : (prio == PrioMaster) ? 2 : -1))

/* define mapping from position in linked list to object priority */
#define LISTPART2PRIO(listtype,listpart,prios)                               \
  {                                                                        \
    INT Entry;                                                           \
    for (Entry=0; Entry<MAX_LISTPARTS; Entry++) prios[Entry] = -1;       \
    Entry = 0;                                                           \
    if (listtype == ELEMENT_LIST)                                        \
    {                                                                    \
      if (listpart == 0)                                               \
      {                                                                \
        prios[Entry++] = PrioHGhost;                                 \
        prios[Entry++] = PrioVGhost;                                 \
        prios[Entry++] = PrioVHGhost;                                \
      }                                                                \
      else if(listpart == 1) prios[Entry++] = PrioMaster;             \
    }                                                                    \
    else                                                                 \
    {                                                                    \
      if (listpart == 0)                                               \
      {                                                                \
        prios[Entry++] = PrioHGhost;                                 \
        prios[Entry++] = PrioVGhost;                                 \
        prios[Entry++] = PrioVHGhost;                                \
      }                                                                \
      else if (listpart == 2)                                          \
      {                                                                \
        prios[Entry++] = PrioBorder;                                 \
        prios[Entry++] = PrioMaster;                                 \
      }                                                                \
    }                                                                    \
  }

/* define mapping from element priority to index in son array of father */
#define PRIO2INDEX(prio)                                                     \
  ((prio==PrioHGhost || prio==PrioVGhost || prio==PrioVHGhost) ? 1 :       \
   (prio == PrioMaster) ? 0 : -1)

/* map pointer to structure onto a pointer to its DDD_HDR */
#define PARHDR(obj)    (&((obj)->ddd))

#define GETGID(x)       (( OBJT(x)==IEOBJ || OBJT(x)==BEOBJ) ? EGID((ELEMENT*)(x)) : \
                         ((OBJT(x)==IVOBJ || OBJT(x)==BVOBJ) ? VXGID((VERTEX *)(x)) :\
                          ((OBJT(x)==NDOBJ || OBJT(x)==VEOBJ || OBJT(x)==EDOBJ) ?    \
                                           GID((NODE *)(x)) : -1)))

#else   /* not ModelP */

/* define number of priorities for objects */
enum {MAX_PRIOS = 1};
enum {ELEMENT_PRIOS = 1};
enum {NODE_PRIOS = 1};
enum {VECTOR_PRIOS = 1};
enum {VERTEX_PRIOS = 1};

/* define number of listparts for objects */
enum {MAX_LISTPARTS = 1};
enum {ELEMENT_LISTPARTS = 1};
enum {NODE_LISTPARTS = 1};
enum {VECTOR_LISTPARTS = 1};
enum {VERTEX_LISTPARTS = 1};

/** \brief define mapping from object priority to position in linked list */
#define PRIO2LISTPART(listtype,prio) 0

/* define mapping from position in linked list to object priority */
#define LISTPART2PRIO(listtype,listpart,prios) 0

/* define mapping from position in linked list to object priority */
#define PRIO2INDEX(prio)  0

#endif

/*
        printing of IDs via printf()

        use ID_FMT as format string, and ID_PRT as macro for printing.
        example of usage:

                printf("NodeId " ID_FMT "\n", ID_PRT(theNode));

        ID_FFMT (fixed format) is a version of ID_FMT with fixed width.
        ID_FFMTE (extended) is a version of ID_FFMT with additional information.

        in ModelP, additionaly the DDD_GlobalID is printed for each object.

        NOTE: for vertices and elements, one must use the VID_ and EID_ macros,
              respectively. this is due to differences in data structures
              (unions -> PARHDRV/PARHDRE ->VID_/EID_)
 */

#ifdef ModelP

#define ID_FMT      "%ld/%08x"
#define ID_FFMT     "%9ld/%08x"
#define ID_PRT(x)   ((long)ID(x)),GID(x)
#define ID_FMTE     "%ld/%08x/%d"
#define ID_FFMTE    "%9ld/%08x/%02d"
#define ID_PRTE(x)  ((long)ID(x)),GID(x),PRIO(x)
#define ID_FMTX     "%d/%ld/%08x/%d"
#define ID_FFMTX    "%x/%9ld/%08x/%02d"
#define ID_PRTX(x)  KeyForObject((KEY_OBJECT *)x),((long)ID(x)),GID(x),PRIO(x)

#define VID_FMT     ID_FMT
#define VID_FFMT    ID_FFMT
#define VID_PRT(x)  ((long)ID(x)),VXGID(x)
#define VID_FMTE    ID_FMTE
#define VID_FFMTE   ID_FFMTE
#define VID_PRTE(x) ((long)ID(x)),VXGID(x),VXPRIO(x)
#define VID_FMTX    ID_FMTX "/%d"
#define VID_FFMTX   ID_FFMTX "/%d"
#define VID_PRTX(x)     KeyForObject((KEY_OBJECT *)x),((long)ID(x)),VXGID(x),VXPRIO(x),LEVEL(x)

#define EID_FMT     ID_FMT
#define EID_FFMT    ID_FFMT
#define EID_PRT(x)  ((long)ID(x)),EGID(x)
#define EID_FMTE    ID_FMTE
#define EID_FFMTE   ID_FFMTE
#define EID_PRTE(x) ((long)ID(x)),EGID(x),EPRIO(x)
#define EID_FMTX    ID_FMTX "/%d/%d/%d/%d"
#define EID_FFMTX   ID_FFMTX "/%d"
#define EID_PRTX(x) KeyForObject((KEY_OBJECT *)x),((long)ID(x)),EGID(x),EPRIO(x),TAG(x),\
  LEVEL(x),ECLASS(x),REFINECLASS(x)

#define VINDEX_FMT     ID_FMT
#define VINDEX_FFMT    ID_FFMT
#define VINDEX_PRT(x)  ((long)VINDEX(x)),GID(x)
#define VINDEX_FMTE    ID_FMTE
#define VINDEX_FFMTE   ID_FFMTE
#define VINDEX_PRTE(x) ((long)VINDEX(x)),GID(x),PRIO(x)
#define VINDEX_FMTX    ID_FMTX
#define VINDEX_FFMTX   ID_FFMTX
#define VINDEX_PRTX(x) KeyForObject((KEY_OBJECT *)x),((long)VINDEX(x)),GID(x),PRIO(x)

#define EDID_FMT     "%08x"
#define EDID_FFMT    EDID_FMT
#define EDID_PRT(x)  GID(x)
#define EDID_FMTE    "%08x/%d"
#define EDID_FFMTE   EDID_FMTE
#define EDID_PRTE(x) GID(x),PRIO(x)
#define EDID_FMTX    "%x/%08x/%d"
#define EDID_FFMTX   EDID_FMTX
#define EDID_PRTX(x) x,GID(x),PRIO(x)


#define PFMT            "%3d:"

/* PAR/ENDPAR parallel preprocessor statements   */
/* to select code only valid for ModelP          */
#define PAR(x)          x
#define ENDPAR

#else

#define ID_FMT      "%ld"
#define ID_FFMT     "%9ld"
#define ID_PRT(x)   ((long)ID(x))
#define ID_FMTE     "%ld"
#define ID_FFMTE    "%9ld"
#define ID_PRTE(x)  ID_PRT(x)
#define ID_FMTX     "%ld"
#define ID_FFMTX    "%9ld"
#define ID_PRTX(x)  ID_PRT(x)

#define VID_FMT     ID_FMT
#define VID_FFMT    ID_FFMT
#define VID_PRT(x)  ID_PRT(x)
#define VID_FMTE    ID_FMTE
#define VID_FFMTE   ID_FFMTE
#define VID_PRTE(x) VID_PRT(x)
#define VID_FMTX    ID_FMTX
#define VID_FFMTX   ID_FFMTX
#define VID_PRTX(x) VID_PRT(x)

#define EID_FMT     ID_FMT
#define EID_FFMT    ID_FFMT
#define EID_PRT(x)  ID_PRT(x)
#define EID_FMTE    ID_FMTE
#define EID_FFMTE   ID_FFMTE
#define EID_PRTE(x) EID_PRT(x)
#define EID_FMTX    ID_FMTX
#define EID_FFMTX   ID_FFMTX
#define EID_PRTX(x) EID_PRT(x)

#define VINDEX_FMT     ID_FMT
#define VINDEX_FFMT    ID_FFMT
#define VINDEX_PRT(x)  ((long)VINDEX(x))
#define VINDEX_FMTE    ID_FMTE
#define VINDEX_FFMTE   ID_FFMTE
#define VINDEX_PRTE(x) VINDEX_PRT(x)
#define VINDEX_FMTX    ID_FMTX
#define VINDEX_FFMTX   ID_FFMTX
#define VINDEX_PRTX(x) VINDEX_PRT(x)

#define EDID_FMT     "%08x"
#define EDID_FFMT    EDID_FMT
#define EDID_PRT(x)  (x)
#define EDID_FMTE    "%08x"
#define EDID_FFMTE   EDID_FMTE
#define EDID_PRTE(x) (x)
#define EDID_FMTX    "%08x"
#define EDID_FFMTX   EDID_FMTX
#define EDID_PRTX(x) (x)

#define PFMT            "%1d:"
#define GIDFMT          "%1d"

/* dummies for global id */
#define EGID(e)     ID(e)
#define GID(e)      ((OBJT(e)==VEOBJ) ? VINDEX((VECTOR *)e) : ID(e))
#define VGID(e)     ID(e)

/* PAR/ENDPAR parallel preprocessor statements   */
/* for serial case expanded to code x is ignored */
#define PAR(x)
#define ENDPAR

#define GetAllSons(e,s)         GetSons(e,s)

/* dummy defines for serial case according to parallel defines in parallel.h */
/* dummies for elements */
#define EMASTER(p)              1
#define EGHOST(p)               0
#define EHGHOST(p)              0
#define EVGHOST(p)              0
#define EPRIO(p)                0
#define SETEPRIO(p,i)   ;
#define EMASTERPRIO(p)  1
#define EPROCLIST(p)    (&_proclist_)
#define ENCOPIES(p)             1
#define PARTITION(p)    _partition_

/* dummies for nodes, vectors, edges */
#define MASTER(p)               1
#define GHOST(p)                0
#define HGHOST(p)               0
#define VGHOST(p)               0
#define PRIO(p)                 0
#define EPRIO(p)                0
#define VXPRIO(p)               0
#define SETPRIO(p,i)    ;
#define PROCLIST(p)             (&_proclist_)
#define NCOPIES(p)              1

/* dummies for vertices */
#define SETVXPRIO(e,p)  ;

/* ddd dummies */
#define DDD_OBJ                 void *
#define DDD_IdentifyBegin()
#define DDD_IdentifyEnd()
#define DDD_IdentifyNumber(o,p,n)
#define DDD_IFAOneway(p1,p2,p3,p4,p5,p6)
#define DDD_PrioritySet(e,p)

/* ppif dummies */
#define Broadcast(p,n)  ((int)0)

/* dummys for reduction functions implemented in parallel/dddif/support.c */
#define UG_GlobalSumINT(x)              x
#define UG_GlobalMaxINT(x)              x
#define UG_GlobalMinINT(x)              x
#define UG_GlobalSumNINT(x,y)
#define UG_GlobalMaxNINT(x,y)
#define UG_GlobalMinNINT(x,y)
#define UG_GlobalSumDOUBLE(x)   x
#define UG_GlobalMaxDOUBLE(x)   x
#define UG_GlobalMinDOUBLE(x)   x
#define UG_GlobalSumNDOUBLE(x,y)
#define UG_GlobalMaxNDOUBLE(x,y)
#define UG_GlobalMinNDOUBLE(x,y)
#endif


/****************************************************************************/
/*                                                                          */
/* exported global variables                                                */
/*                                                                          */
/****************************************************************************/

/****************************************************************************/
/*                                                                          */
/* function declarations                                                    */
/*                                                                          */
/****************************************************************************/

/* functions implemented in parallel/dddif/support.c */
#ifdef ModelP
INT    UG_GlobalSumINT     (INT x);
INT    UG_GlobalMaxINT     (INT x);
INT    UG_GlobalMinINT     (INT x);
void   UG_GlobalSumNINT    (INT n, INT *x);
void   UG_GlobalMaxNINT    (INT n, INT *x);
void   UG_GlobalMinNINT    (INT n, INT *x);
DOUBLE UG_GlobalSumDOUBLE  (DOUBLE i);
DOUBLE UG_GlobalMaxDOUBLE  (DOUBLE i);
DOUBLE UG_GlobalMinDOUBLE  (DOUBLE i);
void   UG_GlobalSumNDOUBLE (INT n, DOUBLE *x);
void   UG_GlobalMaxNDOUBLE (INT n, DOUBLE *x);
void   UG_GlobalMinNDOUBLE (INT n, DOUBLE *x);
#endif

END_UGDIM_NAMESPACE

#endif /* __PARGM_H__ */