This file is indexed.

/usr/include/XdmfMap.hpp is in libxdmf-dev 3.0+git20160803-4.

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
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
/*****************************************************************************/
/*                                    XDMF                                   */
/*                       eXtensible Data Model and Format                    */
/*                                                                           */
/*  Id : XdmfMap.hpp                                                         */
/*                                                                           */
/*  Author:                                                                  */
/*     Kenneth Leiter                                                        */
/*     kenneth.leiter@arl.army.mil                                           */
/*     US Army Research Laboratory                                           */
/*     Aberdeen Proving Ground, MD                                           */
/*                                                                           */
/*     Copyright @ 2011 US Army Research Laboratory                          */
/*     All Rights Reserved                                                   */
/*     See Copyright.txt for details                                         */
/*                                                                           */
/*     This software is distributed WITHOUT ANY WARRANTY; without            */
/*     even the implied warranty of MERCHANTABILITY or FITNESS               */
/*     FOR A PARTICULAR PURPOSE.  See the above copyright notice             */
/*     for more information.                                                 */
/*                                                                           */
/*****************************************************************************/

#ifndef XDMFMAP_HPP_
#define XDMFMAP_HPP_

// C Compatible Includes
#include "Xdmf.hpp"
#include "XdmfItem.hpp"

#ifdef __cplusplus

// Forward Declarations
class XdmfArray;
class XdmfAttribute;
class XdmfHeavyDataController;

// Includes

#include <set>

/**
 * @brief Boundary communicator map for partitioned spatial
 * collections.
 *
 * Provides mechanism for mapping nodes across partition
 * boundaries. Each partitioned grid contains its own map, mapping its
 * own nodes to all other nodes in the global system.
 *
 * There are two methods for constructing XdmfMaps:
 *
 * Calling New() with no parameters will construct an empty map. The
 * map can be filled manually with subsequent insert commands.
 *
 * Calling New(const std::vector<shared_ptr<XdmfAttribute> > &
 * globalNodeIds) will construct XdmfMaps for each grid in an entire
 * global system. Each entry in the vector contains the globalNodeIds
 * for that partition. The constructor accepts global node ids for
 * each partition to construct the proper XdmfMaps.
 */
class XDMF_EXPORT XdmfMap : public XdmfItem {

public:

  typedef int node_id;
  typedef int task_id;
  typedef std::map<node_id, std::set<node_id> > node_id_map;

  /**
   * Create a new XdmfMap.
   *
   * Example of use:
   *
   * C++
   *
   * @dontinclude ExampleXdmfMap.cpp
   * @skipline //#initialization
   * @until //#initialization
   *
   * Python
   *
   * @dontinclude XdmfExampleMap.py
   * @skipline #//initialization
   * @until #//initialization
   *
   * @return    Constructed XdmfMap.
   */
  static shared_ptr<XdmfMap> New();

  /**
   * Create XdmfMaps for each grid in a domain decomposed mesh. Each
   * entry in the globalNodeIds vector contains the global node ids
   * for that partition.
   *
   * Example of use:
   *
   * C++
   *
   * @dontinclude ExampleXdmfMap.cpp
   * @skipline //#initializationnode
   * @until //#initializationnode
   *
   * Python
   *
   * @dontinclude XdmfExampleMap.py
   * @skipline #//initializationnode
   * @until #//initializationnode
   *
   * @param     globalNodeIds   A vector of attributes containing globalNodeId
   *                            values for each partition to be mapped.
   *
   * @return                    Constructed XdmfMaps for each partition. The
   *                            size of the vector will be the same as the
   *                            globalNodeIds vector.
   */
  static std::vector<shared_ptr<XdmfMap> >
  New(const std::vector<shared_ptr<XdmfAttribute> > & globalNodeIds);

  virtual ~XdmfMap();

  LOKI_DEFINE_VISITABLE(XdmfMap, XdmfItem)
  static const std::string ItemTag;

  std::map<std::string, std::string> getItemProperties() const;

  /**
   * Get stored boundary communicator map.
   *
   * Example of use:
   *
   * C++
   *
   * @dontinclude ExampleXdmfMap.cpp
   * @skipline //#initialization
   * @until //#initialization
   * @skipline //#getMap
   * @until //#getMap
   *
   * Python
   *
   * @dontinclude XdmfExampleMap.py
   * @skipline #//initialization
   * @until #//initialization
   * @skipline #//getMap
   * @until #//getMap
   *
   * @return    Stored boundary communicator map.
   */
  std::map<task_id, node_id_map> getMap() const;

  /**
   * Get name of boundary communicator map.
   *
   * Example of use:
   *
   * C++
   *
   * @dontinclude ExampleXdmfMap.cpp
   * @skipline //#initialization
   * @until //#initialization
   * @skipline //#setName
   * @until //#setName
   * @skipline //#getName
   * @until //#getName
   *
   * Python
   *
   * @dontinclude XdmfExampleMap.py
   * @skipline #//initialization
   * @until #//initialization
   * @skipline #//setName
   * @until #//setName
   * @skipline #//getName
   * @until #//getName
   *
   * @return    Name of boundary communicator map.
   */
  std::string getName() const;

  /**
   * Given a remote task id return a map of local node ids to remote
   * node ids
   *
   * Example of use:
   *
   * C++
   *
   * @dontinclude ExampleXdmfMap.cpp
   * @skipline //#initialization
   * @until //#initialization
   * @skipline //#getRemoteNodeIds
   * @until //#getRemoteNodeIds
   *
   * Python
   *
   * @dontinclude XdmfExampleMap.py
   * @skipline #//initialization
   * @until #//initialization
   * @skipline #//getRemoteNodeIds
   * @until #//getRemoteNodeIds
   *
   * @param     remoteTaskId    Task id to retrieve mapping for.
   *
   * @return                    A map of local node ids to a vector of
   *                            remote node ids on remoteTaskId.
   */
  node_id_map getRemoteNodeIds(const task_id remoteTaskId);

  std::string getItemTag() const;

  using XdmfItem::insert;

  /**
   * Insert a new entry in map.
   *
   * Example of use:
   *
   * C++
   *
   * @dontinclude ExampleXdmfMap.cpp
   * @skipline //#initialization
   * @until //#initialization
   * @skipline //#inserttuple
   * @until //#inserttuple
   *
   * Python
   *
   * @dontinclude XdmfExampleMap.py
   * @skipline #//initialization
   * @until #//initialization
   * @skipline #//inserttuple
   * @until #//inserttuple
   *
   * @param     remoteTaskId            task id where the remoteLoalNodeId is
   *                                    located.
   * @param     localNodeId             The node id of the node being mapped.
   * @param     remoteLocalNodeId       A node id on the remoteTaskId that the
   *                                    localNodeId is mapped to.
   */
  void insert(const task_id  remoteTaskId,
              const node_id  localNodeId,
              const node_id  remoteLocalNodeId);

  /**
   * Returns whether the map is initialized (contains values in
   * memory).
   *
   * Example of use:
   *
   * C++
   *
   * @dontinclude ExampleXdmfMap.cpp
   * @skipline //#initialization
   * @until //#initialization
   * @skipline //#isInitialized
   * @until //#isInitialized
   *
   * Python
   *
   * @dontinclude XdmfExampleMap.py
   * @skipline //#initialization
   * @until //#initialization
   * @skipline #//isInitialized
   * @until #//isInitialized
   *
   * @return    bool true if map contains values in memory.
   */
  bool isInitialized() const;

  /**
   * Read data from disk into memory.
   *
   * Example of use:
   *
   * C++
   *
   * @dontinclude ExampleXdmfMap.cpp
   * @skipline //#initialization
   * @until //#initialization
   * @skipline //#isInitialized
   * @until //#isInitialized
   *
   * Python
   *
   * @dontinclude XdmfExampleMap.py
   * @skipline //#initialization
   * @until //#initialization
   * @skipline #//isInitialized
   * @until #//isInitialized
   */
  void read();

  /**
   * Release all data held in memory. The heavy data remain attached.
   *
   * Example of use:
   *
   * C++
   *
   * @dontinclude ExampleXdmfMap.cpp
   * @skipline //#initialization
   * @until //#initialization
   * @skipline //#release
   * @until //#release
   *
   * Python
   *
   * @dontinclude XdmfExampleMap.py
   * @skipline //#initialization
   * @until //#initialization
   * @skipline #//release
   * @until #//release
   */
  void release();

  /**
   * Set the heavy data controllers for this map.
   *
   * Example of use:
   *
   * C++
   *
   * @dontinclude ExampleXdmfMap.cpp
   * @skipline //#initialization
   * @until //#initialization
   * @skipline //#setHeavyDataController
   * @until //#setHeavyDataController
   *
   * Python
   *
   * @dontinclude XdmfExampleMap.py
   * @skipline //#initialization
   * @until //#initialization
   * @skipline #//setHeavyDataController
   * @until #//setHeavyDataController
   *
   * @param     remoteTaskIdsControllers        A vector of XdmfHeavyDataControllers 
   *                                            to the remote task ids dataset.
   * @param     localNodeIdsControllers         A vector of XdmfHeavyDataControllers
   *                                            to the local node ids dataset.
   * @param     remoteLocalNodeIdsControllers   A vector of XdmfHeavyDataControllers
   *                                            to the remote local node ids dataset.
   */
  void
  setHeavyDataControllers(std::vector<shared_ptr<XdmfHeavyDataController> > remoteTaskIdsControllers,
                          std::vector<shared_ptr<XdmfHeavyDataController> > localNodeIdsControllers,
                          std::vector<shared_ptr<XdmfHeavyDataController> > remoteLocalNodeIdsControllers);

  /**
   * Set the boundary communicator map.
   *
   * Example of use:
   *
   * C++
   *
   * @dontinclude ExampleXdmfMap.cpp
   * @skipline //#initialization
   * @until //#initialization
   * @skipline //#setMap
   * @until //#setMap
   *
   * Python
   *
   * @dontinclude XdmfExampleMap.py
   * @skipline #//initialization
   * @until #//initialization
   * @skipline #//setMap
   * @until #//setMap
   *
   * @param     map     The boundary communicator map to store.
   */
  void setMap(std::map<task_id, node_id_map> map);

  /**
   * Set the name of the boundary communicator map.
   *
   * Example of use:
   *
   * C++
   *
   * @dontinclude ExampleXdmfMap.cpp
   * @skipline //#initialization
   * @until //#initialization
   * @skipline //#setName
   * @until //#setName
   *
   * Python
   *
   * @dontinclude XdmfExampleMap.py
   * @skipline #//initialization
   * @until #//initialization
   * @skipline #//setName
   * @until #//setName
   *
   * @param     name    The name of the boundary communicator map to set.
   */
  void setName(const std::string & name);

  void traverse(const shared_ptr<XdmfBaseVisitor> visitor);

  XdmfMap(XdmfMap & map);

protected:

  XdmfMap();

  virtual void
  populateItem(const std::map<std::string, std::string> & itemProperties,
               const std::vector<shared_ptr<XdmfItem> > & childItems,
               const XdmfCoreReader * const reader);

private:

  XdmfMap(const XdmfMap & map);  // Not implemented.
  void operator=(const XdmfMap & map);  // Not implemented.

  std::vector<shared_ptr<XdmfHeavyDataController> > mLocalNodeIdsControllers;
  // remoteTaskId | localNodeId | remoteLocalNodeId
  std::map<task_id, node_id_map > mMap;
  std::string mName;
  std::vector<shared_ptr<XdmfHeavyDataController> > mRemoteLocalNodeIdsControllers;
  std::vector<shared_ptr<XdmfHeavyDataController> > mRemoteTaskIdsControllers;

};

#endif

#ifdef __cplusplus
extern "C" {
#endif

// C wrappers go here

struct XDMFMAP; // Simply as a typedef to ensure correct typing
typedef struct XDMFMAP XDMFMAP;

XDMF_EXPORT XDMFMAP * XdmfMapNew();

XDMF_EXPORT XDMFMAP ** XdmfMapNewFromIdVector(int ** globalNodeIds, int * numIdsOnNode, int numIds);

XDMF_EXPORT char * XdmfMapGetName(XDMFMAP * map);

XDMF_EXPORT void XdmfMapInsert(XDMFMAP * map, int remoteTaskId, int localNodeId, int remoteLocalNodeId);

XDMF_EXPORT int XdmfMapIsInitialized(XDMFMAP * map);

XDMF_EXPORT void XdmfMapRead(XDMFMAP * map, int * status);

XDMF_EXPORT void XdmfMapRelease(XDMFMAP * map);

XDMF_EXPORT int * XdmfMapRetrieveLocalNodeIds(XDMFMAP * map, int remoteTaskId);

XDMF_EXPORT int XdmfMapRetrieveNumberLocalNodeIds(XDMFMAP * map, int remoteTaskId);

XDMF_EXPORT int XdmfMapRetrieveNumberRemoteTaskIds(XDMFMAP * map);

XDMF_EXPORT int XdmfMapRetrieveNumberRemoteNodeIds(XDMFMAP * map, int remoteTaskId, int localNodeId);

XDMF_EXPORT int * XdmfMapRetrieveRemoteTaskIds(XDMFMAP * map);

XDMF_EXPORT int * XdmfMapRetrieveRemoteNodeIds(XDMFMAP * map, int remoteTaskId, int localNodeId);

XDMF_EXPORT void XdmfMapSetHeavyDataControllers(XDMFMAP * map,
                                                XDMFHEAVYDATACONTROLLER ** remoteTaskControllers,
                                                int numRemoteTaskControllers,
                                                XDMFHEAVYDATACONTROLLER ** localNodeControllers,
                                                int numberLocalNodeControllers,
                                                XDMFHEAVYDATACONTROLLER ** remoteLocalNodeControllers,
                                                int numRemoteLocalNodeControllers,
                                                int passControl,
                                                int * status);

XDMF_EXPORT void XdmfMapSetName(XDMFMAP * map, char * newName);

XDMF_ITEM_C_CHILD_DECLARE(XdmfMap, XDMFMAP, XDMF)

#ifdef __cplusplus
}
#endif

#endif /* XDMFMAP_HPP_ */