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
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838 | #include "moab/MOABConfig.h"
#include "iMeshP_extensions.h"
#include "iMesh_MOAB.hpp"
#include "moab/Core.hpp"
#include "moab/Range.hpp"
#include "moab/CN.hpp"
#include "moab/MeshTopoUtil.hpp"
#include "moab/FileOptions.hpp"
#include "moab/ParallelComm.hpp"
#include "MBParallelConventions.h"
#include "MBIter.hpp"
#define IS_BUILDING_MB
#include "Internals.hpp"
#undef IS_BUILDING_MB
#include <cassert>
#include <sstream>
#ifdef MOAB_HAVE_MPI
#include "moab_mpi.h"
#endif
using namespace moab;
/********************* Error Handling **************************/
#define FIXME printf( "Warning: function has incomplete implementation: %s\n", __func__ )
/******** Type-safe casting between MOAB and ITAPS types *********/
#ifndef MOAB_TEMPLATE_FUNC_SPECIALIZATION
// if no template specialization, disable some type checking
template < typename T, typename S >
inline T itaps_cast( S handle )
{
assert( sizeof( S ) >= sizeof( T ) );
return reinterpret_cast< T >( handle );
}
#else
// basic template method : only works to cast to equivalent types (no-op)
template < typename T, typename S >
inline T itaps_cast( S h )
{
return h;
}
// verify size and do reinterpret cast
template < typename T >
inline T itaps_cast_internal_( EntityHandle h )
{
assert( sizeof( T ) >= sizeof( EntityHandle ) );
return reinterpret_cast< T >( h );
}
// verify size and do reinterpret cast
template < typename T >
inline EntityHandle* itaps_cast_ptr_( T* h )
{
assert( sizeof( T ) == sizeof( EntityHandle ) );
return reinterpret_cast< EntityHandle* >( h );
}
// verify size and do reinterpret cast
template < typename T >
inline const EntityHandle* itaps_cast_const_ptr_( const T* h )
{
assert( sizeof( T ) == sizeof( EntityHandle ) );
return reinterpret_cast< const EntityHandle* >( h );
}
// verify set-type handle before cast
template < typename T >
inline T itaps_set_cast_( EntityHandle h )
{
assert( TYPE_FROM_HANDLE( h ) == MBENTITYSET );
return itaps_cast_internal_< T >( h );
}
// define conversion routines between itaps handle and EntityHandle types
#define DECLARE_ALLOWED_ITAPS_CONVERSION( ITAPS_HANDLE_TYPE ) \
template <> \
inline ITAPS_HANDLE_TYPE itaps_cast< ITAPS_HANDLE_TYPE, EntityHandle >( EntityHandle h ) \
{ \
return itaps_cast_internal_< ITAPS_HANDLE_TYPE >( h ); \
} \
\
template <> \
inline EntityHandle itaps_cast< EntityHandle, ITAPS_HANDLE_TYPE >( ITAPS_HANDLE_TYPE handle ) \
{ \
return reinterpret_cast< EntityHandle >( handle ); \
} \
\
template <> \
inline EntityHandle* itaps_cast< EntityHandle*, ITAPS_HANDLE_TYPE* >( ITAPS_HANDLE_TYPE * ptr ) \
{ \
return itaps_cast_ptr_( ptr ); \
} \
\
template <> \
inline const EntityHandle* itaps_cast< const EntityHandle*, const ITAPS_HANDLE_TYPE* >( \
const ITAPS_HANDLE_TYPE* ptr ) \
{ \
return itaps_cast_const_ptr_( ptr ); \
}
// define conversion routines between itaps handle and EntityHandle types
// but limit to EntityHandle for MBENTITYSET type.
#define DECLARE_ALLOWED_ITAPS_SET_CONVERSION( ITAPS_HANDLE_TYPE ) \
template <> \
inline ITAPS_HANDLE_TYPE itaps_cast< ITAPS_HANDLE_TYPE, EntityHandle >( EntityHandle h ) \
{ \
return itaps_set_cast_< ITAPS_HANDLE_TYPE >( h ); \
} \
\
template <> \
inline EntityHandle itaps_cast< EntityHandle, ITAPS_HANDLE_TYPE >( ITAPS_HANDLE_TYPE handle ) \
{ \
return reinterpret_cast< EntityHandle >( handle ); \
} \
\
template <> \
inline EntityHandle* itaps_cast< EntityHandle*, ITAPS_HANDLE_TYPE* >( ITAPS_HANDLE_TYPE * ptr ) \
{ \
return itaps_cast_ptr_( ptr ); \
} \
\
template <> \
inline const EntityHandle* itaps_cast< const EntityHandle*, const ITAPS_HANDLE_TYPE* >( \
const ITAPS_HANDLE_TYPE* ptr ) \
{ \
return itaps_cast_const_ptr_( ptr ); \
}
DECLARE_ALLOWED_ITAPS_SET_CONVERSION( iMeshP_PartitionHandle )<--- The function 'itaps_cast < EntityHandle * , iMeshP_PartitionHandle_Private * * >' is never used.<--- The function 'itaps_cast < EntityHandle , iMeshP_PartitionHandle_Private * >' is never used.<--- The function 'itaps_cast < const EntityHandle * , const iMeshP_PartitionHandle_Private * * >' is never used.<--- The function 'itaps_cast < iMeshP_PartitionHandle_Private * , EntityHandle >' is never used.
// DECLARE_ALLOWED_ITAPS_SET_CONVERSION( iMeshP_PartHandle )
DECLARE_ALLOWED_ITAPS_SET_CONVERSION( iBase_EntitySetHandle )<--- The function 'itaps_cast < EntityHandle * , iBase_EntitySetHandle * >' is never used.<--- The function 'itaps_cast < EntityHandle , iBase_EntitySetHandle >' is never used.<--- The function 'itaps_cast < const EntityHandle * , const iBase_EntitySetHandle * >' is never used.<--- The function 'itaps_cast < iBase_EntitySetHandle , EntityHandle >' is never used.
DECLARE_ALLOWED_ITAPS_CONVERSION( iBase_EntityHandle )<--- The function 'itaps_cast < EntityHandle * , iBase_EntityHandle * >' is never used.<--- The function 'itaps_cast < EntityHandle , iBase_EntityHandle >' is never used.<--- The function 'itaps_cast < const EntityHandle * , const iBase_EntityHandle * >' is never used.<--- The function 'itaps_cast < iBase_EntityHandle , EntityHandle >' is never used.
template <>
inline Tag itaps_cast< Tag, iBase_TagHandle >( iBase_TagHandle h )<--- The function 'itaps_cast < Tag , iBase_TagHandle >' is never used.
{
return reinterpret_cast< Tag >( h );
}
template <>
inline iBase_TagHandle itaps_cast< iBase_TagHandle, Tag >( Tag h )<--- The function 'itaps_cast < iBase_TagHandle , Tag >' is never used.
{
return reinterpret_cast< iBase_TagHandle >( h );
}
#endif
#define PCOMM ParallelComm::get_pcomm( MOABI, itaps_cast< EntityHandle >( partition_handle ) )
/*** static function implemented in iMesh_MOAB.cpp ***/
// Need a different function name for Tag because (currently)
// both Tag and iBase_EntityHandle are void**.
iBase_TagHandle itaps_tag_cast( Tag t )<--- The function 'itaps_tag_cast' is never used.
{
assert( sizeof( iBase_TagHandle ) >= sizeof( Tag ) );
return reinterpret_cast< iBase_TagHandle >( t );
}
/********************* ITAPS arrays **************************/
// Handle returning Range in ITAPS array (do ALLOCATE_ARRAY and copy).
#define RANGE_TO_ITAPS_ARRAY( RANGE, NAME ) \
do \
{ \
ALLOC_CHECK_ARRAY_NOFAIL( NAME, ( RANGE ).size() ); \
std::copy( ( RANGE ).begin(), ( RANGE ).end(), itaps_cast< EntityHandle* >( *( NAME ) ) ); \
} while( false )
static inline ErrorCode get_entities( Interface* iface, EntityHandle set, int type, int topology, Range& entities )
{
if( topology != iMesh_ALL_TOPOLOGIES )
return iface->get_entities_by_type( set, mb_topology_table[topology], entities );
else if( type != iBase_ALL_TYPES )
return iface->get_entities_by_dimension( set, type, entities );
else
return iface->get_entities_by_handle( set, entities );
}
/*
static inline ErrorCode remove_not_owned( ParallelComm* pcomm, Range& ents )
{
ErrorCode rval;
std::vector<unsigned char> pstatus(ents.size());
rval = pcomm->get_moab()->tag_get_data(pcomm->pstatus_tag(), ents, &pstatus[0]);
if (MB_SUCCESS != rval)
return rval;
Range::iterator i = ents.begin();
std::vector<unsigned char>::const_iterator j;
for (j = pstatus.begin(); j != pstatus.end(); ++j) {
if (*j & PSTATUS_NOT_OWNED)
i = ents.erase( i );
else
++i;
}
return MB_SUCCESS;
}
*/
static inline ErrorCode count_owned( ParallelComm* pcomm, const Range& ents, int& n )
{
ErrorCode rval;
n = 0;
std::vector< unsigned char > pstatus( ents.size() );
rval = pcomm->get_moab()->tag_get_data( pcomm->pstatus_tag(), ents, &pstatus[0] );
if( MB_SUCCESS != rval ) return rval;
std::vector< unsigned char >::const_iterator j;
for( j = pstatus.begin(); j != pstatus.end(); ++j )
if( !( *j & PSTATUS_NOT_OWNED ) ) ++n;
return MB_SUCCESS;
}
static void set_intersection_query( iMesh_Instance instance,
iMeshP_PartHandle set1,
iBase_EntitySetHandle set2,
int type,
int topo,
Range& result,
int* err )
{
ErrorCode rval;
if( !set1 )
{
rval = get_entities( MOABI, itaps_cast< EntityHandle >( set2 ), type, topo, result );CHKERR( rval, "Invalid Part handle" );
}
else if( !set2 )
{
rval = get_entities( MOABI, itaps_cast< EntityHandle >( set1 ), type, topo, result );CHKERR( rval, "Invalid set handle" );
}
else
{
Range r1, r2;
rval = get_entities( MOABI, itaps_cast< EntityHandle >( set1 ), type, topo, r1 );CHKERR( rval, "Invalid Part handle" );
rval = get_entities( MOABI, itaps_cast< EntityHandle >( set2 ), type, topo, r2 );CHKERR( rval, "Invalid set handle" );
result.merge( intersect( r1, r2 ) );
}
RETURN( iBase_SUCCESS );
}
/********************* Iterators **************************/
static ErrorCode get_boundary_entities( ParallelComm* pcomm,
EntityHandle part_handle,
int entity_type,
int entity_topology,
int adj_part_id,
Range& entities_out )
{
int* adj_part_id_ptr = ( adj_part_id == iMeshP_ALL_PARTS ) ? 0 : &adj_part_id;
Range iface_sets;
ErrorCode rval = pcomm->get_interface_sets( part_handle, iface_sets, adj_part_id_ptr );
if( MB_SUCCESS != rval ) return rval;
for( Range::iterator i = iface_sets.begin(); i != iface_sets.end(); ++i )
{
rval = get_entities( pcomm->get_moab(), *i, entity_type, entity_topology, entities_out );
if( MB_SUCCESS != rval ) return rval;
}
return MB_SUCCESS;
}
class PartBoundaryIter : public MBRangeIter
{
private:
ParallelComm* pComm;
int adjPart;
public:
inline PartBoundaryIter( ParallelComm* pcomm,
EntityHandle part_handle,
iBase_EntityType entity_type,
iMesh_EntityTopology entity_topology,
int adj_part_id,
int array_sz )
: MBRangeIter( entity_type, entity_topology, part_handle, array_sz ), pComm( pcomm ), adjPart( adj_part_id )
{
}
virtual ErrorCode reset( Interface* )<--- Function in derived class
{
iterData.clear();
ErrorCode result = get_boundary_entities( pComm, entSet, entType, entTopo, adjPart, iterData );
iterPos = iterData.begin();
return result;
}
};
template < class Container >
class SetIntersectIter : public MBIter< Container >
{
private:
EntityHandle otherSet;
public:
SetIntersectIter( iBase_EntityType type,
iMesh_EntityTopology topology,
EntityHandle set,
EntityHandle other_set,
int array_sz )
: MBIter< Container >( type, topology, set, array_sz ), otherSet( other_set )
{
}
virtual ~SetIntersectIter() {}
inline ErrorCode intersect_with_set( Interface* mb, Range& range )
{
Range tmp;
ErrorCode result;
result = mb->get_entities_by_handle( otherSet, tmp );
range = intersect( range, tmp );
return result;
}
inline ErrorCode intersect_with_set( Interface* mb, std::vector< EntityHandle >& list )
{
size_t w = 0;
for( size_t r = 0; r < list.size(); ++r )
{
if( mb->contains_entities( otherSet, &list[r], 1 ) ) list[w++] = list[r];
}
list.resize( w );
return MB_SUCCESS;
}
virtual ErrorCode reset( Interface* mb )<--- Function in derived class
{
ErrorCode result = MBIter< Container >::reset( mb );
if( MB_SUCCESS != result ) return result;
result = intersect_with_set( mb, MBIter< Container >::iterData );
MBIter< Container >::iterPos = MBIter< Container >::iterData.begin();
return result;
}
};
/********************* iMeshP API **************************/
#ifdef __cplusplus
extern "C" {
#endif
void iMeshP_createPartitionAll( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
/*in*/ MPI_Comm communicator,
/*out*/ iMeshP_PartitionHandle* partition_handle,
int* err )
{
*partition_handle = 0;
Tag prtn_tag;
ErrorCode rval = MOABI->tag_get_handle( PARALLEL_PARTITIONING_TAG_NAME, 1, MB_TYPE_INTEGER, prtn_tag,
MB_TAG_SPARSE | MB_TAG_CREAT );CHKERR( rval, "tag creation failed" );
EntityHandle handle;
rval = MOABI->create_meshset( MESHSET_SET, handle );CHKERR( rval, "set creation failed" );
ParallelComm* pcomm = ParallelComm::get_pcomm( MOABI, handle, &communicator );
if( !pcomm )
{
MOABI->delete_entities( &handle, 1 );
RETURN( iBase_FAILURE );
}
// set the value of pcomm id, to the partitioning tag, although this is not used
// we just need the tag to be set
int pid = pcomm->get_id();
rval = MOABI->tag_set_data( prtn_tag, &handle, 1, &pid );CHKERR( rval, "tag creation failed" );
*partition_handle = itaps_cast< iMeshP_PartitionHandle >( handle );
RETURN( iBase_SUCCESS );
}
void iMeshP_destroyPartitionAll( iMesh_Instance instance, iMeshP_PartitionHandle partition_handle, int* err )<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- The function 'imeshp_destroypartitionall' is never used.
{
ParallelComm* pcomm = PCOMM;
if( pcomm ) delete pcomm;
EntityHandle handle = itaps_cast< EntityHandle >( partition_handle );
ErrorCode rval = MOABI->delete_entities( &handle, 1 );CHKERR( rval, "entity deletion failed" );
RETURN( iBase_SUCCESS );
}
void iMeshP_getPartIdFromPartHandle( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
const iMeshP_PartitionHandle partition_handle,
const iMeshP_PartHandle part_handle,
iMeshP_Part* part_id,
int* err )
{
int junk1 = 1, junk2;
iMeshP_getPartIdsFromPartHandlesArr( instance, partition_handle, &part_handle, 1, &part_id, &junk1, &junk2, err );<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
}
void iMeshP_getPartHandleFromPartId( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
const iMeshP_PartitionHandle partition_handle,
iMeshP_Part part_id,
iMeshP_PartHandle* part_handle,
int* err )
{
int junk1 = 1, junk2;
iMeshP_getPartHandlesFromPartsIdsArr( instance, partition_handle, &part_id, 1, &part_handle, &junk1, &junk2, err );<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Calling function imeshp_getparthandlesfrompartsidsarr, 7th argument is uninitialized
}
void iMeshP_getPartIdsFromPartHandlesArr( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
const iMeshP_PartitionHandle partition_handle,
const iMeshP_PartHandle* part_handles,
const int part_handles_size,
iMeshP_Part** part_ids,
int* part_ids_allocated,
int* part_ids_size,
int* err )
{
ErrorCode rval;
ParallelComm* pcomm = PCOMM;
ALLOC_CHECK_ARRAY( part_ids, part_handles_size );<--- Using argument part_ids_size
for( int i = 0; i < part_handles_size; ++i )
{
int id;
rval = pcomm->get_part_id( itaps_cast< EntityHandle >( part_handles[i] ), id );
( *part_ids )[i] = id;CHKERR( rval, "error getting part id" );
}
KEEP_ARRAY( part_ids );
RETURN( iBase_SUCCESS );
}
void iMeshP_getPartHandlesFromPartsIdsArr( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
const iMeshP_PartitionHandle partition_handle,
const iMeshP_Part* part_ids,
const int part_ids_size,
iMeshP_PartHandle** part_handles,
int* part_handles_allocated,
int* part_handles_size,
int* err )
{
ErrorCode rval;
ParallelComm* pcomm = PCOMM;
ALLOC_CHECK_ARRAY( part_handles, part_ids_size );<--- Using argument part_handles_size
for( int i = 0; i < part_ids_size; ++i )
{
EntityHandle handle;
rval = pcomm->get_part_handle( part_ids[i], handle );CHKERR( rval, "error getting part handle" );
( *part_handles )[i] = itaps_cast< iMeshP_PartHandle >( handle );
}
KEEP_ARRAY( part_handles );
RETURN( iBase_SUCCESS );
}
void iMeshP_getPartitionComm( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
iMeshP_PartitionHandle partition_handle,
MPI_Comm* communicator_out,
int* err )
{
ParallelComm* pcomm = PCOMM;
if( !pcomm ) RETURN( iBase_FAILURE );
*communicator_out = pcomm->proc_config().proc_comm();
RETURN( iBase_SUCCESS );
}
void iMeshP_syncPartitionAll( iMesh_Instance instance, iMeshP_PartitionHandle partition_handle, int* err )<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
{
ParallelComm* pcomm = PCOMM;
if( !pcomm ) ERROR( iBase_FAILURE, "No PComm" );
ErrorCode rval = pcomm->collective_sync_partition();CHKERR( rval, "collective sync failed" );
RETURN( iBase_SUCCESS );
}
void iMeshP_getNumPartitions( iMesh_Instance instance, int* num_partitions_out, int* err )<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
{
std::vector< ParallelComm* > pcomms;
ErrorCode rval = ParallelComm::get_all_pcomm( MOABI, pcomms );CHKERR( rval, "Internal error retreiving PComms" );
std::vector< ParallelComm* >::iterator i;
*num_partitions_out = 0;
for( i = pcomms.begin(); i != pcomms.end(); ++i )
if( ( *i )->get_partitioning() ) ( *num_partitions_out )++;
RETURN( iBase_SUCCESS );
}
void iMeshP_getPartitions( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
iMeshP_PartitionHandle** partition_handle,
int* partition_handle_allocated,
int* partition_handle_size,
int* err )
{
std::vector< ParallelComm* > pcomms;
ErrorCode rval = ParallelComm::get_all_pcomm( MOABI, pcomms );CHKERR( rval, "Internal error retreiving PComms" );
std::vector< ParallelComm* >::iterator i;
int count = 0;
for( i = pcomms.begin(); i != pcomms.end(); ++i )
if( ( *i )->get_partitioning() ) ++count;
ALLOC_CHECK_ARRAY_NOFAIL( partition_handle, count );
*partition_handle_size = 0;
for( i = pcomms.begin(); i != pcomms.end(); ++i )
if( ( *i )->get_partitioning() )
( *partition_handle )[( *partition_handle_size )++] =
itaps_cast< iMeshP_PartitionHandle >( ( *i )->get_partitioning() );
RETURN( iBase_SUCCESS );
}
void iMeshP_getNumGlobalParts( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
const iMeshP_PartitionHandle partition_handle,
int* num_global_part,
int* err )
{
ParallelComm* pcomm = PCOMM;
if( !pcomm ) ERROR( iBase_FAILURE, "No PComm" );
ErrorCode rval = pcomm->get_global_part_count( *num_global_part );CHKERR( rval, "PComm::get_global_part_count failed" );
RETURN( iBase_SUCCESS );
}
void iMeshP_getNumLocalParts( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
const iMeshP_PartitionHandle partition_handle,
int* num_local_part,
int* err )
{
ParallelComm* pcomm = PCOMM;
if( !pcomm ) ERROR( iBase_FAILURE, "No PComm" );
*num_local_part = pcomm->partition_sets().size();
RETURN( iBase_SUCCESS );
}
void iMeshP_getLocalParts( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
const iMeshP_PartitionHandle partition_handle,
iMeshP_PartHandle** part_handles,
int* part_handles_allocated,
int* part_handles_size,
int* err )
{
ParallelComm* pcomm = PCOMM;
if( !pcomm ) ERROR( iBase_FAILURE, "No PComm" );
RANGE_TO_ITAPS_ARRAY( pcomm->partition_sets(), part_handles );
RETURN( iBase_SUCCESS );
}
void iMeshP_getRankOfPart( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
const iMeshP_PartitionHandle partition_handle,
const iMeshP_Part part_id,
int* rank,
int* err )
{
int junk1 = 1, junk2 = 1;
iMeshP_getRankOfPartArr( instance, partition_handle, &part_id, 1, &rank, &junk1, &junk2, err );<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
}
void iMeshP_getRankOfPartArr( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
const iMeshP_PartitionHandle partition_handle,
const iMeshP_Part* part_ids,
const int part_ids_size,
int** rank,
int* rank_allocated,
int* rank_size,
int* err )
{
ParallelComm* pcomm = PCOMM;
if( !pcomm ) ERROR( iBase_FAILURE, "No PComm" );
ALLOC_CHECK_ARRAY( rank, part_ids_size );
ErrorCode rval = MB_SUCCESS;<--- Variable 'rval' is assigned a value that is never used.
for( int i = 0; i < part_ids_size; ++i )
{
rval = pcomm->get_part_owner( part_ids[i], ( *rank )[i] );CHKERR( rval, "PComm::get_part_owner failed" );
}
KEEP_ARRAY( rank );
RETURN( iBase_SUCCESS );
}
void iMeshP_getNumOfTypeAll( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
const iMeshP_PartitionHandle partition_handle,
const iBase_EntitySetHandle entity_set_handle,
const int entity_type,
int* num_type,
int* err )
{
ParallelComm* pcomm = PCOMM;
if( !pcomm ) ERROR( iBase_FAILURE, "No PComm" );
Range entities;
ErrorCode rval = get_entities( MOABI, itaps_cast< EntityHandle >( entity_set_handle ), entity_type,
iMesh_ALL_TOPOLOGIES, entities );
int count = 0;
if( MB_SUCCESS == rval ) rval = count_owned( pcomm, entities, count );
int vals[2] = { count, rval }, sums[2];
int ierr = MPI_Allreduce( vals, sums, 2, MPI_INT, MPI_SUM, pcomm->proc_config().proc_comm() );
assert( iBase_SUCCESS == 0 );
if( ierr || sums[1] ) RETURN( iBase_FAILURE );
*num_type = sums[0];
RETURN( iBase_SUCCESS );
}
void iMeshP_getNumOfTopoAll( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
const iMeshP_PartitionHandle partition_handle,
const iBase_EntitySetHandle entity_set_handle,
const int entity_topology,
int* num_topo,
int* err )
{
ParallelComm* pcomm = PCOMM;
if( !pcomm ) ERROR( iBase_FAILURE, "No PComm" );
Range entities;
ErrorCode rval = get_entities( MOABI, itaps_cast< EntityHandle >( entity_set_handle ), iBase_ALL_TYPES,
entity_topology, entities );
int count = 0;
if( MB_SUCCESS == rval ) rval = count_owned( pcomm, entities, count );
int vals[2] = { count, rval }, sums[2];
int ierr = MPI_Allreduce( vals, sums, 2, MPI_INT, MPI_SUM, pcomm->proc_config().proc_comm() );
assert( iBase_SUCCESS == 0 );
if( ierr || sums[1] ) RETURN( iBase_FAILURE );
*num_topo = sums[0];
RETURN( iBase_SUCCESS );
}
void iMeshP_createPart( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
iMeshP_PartitionHandle partition_handle,
iMeshP_PartHandle* part_handle,
int* err )
{
ParallelComm* pcomm = PCOMM;
if( !pcomm ) ERROR( iBase_FAILURE, "No PComm" );
EntityHandle h;
ErrorCode rval = pcomm->create_part( h );CHKERR( rval, "Part creation failed" );
*part_handle = itaps_cast< iMeshP_PartHandle >( h );
RETURN( iBase_SUCCESS );
}
void iMeshP_destroyPart( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- The function 'imeshp_destroypart' is never used.
iMeshP_PartitionHandle partition_handle,
iMeshP_PartHandle part_handle,
int* err )
{
ParallelComm* pcomm = PCOMM;
if( !pcomm ) ERROR( iBase_FAILURE, "No PComm" );
ErrorCode rval = pcomm->destroy_part( itaps_cast< EntityHandle >( part_handle ) );CHKERR( rval, "Part destruction failed" );
RETURN( iBase_SUCCESS );
}
void iMeshP_getNumPartNbors( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
iMeshP_PartitionHandle partition_handle,
iMeshP_PartHandle part_handle,
int entity_type,
int* num_part_nbors,
int* err )
{
int junk1 = 1, junk2 = 1;
iMeshP_getNumPartNborsArr( instance, partition_handle, &part_handle, 1, entity_type, &num_part_nbors, &junk1,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
&junk2, err );
}
void iMeshP_getNumPartNborsArr( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
const iMeshP_PartitionHandle partition_handle,
const iMeshP_PartHandle* part_handles,
const int part_handles_size,
int /*entity_type*/,
int** num_part_nbors,
int* num_part_nbors_allocated,
int* num_part_nbors_size,
int* err )
{
ParallelComm* pcomm = PCOMM;
if( !pcomm ) ERROR( iBase_FAILURE, "No PComm" );
ALLOC_CHECK_ARRAY( num_part_nbors, part_handles_size );
int n, neighbors[MAX_SHARING_PROCS];
ErrorCode rval;
for( int i = 0; i < part_handles_size; ++i )
{
EntityHandle h = itaps_cast< EntityHandle >( part_handles[i] );
rval = pcomm->get_part_neighbor_ids( h, neighbors, n );CHKERR( rval, "error getting neighbor ids" );
( *num_part_nbors )[i] = n;
}
KEEP_ARRAY( num_part_nbors );
RETURN( iBase_SUCCESS );
}
void iMeshP_getPartNbors( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
const iMeshP_PartitionHandle partition_handle,
const iMeshP_PartHandle part_handle,
int entity_type,
int* num_part_nbors,
iMeshP_Part** nbor_part_ids,
int* nbor_part_ids_allocated,
int* nbor_part_ids_size,
int* err )
{
int junk1 = 1, junk2 = 1;
iMeshP_getPartNborsArr( instance, partition_handle, &part_handle, 1, entity_type, &num_part_nbors, &junk1, &junk2,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
nbor_part_ids, nbor_part_ids_allocated, nbor_part_ids_size, err );
}
void iMeshP_getPartNborsArr( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
const iMeshP_PartitionHandle partition_handle,
const iMeshP_PartHandle* part_handles,
const int part_handles_size,
int /*entity_type*/,
int** num_part_nbors,
int* num_part_nbors_allocated,
int* num_part_nbors_size,
iMeshP_Part** nbor_part_ids,
int* nbor_part_ids_allocated,
int* nbor_part_ids_size,
int* err )
{
ParallelComm* pcomm = PCOMM;
if( !pcomm ) ERROR( iBase_FAILURE, "No PComm" );
ALLOC_CHECK_ARRAY( num_part_nbors, part_handles_size );
std::vector< int > all_neighbors;
int n, pnbor[MAX_SHARING_PROCS];
ErrorCode rval;
for( int i = 0; i < part_handles_size; ++i )
{
EntityHandle h = itaps_cast< EntityHandle >( part_handles[i] );
rval = pcomm->get_part_neighbor_ids( h, pnbor, n );CHKERR( rval, "error getting neighbor ids" );
( *num_part_nbors )[i] = n;
std::copy( pnbor, pnbor + n, std::back_inserter( all_neighbors ) );
}
ALLOC_CHECK_ARRAY_NOFAIL( nbor_part_ids, all_neighbors.size() );
memcpy( *nbor_part_ids, &all_neighbors[0], sizeof( int ) * all_neighbors.size() );
KEEP_ARRAY( num_part_nbors );
RETURN( iBase_SUCCESS );
}
void iMeshP_getNumPartBdryEnts( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
const iMeshP_PartitionHandle partition_handle,
const iMeshP_PartHandle part_handle,
const int entity_type,
const int entity_topology,
const iMeshP_Part target_part_id,
int* num_entities,
int* err )
{
Range entities;
ErrorCode rval = get_boundary_entities( PCOMM, itaps_cast< EntityHandle >( part_handle ), entity_type,
entity_topology, target_part_id, entities );CHKERR( rval, "failed to get boundary entities" );
*num_entities = entities.size();
RETURN( iBase_SUCCESS );
}
void iMeshP_getPartBdryEnts( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
const iMeshP_PartitionHandle partition_handle,
const iMeshP_PartHandle part_handle,
const int entity_type,
const int entity_topology,
const iMeshP_Part target_part_id,
iBase_EntityHandle** entity_handles,
int* entity_handles_allocated,
int* entity_handles_size,
int* err )
{
Range entities;
ErrorCode rval = get_boundary_entities( PCOMM, itaps_cast< EntityHandle >( part_handle ), entity_type,
entity_topology, target_part_id, entities );CHKERR( rval, "failed to get boundary entities" );
RANGE_TO_ITAPS_ARRAY( entities, entity_handles );
RETURN( iBase_SUCCESS );
}
void iMeshP_initPartBdryEntIter( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
const iMeshP_PartitionHandle partition_handle,
const iMeshP_PartHandle part_handle,
const int entity_type,
const int entity_topology,
const iMeshP_Part nbor_part_id,
iBase_EntityIterator* entity_iterator,
int* err )
{
iMeshP_initPartBdryEntArrIter( instance, partition_handle, part_handle, entity_type, entity_topology, 1,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
nbor_part_id, reinterpret_cast< iBase_EntityArrIterator* >( entity_iterator ), err );
}
void iMeshP_initPartBdryEntArrIter( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
const iMeshP_PartitionHandle partition_handle,
const iMeshP_PartHandle part_handle,
const int entity_type,
const int entity_topology,
const int array_size,
const iMeshP_Part nbor_part_id,
iBase_EntityArrIterator* entity_iterator,
int* err )
{
*entity_iterator =
new PartBoundaryIter( PCOMM, itaps_cast< EntityHandle >( part_handle ), (iBase_EntityType)entity_type,
(iMesh_EntityTopology)entity_topology, nbor_part_id, array_size );
ErrorCode result = ( *entity_iterator )->reset( MOABI );
if( MB_SUCCESS != result ) delete *entity_iterator;CHKERR( result, "iMesh_initEntArrIter: ERROR getting entities of proper type or topology." );
RETURN( iBase_SUCCESS );
}
void iMeshP_getNumOfType( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
const iMeshP_PartitionHandle,
const iMeshP_PartHandle part_handle,
const iBase_EntitySetHandle entity_set_handle,
const int entity_type,
int* num_type,
int* err )
{
Range r;
set_intersection_query( instance, part_handle, entity_set_handle, entity_type, iMesh_ALL_TOPOLOGIES, r, err );
*num_type = r.size();
}
void iMeshP_getNumOfTopo( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
const iMeshP_PartitionHandle /*partition_handle*/,
const iMeshP_PartHandle part_handle,
const iBase_EntitySetHandle entity_set_handle,
const int entity_topology,
int* num_topo,
int* err )
{
Range r;
set_intersection_query( instance, part_handle, entity_set_handle, iBase_ALL_TYPES, entity_topology, r, err );
*num_topo = r.size();
}
void iMeshP_getAdjEntIndices( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- The function 'imeshp_getadjentindices' is never used.
iMeshP_PartitionHandle partition,
iMeshP_PartHandle part,
iBase_EntitySetHandle entity_set_handle,
int entity_type_requestor,
int entity_topology_requestor,
int entity_type_requested,
iBase_EntityHandle** entity_handles,
int* entity_handles_allocated,
int* entity_handles_size,
iBase_EntityHandle** adj_entity_handles,
int* adj_entity_handles_allocated,
int* adj_entity_handles_size,
int** adj_entity_indices,
int* adj_entity_indices_allocated,
int* adj_entity_indices_size,
int** offset,
int* offset_allocated,
int* offset_size,
int* err )
{
const int allocated_entity_handles = ( *entity_handles_allocated == 0 );
const int allocated_indices = ( *adj_entity_indices_allocated == 0 );
const int allocated_offset = ( *offset_allocated == 0 );
// get source entities
iMeshP_getEntities( instance, partition, part, entity_set_handle, entity_type_requestor, entity_topology_requestor,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
entity_handles, entity_handles_allocated, entity_handles_size, err );
if( iBase_SUCCESS != *err ) return;
// get adjacencies
iBase_EntityHandle* all_adj_handles = 0;
int size = 0, alloc = 0;
iMesh_getEntArrAdj( instance, *entity_handles, *entity_handles_size, entity_type_requested, &all_adj_handles,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
&alloc, &size, offset, offset_allocated, offset_size, err );
if( *err != iBase_SUCCESS )
{
if( allocated_entity_handles )
{
free( *entity_handles );
*entity_handles = 0;
*entity_handles_allocated = 0;
}
return;
}
// allocate or check size of adj_entity_indices
*adj_entity_indices_size = size;
if( allocated_indices )
{
*adj_entity_indices = (int*)malloc( sizeof( iBase_EntityHandle ) * size );
if( !*adj_entity_indices )
*err = iBase_MEMORY_ALLOCATION_FAILED;
else
*adj_entity_indices_allocated = size;
}
else if( *adj_entity_indices_allocated < size )
{
*err = iBase_BAD_ARRAY_DIMENSION;
}
if( iBase_SUCCESS != *err )
{
free( all_adj_handles );
if( allocated_entity_handles )
{
free( *entity_handles );
*entity_handles = 0;
*entity_handles_allocated = 0;
}
if( allocated_offset )
{
free( *offset );
*offset = 0;
*offset_allocated = 0;
}
return;
}
// Now create an array of unique sorted handles from all_adj_handles.
// We need to create a copy because we still need all_adj_handles. We
// will eventually need to copy the resulting unique list into
// adj_entity_handles, so if adj_entity_handles is already allocated and
// of sufficient size, use it rather than allocating another temporary.
iBase_EntityHandle* unique_adj = 0;
if( *adj_entity_handles_allocated >= size )
{
unique_adj = *adj_entity_handles;
}
else
{
unique_adj = (iBase_EntityHandle*)malloc( sizeof( iBase_EntityHandle ) * size );
}
std::copy( all_adj_handles, all_adj_handles + size, unique_adj );
std::sort( unique_adj, unique_adj + size );
*adj_entity_handles_size = std::unique( unique_adj, unique_adj + size ) - unique_adj;
// If we created a temporary array for unique_adj rather than using
// already allocated space in adj_entity_handles, allocate adj_entity_handles
// and copy the unique handle list into it
if( *adj_entity_handles != unique_adj )
{
if( !*adj_entity_handles_allocated )
{
*adj_entity_handles =
(iBase_EntityHandle*)malloc( sizeof( iBase_EntityHandle ) * *adj_entity_handles_size );
if( !*adj_entity_handles )
*err = iBase_MEMORY_ALLOCATION_FAILED;
else
*adj_entity_handles_allocated = *adj_entity_handles_size;
}
else if( *adj_entity_handles_allocated < *adj_entity_handles_size )
*err = iBase_BAD_ARRAY_DIMENSION;
if( iBase_SUCCESS != *err )
{
free( unique_adj );
free( all_adj_handles );
if( allocated_entity_handles )
{
free( *entity_handles );
*entity_handles = 0;
*entity_handles_allocated = 0;
}
if( allocated_offset )
{
free( *offset );
*offset = 0;
*offset_allocated = 0;
}
if( allocated_indices )
{
free( *adj_entity_indices );
*adj_entity_indices = 0;
*adj_entity_indices_allocated = 0;
}
return;
}
std::copy( unique_adj, unique_adj + *adj_entity_handles_size, *adj_entity_handles );
free( unique_adj );
unique_adj = *adj_entity_handles;
}
// convert from adjacency list to indices into unique_adj
for( int i = 0; i < *adj_entity_indices_size; ++i )
( *adj_entity_indices )[i] =
std::lower_bound( unique_adj, unique_adj + *adj_entity_handles_size, all_adj_handles[i] ) - unique_adj;
free( all_adj_handles );
}
void iMeshP_getEntities( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
const iMeshP_PartitionHandle,
const iMeshP_PartHandle part_handle,
const iBase_EntitySetHandle entity_set_handle,
const int entity_type,
const int entity_topology,
iBase_EntityHandle** entity_handles,
int* entity_handles_allocated,
int* entity_handles_size,
int* err )
{
Range r;
set_intersection_query( instance, part_handle, entity_set_handle, entity_type, entity_topology, r, err );
if( iBase_SUCCESS != *err ) return;
RANGE_TO_ITAPS_ARRAY( r, entity_handles );
RETURN( iBase_SUCCESS );
}
void iMeshP_getAdjEntities( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- The function 'imeshp_getadjentities' is never used.
const iMeshP_PartitionHandle /*partition_handle*/,
const iMeshP_PartHandle part_handle,
const iBase_EntitySetHandle entity_set_handle,
const int entity_type_requestor,
const int entity_topology_requestor,
const int entity_type_requested,
iBase_EntityHandle** adj_entity_handles,
int* adj_entity_handles_allocated,
int* adj_entity_handles_size,
int** offset,
int* offset_allocated,
int* offset_size,
int** in_entity_set,
int* in_entity_set_allocated,
int* in_entity_set_size,
int* err )
{
ErrorCode rval;
Range r;
set_intersection_query( instance, part_handle, entity_set_handle, entity_type_requestor, entity_topology_requestor,
r, err );
if( iBase_SUCCESS != *err ) return;
// count adjacencies
std::vector< EntityHandle > tmp_storage;
int num_adj = 0;
int num_conn;
const EntityHandle* conn_ptr;
for( Range::iterator i = r.begin(); i != r.end(); ++i )
{
if( entity_type_requested || TYPE_FROM_HANDLE( *i ) == MBPOLYHEDRON )
{
tmp_storage.clear();
rval = MOABI->get_adjacencies( &*i, 1, entity_type_requested, false, tmp_storage );CHKERR( rval, "get_adjacencies failed" );
num_adj += tmp_storage.size();
}
else
{
rval = MOABI->get_connectivity( *i, conn_ptr, num_conn, false, &tmp_storage );CHKERR( rval, "get_connectivity failed" );
num_adj += num_conn;
}
}
// get adjacencies
ALLOC_CHECK_ARRAY( adj_entity_handles, num_adj );
ALLOC_CHECK_ARRAY( offset, r.size() );
int arr_pos = 0;
int* offset_iter = *offset;
for( Range::iterator i = r.begin(); i != r.end(); ++i )
{
*offset_iter = arr_pos;
++offset_iter;
tmp_storage.clear();
rval = MOABI->get_adjacencies( &*i, 1, entity_type_requested, false, tmp_storage );CHKERR( rval, "get_adjacencies failed" );
for( std::vector< EntityHandle >::iterator j = tmp_storage.begin(); j != tmp_storage.end(); ++j )
{
( *adj_entity_handles )[arr_pos] = itaps_cast< iBase_EntityHandle >( *j );
++arr_pos;
}
}
// get in_entity_set
iMesh_isEntArrContained( instance, entity_set_handle, *adj_entity_handles, *adj_entity_handles_size, in_entity_set,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
in_entity_set_allocated, in_entity_set_size, err );
if( iBase_SUCCESS == *err )
{
KEEP_ARRAY( adj_entity_handles );
KEEP_ARRAY( offset );
}
}
void iMeshP_initEntIter( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- The function 'imeshp_initentiter' is never used.
const iMeshP_PartitionHandle partition_handle,
const iMeshP_PartHandle part_handle,
const iBase_EntitySetHandle entity_set_handle,
const int requested_entity_type,
const int requested_entity_topology,
iBase_EntityIterator* entity_iterator,
int* err )
{
iMeshP_initEntArrIter( instance, partition_handle, part_handle, entity_set_handle, requested_entity_type,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
requested_entity_topology, 1,
reinterpret_cast< iBase_EntityArrIterator* >( entity_iterator ), err );
}
void iMeshP_initEntArrIter( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
const iMeshP_PartitionHandle /*partition_handle*/,
const iMeshP_PartHandle part_handle,
const iBase_EntitySetHandle entity_set_handle,
const int requested_entity_type,
const int requested_entity_topology,
const int requested_array_size,
iBase_EntityArrIterator* entArr_iterator,
int* err )
{
if( !entity_set_handle || entity_set_handle == part_handle )
{
iMesh_initEntArrIter( instance, part_handle, requested_entity_type, requested_entity_topology,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
requested_array_size,
0, // TODO: update this function for "resilient" arg
entArr_iterator, err );
}
else
{
unsigned flags;
ErrorCode result = MOABI->get_meshset_options( itaps_cast< EntityHandle >( entity_set_handle ), flags );CHKERR( result, "Invalid entity set handle" );
if( flags & MESHSET_ORDERED )
*entArr_iterator = new SetIntersectIter< std::vector< EntityHandle > >(
(iBase_EntityType)requested_entity_type, (iMesh_EntityTopology)requested_entity_topology,
itaps_cast< EntityHandle >( entity_set_handle ), itaps_cast< EntityHandle >( part_handle ),
requested_array_size );
else
*entArr_iterator =
new SetIntersectIter< Range >( (iBase_EntityType)requested_entity_type,
(iMesh_EntityTopology)requested_entity_topology,
itaps_cast< EntityHandle >( entity_set_handle ),
itaps_cast< EntityHandle >( part_handle ), requested_array_size );
result = ( *entArr_iterator )->reset( MOABI );
if( MB_SUCCESS != result ) delete *entArr_iterator;CHKERR( result, "iMesh_initEntArrIter: ERROR getting entities of proper type or topology." );
RETURN( iBase_SUCCESS );
}
}
void iMeshP_getEntOwnerPart( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
const iMeshP_PartitionHandle partition_handle,
const iBase_EntityHandle entity_handle,
iMeshP_Part* part_id,
int* err )
{
int junk1 = 1, junk2 = 1;
iMeshP_getEntOwnerPartArr( instance, partition_handle, &entity_handle, 1, &part_id, &junk1, &junk2, err );<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
}
void iMeshP_getEntOwnerPartArr( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
const iMeshP_PartitionHandle partition_handle,
const iBase_EntityHandle* entity_handles,
const int entity_handles_size,
iMeshP_Part** part_ids,
int* part_ids_allocated,
int* part_ids_size,
int* err )
{
ParallelComm* pcomm = PCOMM;
if( !pcomm ) ERROR( iBase_FAILURE, "No PComm" );
int id;
ALLOC_CHECK_ARRAY( part_ids, entity_handles_size );
ErrorCode rval = MB_SUCCESS;<--- Variable 'rval' is assigned a value that is never used.
for( int i = 0; i < entity_handles_size; ++i )
{
EntityHandle h = itaps_cast< EntityHandle >( entity_handles[i] );
rval = pcomm->get_owning_part( h, id );
( *part_ids )[i] = id;CHKERR( rval, "Failet get part owner" );
}
KEEP_ARRAY( part_ids );
RETURN( iBase_SUCCESS );
}
void iMeshP_isEntOwner( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
const iMeshP_PartitionHandle partition_handle,
const iMeshP_PartHandle part_handle,
const iBase_EntityHandle entity_handle,
int* is_owner,
int* err )
{
int junk1 = 1, junk2 = 1;
iMeshP_isEntOwnerArr( instance, partition_handle, part_handle, &entity_handle, 1, &is_owner, &junk1, &junk2, err );<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
}
void iMeshP_isEntOwnerArr( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
const iMeshP_PartitionHandle partition_handle,
const iMeshP_PartHandle part_handle,
const iBase_EntityHandle* entity_handles,
const int entity_handles_size,
int** is_owner,
int* is_owner_allocated,
int* is_owner_size,
int* err )
{
ErrorCode rval;
ParallelComm* pcomm = PCOMM;
if( !pcomm ) ERROR( iBase_FAILURE, "No PComm" );
int id;
rval = pcomm->get_part_id( itaps_cast< EntityHandle >( part_handle ), id );CHKERR( rval, "error getting part id" );
ALLOC_CHECK_ARRAY( is_owner, entity_handles_size );
*is_owner_size = entity_handles_size;
int owner;
for( int i = 0; i < entity_handles_size; ++i )
{
rval = pcomm->get_owner( itaps_cast< EntityHandle >( entity_handles[i] ), owner );CHKERR( rval, "error getting owner" );
( *is_owner )[i] = ( owner == id );
}
KEEP_ARRAY( is_owner );
RETURN( iBase_SUCCESS );
}
void iMeshP_getEntStatus( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
/*in*/ const iMeshP_PartitionHandle partition_handle,
/*in*/ const iMeshP_PartHandle part_handle,
/*in*/ const iBase_EntityHandle entity_handle,
/*out*/ int* par_status, // Values=INTERNAL,BOUNDARY,GHOST
int* err )
{
int junk1 = 1, junk2 = 1;
iMeshP_getEntStatusArr( instance, partition_handle, part_handle, &entity_handle, 1, &par_status, &junk1, &junk2,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
err );
}
void iMeshP_getEntStatusArr( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
/*in*/ const iMeshP_PartitionHandle partition_handle,
/*in*/ const iMeshP_PartHandle /*part_handle*/,
/*in*/ const iBase_EntityHandle* entity_handles,
/*in*/ const int entity_handles_size,
/*inout*/ int** par_status, // Values=INTERNAL,BOUNDARY,GHOST
/*inout*/ int* par_status_allocated,
/*inout*/ int* par_status_size,
int* err )
{
ParallelComm* pcomm = PCOMM;
if( !pcomm ) ERROR( iBase_FAILURE, "No PComm" );
std::vector< unsigned char > pstatus( entity_handles_size );
ErrorCode result = MOABI->tag_get_data( pcomm->pstatus_tag(), itaps_cast< const EntityHandle* >( entity_handles ),
entity_handles_size, &pstatus[0] );CHKERR( result, "error getting pstatus_tag" );
ALLOC_CHECK_ARRAY( par_status, entity_handles_size );
for( int i = 0; i < entity_handles_size; i++ )
{
if( !pstatus[i] )
( *par_status )[i] = iMeshP_INTERNAL;
else if( pstatus[i] & PSTATUS_GHOST )
( *par_status )[i] = iMeshP_GHOST;
else if( pstatus[i] & PSTATUS_INTERFACE )
( *par_status )[i] = iMeshP_BOUNDARY;
}
KEEP_ARRAY( par_status );
RETURN( iBase_SUCCESS );
}
void iMeshP_getNumCopies( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
const iMeshP_PartitionHandle partition_handle,
const iBase_EntityHandle entity_handle,
int* num_copies_ent,
int* err )
{
ParallelComm* pcomm = PCOMM;
if( !pcomm ) ERROR( iBase_FAILURE, "No PComm" );
int ids[MAX_SHARING_PROCS];
ErrorCode rval = pcomm->get_sharing_parts( itaps_cast< EntityHandle >( entity_handle ), ids, *num_copies_ent );CHKERR( rval, "ParallelComm::get_sharing_parts failed" );
RETURN( iBase_SUCCESS );
}
void iMeshP_getCopyParts( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
const iMeshP_PartitionHandle partition_handle,
const iBase_EntityHandle entity_handle,
iMeshP_Part** part_ids,
int* part_ids_allocated,
int* part_ids_size,
int* err )
{
ParallelComm* pcomm = PCOMM;
if( !pcomm ) ERROR( iBase_FAILURE, "No PComm" );
int ids[MAX_SHARING_PROCS], num_ids;
ErrorCode rval = pcomm->get_sharing_parts( itaps_cast< EntityHandle >( entity_handle ), ids, num_ids );CHKERR( rval, "ParallelComm::get_sharing_parts failed" );
ALLOC_CHECK_ARRAY_NOFAIL( part_ids, num_ids );
std::copy( ids, ids + num_ids, *part_ids );
RETURN( iBase_SUCCESS );
}
void iMeshP_getCopies( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
const iMeshP_PartitionHandle partition_handle,
const iBase_EntityHandle entity_handle,
iMeshP_Part** part_ids,
int* part_ids_allocated,
int* part_ids_size,
iBase_EntityHandle** copies_entity_handles,
int* copies_entity_handles_allocated,
int* copies_entity_handles_size,
int* err )
{
ParallelComm* pcomm = PCOMM;
if( !pcomm ) ERROR( iBase_FAILURE, "No PComm" );
int ids[MAX_SHARING_PROCS], num_ids;
EntityHandle handles[MAX_SHARING_PROCS];
ErrorCode rval = pcomm->get_sharing_parts( itaps_cast< EntityHandle >( entity_handle ), ids, num_ids, handles );CHKERR( rval, "ParallelComm::get_sharing_parts failed" );
ALLOC_CHECK_ARRAY_NOFAIL( part_ids, num_ids );
ALLOC_CHECK_ARRAY_NOFAIL( copies_entity_handles, num_ids );
for( int i = 0; i < num_ids; ++i )
{
( *part_ids )[i] = ids[i];
( *copies_entity_handles )[i] = itaps_cast< iBase_EntityHandle >( handles[i] );
}
RETURN( iBase_SUCCESS );
}
void iMeshP_getCopyOnPart( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
const iMeshP_PartitionHandle partition_handle,
const iBase_EntityHandle entity_handle,
const iMeshP_Part part_id,
iBase_EntityHandle* copy_entity_handle,
int* err )
{
ParallelComm* pcomm = PCOMM;
if( !pcomm ) ERROR( iBase_FAILURE, "No PComm" );
int ids[MAX_SHARING_PROCS], num_ids;
EntityHandle handles[MAX_SHARING_PROCS];
ErrorCode rval = pcomm->get_sharing_parts( itaps_cast< EntityHandle >( entity_handle ), ids, num_ids, handles );CHKERR( rval, "ParallelComm::get_sharing_parts failed" );
int idx = std::find( ids, ids + num_ids, part_id ) - ids;
if( idx == num_ids ) RETURN( iBase_FAILURE );
*copy_entity_handle = itaps_cast< iBase_EntityHandle >( handles[idx] );
RETURN( iBase_SUCCESS );
}
void iMeshP_getOwnerCopy( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
const iMeshP_PartitionHandle partition_handle,
const iBase_EntityHandle entity_handle,
iMeshP_Part* owner_part_id,
iBase_EntityHandle* owner_entity_handle,
int* err )
{
ParallelComm* pcomm = PCOMM;
if( !pcomm ) ERROR( iBase_FAILURE, "No PComm" );
int id;
EntityHandle h;
ErrorCode rval = pcomm->get_owning_part( itaps_cast< EntityHandle >( entity_handle ), id, &h );CHKERR( rval, "Failed to get owner" );
*owner_part_id = id;
*owner_entity_handle = itaps_cast< iBase_EntityHandle >( h );
RETURN( iBase_SUCCESS );
}
void iMeshP_waitForAnyRequest( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- The function 'imeshp_waitforanyrequest' is never used.
iMeshP_PartitionHandle,
iMeshP_RequestHandle*,
int,
int*,
int* err )
{
FIXME;
RETURN( iBase_NOT_SUPPORTED );
}
void iMeshP_waitForAllRequests( iMesh_Instance instance, iMeshP_PartitionHandle, iMeshP_RequestHandle*, int, int* err )<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- The function 'imeshp_waitforallrequests' is never used.
{
FIXME;
RETURN( iBase_NOT_SUPPORTED );
}
void iMeshP_waitForRequestEnt( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- The function 'imeshp_waitforrequestent' is never used.
const iMeshP_PartitionHandle,
iMeshP_RequestHandle,
iBase_EntityHandle**,
int*,
int*,
int* err )
{
FIXME;
RETURN( iBase_NOT_SUPPORTED );
}
void iMeshP_testRequest( iMesh_Instance instance, const iMeshP_PartitionHandle, iMeshP_RequestHandle, int*, int* err )<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- The function 'imeshp_testrequest' is never used.
{
FIXME;
RETURN( iBase_NOT_SUPPORTED );
}
void iMeshP_pollForRequests( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- The function 'imeshp_pollforrequests' is never used.
iMeshP_PartitionHandle,
iMeshP_RequestHandle**,
int*,
int*,
int* err )
{
FIXME;
RETURN( iBase_NOT_SUPPORTED );
}
void iMeshP_exchEntArrToPartsAll( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
const iMeshP_PartitionHandle partition_handle,
const iBase_EntityHandle* entity_handles,
const int entity_handles_size,
const iMeshP_Part* target_part_ids,
int command_code,
int update_ghost,
iMeshP_RequestHandle* /*request*/,
int* err )
{
if( command_code == 1 )
{
std::cerr << "Entity migration option is not supported." << std::endl;
RETURN( iBase_NOT_SUPPORTED );
}
if( update_ghost == 1 )
{
std::cerr << "Gost update option is not supported." << std::endl;
RETURN( iBase_NOT_SUPPORTED );
}
// make exchange entity and processor list
ErrorCode rval;
ParallelComm* pcomm = PCOMM;
std::vector< unsigned int > exchange_procs;
std::vector< Range* > exchange_ents;
for( int i = 0; i < entity_handles_size; i++ )
{
int ind = -1;
// iMeshP_Part target_p = target_part_ids[i];
int target_p;
rval = pcomm->get_part_owner( target_part_ids[i], target_p );CHKERR( rval, "ParallelComm::get_part_owner failed" );
std::vector< unsigned int >::iterator vit = std::find( exchange_procs.begin(), exchange_procs.end(), target_p );
if( vit == exchange_procs.end() )
{
ind = exchange_procs.size();
exchange_procs.push_back( target_p );
exchange_ents.push_back( new Range );
}
else
ind = vit - exchange_procs.begin();
exchange_ents[ind]->insert( itaps_cast< EntityHandle >( entity_handles[i] ) );
}
std::vector< MPI_Request > recv_ent_reqs, recv_remoteh_reqs;
rval = pcomm->exchange_owned_meshs( exchange_procs, exchange_ents, recv_ent_reqs, recv_remoteh_reqs, true );CHKERR( rval, "ParallelComm::exchange_owned_meshs failed" );
// delete exchange list
std::vector< Range* >::iterator vit;
for( vit = exchange_ents.begin(); vit != exchange_ents.end(); ++vit )
delete( *vit );
RETURN( iBase_SUCCESS );
}
void iMeshP_migrateEntity( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- The function 'imeshp_migrateentity' is never used.
const iMeshP_PartitionHandle,
const iMeshP_PartHandle,
const iBase_EntityHandle,
iMeshP_RequestHandle*,
int* err )
{
FIXME;
RETURN( iBase_NOT_SUPPORTED );
}
void iMeshP_updateVtxCoords( iMesh_Instance instance, const iMeshP_PartitionHandle, const iBase_EntityHandle, int* err )<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- The function 'imeshp_updatevtxcoords' is never used.
{
FIXME;
RETURN( iBase_NOT_SUPPORTED );
}
void iMeshP_replaceOnPartBdry( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- The function 'imeshp_replaceonpartbdry' is never used.
const iMeshP_PartitionHandle,
const iBase_EntityHandle*,
const int,
const iBase_EntityHandle*,
const int,
const int*,
const int,
int* err )
{
FIXME;
RETURN( iBase_NOT_SUPPORTED );
}
void iMeshP_addGhostOf( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- The function 'imeshp_addghostof' is never used.
const iMeshP_PartitionHandle,
const iMeshP_Part,
const iBase_EntityHandle,
iMeshP_RequestHandle*,
int* err )
{
FIXME;
RETURN( iBase_NOT_SUPPORTED );
}
void iMeshP_rmvGhostOf( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- The function 'imeshp_rmvghostof' is never used.
const iMeshP_PartitionHandle,
const iMeshP_Part,
const iBase_EntityHandle,
int* err )
{
FIXME;
RETURN( iBase_NOT_SUPPORTED );
}
void iMeshP_syncMeshAll( iMesh_Instance instance, const iMeshP_PartitionHandle partition_handle, int* err )<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
{
ParallelComm* pcomm = PCOMM;
ErrorCode rval = pcomm->resolve_shared_ents( itaps_cast< EntityHandle >( partition_handle ), -1, -1 );CHKERR( rval, "update failed" );
RETURN( iBase_SUCCESS );
}
void iMeshP_pushTags( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
const iMeshP_PartitionHandle partition_handle,
iBase_TagHandle source_tag,
iBase_TagHandle dest_tag,
int entity_type,
int entity_topo,
int* err )
{
ParallelComm* pcomm = PCOMM;
DimensionPair types;
if( entity_topo != iMesh_ALL_TOPOLOGIES )
types.first = types.second = mb_topology_table[entity_topo];
else if( entity_type != iBase_ALL_TYPES )
// types = CN::TypeDimensionMap[entity_type];
types = CN::getDimPair( entity_type );
else
{
types.first = MBVERTEX;
types.second = MBENTITYSET;
--types.second;
}
std::vector< Tag > src_tags( 1, itaps_cast< Tag >( source_tag ) );
std::vector< Tag > dst_tags( 1, itaps_cast< Tag >( dest_tag ) );
ErrorCode rval;
Range entities;
for( EntityType t = types.first; t <= types.second; ++t )
{
rval = MOABI->get_entities_by_type_and_tag( 0, t, &src_tags[0], 0, 1, entities, Interface::UNION );CHKERR( rval, "error getting entities to push" );
}
rval = pcomm->exchange_tags( src_tags, dst_tags, entities );CHKERR( rval, "tag data communication failed" );
RETURN( iBase_SUCCESS );
}
void iMeshP_pushTagsEnt( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
const iMeshP_PartitionHandle partition_handle,
iBase_TagHandle source_tag,
iBase_TagHandle dest_tag,
const iBase_EntityHandle* entities,
int entities_size,
int* err )
{
Range range;
const EntityHandle* ents = itaps_cast< const EntityHandle* >( entities );
std::copy( ents, ents + entities_size, range_inserter( range ) );
std::vector< Tag > src_tags( 1, itaps_cast< Tag >( source_tag ) );
std::vector< Tag > dst_tags( 1, itaps_cast< Tag >( dest_tag ) );
ParallelComm* pcomm = PCOMM;
ErrorCode rval = pcomm->exchange_tags( src_tags, dst_tags, range );CHKERR( rval, "tag data communication failed" );
RETURN( iBase_SUCCESS );
}
void iMeshP_iPushTags( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- The function 'imeshp_ipushtags' is never used.
const iMeshP_PartitionHandle,
iBase_TagHandle,
iBase_TagHandle,
int,
int,
iMeshP_RequestHandle*,
int* err )
{
FIXME;
RETURN( iBase_NOT_SUPPORTED );
}
void iMeshP_iPushTagsEnt( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- The function 'imeshp_ipushtagsent' is never used.
const iMeshP_PartitionHandle,
iBase_TagHandle,
iBase_TagHandle,
const iBase_EntityHandle*,
int,
iMeshP_RequestHandle*,
int* err )
{
FIXME;
RETURN( iBase_NOT_SUPPORTED );
}
void iMeshP_createGhostEntsAll( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
iMeshP_PartitionHandle partition_handle,
int ghost_dim,
int bridge_dim,
int num_layers,
int include_copies,
int* err )
{
if( include_copies )
{
FIXME;
RETURN( iBase_NOT_SUPPORTED );
}
ParallelComm* pcomm = PCOMM;
ErrorCode rval;
if( iBase_ALL_TYPES == ghost_dim ) ghost_dim = -1;
rval = pcomm->exchange_ghost_cells( ghost_dim, bridge_dim, num_layers, 0, true );CHKERR( rval, "ghost exchange failed" );
RETURN( iBase_SUCCESS );
}
void iMeshP_deleteGhostEntsAll( iMesh_Instance instance, iMeshP_PartitionHandle, int* err )<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- The function 'imeshp_deleteghostentsall' is never used.
{
FIXME;
RETURN( iBase_NOT_SUPPORTED );
}
void iMeshP_ghostEntInfo( const iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- The function 'imeshp_ghostentinfo' is never used.
const iMeshP_PartitionHandle,
int*,
int*,
int**,
int**,
int**,
int* err )
{
FIXME;
RETURN( iBase_NOT_SUPPORTED );
}
// append the specified option if it isn't already there; returns whether this
// function actually appended it or not
static bool append_option( std::string& opt, const char* option, const char* default_value = 0 )
{
std::string::size_type i;
const char sep = ' ';
if( strchr( option, sep ) || ( default_value && strchr( default_value, sep ) ) )
{
// options can't have a separator in them; XXX work around this
return false; // iBase_INVALID_ARGUMENT;
}
// search for the required option
std::string search( &sep, 1 );
search += option;
const std::string::size_type sl = search.length();
i = opt.find( search );
while( i != std::string::npos )
{
std::string::size_type end = i + sl;
if( end == opt.size() || opt[end] == sep || opt[end] == '=' ) break;
i = end;
}
// if string already contained the option, just return
if( i != std::string::npos ) return false;
opt += search;
if( default_value )
{
opt += "=";
opt += default_value;
}
return true;
}
void iMeshP_loadAll( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
const iMeshP_PartitionHandle partition,
const iBase_EntitySetHandle entity_set_handle,
const char* name,
const char* options,
int* err,
int name_len,
int options_len )
{
ErrorCode rval;
// create partition set if user didn't give us one.
EntityHandle partitioning;
if( partition )
{
partitioning = itaps_cast< EntityHandle >( partition );
}
else
{
rval = MOABI->create_meshset( MESHSET_SET, partitioning );CHKERR( rval, "failed to create meshset" );
}
// get ParallelComm for partition
MPI_Comm default_comm = MPI_COMM_WORLD;
ParallelComm* pcomm = ParallelComm::get_pcomm( MOABI, partitioning, &default_comm );
if( !pcomm )
{
RETURN( iBase_FAILURE );
}
// add necessary values to options string
std::string opt = std::string( options, options + options_len );
if( append_option( opt, "moab:PARALLEL" ) )
{
// only append these other ones if the parallel option wasn't there originally
append_option( opt, "moab:PARTITION_DISTRIBUTE" );
append_option( opt, "moab:PARALLEL_RESOLVE_SHARED_ENTS" );
std::ostringstream id;
id << pcomm->get_id();
append_option( opt, "moab:PCOMM", id.str().c_str() );
}
// load the file
iMesh_load( instance, entity_set_handle, name, opt.c_str(), err, name_len, opt.length() );<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
if( *err ) return;
rval = pcomm->collective_sync_partition();CHKERR( rval, "collective sync failed" );
RETURN( iBase_SUCCESS );
}
void iMeshP_saveAll( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
const iMeshP_PartitionHandle partition,
const iBase_EntitySetHandle entity_set_handle,
const char* name,
const char* options,
int* err,
const int name_len,
int options_len )
{
EntityHandle set;
set = entity_set_handle ? itaps_cast< EntityHandle >( entity_set_handle ) : itaps_cast< EntityHandle >( partition );
iMesh_save( instance, itaps_cast< iBase_EntitySetHandle >( set ), name, options, err, name_len, options_len );<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
}
// Map from processes to parts:
// Given a partition handle and a process rank,
// return the part handles owned by the process.
// COMMUNICATION: None++.
void iMeshP_getPartsOnRank( iMesh_Instance instance,
const iMeshP_PartitionHandle partition_handle,
/*in*/ const int /*rank*/,
/*inout*/ iMeshP_PartHandle** part_handles,
/*inout*/ int* part_handles_allocated,
/*out*/ int* part_handles_size,
int* err )
{
EntityHandle p = itaps_cast< EntityHandle >( partition_handle );
ParallelComm* pc = ParallelComm::get_pcomm( MOABI, p );
if( !pc ) RETURN( iBase_ERROR_MAP[MB_FAILURE] );
Range part_sets;
ALLOC_CHECK_ARRAY_NOFAIL( part_handles, pc->partition_sets().size() );
Range::iterator rit;
int i;
for( i = 0, rit = pc->partition_sets().begin(); rit != pc->partition_sets().end(); ++rit, i++ )
( *part_handles )[i] = itaps_cast< iMeshP_PartHandle >( *rit );
RETURN( iBase_SUCCESS );
}
void iMeshP_getPartsArrOnRank( iMesh_Instance instance,<--- The function 'iMeshP_getPartsArrOnRank' is never used.
const iMeshP_PartitionHandle partition_handle,
/*in*/ const int* rank,
/*in*/ const int rank_size,
/*inout*/ iMeshP_PartHandle** part_handles,
/*inout*/ int* part_handles_allocated,
/*out*/ int* part_handles_size,
int* err )
{
EntityHandle p = itaps_cast< EntityHandle >( partition_handle );
ParallelComm* pc = ParallelComm::get_pcomm( MOABI, p );
if( !pc ) RETURN( iBase_ERROR_MAP[MB_FAILURE] );
if( rank[0] != (int)pc->proc_config().proc_rank() || rank_size > 1 )
{
RETURN( iBase_ERROR_MAP[MB_NOT_IMPLEMENTED] );
}
iMeshP_getPartsOnRank( instance, partition_handle, rank[0], part_handles, part_handles_allocated, part_handles_size,
err );
}
/** \brief Assign a global id space to entities
* Assign a global id space to entities and vertices, and optionally intermediate-dimension entities
*
* COMMUNICATION: Collective.
*/
void iMeshP_assignGlobalIds( iMesh_Instance instance,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- The function 'imeshp_assignglobalids' is never used.
const iMeshP_PartitionHandle partition,
const iBase_EntitySetHandle this_set,
const int dimension,
const int start_id,
const int largest_dim_only,
const int parallel,
const int owned_only,
int* err )
{
ErrorCode rval;
// get partition set
EntityHandle partitionset = itaps_cast< EntityHandle >( partition );
if( !partitionset )
{
rval = MB_FAILURE;CHKERR( rval, "failed to get partition set" );
}
EntityHandle this_mb_set = itaps_cast< EntityHandle >( this_set );
// get ParallelComm for partition
MPI_Comm default_comm;
ParallelComm* pcomm = ParallelComm::get_pcomm( MOABI, partitionset, &default_comm );
if( !pcomm )
{
RETURN( iBase_FAILURE );
}
rval = pcomm->assign_global_ids( this_mb_set, dimension, start_id, largest_dim_only, parallel, owned_only );
RETURN( rval );
}
void iMeshP_getCommunicator( iMesh_Instance instance, int* fcomm, MPI_Comm* ccomm, int* err )<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- The function 'imeshp_getcommunicator' is never used.
{
*ccomm = MPI_Comm_f2c( *fcomm );
RETURN( iBase_SUCCESS );
}
#ifdef __cplusplus
} // extern "C"
#endif
|