File: petscsys.h.html

package info (click to toggle)
petsc 3.23.1%2Bdfsg1-1exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 515,576 kB
  • sloc: ansic: 751,607; cpp: 51,542; python: 38,598; f90: 17,352; javascript: 3,493; makefile: 3,157; sh: 1,502; xml: 619; objc: 445; java: 13; csh: 1
file content (2905 lines) | stat: -rw-r--r-- 397,827 bytes parent folder | download
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
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
<center><a href="https://gitlab.com/petsc/petsc/-/blob/966382dc56242773704ef5f5cee7aa2db3ebc577/include/petscsys.h">Actual source code: petscsys.h</a></center><br>

<html>
<head>
<title></title>
<meta name="generator" content="c2html 0.9.6">
<meta name="date" content="2025-04-30T18:14:50+00:00">
</head>

<body bgcolor="#FFFFFF">
<pre width=80>
<a name="line1">  1: </a><font color="#B22222">/*</font>
<a name="line2">  2: </a><font color="#B22222">   This is the main PETSc include file (for C and C++).  It is included by all</font>
<a name="line3">  3: </a><font color="#B22222">   other PETSc include files, so it almost never has to be specifically included.</font>
<a name="line4">  4: </a><font color="#B22222">   Portions of this code are under:</font>
<a name="line5">  5: </a><font color="#B22222">   Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved.</font>
<a name="line6">  6: </a><font color="#B22222">*/</font>
<a name="line7">  7: </a><font color="#A020F0">#pragma once</font>

<a name="line9">  9: </a><font color="#B22222">/* ========================================================================== */</font>
<a name="line10"> 10: </a><font color="#B22222">/*</font>
<a name="line11"> 11: </a><font color="#B22222">   petscconf.h is contained in ${PETSC_ARCH}/include/petscconf.h it is</font>
<a name="line12"> 12: </a><font color="#B22222">   found automatically by the compiler due to the -I${PETSC_DIR}/${PETSC_ARCH}/include that</font>
<a name="line13"> 13: </a><font color="#B22222">   PETSc's makefiles add to the compiler rules.</font>
<a name="line14"> 14: </a><font color="#B22222">   For --prefix installs the directory ${PETSC_ARCH} does not exist and petscconf.h is in the same</font>
<a name="line15"> 15: </a><font color="#B22222">   directory as the other PETSc include files.</font>
<a name="line16"> 16: </a><font color="#B22222">*/</font>
<a name="line17"> 17: </a><font color="#A020F0">#include &lt;petscconf.h&gt;</font>
<a name="line18"> 18: </a><font color="#A020F0">#include &lt;petscpkg_version.h&gt;</font>
<a name="line19"> 19: </a><font color="#A020F0">#include &lt;petscconf_poison.h&gt;</font>
<a name="line20"> 20: </a><font color="#A020F0">#include &lt;petscfix.h&gt;</font>
<a name="line21"> 21: </a>#include <A href="../include/petscmacros.h.html">&lt;petscmacros.h&gt;</A>

<a name="line23"> 23: </a><font color="#B22222">/* SUBMANSEC = Sys */</font>

<a name="line25"> 25: </a><font color="#A020F0">#if defined(PETSC_DESIRE_FEATURE_TEST_MACROS)</font>
<a name="line26"> 26: </a>  <font color="#B22222">/*</font>
<a name="line27"> 27: </a><font color="#B22222">   Feature test macros must be included before headers defined by IEEE Std 1003.1-2001</font>
<a name="line28"> 28: </a><font color="#B22222">   We only turn these in PETSc source files that require them by setting PETSC_DESIRE_FEATURE_TEST_MACROS</font>
<a name="line29"> 29: </a><font color="#B22222">*/</font>
<a name="line30"> 30: </a><font color="#A020F0">  #if defined(PETSC__POSIX_C_SOURCE_200112L) &amp;&amp; !defined(_POSIX_C_SOURCE)</font>
<a name="line31"> 31: </a><strong><font color="#228B22">    #define _POSIX_C_SOURCE 200112L</font></strong>
<a name="line32"> 32: </a><font color="#A020F0">  #endif</font>
<a name="line33"> 33: </a><font color="#A020F0">  #if defined(PETSC__BSD_SOURCE) &amp;&amp; !defined(_BSD_SOURCE)</font>
<a name="line34"> 34: </a><strong><font color="#228B22">    #define _BSD_SOURCE</font></strong>
<a name="line35"> 35: </a><font color="#A020F0">  #endif</font>
<a name="line36"> 36: </a><font color="#A020F0">  #if defined(PETSC__DEFAULT_SOURCE) &amp;&amp; !defined(_DEFAULT_SOURCE)</font>
<a name="line37"> 37: </a><strong><font color="#228B22">    #define _DEFAULT_SOURCE</font></strong>
<a name="line38"> 38: </a><font color="#A020F0">  #endif</font>
<a name="line39"> 39: </a><font color="#A020F0">  #if defined(PETSC__GNU_SOURCE) &amp;&amp; !defined(_GNU_SOURCE)</font>
<a name="line40"> 40: </a><strong><font color="#228B22">    #define _GNU_SOURCE</font></strong>
<a name="line41"> 41: </a><font color="#A020F0">  #endif</font>
<a name="line42"> 42: </a><font color="#A020F0">#endif</font>

<a name="line44"> 44: </a>#include <A href="../include/petscsystypes.h.html">&lt;petscsystypes.h&gt;</A>

<a name="line46"> 46: </a><font color="#B22222">/* ========================================================================== */</font>

<a name="line48"> 48: </a><font color="#B22222">/*</font>
<a name="line49"> 49: </a><font color="#B22222">    Defines the interface to MPI allowing the use of all MPI functions.</font>

<a name="line51"> 51: </a><font color="#B22222">    PETSc does not use the C++ binding of MPI at ALL. The following flag</font>
<a name="line52"> 52: </a><font color="#B22222">    makes sure the C++ bindings are not included. The C++ bindings REQUIRE</font>
<a name="line53"> 53: </a><font color="#B22222">    putting mpi.h before ANY C++ include files, we cannot control this</font>
<a name="line54"> 54: </a><font color="#B22222">    with all PETSc users. Users who want to use the MPI C++ bindings can include</font>
<a name="line55"> 55: </a><font color="#B22222">    mpicxx.h directly in their code</font>
<a name="line56"> 56: </a><font color="#B22222">*/</font>
<a name="line57"> 57: </a><font color="#A020F0">#if !defined(MPICH_SKIP_MPICXX)</font>
<a name="line58"> 58: </a><strong><font color="#228B22">  #define MPICH_SKIP_MPICXX 1</font></strong>
<a name="line59"> 59: </a><font color="#A020F0">#endif</font>
<a name="line60"> 60: </a><font color="#A020F0">#if !defined(OMPI_SKIP_MPICXX)</font>
<a name="line61"> 61: </a><strong><font color="#228B22">  #define OMPI_SKIP_MPICXX 1</font></strong>
<a name="line62"> 62: </a><font color="#A020F0">#endif</font>
<a name="line63"> 63: </a><font color="#A020F0">#if defined(PETSC_HAVE_MPIUNI)</font>
<a name="line64"> 64: </a>#include <A href="../include/petsc/mpiuni/mpi.h.html">&lt;petsc/mpiuni/mpi.h&gt;</A>
<a name="line65"> 65: </a><font color="#A020F0">#else</font>
<a name="line66"> 66: </a><font color="#A020F0">  #include &lt;mpi.h&gt;</font>
<a name="line67"> 67: </a><font color="#A020F0">#endif</font>

<a name="line69"> 69: </a><font color="#B22222">/*</font>
<a name="line70"> 70: </a><font color="#B22222">   Perform various sanity checks that the correct mpi.h is being included at compile time.</font>
<a name="line71"> 71: </a><font color="#B22222">   This usually happens because</font>
<a name="line72"> 72: </a><font color="#B22222">      * either an unexpected mpi.h is in the default compiler path (i.e. in /usr/include) or</font>
<a name="line73"> 73: </a><font color="#B22222">      * an extra include path -I/something (which contains the unexpected mpi.h) is being passed to the compiler</font>
<a name="line74"> 74: </a><font color="#B22222">   Note: with MPICH and OpenMPI, accept versions [x.y.z, x+1.0.0) as compatible</font>
<a name="line75"> 75: </a><font color="#B22222">*/</font>
<a name="line76"> 76: </a><font color="#A020F0">#if defined(PETSC_HAVE_MPIUNI)</font>
<a name="line77"> 77: </a><font color="#A020F0">  #ifndef MPIUNI_H</font>
<a name="line78"> 78: </a><font color="#A020F0">    #error </font><font color="#666666">"PETSc was configured with --with-mpi=0 but now appears to be compiling using a different mpi.h"</font><font color="#A020F0"></font>
<a name="line79"> 79: </a><font color="#A020F0">  #endif</font>
<a name="line80"> 80: </a><font color="#A020F0">#elif defined(PETSC_HAVE_I_MPI)</font>
<a name="line81"> 81: </a><font color="#A020F0">  #if !defined(I_MPI_NUMVERSION)</font>
<a name="line82"> 82: </a><font color="#A020F0">    #error </font><font color="#666666">"PETSc was configured with I_MPI but now appears to be compiling using a non-I_MPI mpi.h"</font><font color="#A020F0"></font>
<a name="line83"> 83: </a><font color="#A020F0">  #elif I_MPI_NUMVERSION != PETSC_PKG_I_MPI_NUMVERSION</font>
<a name="line84"> 84: </a><font color="#A020F0">    #error </font><font color="#666666">"PETSc was configured with one I_MPI mpi.h version but now appears to be compiling using a different I_MPI mpi.h version"</font><font color="#A020F0"></font>
<a name="line85"> 85: </a><font color="#A020F0">  #endif</font>
<a name="line86"> 86: </a><font color="#A020F0">#elif defined(PETSC_HAVE_MVAPICH2)</font>
<a name="line87"> 87: </a><font color="#A020F0">  #if !defined(MVAPICH2_NUMVERSION)</font>
<a name="line88"> 88: </a><font color="#A020F0">    #error </font><font color="#666666">"PETSc was configured with MVAPICH2 but now appears to be compiling using a non-MVAPICH2 mpi.h"</font><font color="#A020F0"></font>
<a name="line89"> 89: </a><font color="#A020F0">  #elif MVAPICH2_NUMVERSION != PETSC_PKG_MVAPICH2_NUMVERSION</font>
<a name="line90"> 90: </a><font color="#A020F0">    #error </font><font color="#666666">"PETSc was configured with one MVAPICH2 mpi.h version but now appears to be compiling using a different MVAPICH2 mpi.h version"</font><font color="#A020F0"></font>
<a name="line91"> 91: </a><font color="#A020F0">  #endif</font>
<a name="line92"> 92: </a><font color="#A020F0">#elif defined(PETSC_HAVE_MPICH)</font>
<a name="line93"> 93: </a><font color="#A020F0">  #if !defined(MPICH_NUMVERSION) || defined(MVAPICH2_NUMVERSION) || defined(I_MPI_NUMVERSION)</font>
<a name="line94"> 94: </a><font color="#A020F0">    #error </font><font color="#666666">"PETSc was configured with MPICH but now appears to be compiling using a non-MPICH mpi.h"</font><font color="#A020F0"></font>
<a name="line95"> 95: </a><font color="#A020F0">  #elif PETSC_PKG_MPICH_VERSION_GT(MPICH_NUMVERSION / 10000000, MPICH_NUMVERSION / 100000 % 100, MPICH_NUMVERSION / 1000 % 100)</font>
<a name="line96"> 96: </a><font color="#A020F0">    #error </font><font color="#666666">"PETSc was configured with one MPICH mpi.h version but now appears to be compiling using an older MPICH mpi.h version"</font><font color="#A020F0"></font>
<a name="line97"> 97: </a><font color="#A020F0">  #elif PETSC_PKG_MPICH_VERSION_LT(MPICH_NUMVERSION / 10000000, 0, 0)</font>
<a name="line98"> 98: </a><font color="#A020F0">    #error </font><font color="#666666">"PETSc was configured with one MPICH mpi.h version but now appears to be compiling using a newer major MPICH mpi.h version"</font><font color="#A020F0"></font>
<a name="line99"> 99: </a><font color="#A020F0">  #endif</font>
<a name="line100">100: </a><font color="#A020F0">#elif defined(PETSC_HAVE_OPENMPI)</font>
<a name="line101">101: </a><font color="#A020F0">  #if !defined(OMPI_MAJOR_VERSION)</font>
<a name="line102">102: </a><font color="#A020F0">    #error </font><font color="#666666">"PETSc was configured with Open MPI but now appears to be compiling using a non-Open MPI mpi.h"</font><font color="#A020F0"></font>
<a name="line103">103: </a><font color="#A020F0">  #elif PETSC_PKG_OPENMPI_VERSION_GT(OMPI_MAJOR_VERSION, OMPI_MINOR_VERSION, OMPI_RELEASE_VERSION)</font>
<a name="line104">104: </a><font color="#A020F0">    #error </font><font color="#666666">"PETSc was configured with one Open MPI mpi.h version but now appears to be compiling using an older Open MPI mpi.h version"</font><font color="#A020F0"></font>
<a name="line105">105: </a><font color="#A020F0">  #elif PETSC_PKG_OPENMPI_VERSION_LT(OMPI_MAJOR_VERSION, 0, 0)</font>
<a name="line106">106: </a><font color="#A020F0">    #error </font><font color="#666666">"PETSc was configured with one Open MPI mpi.h version but now appears to be compiling using a newer major Open MPI mpi.h version"</font><font color="#A020F0"></font>
<a name="line107">107: </a><font color="#A020F0">  #endif</font>
<a name="line108">108: </a><font color="#A020F0">#elif defined(PETSC_HAVE_MSMPI_VERSION)</font>
<a name="line109">109: </a><font color="#A020F0">  #if !defined(MSMPI_VER)</font>
<a name="line110">110: </a><font color="#A020F0">    #error </font><font color="#666666">"PETSc was configured with MSMPI but now appears to be compiling using a non-MSMPI mpi.h"</font><font color="#A020F0"></font>
<a name="line111">111: </a><font color="#A020F0">  #elif (MSMPI_VER != PETSC_HAVE_MSMPI_VERSION)</font>
<a name="line112">112: </a><font color="#A020F0">    #error </font><font color="#666666">"PETSc was configured with one MSMPI mpi.h version but now appears to be compiling using a different MSMPI mpi.h version"</font><font color="#A020F0"></font>
<a name="line113">113: </a><font color="#A020F0">  #endif</font>
<a name="line114">114: </a><font color="#A020F0">#elif defined(OMPI_MAJOR_VERSION) || defined(MPICH_NUMVERSION) || defined(MSMPI_VER)</font>
<a name="line115">115: </a><font color="#A020F0">  #error </font><font color="#666666">"PETSc was configured with undetermined MPI - but now appears to be compiling using any of Open MPI, MS-MPI or a MPICH variant"</font><font color="#A020F0"></font>
<a name="line116">116: </a><font color="#A020F0">#endif</font>

<a name="line118">118: </a><font color="#B22222">/*</font>
<a name="line119">119: </a><font color="#B22222">    Need to put stdio.h AFTER mpi.h for MPICH2 with C++ compiler</font>
<a name="line120">120: </a><font color="#B22222">    see the top of mpicxx.h in the MPICH2 distribution.</font>
<a name="line121">121: </a><font color="#B22222">*/</font>
<a name="line122">122: </a><font color="#A020F0">#include &lt;stdio.h&gt;</font>

<a name="line124">124: </a><font color="#B22222">/* MSMPI on 32-bit Microsoft Windows requires this yukky hack - that breaks MPI standard compliance */</font>
<a name="line125">125: </a><font color="#A020F0">#if !defined(MPIAPI)</font>
<a name="line126">126: </a><strong><font color="#228B22">  #define MPIAPI</font></strong>
<a name="line127">127: </a><font color="#A020F0">#endif</font>

<a name="line129">129: </a><strong><font color="#4169E1">PETSC_EXTERN MPI_Datatype MPIU_ENUM PETSC_ATTRIBUTE_MPI_TYPE_TAG(<a href="../manualpages/Sys/PetscEnum.html">PetscEnum</a>)</font></strong>;
<a name="line130">130: </a><strong><font color="#4169E1">PETSC_EXTERN MPI_Datatype MPIU_BOOL PETSC_ATTRIBUTE_MPI_TYPE_TAG(<a href="../manualpages/Sys/PetscBool.html">PetscBool</a>)</font></strong>;

<a name="line132">132: </a><font color="#B22222">/*MC</font>
<a name="line133">133: </a><font color="#B22222">   <a href="../manualpages/Sys/MPIU_INT.html">MPIU_INT</a> - Portable MPI datatype corresponding to `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` independent of the precision of `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>`</font>

<a name="line135">135: </a><font color="#B22222">   Level: beginner</font>

<a name="line137">137: </a><font color="#B22222">   Note:</font>
<a name="line138">138: </a><font color="#B22222">   In MPI calls that require an MPI datatype that matches a `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` or array of `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` values, pass this value.</font>

<a name="line140">140: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscReal.html">PetscReal</a>`, `<a href="../manualpages/Sys/PetscScalar.html">PetscScalar</a>`, `<a href="../manualpages/Sys/PetscComplex.html">PetscComplex</a>`, `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>`, `<a href="../manualpages/Sys/MPIU_COUNT.html">MPIU_COUNT</a>`, `<a href="../manualpages/Sys/MPIU_REAL.html">MPIU_REAL</a>`, `<a href="../manualpages/Sys/MPIU_SCALAR.html">MPIU_SCALAR</a>`, `<a href="../manualpages/Sys/MPIU_COMPLEX.html">MPIU_COMPLEX</a>`</font>
<a name="line141">141: </a><font color="#B22222">M*/</font>

<a name="line143">143: </a>PETSC_EXTERN MPI_Datatype MPIU_FORTRANADDR;

<a name="line145">145: </a><font color="#A020F0">#if defined(PETSC_USE_64BIT_INDICES)</font>
<a name="line146">146: </a><strong><font color="#228B22">  #define <a href="../manualpages/Sys/MPIU_INT.html">MPIU_INT</a> MPIU_INT64</font></strong>
<a name="line147">147: </a><font color="#A020F0">#else</font>
<a name="line148">148: </a><strong><font color="#228B22">  #define <a href="../manualpages/Sys/MPIU_INT.html">MPIU_INT</a> MPI_INT</font></strong>
<a name="line149">149: </a><font color="#A020F0">#endif</font>

<a name="line151">151: </a><font color="#B22222">/*MC</font>
<a name="line152">152: </a><font color="#B22222">   <a href="../manualpages/Sys/MPIU_COUNT.html">MPIU_COUNT</a> - Portable MPI datatype corresponding to `<a href="../manualpages/Sys/PetscCount.html">PetscCount</a>` independent of the precision of `<a href="../manualpages/Sys/PetscCount.html">PetscCount</a>`</font>

<a name="line154">154: </a><font color="#B22222">   Level: beginner</font>

<a name="line156">156: </a><font color="#B22222">   Note:</font>
<a name="line157">157: </a><font color="#B22222">   In MPI calls that require an MPI datatype that matches a `<a href="../manualpages/Sys/PetscCount.html">PetscCount</a>` or array of `<a href="../manualpages/Sys/PetscCount.html">PetscCount</a>` values, pass this value.</font>

<a name="line159">159: </a><font color="#B22222">  Developer Note:</font>
<a name="line160">160: </a><font color="#B22222">  It seems `MPI_AINT` is unsigned so this may be the wrong choice here since `<a href="../manualpages/Sys/PetscCount.html">PetscCount</a>` is signed</font>

<a name="line162">162: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscReal.html">PetscReal</a>`, `<a href="../manualpages/Sys/PetscScalar.html">PetscScalar</a>`, `<a href="../manualpages/Sys/PetscComplex.html">PetscComplex</a>`, `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>`, `<a href="../manualpages/Sys/MPIU_INT.html">MPIU_INT</a>`, `<a href="../manualpages/Sys/MPIU_REAL.html">MPIU_REAL</a>`, `<a href="../manualpages/Sys/MPIU_SCALAR.html">MPIU_SCALAR</a>`, `<a href="../manualpages/Sys/MPIU_COMPLEX.html">MPIU_COMPLEX</a>`</font>
<a name="line163">163: </a><font color="#B22222">M*/</font>
<a name="line164">164: </a><strong><font color="#228B22">#define <a href="../manualpages/Sys/MPIU_COUNT.html">MPIU_COUNT</a> MPI_AINT</font></strong>

<a name="line166">166: </a><font color="#B22222">/*</font>
<a name="line167">167: </a><font color="#B22222">    For the rare cases when one needs to send a size_t object with MPI</font>
<a name="line168">168: </a><font color="#B22222">*/</font>
<a name="line169">169: </a><strong><font color="#4169E1">PETSC_EXTERN MPI_Datatype MPIU_SIZE_T PETSC_ATTRIBUTE_MPI_TYPE_TAG(size_t)</font></strong>;

<a name="line171">171: </a><font color="#B22222">/*</font>
<a name="line172">172: </a><font color="#B22222">      You can use PETSC_STDOUT as a replacement of stdout. You can also change</font>
<a name="line173">173: </a><font color="#B22222">    the value of PETSC_STDOUT to redirect all standard output elsewhere</font>
<a name="line174">174: </a><font color="#B22222">*/</font>
<a name="line175">175: </a>PETSC_EXTERN FILE *PETSC_STDOUT;

<a name="line177">177: </a><font color="#B22222">/*</font>
<a name="line178">178: </a><font color="#B22222">      You can use PETSC_STDERR as a replacement of stderr. You can also change</font>
<a name="line179">179: </a><font color="#B22222">    the value of PETSC_STDERR to redirect all standard error elsewhere</font>
<a name="line180">180: </a><font color="#B22222">*/</font>
<a name="line181">181: </a>PETSC_EXTERN FILE *PETSC_STDERR;

<a name="line183">183: </a><font color="#B22222">/*</font>
<a name="line184">184: </a><font color="#B22222">  Handle inclusion when using clang compiler with CUDA support</font>
<a name="line185">185: </a><font color="#B22222">  __float128 is not available for the device</font>
<a name="line186">186: </a><font color="#B22222">*/</font>
<a name="line187">187: </a><font color="#A020F0">#if defined(__clang__) &amp;&amp; (defined(__CUDA_ARCH__) || defined(__HIPCC__))</font>
<a name="line188">188: </a><strong><font color="#228B22">  #define PETSC_SKIP_REAL___FLOAT128</font></strong>
<a name="line189">189: </a><font color="#A020F0">#endif</font>

<a name="line191">191: </a><font color="#B22222">/*</font>
<a name="line192">192: </a><font color="#B22222">    Declare extern C stuff after including external header files</font>
<a name="line193">193: </a><font color="#B22222">*/</font>

<a name="line195">195: </a>PETSC_EXTERN <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> PETSC_RUNNING_ON_VALGRIND;
<a name="line196">196: </a><font color="#B22222">/*</font>
<a name="line197">197: </a><font color="#B22222">    Defines elementary mathematics functions and constants.</font>
<a name="line198">198: </a><font color="#B22222">*/</font>
<a name="line199">199: </a>#include <A href="../include/petscmath.h.html">&lt;petscmath.h&gt;</A>

<a name="line201">201: </a><font color="#B22222">/*MC</font>
<a name="line202">202: </a><font color="#B22222">   <a href="../manualpages/Sys/PETSC_IGNORE.html">PETSC_IGNORE</a> - same as `NULL`, means PETSc will ignore this argument</font>

<a name="line204">204: </a><font color="#B22222">   Level: beginner</font>

<a name="line206">206: </a><font color="#B22222">   Note:</font>
<a name="line207">207: </a><font color="#B22222">   Accepted by many PETSc functions to not set a parameter and instead use a default value</font>

<a name="line209">209: </a><font color="#B22222">   Fortran Note:</font>
<a name="line210">210: </a><font color="#B22222">   Use `PETSC_NULL_INTEGER`, `PETSC_NULL_SCALAR` etc</font>

<a name="line212">212: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PETSC_DECIDE.html">PETSC_DECIDE</a>`, `<a href="../manualpages/Sys/PETSC_DEFAULT.html">PETSC_DEFAULT</a>`, `<a href="../manualpages/Sys/PETSC_DETERMINE.html">PETSC_DETERMINE</a>`</font>
<a name="line213">213: </a><font color="#B22222">M*/</font>
<a name="line214">214: </a><strong><font color="#228B22">#define <a href="../manualpages/Sys/PETSC_IGNORE.html">PETSC_IGNORE</a> <a href="../manualpages/Sys/PETSC_NULLPTR.html">PETSC_NULLPTR</a></font></strong>
<a name="line215">215: </a><strong><font color="#228B22">#define PETSC_NULL   PETSC_DEPRECATED_MACRO(3, 19, 0, </font><font color="#666666">"<a href="../manualpages/Sys/PETSC_NULLPTR.html">PETSC_NULLPTR</a>"</font><font color="#228B22">, ) <a href="../manualpages/Sys/PETSC_NULLPTR.html">PETSC_NULLPTR</a></font></strong>

<a name="line217">217: </a><font color="#B22222">/*MC</font>
<a name="line218">218: </a><font color="#B22222">   <a href="../manualpages/Sys/PETSC_UNLIMITED.html">PETSC_UNLIMITED</a> - standard way of passing an integer or floating point parameter to indicate PETSc there is no bound on the value allowed</font>

<a name="line220">220: </a><font color="#B22222">   Level: beginner</font>

<a name="line222">222: </a><font color="#B22222">   Example Usage:</font>
<a name="line223">223: </a><font color="#B22222">.vb</font>
<a name="line224">224: </a><font color="#B22222">   <a href="../manualpages/KSP/KSPSetTolerances.html">KSPSetTolerances</a>(ksp, <a href="../manualpages/Sys/PETSC_CURRENT.html">PETSC_CURRENT</a>, <a href="../manualpages/Sys/PETSC_CURRENT.html">PETSC_CURRENT</a>, <a href="../manualpages/Sys/PETSC_UNLIMITED.html">PETSC_UNLIMITED</a>, <a href="../manualpages/Sys/PETSC_UNLIMITED.html">PETSC_UNLIMITED</a>);</font>
<a name="line225">225: </a><font color="#B22222">.ve</font>
<a name="line226">226: </a><font color="#B22222">  indicates that the solver is allowed to take any number of iterations and will not stop early no matter how the residual gets.</font>

<a name="line228">228: </a><font color="#B22222">   Fortran Note:</font>
<a name="line229">229: </a><font color="#B22222">   Use `PETSC_UNLIMITED_INTEGER` or `PETSC_UNLIMITED_REAL`.</font>

<a name="line231">231: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PETSC_DEFAULT.html">PETSC_DEFAULT</a>`, `<a href="../manualpages/Sys/PETSC_IGNORE.html">PETSC_IGNORE</a>`, `<a href="../manualpages/Sys/PETSC_DETERMINE.html">PETSC_DETERMINE</a>`, `<a href="../manualpages/Sys/PETSC_DECIDE.html">PETSC_DECIDE</a>`</font>
<a name="line232">232: </a><font color="#B22222">M*/</font>

<a name="line234">234: </a><font color="#B22222">/*MC</font>
<a name="line235">235: </a><font color="#B22222">   <a href="../manualpages/Sys/PETSC_DECIDE.html">PETSC_DECIDE</a> - standard way of passing an integer or floating point parameter to indicate PETSc should determine an appropriate value</font>

<a name="line237">237: </a><font color="#B22222">   Level: beginner</font>

<a name="line239">239: </a><font color="#B22222">   Example Usage:</font>
<a name="line240">240: </a><font color="#B22222">.vb</font>
<a name="line241">241: </a><font color="#B22222">   <a href="../manualpages/Vec/VecSetSizes.html">VecSetSizes</a>(ksp, <a href="../manualpages/Sys/PETSC_DECIDE.html">PETSC_DECIDE</a>, 10);</font>
<a name="line242">242: </a><font color="#B22222">.ve</font>
<a name="line243">243: </a><font color="#B22222">  indicates that the global size of the vector is 10 and the local size will be automatically determined so that the sum of the</font>
<a name="line244">244: </a><font color="#B22222">  local sizes is the global size, see `<a href="../manualpages/Sys/PetscSplitOwnership.html">PetscSplitOwnership</a>()`.</font>

<a name="line246">246: </a><font color="#B22222">   Fortran Note:</font>
<a name="line247">247: </a><font color="#B22222">   Use `PETSC_DECIDE_INTEGER` or `PETSC_DECIDE_REAL`.</font>

<a name="line249">249: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PETSC_DEFAULT.html">PETSC_DEFAULT</a>`, `<a href="../manualpages/Sys/PETSC_IGNORE.html">PETSC_IGNORE</a>`, `<a href="../manualpages/Sys/PETSC_DETERMINE.html">PETSC_DETERMINE</a>`, `<a href="../manualpages/Sys/PETSC_UNLIMITED.html">PETSC_UNLIMITED</a>'</font>
<a name="line250">250: </a><font color="#B22222">M*/</font>

<a name="line252">252: </a><font color="#B22222">/*MC</font>
<a name="line253">253: </a><font color="#B22222">   <a href="../manualpages/Sys/PETSC_DETERMINE.html">PETSC_DETERMINE</a> - standard way of passing an integer or floating point parameter to indicate PETSc should determine an appropriate value</font>

<a name="line255">255: </a><font color="#B22222">   Level: beginner</font>

<a name="line257">257: </a><font color="#B22222">    Example Usage:</font>
<a name="line258">258: </a><font color="#B22222">.vb</font>
<a name="line259">259: </a><font color="#B22222">   <a href="../manualpages/Vec/VecSetSizes.html">VecSetSizes</a>(ksp, 10, <a href="../manualpages/Sys/PETSC_DETERMINE.html">PETSC_DETERMINE</a>);</font>
<a name="line260">260: </a><font color="#B22222">.ve</font>
<a name="line261">261: </a><font color="#B22222">  indicates that the local size of the vector is 10 and the global size will be automatically summing up all the local sizes.</font>

<a name="line263">263: </a><font color="#B22222">   Note:</font>
<a name="line264">264: </a><font color="#B22222">   Same as `<a href="../manualpages/Sys/PETSC_DECIDE.html">PETSC_DECIDE</a>`</font>

<a name="line266">266: </a><font color="#B22222">   Fortran Note:</font>
<a name="line267">267: </a><font color="#B22222">   Use `PETSC_DETERMINE_INTEGER` or `PETSC_DETERMINE_REAL`.</font>

<a name="line269">269: </a><font color="#B22222">   Developer Note:</font>
<a name="line270">270: </a><font color="#B22222">   I would like to use const `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` `<a href="../manualpages/Sys/PETSC_DETERMINE.html">PETSC_DETERMINE</a>` = `<a href="../manualpages/Sys/PETSC_DECIDE.html">PETSC_DECIDE</a>`; but for</font>
<a name="line271">271: </a><font color="#B22222">   some reason this is not allowed by the standard even though `<a href="../manualpages/Sys/PETSC_DECIDE.html">PETSC_DECIDE</a>` is a constant value.</font>

<a name="line273">273: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PETSC_DECIDE.html">PETSC_DECIDE</a>`, `<a href="../manualpages/Sys/PETSC_DEFAULT.html">PETSC_DEFAULT</a>`, `<a href="../manualpages/Sys/PETSC_IGNORE.html">PETSC_IGNORE</a>`, `<a href="../manualpages/Vec/VecSetSizes.html">VecSetSizes</a>()`, `<a href="../manualpages/Sys/PETSC_UNLIMITED.html">PETSC_UNLIMITED</a>'</font>
<a name="line274">274: </a><font color="#B22222">M*/</font>

<a name="line276">276: </a><font color="#B22222">/*MC</font>
<a name="line277">277: </a><font color="#B22222">   <a href="../manualpages/Sys/PETSC_CURRENT.html">PETSC_CURRENT</a> - standard way of indicating to an object not to change the current value of the parameter in the object</font>

<a name="line279">279: </a><font color="#B22222">   Level: beginner</font>

<a name="line281">281: </a><font color="#B22222">   Note:</font>
<a name="line282">282: </a><font color="#B22222">   Use `<a href="../manualpages/Sys/PETSC_DECIDE.html">PETSC_DECIDE</a>` to use the value that was set by PETSc when the object's type was set</font>

<a name="line284">284: </a><font color="#B22222">   Fortran Note:</font>
<a name="line285">285: </a><font color="#B22222">   Use `PETSC_CURRENT_INTEGER` or `PETSC_CURRENT_REAL`.</font>

<a name="line287">287: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PETSC_DECIDE.html">PETSC_DECIDE</a>`, `<a href="../manualpages/Sys/PETSC_IGNORE.html">PETSC_IGNORE</a>`, `<a href="../manualpages/Sys/PETSC_DETERMINE.html">PETSC_DETERMINE</a>`, `<a href="../manualpages/Sys/PETSC_DEFAULT.html">PETSC_DEFAULT</a>`, `<a href="../manualpages/Sys/PETSC_UNLIMITED.html">PETSC_UNLIMITED</a>'</font>
<a name="line288">288: </a><font color="#B22222">M*/</font>

<a name="line290">290: </a><font color="#B22222">/*MC</font>
<a name="line291">291: </a><font color="#B22222">   <a href="../manualpages/Sys/PETSC_DEFAULT.html">PETSC_DEFAULT</a> - deprecated, see `<a href="../manualpages/Sys/PETSC_CURRENT.html">PETSC_CURRENT</a>` and `<a href="../manualpages/Sys/PETSC_DETERMINE.html">PETSC_DETERMINE</a>`</font>

<a name="line293">293: </a><font color="#B22222">   Level: beginner</font>

<a name="line295">295: </a><font color="#B22222">   Note:</font>
<a name="line296">296: </a><font color="#B22222">   The name is confusing since it tells the object to continue to use the value it is using, not the default value when the object's type was set.</font>

<a name="line298">298: </a><font color="#B22222">   Developer Note:</font>
<a name="line299">299: </a><font color="#B22222">   Unfortunately this was used for two different purposes in the past, to actually trigger the use of a default value or to continue the</font>
<a name="line300">300: </a><font color="#B22222">   use of currently set value (in, for example, `<a href="../manualpages/KSP/KSPSetTolerances.html">KSPSetTolerances</a>()`.</font>

<a name="line302">302: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PETSC_DECIDE.html">PETSC_DECIDE</a>`, `<a href="../manualpages/Sys/PETSC_IGNORE.html">PETSC_IGNORE</a>`, `<a href="../manualpages/Sys/PETSC_DETERMINE.html">PETSC_DETERMINE</a>`, `<a href="../manualpages/Sys/PETSC_CURRENT.html">PETSC_CURRENT</a>`, `<a href="../manualpages/Sys/PETSC_UNLIMITED.html">PETSC_UNLIMITED</a>'</font>
<a name="line303">303: </a><font color="#B22222">M*/</font>

<a name="line305">305: </a><font color="#B22222">/* These MUST be preprocessor defines! see https://gitlab.com/petsc/petsc/-/issues/1370 */</font>
<a name="line306">306: </a><strong><font color="#228B22">#define <a href="../manualpages/Sys/PETSC_DECIDE.html">PETSC_DECIDE</a>    (-1)</font></strong>
<a name="line307">307: </a><strong><font color="#228B22">#define <a href="../manualpages/Sys/PETSC_DETERMINE.html">PETSC_DETERMINE</a> <a href="../manualpages/Sys/PETSC_DECIDE.html">PETSC_DECIDE</a></font></strong>
<a name="line308">308: </a><strong><font color="#228B22">#define <a href="../manualpages/Sys/PETSC_CURRENT.html">PETSC_CURRENT</a>   (-2)</font></strong>
<a name="line309">309: </a><strong><font color="#228B22">#define <a href="../manualpages/Sys/PETSC_UNLIMITED.html">PETSC_UNLIMITED</a> (-3)</font></strong>
<a name="line310">310: </a><font color="#B22222">/*  <a href="../manualpages/Sys/PETSC_DEFAULT.html">PETSC_DEFAULT</a> is deprecated in favor of <a href="../manualpages/Sys/PETSC_CURRENT.html">PETSC_CURRENT</a> for use in <a href="../manualpages/KSP/KSPSetTolerances.html">KSPSetTolerances</a>() and similar functions */</font>
<a name="line311">311: </a><strong><font color="#228B22">#define <a href="../manualpages/Sys/PETSC_DEFAULT.html">PETSC_DEFAULT</a> <a href="../manualpages/Sys/PETSC_CURRENT.html">PETSC_CURRENT</a></font></strong>

<a name="line313">313: </a><font color="#B22222">/*MC</font>
<a name="line314">314: </a><font color="#B22222">   <a href="../manualpages/Sys/PETSC_COMM_WORLD.html">PETSC_COMM_WORLD</a> - the equivalent of the `MPI_COMM_WORLD` communicator which represents all the processes that PETSc knows about.</font>

<a name="line316">316: </a><font color="#B22222">   Level: beginner</font>

<a name="line318">318: </a><font color="#B22222">   Notes:</font>
<a name="line319">319: </a><font color="#B22222">   By default `<a href="../manualpages/Sys/PETSC_COMM_WORLD.html">PETSC_COMM_WORLD</a>` and `MPI_COMM_WORLD` are identical unless you wish to</font>
<a name="line320">320: </a><font color="#B22222">   run PETSc on ONLY a subset of `MPI_COMM_WORLD`. In that case create your new (smaller)</font>
<a name="line321">321: </a><font color="#B22222">   communicator, call it, say comm, and set `<a href="../manualpages/Sys/PETSC_COMM_WORLD.html">PETSC_COMM_WORLD</a>` = comm BEFORE calling</font>
<a name="line322">322: </a><font color="#B22222">   `<a href="../manualpages/Sys/PetscInitialize.html">PetscInitialize</a>()`, but after `<a href="http://www.mpich.org/static/docs/latest/www3/MPI_Init.html#MPI_Init">MPI_Init</a>()` has been called.</font>

<a name="line324">324: </a><font color="#B22222">   The value of `<a href="../manualpages/Sys/PETSC_COMM_WORLD.html">PETSC_COMM_WORLD</a>` should never be used or accessed before `<a href="../manualpages/Sys/PetscInitialize.html">PetscInitialize</a>()`</font>
<a name="line325">325: </a><font color="#B22222">   is called because it may not have a valid value yet.</font>

<a name="line327">327: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PETSC_COMM_SELF.html">PETSC_COMM_SELF</a>`</font>
<a name="line328">328: </a><font color="#B22222">M*/</font>
<a name="line329">329: </a>PETSC_EXTERN <a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a> <a href="../manualpages/Sys/PETSC_COMM_WORLD.html">PETSC_COMM_WORLD</a>;

<a name="line331">331: </a><font color="#B22222">/*MC</font>
<a name="line332">332: </a><font color="#B22222">   <a href="../manualpages/Sys/PETSC_COMM_SELF.html">PETSC_COMM_SELF</a> - This is always `MPI_COMM_SELF`</font>

<a name="line334">334: </a><font color="#B22222">   Level: beginner</font>

<a name="line336">336: </a><font color="#B22222">   Note:</font>
<a name="line337">337: </a><font color="#B22222">   Do not USE/access or set this variable before `<a href="../manualpages/Sys/PetscInitialize.html">PetscInitialize</a>()` has been called.</font>

<a name="line339">339: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PETSC_COMM_WORLD.html">PETSC_COMM_WORLD</a>`</font>
<a name="line340">340: </a><font color="#B22222">M*/</font>
<a name="line341">341: </a><strong><font color="#228B22">#define <a href="../manualpages/Sys/PETSC_COMM_SELF.html">PETSC_COMM_SELF</a> MPI_COMM_SELF</font></strong>

<a name="line343">343: </a><font color="#B22222">/*MC</font>
<a name="line344">344: </a><font color="#B22222">   <a href="../manualpages/Sys/PETSC_MPI_THREAD_REQUIRED.html">PETSC_MPI_THREAD_REQUIRED</a> - the required threading support used if PETSc initializes MPI with `<a href="http://www.mpich.org/static/docs/latest/www3/MPI_Init_thread.html#MPI_Init_thread">MPI_Init_thread</a>()`.</font>

<a name="line346">346: </a><font color="#B22222">   No Fortran Support</font>

<a name="line348">348: </a><font color="#B22222">   Level: beginner</font>

<a name="line350">350: </a><font color="#B22222">   Note:</font>
<a name="line351">351: </a><font color="#B22222">   By default `<a href="../manualpages/Sys/PETSC_MPI_THREAD_REQUIRED.html">PETSC_MPI_THREAD_REQUIRED</a>` equals `MPI_THREAD_FUNNELED` when the MPI implementation provides `<a href="http://www.mpich.org/static/docs/latest/www3/MPI_Init_thread.html#MPI_Init_thread">MPI_Init_thread</a>()`, otherwise it equals `MPI_THREAD_SINGLE`</font>

<a name="line353">353: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscInitialize.html">PetscInitialize</a>()`</font>
<a name="line354">354: </a><font color="#B22222">M*/</font>
<a name="line355">355: </a>PETSC_EXTERN <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> <a href="../manualpages/Sys/PETSC_MPI_THREAD_REQUIRED.html">PETSC_MPI_THREAD_REQUIRED</a>;

<a name="line357">357: </a><font color="#B22222">/*MC</font>
<a name="line358">358: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscBeganMPI.html">PetscBeganMPI</a> - indicates if PETSc initialized MPI using `<a href="http://www.mpich.org/static/docs/latest/www3/MPI_Init.html#MPI_Init">MPI_Init</a>()` during `<a href="../manualpages/Sys/PetscInitialize.html">PetscInitialize</a>()` or if MPI was already initialized with `<a href="http://www.mpich.org/static/docs/latest/www3/MPI_Init.html#MPI_Init">MPI_Init</a>()`</font>

<a name="line360">360: </a><font color="#B22222">   Synopsis:</font>
<a name="line361">361: </a>#include <A href="../include/petscsys.h.html">&lt;petscsys.h&gt;</A>
<a name="line362">362: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> <a href="../manualpages/Sys/PetscBeganMPI.html">PetscBeganMPI</a>;</font>

<a name="line364">364: </a><font color="#B22222">   No Fortran Support</font>

<a name="line366">366: </a><font color="#B22222">   Level: developer</font>

<a name="line368">368: </a><font color="#B22222">   Note:</font>
<a name="line369">369: </a><font color="#B22222">   `<a href="http://www.mpich.org/static/docs/latest/www3/MPI_Init.html#MPI_Init">MPI_Init</a>()` can never be called after `<a href="../manualpages/Sys/PetscInitialize.html">PetscInitialize</a>()`</font>

<a name="line371">371: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscInitialize.html">PetscInitialize</a>()`, `PetscInitializeCalled`</font>
<a name="line372">372: </a><font color="#B22222">M*/</font>
<a name="line373">373: </a>PETSC_EXTERN <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> <a href="../manualpages/Sys/PetscBeganMPI.html">PetscBeganMPI</a>;

<a name="line375">375: </a>PETSC_EXTERN <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> PetscErrorHandlingInitialized;
<a name="line376">376: </a>PETSC_EXTERN <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> PetscInitializeCalled;
<a name="line377">377: </a>PETSC_EXTERN <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> PetscFinalizeCalled;
<a name="line378">378: </a>PETSC_EXTERN <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> PetscViennaCLSynchronize;

<a name="line380">380: </a><strong><font color="#4169E1"><a name="PetscSetHelpVersionFunctions"></a>PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSetHelpVersionFunctions.html">PetscSetHelpVersionFunctions</a>(<a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> (*)(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>), <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> (*)(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>)</font></strong>);
<a name="line381">381: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscCommDuplicate.html">PetscCommDuplicate</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, <a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a> *, int *)</font></strong>;
<a name="line382">382: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscCommDestroy.html">PetscCommDestroy</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a> *)</font></strong>;
<a name="line383">383: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscCommGetComm.html">PetscCommGetComm</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, <a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a> *)</font></strong>;
<a name="line384">384: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscCommRestoreComm.html">PetscCommRestoreComm</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, <a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a> *)</font></strong>;

<a name="line386">386: </a><font color="#A020F0">#if defined(PETSC_HAVE_KOKKOS)</font>
<a name="line387">387: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> PetscKokkosInitializeCheck(void)</font></strong>; <font color="#B22222">/* Initialize Kokkos if not yet. */</font>
<a name="line388">388: </a><font color="#A020F0">#endif</font>

<a name="line390">390: </a><font color="#A020F0">#if defined(PETSC_HAVE_NVSHMEM)</font>
<a name="line391">391: </a>PETSC_EXTERN <a href="../manualpages/Sys/PetscBool.html">PetscBool</a>      PetscBeganNvshmem;
<a name="line392">392: </a>PETSC_EXTERN <a href="../manualpages/Sys/PetscBool.html">PetscBool</a>      PetscNvshmemInitialized;
<a name="line393">393: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> PetscNvshmemFinalize(void)</font></strong>;
<a name="line394">394: </a><font color="#A020F0">#endif</font>

<a name="line396">396: </a><font color="#A020F0">#if defined(PETSC_HAVE_ELEMENTAL)</font>
<a name="line397">397: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscElementalInitializePackage.html">PetscElementalInitializePackage</a>(void)</font></strong>;
<a name="line398">398: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscElementalInitialized.html">PetscElementalInitialized</a>(<a href="../manualpages/Sys/PetscBool.html">PetscBool</a> *)</font></strong>;
<a name="line399">399: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscElementalFinalizePackage.html">PetscElementalFinalizePackage</a>(void)</font></strong>;
<a name="line400">400: </a><font color="#A020F0">#endif</font>

<a name="line402">402: </a><font color="#B22222">/*MC</font>
<a name="line403">403: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscMalloc.html">PetscMalloc</a> - Allocates memory for use with PETSc. One should use `<a href="../manualpages/Sys/PetscNew.html">PetscNew</a>()`, `<a href="../manualpages/Sys/PetscMalloc1.html">PetscMalloc1</a>()` or `<a href="../manualpages/Sys/PetscCalloc1.html">PetscCalloc1</a>()` usually instead of `<a href="../manualpages/Sys/PetscMalloc.html">PetscMalloc</a>()`</font>

<a name="line405">405: </a><font color="#B22222">   Synopsis:</font>
<a name="line406">406: </a>#include <A href="../include/petscsys.h.html">&lt;petscsys.h&gt;</A>
<a name="line407">407: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscMalloc.html">PetscMalloc</a>(size_t m,void **result)</font>

<a name="line409">409: </a><font color="#B22222">   Not Collective</font>

<a name="line411">411: </a><font color="#B22222">   Input Parameter:</font>
<a name="line412">412: </a><font color="#B22222">.  m - number of bytes to allocate</font>

<a name="line414">414: </a><font color="#B22222">   Output Parameter:</font>
<a name="line415">415: </a><font color="#B22222">.  result - memory allocated</font>

<a name="line417">417: </a><font color="#B22222">   Level: beginner</font>

<a name="line419">419: </a><font color="#B22222">   Notes:</font>
<a name="line420">420: </a><font color="#B22222">   Memory is always allocated at least double aligned</font>

<a name="line422">422: </a><font color="#B22222">   It is safe to allocate with an m of 0 and pass the resulting pointer to `<a href="../manualpages/Sys/PetscFree.html">PetscFree</a>()`.</font>
<a name="line423">423: </a><font color="#B22222">   However, the pointer should never be dereferenced or the program will crash.</font>

<a name="line425">425: </a><font color="#B22222">   Developer Note:</font>
<a name="line426">426: </a><font color="#B22222">   All the `PetscMallocN()` routines actually call `<a href="../manualpages/Sys/PetscMalloc.html">PetscMalloc</a>()` behind the scenes.</font>

<a name="line428">428: </a><font color="#B22222">   Except for data structures that store information about the PETSc options database all memory allocated by PETSc is</font>
<a name="line429">429: </a><font color="#B22222">   obtained with `<a href="../manualpages/Sys/PetscMalloc.html">PetscMalloc</a>()` or `<a href="../manualpages/Sys/PetscCalloc.html">PetscCalloc</a>()`</font>

<a name="line431">431: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscFree.html">PetscFree</a>()`, `<a href="../manualpages/Sys/PetscNew.html">PetscNew</a>()`, `<a href="../manualpages/Sys/PetscCalloc.html">PetscCalloc</a>()`</font>
<a name="line432">432: </a><font color="#B22222">M*/</font>
<a name="line433">433: </a><strong><font color="#228B22">#define <a href="../manualpages/Sys/PetscMalloc.html">PetscMalloc</a>(a, b) ((*PetscTrMalloc)((a), <a href="../manualpages/Sys/PETSC_FALSE.html">PETSC_FALSE</a>, __LINE__, PETSC_FUNCTION_NAME, __FILE__, (void **)(b)))</font></strong>

<a name="line435">435: </a><font color="#B22222">/*MC</font>
<a name="line436">436: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscRealloc.html">PetscRealloc</a> - Reallocates memory</font>

<a name="line438">438: </a><font color="#B22222">   Synopsis:</font>
<a name="line439">439: </a>#include <A href="../include/petscsys.h.html">&lt;petscsys.h&gt;</A>
<a name="line440">440: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscRealloc.html">PetscRealloc</a>(size_t m,void **result)</font>

<a name="line442">442: </a><font color="#B22222">   Not Collective</font>

<a name="line444">444: </a><font color="#B22222">   Input Parameters:</font>
<a name="line445">445: </a><font color="#B22222">+  m      - number of bytes to allocate</font>
<a name="line446">446: </a><font color="#B22222">-  result - previous memory</font>

<a name="line448">448: </a><font color="#B22222">   Output Parameter:</font>
<a name="line449">449: </a><font color="#B22222">.  result - new memory allocated</font>

<a name="line451">451: </a><font color="#B22222">   Level: developer</font>

<a name="line453">453: </a><font color="#B22222">   Notes:</font>
<a name="line454">454: </a><font color="#B22222">   `results` must have already been obtained with `<a href="../manualpages/Sys/PetscMalloc.html">PetscMalloc</a>()`</font>

<a name="line456">456: </a><font color="#B22222">   Memory is always allocated at least double aligned</font>

<a name="line458">458: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscMalloc.html">PetscMalloc</a>()`, `<a href="../manualpages/Sys/PetscFree.html">PetscFree</a>()`, `<a href="../manualpages/Sys/PetscNew.html">PetscNew</a>()`</font>
<a name="line459">459: </a><font color="#B22222">M*/</font>
<a name="line460">460: </a><strong><font color="#228B22">#define <a href="../manualpages/Sys/PetscRealloc.html">PetscRealloc</a>(a, b) ((*PetscTrRealloc)((a), __LINE__, PETSC_FUNCTION_NAME, __FILE__, (void **)(b)))</font></strong>

<a name="line462">462: </a><font color="#B22222">/*MC</font>
<a name="line463">463: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscAddrAlign.html">PetscAddrAlign</a> - Rounds up an address to `PETSC_MEMALIGN` alignment</font>

<a name="line465">465: </a><font color="#B22222">   Synopsis:</font>
<a name="line466">466: </a>#include <A href="../include/petscsys.h.html">&lt;petscsys.h&gt;</A>
<a name="line467">467: </a><font color="#B22222">   void *<a href="../manualpages/Sys/PetscAddrAlign.html">PetscAddrAlign</a>(void *addr)</font>

<a name="line469">469: </a><font color="#B22222">   Not Collective</font>

<a name="line471">471: </a><font color="#B22222">   Input Parameter:</font>
<a name="line472">472: </a><font color="#B22222">.  addr - address to align (any pointer type)</font>

<a name="line474">474: </a><font color="#B22222">   Level: developer</font>

<a name="line476">476: </a><font color="#B22222">.seealso: `PetscMallocAlign()`</font>
<a name="line477">477: </a><font color="#B22222">M*/</font>
<a name="line478">478: </a><strong><font color="#228B22">#define <a href="../manualpages/Sys/PetscAddrAlign.html">PetscAddrAlign</a>(a) ((void *)((((PETSC_UINTPTR_T)(a)) + (PETSC_MEMALIGN - 1)) &amp; ~(PETSC_MEMALIGN - 1)))</font></strong>

<a name="line480">480: </a><font color="#B22222">/*MC</font>
<a name="line481">481: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscCalloc.html">PetscCalloc</a> - Allocates a cleared (zeroed) memory region aligned to `PETSC_MEMALIGN`, similar to `<a href="../manualpages/Sys/PetscMalloc.html">PetscMalloc</a>()`</font>

<a name="line483">483: </a><font color="#B22222">   Synopsis:</font>
<a name="line484">484: </a>#include <A href="../include/petscsys.h.html">&lt;petscsys.h&gt;</A>
<a name="line485">485: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscCalloc.html">PetscCalloc</a>(size_t m,void **result)</font>

<a name="line487">487: </a><font color="#B22222">   Not Collective</font>

<a name="line489">489: </a><font color="#B22222">   Input Parameter:</font>
<a name="line490">490: </a><font color="#B22222">.  m - number of bytes to allocate</font>

<a name="line492">492: </a><font color="#B22222">   Output Parameter:</font>
<a name="line493">493: </a><font color="#B22222">.  result - memory allocated</font>

<a name="line495">495: </a><font color="#B22222">   Level: beginner</font>

<a name="line497">497: </a><font color="#B22222">   Notes:</font>
<a name="line498">498: </a><font color="#B22222">   Memory is always allocated at least double aligned. This macro is useful in allocating memory pointed by void pointers</font>

<a name="line500">500: </a><font color="#B22222">   It is safe to allocate with an m of 0 and pass the resulting pointer to `<a href="../manualpages/Sys/PetscFree.html">PetscFree</a>()`.</font>

<a name="line502">502: </a><font color="#B22222">   However, the pointer should never be dereferenced or the program will crash.</font>

<a name="line504">504: </a><font color="#B22222">   Developer Note:</font>
<a name="line505">505: </a><font color="#B22222">   All `PetscCallocN()` routines call `<a href="../manualpages/Sys/PetscCalloc.html">PetscCalloc</a>()` behind the scenes.</font>

<a name="line507">507: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscFree.html">PetscFree</a>()`, `<a href="../manualpages/Sys/PetscNew.html">PetscNew</a>()`, `<a href="../manualpages/Sys/PetscMalloc.html">PetscMalloc</a>()`</font>
<a name="line508">508: </a><font color="#B22222">M*/</font>
<a name="line509">509: </a><strong><font color="#228B22">#define <a href="../manualpages/Sys/PetscCalloc.html">PetscCalloc</a>(m, result) <a href="../manualpages/Sys/PetscMallocA.html">PetscMallocA</a>(1, <a href="../manualpages/Sys/PETSC_TRUE.html">PETSC_TRUE</a>, __LINE__, PETSC_FUNCTION_NAME, __FILE__, ((size_t)m), (result))</font></strong>

<a name="line511">511: </a><font color="#B22222">/*MC</font>
<a name="line512">512: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscMalloc1.html">PetscMalloc1</a> - Allocates an array of memory aligned to `PETSC_MEMALIGN`</font>

<a name="line514">514: </a><font color="#B22222">   Synopsis:</font>
<a name="line515">515: </a>#include <A href="../include/petscsys.h.html">&lt;petscsys.h&gt;</A>
<a name="line516">516: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscMalloc1.html">PetscMalloc1</a>(size_t m1,type **r1)</font>

<a name="line518">518: </a><font color="#B22222">   Not Collective</font>

<a name="line520">520: </a><font color="#B22222">   Input Parameter:</font>
<a name="line521">521: </a><font color="#B22222">.  m1 - number of elements to allocate  (may be zero)</font>

<a name="line523">523: </a><font color="#B22222">   Output Parameter:</font>
<a name="line524">524: </a><font color="#B22222">.  r1 - memory allocated</font>

<a name="line526">526: </a><font color="#B22222">   Level: beginner</font>

<a name="line528">528: </a><font color="#B22222">   Note:</font>
<a name="line529">529: </a><font color="#B22222">   This uses `sizeof()` of the memory type requested to determine the total memory to be allocated; therefore, you should not</font>
<a name="line530">530: </a><font color="#B22222">   multiply the number of elements requested by the `sizeof()` the type. For example, use</font>
<a name="line531">531: </a><font color="#B22222">.vb</font>
<a name="line532">532: </a><font color="#B22222">  <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *id;</font>
<a name="line533">533: </a><font color="#B22222">  <a href="../manualpages/Sys/PetscMalloc1.html">PetscMalloc1</a>(10,&amp;id);</font>
<a name="line534">534: </a><font color="#B22222">.ve</font>
<a name="line535">535: </a><font color="#B22222">       not</font>
<a name="line536">536: </a><font color="#B22222">.vb</font>
<a name="line537">537: </a><font color="#B22222">  <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *id;</font>
<a name="line538">538: </a><font color="#B22222">  <a href="../manualpages/Sys/PetscMalloc1.html">PetscMalloc1</a>(10*sizeof(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>),&amp;id);</font>
<a name="line539">539: </a><font color="#B22222">.ve</font>

<a name="line541">541: </a><font color="#B22222">  Does not zero the memory allocated, use `<a href="../manualpages/Sys/PetscCalloc1.html">PetscCalloc1</a>()` to obtain memory that has been zeroed.</font>

<a name="line543">543: </a><font color="#B22222">  The `<a href="../manualpages/Sys/PetscMalloc.html">PetscMalloc</a>[N]()` and `<a href="../manualpages/Sys/PetscCalloc.html">PetscCalloc</a>[N]()` take an argument of type `size_t`! However, most codes use `value`, computed via `int` or `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` variables. This can overflow in</font>
<a name="line544">544: </a><font color="#B22222">  32bit `int` computation - while computation in 64bit `size_t` would not overflow!</font>
<a name="line545">545: </a><font color="#B22222">  It's best if any arithmetic that is done for size computations is done with `size_t` type - avoiding arithmetic overflow!</font>

<a name="line547">547: </a><font color="#B22222">  `<a href="../manualpages/Sys/PetscMalloc.html">PetscMalloc</a>[N]()` and `<a href="../manualpages/Sys/PetscCalloc.html">PetscCalloc</a>[N]()` attempt to work-around this by casting the first variable to `size_t`.</font>
<a name="line548">548: </a><font color="#B22222">  This works for most expressions, but not all, such as</font>
<a name="line549">549: </a><font color="#B22222">.vb</font>
<a name="line550">550: </a><font color="#B22222">  <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *id, a, b;</font>
<a name="line551">551: </a><font color="#B22222">  <a href="../manualpages/Sys/PetscMalloc1.html">PetscMalloc1</a>(use_a_squared ? a * a * b : a * b, &amp;id); // use_a_squared is cast to size_t, but a and b are still <a href="../manualpages/Sys/PetscInt.html">PetscInt</a></font>
<a name="line552">552: </a><font color="#B22222">  <a href="../manualpages/Sys/PetscMalloc1.html">PetscMalloc1</a>(a + b * b, &amp;id); // a is cast to size_t, but b * b is performed at <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> precision first due to order-of-operations</font>
<a name="line553">553: </a><font color="#B22222">.ve</font>

<a name="line555">555: </a><font color="#B22222">  These expressions should either be avoided, or appropriately cast variables to `size_t`:</font>
<a name="line556">556: </a><font color="#B22222">.vb</font>
<a name="line557">557: </a><font color="#B22222">  <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *id, a, b;</font>
<a name="line558">558: </a><font color="#B22222">  <a href="../manualpages/Sys/PetscMalloc1.html">PetscMalloc1</a>(use_a_squared ? (size_t)a * a * b : (size_t)a * b, &amp;id); // Cast a to size_t before multiplication</font>
<a name="line559">559: </a><font color="#B22222">  <a href="../manualpages/Sys/PetscMalloc1.html">PetscMalloc1</a>(b * b + a, &amp;id); // b is automatically cast to size_t and order-of-operations ensures size_t precision is maintained</font>
<a name="line560">560: </a><font color="#B22222">.ve</font>

<a name="line562">562: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscFree.html">PetscFree</a>()`, `<a href="../manualpages/Sys/PetscNew.html">PetscNew</a>()`, `<a href="../manualpages/Sys/PetscMalloc.html">PetscMalloc</a>()`, `<a href="../manualpages/Sys/PetscCalloc1.html">PetscCalloc1</a>()`, `<a href="../manualpages/Sys/PetscMalloc2.html">PetscMalloc2</a>()`</font>
<a name="line563">563: </a><font color="#B22222">M*/</font>
<a name="line564">564: </a><strong><font color="#228B22">#define <a href="../manualpages/Sys/PetscMalloc1.html">PetscMalloc1</a>(m1, r1) <a href="../manualpages/Sys/PetscMallocA.html">PetscMallocA</a>(1, <a href="../manualpages/Sys/PETSC_FALSE.html">PETSC_FALSE</a>, __LINE__, PETSC_FUNCTION_NAME, __FILE__, ((size_t)((size_t)m1) * sizeof(**(r1))), (r1))</font></strong>

<a name="line566">566: </a><font color="#B22222">/*MC</font>
<a name="line567">567: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscCalloc1.html">PetscCalloc1</a> - Allocates a cleared (zeroed) array of memory aligned to `PETSC_MEMALIGN`</font>

<a name="line569">569: </a><font color="#B22222">   Synopsis:</font>
<a name="line570">570: </a>#include <A href="../include/petscsys.h.html">&lt;petscsys.h&gt;</A>
<a name="line571">571: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscCalloc1.html">PetscCalloc1</a>(size_t m1,type **r1)</font>

<a name="line573">573: </a><font color="#B22222">   Not Collective</font>

<a name="line575">575: </a><font color="#B22222">   Input Parameter:</font>
<a name="line576">576: </a><font color="#B22222">.  m1 - number of elements to allocate in 1st chunk  (may be zero)</font>

<a name="line578">578: </a><font color="#B22222">   Output Parameter:</font>
<a name="line579">579: </a><font color="#B22222">.  r1 - memory allocated</font>

<a name="line581">581: </a><font color="#B22222">   Level: beginner</font>

<a name="line583">583: </a><font color="#B22222">   Note:</font>
<a name="line584">584: </a><font color="#B22222">   See `<a href="../manualpages/Sys/PetscMalloc1.html">PetscMalloc1</a>()` for more details on usage.</font>

<a name="line586">586: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscFree.html">PetscFree</a>()`, `<a href="../manualpages/Sys/PetscNew.html">PetscNew</a>()`, `<a href="../manualpages/Sys/PetscMalloc.html">PetscMalloc</a>()`, `<a href="../manualpages/Sys/PetscMalloc1.html">PetscMalloc1</a>()`, `<a href="../manualpages/Sys/PetscCalloc2.html">PetscCalloc2</a>()`</font>
<a name="line587">587: </a><font color="#B22222">M*/</font>
<a name="line588">588: </a><strong><font color="#228B22">#define <a href="../manualpages/Sys/PetscCalloc1.html">PetscCalloc1</a>(m1, r1) <a href="../manualpages/Sys/PetscMallocA.html">PetscMallocA</a>(1, <a href="../manualpages/Sys/PETSC_TRUE.html">PETSC_TRUE</a>, __LINE__, PETSC_FUNCTION_NAME, __FILE__, ((size_t)((size_t)m1) * sizeof(**(r1))), (r1))</font></strong>

<a name="line590">590: </a><font color="#B22222">/*MC</font>
<a name="line591">591: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscMalloc2.html">PetscMalloc2</a> - Allocates 2 arrays of memory both aligned to `PETSC_MEMALIGN`</font>

<a name="line593">593: </a><font color="#B22222">   Synopsis:</font>
<a name="line594">594: </a>#include <A href="../include/petscsys.h.html">&lt;petscsys.h&gt;</A>
<a name="line595">595: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscMalloc2.html">PetscMalloc2</a>(size_t m1,type **r1,size_t m2,type **r2)</font>

<a name="line597">597: </a><font color="#B22222">   Not Collective</font>

<a name="line599">599: </a><font color="#B22222">   Input Parameters:</font>
<a name="line600">600: </a><font color="#B22222">+  m1 - number of elements to allocate in 1st chunk  (may be zero)</font>
<a name="line601">601: </a><font color="#B22222">-  m2 - number of elements to allocate in 2nd chunk  (may be zero)</font>

<a name="line603">603: </a><font color="#B22222">   Output Parameters:</font>
<a name="line604">604: </a><font color="#B22222">+  r1 - memory allocated in first chunk</font>
<a name="line605">605: </a><font color="#B22222">-  r2 - memory allocated in second chunk</font>

<a name="line607">607: </a><font color="#B22222">   Level: developer</font>

<a name="line609">609: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscFree.html">PetscFree</a>()`, `<a href="../manualpages/Sys/PetscNew.html">PetscNew</a>()`, `<a href="../manualpages/Sys/PetscMalloc.html">PetscMalloc</a>()`, `<a href="../manualpages/Sys/PetscMalloc1.html">PetscMalloc1</a>()`, `<a href="../manualpages/Sys/PetscCalloc2.html">PetscCalloc2</a>()`</font>
<a name="line610">610: </a><font color="#B22222">M*/</font>
<a name="line611">611: </a><strong><font color="#228B22">#define <a href="../manualpages/Sys/PetscMalloc2.html">PetscMalloc2</a>(m1, r1, m2, r2) <a href="../manualpages/Sys/PetscMallocA.html">PetscMallocA</a>(2, <a href="../manualpages/Sys/PETSC_FALSE.html">PETSC_FALSE</a>, __LINE__, PETSC_FUNCTION_NAME, __FILE__, ((size_t)((size_t)m1) * sizeof(**(r1))), (r1), ((size_t)((size_t)m2) * sizeof(**(r2))), (r2))</font></strong>

<a name="line613">613: </a><font color="#B22222">/*MC</font>
<a name="line614">614: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscCalloc2.html">PetscCalloc2</a> - Allocates 2 cleared (zeroed) arrays of memory both aligned to `PETSC_MEMALIGN`</font>

<a name="line616">616: </a><font color="#B22222">   Synopsis:</font>
<a name="line617">617: </a>#include <A href="../include/petscsys.h.html">&lt;petscsys.h&gt;</A>
<a name="line618">618: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscCalloc2.html">PetscCalloc2</a>(size_t m1,type **r1,size_t m2,type **r2)</font>

<a name="line620">620: </a><font color="#B22222">   Not Collective</font>

<a name="line622">622: </a><font color="#B22222">   Input Parameters:</font>
<a name="line623">623: </a><font color="#B22222">+  m1 - number of elements to allocate in 1st chunk  (may be zero)</font>
<a name="line624">624: </a><font color="#B22222">-  m2 - number of elements to allocate in 2nd chunk  (may be zero)</font>

<a name="line626">626: </a><font color="#B22222">   Output Parameters:</font>
<a name="line627">627: </a><font color="#B22222">+  r1 - memory allocated in first chunk</font>
<a name="line628">628: </a><font color="#B22222">-  r2 - memory allocated in second chunk</font>

<a name="line630">630: </a><font color="#B22222">   Level: developer</font>

<a name="line632">632: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscFree.html">PetscFree</a>()`, `<a href="../manualpages/Sys/PetscNew.html">PetscNew</a>()`, `<a href="../manualpages/Sys/PetscMalloc.html">PetscMalloc</a>()`, `<a href="../manualpages/Sys/PetscCalloc1.html">PetscCalloc1</a>()`, `<a href="../manualpages/Sys/PetscMalloc2.html">PetscMalloc2</a>()`</font>
<a name="line633">633: </a><font color="#B22222">M*/</font>
<a name="line634">634: </a><strong><font color="#228B22">#define <a href="../manualpages/Sys/PetscCalloc2.html">PetscCalloc2</a>(m1, r1, m2, r2) <a href="../manualpages/Sys/PetscMallocA.html">PetscMallocA</a>(2, <a href="../manualpages/Sys/PETSC_TRUE.html">PETSC_TRUE</a>, __LINE__, PETSC_FUNCTION_NAME, __FILE__, ((size_t)((size_t)m1) * sizeof(**(r1))), (r1), ((size_t)((size_t)m2) * sizeof(**(r2))), (r2))</font></strong>

<a name="line636">636: </a><font color="#B22222">/*MC</font>
<a name="line637">637: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscMalloc3.html">PetscMalloc3</a> - Allocates 3 arrays of memory, all aligned to `PETSC_MEMALIGN`</font>

<a name="line639">639: </a><font color="#B22222">   Synopsis:</font>
<a name="line640">640: </a>#include <A href="../include/petscsys.h.html">&lt;petscsys.h&gt;</A>
<a name="line641">641: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscMalloc3.html">PetscMalloc3</a>(size_t m1,type **r1,size_t m2,type **r2,size_t m3,type **r3)</font>

<a name="line643">643: </a><font color="#B22222">   Not Collective</font>

<a name="line645">645: </a><font color="#B22222">   Input Parameters:</font>
<a name="line646">646: </a><font color="#B22222">+  m1 - number of elements to allocate in 1st chunk  (may be zero)</font>
<a name="line647">647: </a><font color="#B22222">.  m2 - number of elements to allocate in 2nd chunk  (may be zero)</font>
<a name="line648">648: </a><font color="#B22222">-  m3 - number of elements to allocate in 3rd chunk  (may be zero)</font>

<a name="line650">650: </a><font color="#B22222">   Output Parameters:</font>
<a name="line651">651: </a><font color="#B22222">+  r1 - memory allocated in first chunk</font>
<a name="line652">652: </a><font color="#B22222">.  r2 - memory allocated in second chunk</font>
<a name="line653">653: </a><font color="#B22222">-  r3 - memory allocated in third chunk</font>

<a name="line655">655: </a><font color="#B22222">   Level: developer</font>

<a name="line657">657: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscFree.html">PetscFree</a>()`, `<a href="../manualpages/Sys/PetscNew.html">PetscNew</a>()`, `<a href="../manualpages/Sys/PetscMalloc.html">PetscMalloc</a>()`, `<a href="../manualpages/Sys/PetscMalloc2.html">PetscMalloc2</a>()`, `<a href="../manualpages/Sys/PetscCalloc3.html">PetscCalloc3</a>()`, `<a href="../manualpages/Sys/PetscFree3.html">PetscFree3</a>()`</font>
<a name="line658">658: </a><font color="#B22222">M*/</font>
<a name="line659">659: </a><strong><font color="#228B22">#define <a href="../manualpages/Sys/PetscMalloc3.html">PetscMalloc3</a>(m1, r1, m2, r2, m3, r3) \</font></strong>
<a name="line660">660: </a><strong><font color="#228B22">  <a href="../manualpages/Sys/PetscMallocA.html">PetscMallocA</a>(3, <a href="../manualpages/Sys/PETSC_FALSE.html">PETSC_FALSE</a>, __LINE__, PETSC_FUNCTION_NAME, __FILE__, ((size_t)((size_t)m1) * sizeof(**(r1))), (r1), ((size_t)((size_t)m2) * sizeof(**(r2))), (r2), ((size_t)((size_t)m3) * sizeof(**(r3))), (r3))</font></strong>

<a name="line662">662: </a><font color="#B22222">/*MC</font>
<a name="line663">663: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscCalloc3.html">PetscCalloc3</a> - Allocates 3 cleared (zeroed) arrays of memory, all aligned to `PETSC_MEMALIGN`</font>

<a name="line665">665: </a><font color="#B22222">   Synopsis:</font>
<a name="line666">666: </a>#include <A href="../include/petscsys.h.html">&lt;petscsys.h&gt;</A>
<a name="line667">667: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscCalloc3.html">PetscCalloc3</a>(size_t m1,type **r1,size_t m2,type **r2,size_t m3,type **r3)</font>

<a name="line669">669: </a><font color="#B22222">   Not Collective</font>

<a name="line671">671: </a><font color="#B22222">   Input Parameters:</font>
<a name="line672">672: </a><font color="#B22222">+  m1 - number of elements to allocate in 1st chunk  (may be zero)</font>
<a name="line673">673: </a><font color="#B22222">.  m2 - number of elements to allocate in 2nd chunk  (may be zero)</font>
<a name="line674">674: </a><font color="#B22222">-  m3 - number of elements to allocate in 3rd chunk  (may be zero)</font>

<a name="line676">676: </a><font color="#B22222">   Output Parameters:</font>
<a name="line677">677: </a><font color="#B22222">+  r1 - memory allocated in first chunk</font>
<a name="line678">678: </a><font color="#B22222">.  r2 - memory allocated in second chunk</font>
<a name="line679">679: </a><font color="#B22222">-  r3 - memory allocated in third chunk</font>

<a name="line681">681: </a><font color="#B22222">   Level: developer</font>

<a name="line683">683: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscFree.html">PetscFree</a>()`, `<a href="../manualpages/Sys/PetscNew.html">PetscNew</a>()`, `<a href="../manualpages/Sys/PetscMalloc.html">PetscMalloc</a>()`, `<a href="../manualpages/Sys/PetscCalloc2.html">PetscCalloc2</a>()`, `<a href="../manualpages/Sys/PetscMalloc3.html">PetscMalloc3</a>()`, `<a href="../manualpages/Sys/PetscFree3.html">PetscFree3</a>()`</font>
<a name="line684">684: </a><font color="#B22222">M*/</font>
<a name="line685">685: </a><strong><font color="#228B22">#define <a href="../manualpages/Sys/PetscCalloc3.html">PetscCalloc3</a>(m1, r1, m2, r2, m3, r3) \</font></strong>
<a name="line686">686: </a><strong><font color="#228B22">  <a href="../manualpages/Sys/PetscMallocA.html">PetscMallocA</a>(3, <a href="../manualpages/Sys/PETSC_TRUE.html">PETSC_TRUE</a>, __LINE__, PETSC_FUNCTION_NAME, __FILE__, ((size_t)((size_t)m1) * sizeof(**(r1))), (r1), ((size_t)((size_t)m2) * sizeof(**(r2))), (r2), ((size_t)((size_t)m3) * sizeof(**(r3))), (r3))</font></strong>

<a name="line688">688: </a><font color="#B22222">/*MC</font>
<a name="line689">689: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscMalloc4.html">PetscMalloc4</a> - Allocates 4 arrays of memory, all aligned to `PETSC_MEMALIGN`</font>

<a name="line691">691: </a><font color="#B22222">   Synopsis:</font>
<a name="line692">692: </a>#include <A href="../include/petscsys.h.html">&lt;petscsys.h&gt;</A>
<a name="line693">693: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscMalloc4.html">PetscMalloc4</a>(size_t m1,type **r1,size_t m2,type **r2,size_t m3,type **r3,size_t m4,type **r4)</font>

<a name="line695">695: </a><font color="#B22222">   Not Collective</font>

<a name="line697">697: </a><font color="#B22222">   Input Parameters:</font>
<a name="line698">698: </a><font color="#B22222">+  m1 - number of elements to allocate in 1st chunk  (may be zero)</font>
<a name="line699">699: </a><font color="#B22222">.  m2 - number of elements to allocate in 2nd chunk  (may be zero)</font>
<a name="line700">700: </a><font color="#B22222">.  m3 - number of elements to allocate in 3rd chunk  (may be zero)</font>
<a name="line701">701: </a><font color="#B22222">-  m4 - number of elements to allocate in 4th chunk  (may be zero)</font>

<a name="line703">703: </a><font color="#B22222">   Output Parameters:</font>
<a name="line704">704: </a><font color="#B22222">+  r1 - memory allocated in first chunk</font>
<a name="line705">705: </a><font color="#B22222">.  r2 - memory allocated in second chunk</font>
<a name="line706">706: </a><font color="#B22222">.  r3 - memory allocated in third chunk</font>
<a name="line707">707: </a><font color="#B22222">-  r4 - memory allocated in fourth chunk</font>

<a name="line709">709: </a><font color="#B22222">   Level: developer</font>

<a name="line711">711: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscFree.html">PetscFree</a>()`, `<a href="../manualpages/Sys/PetscNew.html">PetscNew</a>()`, `<a href="../manualpages/Sys/PetscMalloc.html">PetscMalloc</a>()`, `<a href="../manualpages/Sys/PetscMalloc2.html">PetscMalloc2</a>()`, `<a href="../manualpages/Sys/PetscCalloc4.html">PetscCalloc4</a>()`, `<a href="../manualpages/Sys/PetscFree4.html">PetscFree4</a>()`</font>
<a name="line712">712: </a><font color="#B22222">M*/</font>
<a name="line713">713: </a><strong><font color="#228B22">#define <a href="../manualpages/Sys/PetscMalloc4.html">PetscMalloc4</a>(m1, r1, m2, r2, m3, r3, m4, r4) \</font></strong>
<a name="line714">714: </a><strong><font color="#228B22">  <a href="../manualpages/Sys/PetscMallocA.html">PetscMallocA</a>(4, <a href="../manualpages/Sys/PETSC_FALSE.html">PETSC_FALSE</a>, __LINE__, PETSC_FUNCTION_NAME, __FILE__, ((size_t)((size_t)m1) * sizeof(**(r1))), (r1), ((size_t)((size_t)m2) * sizeof(**(r2))), (r2), ((size_t)((size_t)m3) * sizeof(**(r3))), (r3), ((size_t)((size_t)m4) * sizeof(**(r4))), (r4))</font></strong>

<a name="line716">716: </a><font color="#B22222">/*MC</font>
<a name="line717">717: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscCalloc4.html">PetscCalloc4</a> - Allocates 4 cleared (zeroed) arrays of memory, all aligned to `PETSC_MEMALIGN`</font>

<a name="line719">719: </a><font color="#B22222">   Synopsis:</font>
<a name="line720">720: </a>#include <A href="../include/petscsys.h.html">&lt;petscsys.h&gt;</A>
<a name="line721">721: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscCalloc4.html">PetscCalloc4</a>(size_t m1,type **r1,size_t m2,type **r2,size_t m3,type **r3,size_t m4,type **r4)</font>

<a name="line723">723: </a><font color="#B22222">   Not Collective</font>

<a name="line725">725: </a><font color="#B22222">   Input Parameters:</font>
<a name="line726">726: </a><font color="#B22222">+  m1 - number of elements to allocate in 1st chunk  (may be zero)</font>
<a name="line727">727: </a><font color="#B22222">.  m2 - number of elements to allocate in 2nd chunk  (may be zero)</font>
<a name="line728">728: </a><font color="#B22222">.  m3 - number of elements to allocate in 3rd chunk  (may be zero)</font>
<a name="line729">729: </a><font color="#B22222">-  m4 - number of elements to allocate in 4th chunk  (may be zero)</font>

<a name="line731">731: </a><font color="#B22222">   Output Parameters:</font>
<a name="line732">732: </a><font color="#B22222">+  r1 - memory allocated in first chunk</font>
<a name="line733">733: </a><font color="#B22222">.  r2 - memory allocated in second chunk</font>
<a name="line734">734: </a><font color="#B22222">.  r3 - memory allocated in third chunk</font>
<a name="line735">735: </a><font color="#B22222">-  r4 - memory allocated in fourth chunk</font>

<a name="line737">737: </a><font color="#B22222">   Level: developer</font>

<a name="line739">739: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscFree.html">PetscFree</a>()`, `<a href="../manualpages/Sys/PetscNew.html">PetscNew</a>()`, `<a href="../manualpages/Sys/PetscMalloc.html">PetscMalloc</a>()`, `<a href="../manualpages/Sys/PetscMalloc2.html">PetscMalloc2</a>()`, `<a href="../manualpages/Sys/PetscCalloc4.html">PetscCalloc4</a>()`, `<a href="../manualpages/Sys/PetscFree4.html">PetscFree4</a>()`</font>
<a name="line740">740: </a><font color="#B22222">M*/</font>
<a name="line741">741: </a><strong><font color="#228B22">#define <a href="../manualpages/Sys/PetscCalloc4.html">PetscCalloc4</a>(m1, r1, m2, r2, m3, r3, m4, r4) \</font></strong>
<a name="line742">742: </a><strong><font color="#228B22">  <a href="../manualpages/Sys/PetscMallocA.html">PetscMallocA</a>(4, <a href="../manualpages/Sys/PETSC_TRUE.html">PETSC_TRUE</a>, __LINE__, PETSC_FUNCTION_NAME, __FILE__, ((size_t)((size_t)m1) * sizeof(**(r1))), (r1), ((size_t)((size_t)m2) * sizeof(**(r2))), (r2), ((size_t)((size_t)m3) * sizeof(**(r3))), (r3), ((size_t)((size_t)m4) * sizeof(**(r4))), (r4))</font></strong>

<a name="line744">744: </a><font color="#B22222">/*MC</font>
<a name="line745">745: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscMalloc5.html">PetscMalloc5</a> - Allocates 5 arrays of memory, all aligned to `PETSC_MEMALIGN`</font>

<a name="line747">747: </a><font color="#B22222">   Synopsis:</font>
<a name="line748">748: </a>#include <A href="../include/petscsys.h.html">&lt;petscsys.h&gt;</A>
<a name="line749">749: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscMalloc5.html">PetscMalloc5</a>(size_t m1,type **r1,size_t m2,type **r2,size_t m3,type **r3,size_t m4,type **r4,size_t m5,type **r5)</font>

<a name="line751">751: </a><font color="#B22222">   Not Collective</font>

<a name="line753">753: </a><font color="#B22222">   Input Parameters:</font>
<a name="line754">754: </a><font color="#B22222">+  m1 - number of elements to allocate in 1st chunk  (may be zero)</font>
<a name="line755">755: </a><font color="#B22222">.  m2 - number of elements to allocate in 2nd chunk  (may be zero)</font>
<a name="line756">756: </a><font color="#B22222">.  m3 - number of elements to allocate in 3rd chunk  (may be zero)</font>
<a name="line757">757: </a><font color="#B22222">.  m4 - number of elements to allocate in 4th chunk  (may be zero)</font>
<a name="line758">758: </a><font color="#B22222">-  m5 - number of elements to allocate in 5th chunk  (may be zero)</font>

<a name="line760">760: </a><font color="#B22222">   Output Parameters:</font>
<a name="line761">761: </a><font color="#B22222">+  r1 - memory allocated in first chunk</font>
<a name="line762">762: </a><font color="#B22222">.  r2 - memory allocated in second chunk</font>
<a name="line763">763: </a><font color="#B22222">.  r3 - memory allocated in third chunk</font>
<a name="line764">764: </a><font color="#B22222">.  r4 - memory allocated in fourth chunk</font>
<a name="line765">765: </a><font color="#B22222">-  r5 - memory allocated in fifth chunk</font>

<a name="line767">767: </a><font color="#B22222">   Level: developer</font>

<a name="line769">769: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscFree.html">PetscFree</a>()`, `<a href="../manualpages/Sys/PetscNew.html">PetscNew</a>()`, `<a href="../manualpages/Sys/PetscMalloc.html">PetscMalloc</a>()`, `<a href="../manualpages/Sys/PetscMalloc2.html">PetscMalloc2</a>()`, `<a href="../manualpages/Sys/PetscCalloc5.html">PetscCalloc5</a>()`, `<a href="../manualpages/Sys/PetscFree5.html">PetscFree5</a>()`</font>
<a name="line770">770: </a><font color="#B22222">M*/</font>
<a name="line771">771: </a><strong><font color="#228B22">#define <a href="../manualpages/Sys/PetscMalloc5.html">PetscMalloc5</a>(m1, r1, m2, r2, m3, r3, m4, r4, m5, r5) \</font></strong>
<a name="line772">772: </a><strong><font color="#228B22">  <a href="../manualpages/Sys/PetscMallocA.html">PetscMallocA</a>(5, <a href="../manualpages/Sys/PETSC_FALSE.html">PETSC_FALSE</a>, __LINE__, PETSC_FUNCTION_NAME, __FILE__, ((size_t)((size_t)m1) * sizeof(**(r1))), (r1), ((size_t)((size_t)m2) * sizeof(**(r2))), (r2), ((size_t)((size_t)m3) * sizeof(**(r3))), (r3), ((size_t)((size_t)m4) * sizeof(**(r4))), (r4), ((size_t)((size_t)m5) * sizeof(**(r5))), (r5))</font></strong>

<a name="line774">774: </a><font color="#B22222">/*MC</font>
<a name="line775">775: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscCalloc5.html">PetscCalloc5</a> - Allocates 5 cleared (zeroed) arrays of memory, all aligned to `PETSC_MEMALIGN`</font>

<a name="line777">777: </a><font color="#B22222">   Synopsis:</font>
<a name="line778">778: </a>#include <A href="../include/petscsys.h.html">&lt;petscsys.h&gt;</A>
<a name="line779">779: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscCalloc5.html">PetscCalloc5</a>(size_t m1,type **r1,size_t m2,type **r2,size_t m3,type **r3,size_t m4,type **r4,size_t m5,type **r5)</font>

<a name="line781">781: </a><font color="#B22222">   Not Collective</font>

<a name="line783">783: </a><font color="#B22222">   Input Parameters:</font>
<a name="line784">784: </a><font color="#B22222">+  m1 - number of elements to allocate in 1st chunk  (may be zero)</font>
<a name="line785">785: </a><font color="#B22222">.  m2 - number of elements to allocate in 2nd chunk  (may be zero)</font>
<a name="line786">786: </a><font color="#B22222">.  m3 - number of elements to allocate in 3rd chunk  (may be zero)</font>
<a name="line787">787: </a><font color="#B22222">.  m4 - number of elements to allocate in 4th chunk  (may be zero)</font>
<a name="line788">788: </a><font color="#B22222">-  m5 - number of elements to allocate in 5th chunk  (may be zero)</font>

<a name="line790">790: </a><font color="#B22222">   Output Parameters:</font>
<a name="line791">791: </a><font color="#B22222">+  r1 - memory allocated in first chunk</font>
<a name="line792">792: </a><font color="#B22222">.  r2 - memory allocated in second chunk</font>
<a name="line793">793: </a><font color="#B22222">.  r3 - memory allocated in third chunk</font>
<a name="line794">794: </a><font color="#B22222">.  r4 - memory allocated in fourth chunk</font>
<a name="line795">795: </a><font color="#B22222">-  r5 - memory allocated in fifth chunk</font>

<a name="line797">797: </a><font color="#B22222">   Level: developer</font>

<a name="line799">799: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscFree.html">PetscFree</a>()`, `<a href="../manualpages/Sys/PetscNew.html">PetscNew</a>()`, `<a href="../manualpages/Sys/PetscMalloc.html">PetscMalloc</a>()`, `<a href="../manualpages/Sys/PetscMalloc5.html">PetscMalloc5</a>()`, `<a href="../manualpages/Sys/PetscFree5.html">PetscFree5</a>()`</font>
<a name="line800">800: </a><font color="#B22222">M*/</font>
<a name="line801">801: </a><strong><font color="#228B22">#define <a href="../manualpages/Sys/PetscCalloc5.html">PetscCalloc5</a>(m1, r1, m2, r2, m3, r3, m4, r4, m5, r5) \</font></strong>
<a name="line802">802: </a><strong><font color="#228B22">  <a href="../manualpages/Sys/PetscMallocA.html">PetscMallocA</a>(5, <a href="../manualpages/Sys/PETSC_TRUE.html">PETSC_TRUE</a>, __LINE__, PETSC_FUNCTION_NAME, __FILE__, ((size_t)((size_t)m1) * sizeof(**(r1))), (r1), ((size_t)((size_t)m2) * sizeof(**(r2))), (r2), ((size_t)((size_t)m3) * sizeof(**(r3))), (r3), ((size_t)((size_t)m4) * sizeof(**(r4))), (r4), ((size_t)((size_t)m5) * sizeof(**(r5))), (r5))</font></strong>

<a name="line804">804: </a><font color="#B22222">/*MC</font>
<a name="line805">805: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscMalloc6.html">PetscMalloc6</a> - Allocates 6 arrays of memory, all aligned to `PETSC_MEMALIGN`</font>

<a name="line807">807: </a><font color="#B22222">   Synopsis:</font>
<a name="line808">808: </a>#include <A href="../include/petscsys.h.html">&lt;petscsys.h&gt;</A>
<a name="line809">809: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscMalloc6.html">PetscMalloc6</a>(size_t m1,type **r1,size_t m2,type **r2,size_t m3,type **r3,size_t m4,type **r4,size_t m5,type **r5,size_t m6,type **r6)</font>

<a name="line811">811: </a><font color="#B22222">   Not Collective</font>

<a name="line813">813: </a><font color="#B22222">   Input Parameters:</font>
<a name="line814">814: </a><font color="#B22222">+  m1 - number of elements to allocate in 1st chunk  (may be zero)</font>
<a name="line815">815: </a><font color="#B22222">.  m2 - number of elements to allocate in 2nd chunk  (may be zero)</font>
<a name="line816">816: </a><font color="#B22222">.  m3 - number of elements to allocate in 3rd chunk  (may be zero)</font>
<a name="line817">817: </a><font color="#B22222">.  m4 - number of elements to allocate in 4th chunk  (may be zero)</font>
<a name="line818">818: </a><font color="#B22222">.  m5 - number of elements to allocate in 5th chunk  (may be zero)</font>
<a name="line819">819: </a><font color="#B22222">-  m6 - number of elements to allocate in 6th chunk  (may be zero)</font>

<a name="line821">821: </a><font color="#B22222">   Output Parameteasr:</font>
<a name="line822">822: </a><font color="#B22222">+  r1 - memory allocated in first chunk</font>
<a name="line823">823: </a><font color="#B22222">.  r2 - memory allocated in second chunk</font>
<a name="line824">824: </a><font color="#B22222">.  r3 - memory allocated in third chunk</font>
<a name="line825">825: </a><font color="#B22222">.  r4 - memory allocated in fourth chunk</font>
<a name="line826">826: </a><font color="#B22222">.  r5 - memory allocated in fifth chunk</font>
<a name="line827">827: </a><font color="#B22222">-  r6 - memory allocated in sixth chunk</font>

<a name="line829">829: </a><font color="#B22222">   Level: developer</font>

<a name="line831">831: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscFree.html">PetscFree</a>()`, `<a href="../manualpages/Sys/PetscNew.html">PetscNew</a>()`, `<a href="../manualpages/Sys/PetscMalloc.html">PetscMalloc</a>()`, `<a href="../manualpages/Sys/PetscMalloc2.html">PetscMalloc2</a>()`, `<a href="../manualpages/Sys/PetscCalloc6.html">PetscCalloc6</a>()`, `<a href="../manualpages/Sys/PetscFree3.html">PetscFree3</a>()`, `<a href="../manualpages/Sys/PetscFree4.html">PetscFree4</a>()`, `<a href="../manualpages/Sys/PetscFree5.html">PetscFree5</a>()`, `<a href="../manualpages/Sys/PetscFree6.html">PetscFree6</a>()`</font>
<a name="line832">832: </a><font color="#B22222">M*/</font>
<a name="line833">833: </a><strong><font color="#228B22">#define <a href="../manualpages/Sys/PetscMalloc6.html">PetscMalloc6</a>(m1, r1, m2, r2, m3, r3, m4, r4, m5, r5, m6, r6) \</font></strong>
<a name="line834">834: </a><strong><font color="#228B22">  <a href="../manualpages/Sys/PetscMallocA.html">PetscMallocA</a>(6, <a href="../manualpages/Sys/PETSC_FALSE.html">PETSC_FALSE</a>, __LINE__, PETSC_FUNCTION_NAME, __FILE__, ((size_t)((size_t)m1) * sizeof(**(r1))), (r1), ((size_t)((size_t)m2) * sizeof(**(r2))), (r2), ((size_t)((size_t)m3) * sizeof(**(r3))), (r3), ((size_t)((size_t)m4) * sizeof(**(r4))), (r4), ((size_t)((size_t)m5) * sizeof(**(r5))), (r5), ((size_t)((size_t)m6) * sizeof(**(r6))), (r6))</font></strong>

<a name="line836">836: </a><font color="#B22222">/*MC</font>
<a name="line837">837: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscCalloc6.html">PetscCalloc6</a> - Allocates 6 cleared (zeroed) arrays of memory, all aligned to `PETSC_MEMALIGN`</font>

<a name="line839">839: </a><font color="#B22222">   Synopsis:</font>
<a name="line840">840: </a>#include <A href="../include/petscsys.h.html">&lt;petscsys.h&gt;</A>
<a name="line841">841: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscCalloc6.html">PetscCalloc6</a>(size_t m1,type **r1,size_t m2,type **r2,size_t m3,type **r3,size_t m4,type **r4,size_t m5,type **r5,size_t m6,type **r6)</font>

<a name="line843">843: </a><font color="#B22222">   Not Collective</font>

<a name="line845">845: </a><font color="#B22222">   Input Parameters:</font>
<a name="line846">846: </a><font color="#B22222">+  m1 - number of elements to allocate in 1st chunk  (may be zero)</font>
<a name="line847">847: </a><font color="#B22222">.  m2 - number of elements to allocate in 2nd chunk  (may be zero)</font>
<a name="line848">848: </a><font color="#B22222">.  m3 - number of elements to allocate in 3rd chunk  (may be zero)</font>
<a name="line849">849: </a><font color="#B22222">.  m4 - number of elements to allocate in 4th chunk  (may be zero)</font>
<a name="line850">850: </a><font color="#B22222">.  m5 - number of elements to allocate in 5th chunk  (may be zero)</font>
<a name="line851">851: </a><font color="#B22222">-  m6 - number of elements to allocate in 6th chunk  (may be zero)</font>

<a name="line853">853: </a><font color="#B22222">   Output Parameters:</font>
<a name="line854">854: </a><font color="#B22222">+  r1 - memory allocated in first chunk</font>
<a name="line855">855: </a><font color="#B22222">.  r2 - memory allocated in second chunk</font>
<a name="line856">856: </a><font color="#B22222">.  r3 - memory allocated in third chunk</font>
<a name="line857">857: </a><font color="#B22222">.  r4 - memory allocated in fourth chunk</font>
<a name="line858">858: </a><font color="#B22222">.  r5 - memory allocated in fifth chunk</font>
<a name="line859">859: </a><font color="#B22222">-  r6 - memory allocated in sixth chunk</font>

<a name="line861">861: </a><font color="#B22222">   Level: developer</font>

<a name="line863">863: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscFree.html">PetscFree</a>()`, `<a href="../manualpages/Sys/PetscNew.html">PetscNew</a>()`, `<a href="../manualpages/Sys/PetscMalloc.html">PetscMalloc</a>()`, `<a href="../manualpages/Sys/PetscMalloc2.html">PetscMalloc2</a>()`, `<a href="../manualpages/Sys/PetscMalloc6.html">PetscMalloc6</a>()`, `<a href="../manualpages/Sys/PetscFree6.html">PetscFree6</a>()`</font>
<a name="line864">864: </a><font color="#B22222">M*/</font>
<a name="line865">865: </a><strong><font color="#228B22">#define <a href="../manualpages/Sys/PetscCalloc6.html">PetscCalloc6</a>(m1, r1, m2, r2, m3, r3, m4, r4, m5, r5, m6, r6) \</font></strong>
<a name="line866">866: </a><strong><font color="#228B22">  <a href="../manualpages/Sys/PetscMallocA.html">PetscMallocA</a>(6, <a href="../manualpages/Sys/PETSC_TRUE.html">PETSC_TRUE</a>, __LINE__, PETSC_FUNCTION_NAME, __FILE__, ((size_t)((size_t)m1) * sizeof(**(r1))), (r1), ((size_t)((size_t)m2) * sizeof(**(r2))), (r2), ((size_t)((size_t)m3) * sizeof(**(r3))), (r3), ((size_t)((size_t)m4) * sizeof(**(r4))), (r4), ((size_t)((size_t)m5) * sizeof(**(r5))), (r5), ((size_t)((size_t)m6) * sizeof(**(r6))), (r6))</font></strong>

<a name="line868">868: </a><font color="#B22222">/*MC</font>
<a name="line869">869: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscMalloc7.html">PetscMalloc7</a> - Allocates 7 arrays of memory, all aligned to `PETSC_MEMALIGN`</font>

<a name="line871">871: </a><font color="#B22222">   Synopsis:</font>
<a name="line872">872: </a>#include <A href="../include/petscsys.h.html">&lt;petscsys.h&gt;</A>
<a name="line873">873: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscMalloc7.html">PetscMalloc7</a>(size_t m1,type **r1,size_t m2,type **r2,size_t m3,type **r3,size_t m4,type **r4,size_t m5,type **r5,size_t m6,type **r6,size_t m7,type **r7)</font>

<a name="line875">875: </a><font color="#B22222">   Not Collective</font>

<a name="line877">877: </a><font color="#B22222">   Input Parameters:</font>
<a name="line878">878: </a><font color="#B22222">+  m1 - number of elements to allocate in 1st chunk  (may be zero)</font>
<a name="line879">879: </a><font color="#B22222">.  m2 - number of elements to allocate in 2nd chunk  (may be zero)</font>
<a name="line880">880: </a><font color="#B22222">.  m3 - number of elements to allocate in 3rd chunk  (may be zero)</font>
<a name="line881">881: </a><font color="#B22222">.  m4 - number of elements to allocate in 4th chunk  (may be zero)</font>
<a name="line882">882: </a><font color="#B22222">.  m5 - number of elements to allocate in 5th chunk  (may be zero)</font>
<a name="line883">883: </a><font color="#B22222">.  m6 - number of elements to allocate in 6th chunk  (may be zero)</font>
<a name="line884">884: </a><font color="#B22222">-  m7 - number of elements to allocate in 7th chunk  (may be zero)</font>

<a name="line886">886: </a><font color="#B22222">   Output Parameters:</font>
<a name="line887">887: </a><font color="#B22222">+  r1 - memory allocated in first chunk</font>
<a name="line888">888: </a><font color="#B22222">.  r2 - memory allocated in second chunk</font>
<a name="line889">889: </a><font color="#B22222">.  r3 - memory allocated in third chunk</font>
<a name="line890">890: </a><font color="#B22222">.  r4 - memory allocated in fourth chunk</font>
<a name="line891">891: </a><font color="#B22222">.  r5 - memory allocated in fifth chunk</font>
<a name="line892">892: </a><font color="#B22222">.  r6 - memory allocated in sixth chunk</font>
<a name="line893">893: </a><font color="#B22222">-  r7 - memory allocated in seventh chunk</font>

<a name="line895">895: </a><font color="#B22222">   Level: developer</font>

<a name="line897">897: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscFree.html">PetscFree</a>()`, `<a href="../manualpages/Sys/PetscNew.html">PetscNew</a>()`, `<a href="../manualpages/Sys/PetscMalloc.html">PetscMalloc</a>()`, `<a href="../manualpages/Sys/PetscMalloc2.html">PetscMalloc2</a>()`, `<a href="../manualpages/Sys/PetscCalloc7.html">PetscCalloc7</a>()`, `<a href="../manualpages/Sys/PetscFree7.html">PetscFree7</a>()`</font>
<a name="line898">898: </a><font color="#B22222">M*/</font>
<a name="line899">899: </a><strong><font color="#228B22">#define <a href="../manualpages/Sys/PetscMalloc7.html">PetscMalloc7</a>(m1, r1, m2, r2, m3, r3, m4, r4, m5, r5, m6, r6, m7, r7) \</font></strong>
<a name="line900">900: </a><strong><font color="#228B22">  <a href="../manualpages/Sys/PetscMallocA.html">PetscMallocA</a>(7, <a href="../manualpages/Sys/PETSC_FALSE.html">PETSC_FALSE</a>, __LINE__, PETSC_FUNCTION_NAME, __FILE__, ((size_t)((size_t)m1) * sizeof(**(r1))), (r1), ((size_t)((size_t)m2) * sizeof(**(r2))), (r2), ((size_t)((size_t)m3) * sizeof(**(r3))), (r3), ((size_t)((size_t)m4) * sizeof(**(r4))), (r4), ((size_t)((size_t)m5) * sizeof(**(r5))), (r5), ((size_t)((size_t)m6) * sizeof(**(r6))), (r6), ((size_t)((size_t)m7) * sizeof(**(r7))), (r7))</font></strong>

<a name="line902">902: </a><font color="#B22222">/*MC</font>
<a name="line903">903: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscCalloc7.html">PetscCalloc7</a> - Allocates 7 cleared (zeroed) arrays of memory, all aligned to `PETSC_MEMALIGN`</font>

<a name="line905">905: </a><font color="#B22222">   Synopsis:</font>
<a name="line906">906: </a>#include <A href="../include/petscsys.h.html">&lt;petscsys.h&gt;</A>
<a name="line907">907: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscCalloc7.html">PetscCalloc7</a>(size_t m1,type **r1,size_t m2,type **r2,size_t m3,type **r3,size_t m4,type **r4,size_t m5,type **r5,size_t m6,type **r6,size_t m7,type **r7)</font>

<a name="line909">909: </a><font color="#B22222">   Not Collective</font>

<a name="line911">911: </a><font color="#B22222">   Input Parameters:</font>
<a name="line912">912: </a><font color="#B22222">+  m1 - number of elements to allocate in 1st chunk  (may be zero)</font>
<a name="line913">913: </a><font color="#B22222">.  m2 - number of elements to allocate in 2nd chunk  (may be zero)</font>
<a name="line914">914: </a><font color="#B22222">.  m3 - number of elements to allocate in 3rd chunk  (may be zero)</font>
<a name="line915">915: </a><font color="#B22222">.  m4 - number of elements to allocate in 4th chunk  (may be zero)</font>
<a name="line916">916: </a><font color="#B22222">.  m5 - number of elements to allocate in 5th chunk  (may be zero)</font>
<a name="line917">917: </a><font color="#B22222">.  m6 - number of elements to allocate in 6th chunk  (may be zero)</font>
<a name="line918">918: </a><font color="#B22222">-  m7 - number of elements to allocate in 7th chunk  (may be zero)</font>

<a name="line920">920: </a><font color="#B22222">   Output Parameters:</font>
<a name="line921">921: </a><font color="#B22222">+  r1 - memory allocated in first chunk</font>
<a name="line922">922: </a><font color="#B22222">.  r2 - memory allocated in second chunk</font>
<a name="line923">923: </a><font color="#B22222">.  r3 - memory allocated in third chunk</font>
<a name="line924">924: </a><font color="#B22222">.  r4 - memory allocated in fourth chunk</font>
<a name="line925">925: </a><font color="#B22222">.  r5 - memory allocated in fifth chunk</font>
<a name="line926">926: </a><font color="#B22222">.  r6 - memory allocated in sixth chunk</font>
<a name="line927">927: </a><font color="#B22222">-  r7 - memory allocated in seventh chunk</font>

<a name="line929">929: </a><font color="#B22222">   Level: developer</font>

<a name="line931">931: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscFree.html">PetscFree</a>()`, `<a href="../manualpages/Sys/PetscNew.html">PetscNew</a>()`, `<a href="../manualpages/Sys/PetscMalloc.html">PetscMalloc</a>()`, `<a href="../manualpages/Sys/PetscMalloc2.html">PetscMalloc2</a>()`, `<a href="../manualpages/Sys/PetscMalloc7.html">PetscMalloc7</a>()`, `<a href="../manualpages/Sys/PetscFree7.html">PetscFree7</a>()`</font>
<a name="line932">932: </a><font color="#B22222">M*/</font>
<a name="line933">933: </a><strong><font color="#228B22">#define <a href="../manualpages/Sys/PetscCalloc7.html">PetscCalloc7</a>(m1, r1, m2, r2, m3, r3, m4, r4, m5, r5, m6, r6, m7, r7) \</font></strong>
<a name="line934">934: </a><strong><font color="#228B22">  <a href="../manualpages/Sys/PetscMallocA.html">PetscMallocA</a>(7, <a href="../manualpages/Sys/PETSC_TRUE.html">PETSC_TRUE</a>, __LINE__, PETSC_FUNCTION_NAME, __FILE__, ((size_t)((size_t)m1) * sizeof(**(r1))), (r1), ((size_t)((size_t)m2) * sizeof(**(r2))), (r2), ((size_t)((size_t)m3) * sizeof(**(r3))), (r3), ((size_t)((size_t)m4) * sizeof(**(r4))), (r4), ((size_t)((size_t)m5) * sizeof(**(r5))), (r5), ((size_t)((size_t)m6) * sizeof(**(r6))), (r6), ((size_t)((size_t)m7) * sizeof(**(r7))), (r7))</font></strong>

<a name="line936">936: </a><font color="#B22222">/*MC</font>
<a name="line937">937: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscNew.html">PetscNew</a> - Allocates memory of a particular type, zeros the memory! Aligned to `PETSC_MEMALIGN`</font>

<a name="line939">939: </a><font color="#B22222">   Synopsis:</font>
<a name="line940">940: </a>#include <A href="../include/petscsys.h.html">&lt;petscsys.h&gt;</A>
<a name="line941">941: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscNew.html">PetscNew</a>(type **result)</font>

<a name="line943">943: </a><font color="#B22222">   Not Collective</font>

<a name="line945">945: </a><font color="#B22222">   Output Parameter:</font>
<a name="line946">946: </a><font color="#B22222">.  result - memory allocated, sized to match pointer `type`</font>

<a name="line948">948: </a><font color="#B22222">   Level: beginner</font>

<a name="line950">950: </a><font color="#B22222">   Developer Note:</font>
<a name="line951">951: </a><font color="#B22222">   Calls `<a href="../manualpages/Sys/PetscCalloc.html">PetscCalloc</a>()` with the appropriate memory size obtained from `type`</font>

<a name="line953">953: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscFree.html">PetscFree</a>()`, `<a href="../manualpages/Sys/PetscMalloc.html">PetscMalloc</a>()`, `<a href="../manualpages/Sys/PetscCall.html">PetscCall</a>()`, `<a href="../manualpages/Sys/PetscCalloc1.html">PetscCalloc1</a>()`, `<a href="../manualpages/Sys/PetscMalloc1.html">PetscMalloc1</a>()`</font>
<a name="line954">954: </a><font color="#B22222">M*/</font>
<a name="line955">955: </a><strong><font color="#228B22">#define <a href="../manualpages/Sys/PetscNew.html">PetscNew</a>(b) <a href="../manualpages/Sys/PetscCalloc1.html">PetscCalloc1</a>(1, (b))</font></strong>

<a name="line957">957: </a><strong><font color="#228B22">#define PetscNewLog(o, b) PETSC_DEPRECATED_MACRO(3, 18, 0, </font><font color="#666666">"<a href="../manualpages/Sys/PetscNew.html">PetscNew</a>()"</font><font color="#228B22">, ) <a href="../manualpages/Sys/PetscNew.html">PetscNew</a>(b)</font></strong>

<a name="line959">959: </a><font color="#B22222">/*MC</font>
<a name="line960">960: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscFree.html">PetscFree</a> - Frees memory</font>

<a name="line962">962: </a><font color="#B22222">   Synopsis:</font>
<a name="line963">963: </a>#include <A href="../include/petscsys.h.html">&lt;petscsys.h&gt;</A>
<a name="line964">964: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscFree.html">PetscFree</a>(void *memory)</font>

<a name="line966">966: </a><font color="#B22222">   Not Collective</font>

<a name="line968">968: </a><font color="#B22222">   Input Parameter:</font>
<a name="line969">969: </a><font color="#B22222">.   memory - memory to free (the pointer is ALWAYS set to `NULL` upon success)</font>

<a name="line971">971: </a><font color="#B22222">   Level: beginner</font>

<a name="line973">973: </a><font color="#B22222">   Notes:</font>
<a name="line974">974: </a><font color="#B22222">   Do not free memory obtained with `<a href="../manualpages/Sys/PetscMalloc2.html">PetscMalloc2</a>()`, `<a href="../manualpages/Sys/PetscCalloc2.html">PetscCalloc2</a>()` etc, they must be freed with `<a href="../manualpages/Sys/PetscFree2.html">PetscFree2</a>()` etc.</font>

<a name="line976">976: </a><font color="#B22222">   It is safe to call `<a href="../manualpages/Sys/PetscFree.html">PetscFree</a>()` on a `NULL` pointer.</font>

<a name="line978">978: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscNew.html">PetscNew</a>()`, `<a href="../manualpages/Sys/PetscMalloc.html">PetscMalloc</a>()`, `<a href="../manualpages/Sys/PetscMalloc1.html">PetscMalloc1</a>()`, `<a href="../manualpages/Sys/PetscCalloc1.html">PetscCalloc1</a>()`</font>
<a name="line979">979: </a><font color="#B22222">M*/</font>
<a name="line980">980: </a><strong><font color="#228B22">#define <a href="../manualpages/Sys/PetscFree.html">PetscFree</a>(a) ((<a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a>)((*PetscTrFree)((void *)(a), __LINE__, PETSC_FUNCTION_NAME, __FILE__) || ((a) = <a href="../manualpages/Sys/PETSC_NULLPTR.html">PETSC_NULLPTR</a>, <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_SUCCESS</a>)))</font></strong>

<a name="line982">982: </a><font color="#B22222">/*MC</font>
<a name="line983">983: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscFree2.html">PetscFree2</a> - Frees 2 chunks of memory obtained with `<a href="../manualpages/Sys/PetscMalloc2.html">PetscMalloc2</a>()`</font>

<a name="line985">985: </a><font color="#B22222">   Synopsis:</font>
<a name="line986">986: </a>#include <A href="../include/petscsys.h.html">&lt;petscsys.h&gt;</A>
<a name="line987">987: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscFree2.html">PetscFree2</a>(void *memory1,void *memory2)</font>

<a name="line989">989: </a><font color="#B22222">   Not Collective</font>

<a name="line991">991: </a><font color="#B22222">   Input Parameters:</font>
<a name="line992">992: </a><font color="#B22222">+   memory1 - memory to free</font>
<a name="line993">993: </a><font color="#B22222">-   memory2 - 2nd memory to free</font>

<a name="line995">995: </a><font color="#B22222">   Level: developer</font>

<a name="line997">997: </a><font color="#B22222">   Notes:</font>
<a name="line998">998: </a><font color="#B22222">    Memory must have been obtained with `<a href="../manualpages/Sys/PetscMalloc2.html">PetscMalloc2</a>()`</font>

<a name="line1000">1000: </a><font color="#B22222">    The arguments need to be in the same order as they were in the call to `<a href="../manualpages/Sys/PetscMalloc2.html">PetscMalloc2</a>()`</font>

<a name="line1002">1002: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscNew.html">PetscNew</a>()`, `<a href="../manualpages/Sys/PetscMalloc.html">PetscMalloc</a>()`, `<a href="../manualpages/Sys/PetscMalloc2.html">PetscMalloc2</a>()`, `<a href="../manualpages/Sys/PetscFree.html">PetscFree</a>()`</font>
<a name="line1003">1003: </a><font color="#B22222">M*/</font>
<a name="line1004">1004: </a><strong><font color="#228B22">#define <a href="../manualpages/Sys/PetscFree2.html">PetscFree2</a>(m1, m2) <a href="../manualpages/Sys/PetscFreeA.html">PetscFreeA</a>(2, __LINE__, PETSC_FUNCTION_NAME, __FILE__, &amp;(m1), &amp;(m2))</font></strong>

<a name="line1006">1006: </a><font color="#B22222">/*MC</font>
<a name="line1007">1007: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscFree3.html">PetscFree3</a> - Frees 3 chunks of memory obtained with `<a href="../manualpages/Sys/PetscMalloc3.html">PetscMalloc3</a>()`</font>

<a name="line1009">1009: </a><font color="#B22222">   Synopsis:</font>
<a name="line1010">1010: </a>#include <A href="../include/petscsys.h.html">&lt;petscsys.h&gt;</A>
<a name="line1011">1011: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscFree3.html">PetscFree3</a>(void *memory1,void *memory2,void *memory3)</font>

<a name="line1013">1013: </a><font color="#B22222">   Not Collective</font>

<a name="line1015">1015: </a><font color="#B22222">   Input Parameters:</font>
<a name="line1016">1016: </a><font color="#B22222">+   memory1 - memory to free</font>
<a name="line1017">1017: </a><font color="#B22222">.   memory2 - 2nd memory to free</font>
<a name="line1018">1018: </a><font color="#B22222">-   memory3 - 3rd memory to free</font>

<a name="line1020">1020: </a><font color="#B22222">   Level: developer</font>

<a name="line1022">1022: </a><font color="#B22222">   Notes:</font>
<a name="line1023">1023: </a><font color="#B22222">    Memory must have been obtained with `<a href="../manualpages/Sys/PetscMalloc3.html">PetscMalloc3</a>()`</font>

<a name="line1025">1025: </a><font color="#B22222">    The arguments need to be in the same order as they were in the call to `<a href="../manualpages/Sys/PetscMalloc3.html">PetscMalloc3</a>()`</font>

<a name="line1027">1027: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscNew.html">PetscNew</a>()`, `<a href="../manualpages/Sys/PetscMalloc.html">PetscMalloc</a>()`, `<a href="../manualpages/Sys/PetscMalloc2.html">PetscMalloc2</a>()`, `<a href="../manualpages/Sys/PetscFree.html">PetscFree</a>()`, `<a href="../manualpages/Sys/PetscMalloc3.html">PetscMalloc3</a>()`</font>
<a name="line1028">1028: </a><font color="#B22222">M*/</font>
<a name="line1029">1029: </a><strong><font color="#228B22">#define <a href="../manualpages/Sys/PetscFree3.html">PetscFree3</a>(m1, m2, m3) <a href="../manualpages/Sys/PetscFreeA.html">PetscFreeA</a>(3, __LINE__, PETSC_FUNCTION_NAME, __FILE__, &amp;(m1), &amp;(m2), &amp;(m3))</font></strong>

<a name="line1031">1031: </a><font color="#B22222">/*MC</font>
<a name="line1032">1032: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscFree4.html">PetscFree4</a> - Frees 4 chunks of memory obtained with `<a href="../manualpages/Sys/PetscMalloc4.html">PetscMalloc4</a>()`</font>

<a name="line1034">1034: </a><font color="#B22222">   Synopsis:</font>
<a name="line1035">1035: </a>#include <A href="../include/petscsys.h.html">&lt;petscsys.h&gt;</A>
<a name="line1036">1036: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscFree4.html">PetscFree4</a>(void *m1,void *m2,void *m3,void *m4)</font>

<a name="line1038">1038: </a><font color="#B22222">   Not Collective</font>

<a name="line1040">1040: </a><font color="#B22222">   Input Parameters:</font>
<a name="line1041">1041: </a><font color="#B22222">+   m1 - memory to free</font>
<a name="line1042">1042: </a><font color="#B22222">.   m2 - 2nd memory to free</font>
<a name="line1043">1043: </a><font color="#B22222">.   m3 - 3rd memory to free</font>
<a name="line1044">1044: </a><font color="#B22222">-   m4 - 4th memory to free</font>

<a name="line1046">1046: </a><font color="#B22222">   Level: developer</font>

<a name="line1048">1048: </a><font color="#B22222">   Notes:</font>
<a name="line1049">1049: </a><font color="#B22222">    Memory must have been obtained with `<a href="../manualpages/Sys/PetscMalloc4.html">PetscMalloc4</a>()`</font>

<a name="line1051">1051: </a><font color="#B22222">    The arguments need to be in the same order as they were in the call to `<a href="../manualpages/Sys/PetscMalloc4.html">PetscMalloc4</a>()`</font>

<a name="line1053">1053: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscNew.html">PetscNew</a>()`, `<a href="../manualpages/Sys/PetscMalloc.html">PetscMalloc</a>()`, `<a href="../manualpages/Sys/PetscMalloc2.html">PetscMalloc2</a>()`, `<a href="../manualpages/Sys/PetscFree.html">PetscFree</a>()`, `<a href="../manualpages/Sys/PetscMalloc3.html">PetscMalloc3</a>()`, `<a href="../manualpages/Sys/PetscMalloc4.html">PetscMalloc4</a>()`</font>
<a name="line1054">1054: </a><font color="#B22222">M*/</font>
<a name="line1055">1055: </a><strong><font color="#228B22">#define <a href="../manualpages/Sys/PetscFree4.html">PetscFree4</a>(m1, m2, m3, m4) <a href="../manualpages/Sys/PetscFreeA.html">PetscFreeA</a>(4, __LINE__, PETSC_FUNCTION_NAME, __FILE__, &amp;(m1), &amp;(m2), &amp;(m3), &amp;(m4))</font></strong>

<a name="line1057">1057: </a><font color="#B22222">/*MC</font>
<a name="line1058">1058: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscFree5.html">PetscFree5</a> - Frees 5 chunks of memory obtained with `<a href="../manualpages/Sys/PetscMalloc5.html">PetscMalloc5</a>()`</font>

<a name="line1060">1060: </a><font color="#B22222">   Synopsis:</font>
<a name="line1061">1061: </a>#include <A href="../include/petscsys.h.html">&lt;petscsys.h&gt;</A>
<a name="line1062">1062: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscFree5.html">PetscFree5</a>(void *m1,void *m2,void *m3,void *m4,void *m5)</font>

<a name="line1064">1064: </a><font color="#B22222">   Not Collective</font>

<a name="line1066">1066: </a><font color="#B22222">   Input Parameters:</font>
<a name="line1067">1067: </a><font color="#B22222">+   m1 - memory to free</font>
<a name="line1068">1068: </a><font color="#B22222">.   m2 - 2nd memory to free</font>
<a name="line1069">1069: </a><font color="#B22222">.   m3 - 3rd memory to free</font>
<a name="line1070">1070: </a><font color="#B22222">.   m4 - 4th memory to free</font>
<a name="line1071">1071: </a><font color="#B22222">-   m5 - 5th memory to free</font>

<a name="line1073">1073: </a><font color="#B22222">   Level: developer</font>

<a name="line1075">1075: </a><font color="#B22222">   Notes:</font>
<a name="line1076">1076: </a><font color="#B22222">    Memory must have been obtained with `<a href="../manualpages/Sys/PetscMalloc5.html">PetscMalloc5</a>()`</font>

<a name="line1078">1078: </a><font color="#B22222">    The arguments need to be in the same order as they were in the call to `<a href="../manualpages/Sys/PetscMalloc5.html">PetscMalloc5</a>()`</font>

<a name="line1080">1080: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscNew.html">PetscNew</a>()`, `<a href="../manualpages/Sys/PetscMalloc.html">PetscMalloc</a>()`, `<a href="../manualpages/Sys/PetscMalloc2.html">PetscMalloc2</a>()`, `<a href="../manualpages/Sys/PetscFree.html">PetscFree</a>()`, `<a href="../manualpages/Sys/PetscMalloc3.html">PetscMalloc3</a>()`, `<a href="../manualpages/Sys/PetscMalloc4.html">PetscMalloc4</a>()`, `<a href="../manualpages/Sys/PetscMalloc5.html">PetscMalloc5</a>()`</font>
<a name="line1081">1081: </a><font color="#B22222">M*/</font>
<a name="line1082">1082: </a><strong><font color="#228B22">#define <a href="../manualpages/Sys/PetscFree5.html">PetscFree5</a>(m1, m2, m3, m4, m5) <a href="../manualpages/Sys/PetscFreeA.html">PetscFreeA</a>(5, __LINE__, PETSC_FUNCTION_NAME, __FILE__, &amp;(m1), &amp;(m2), &amp;(m3), &amp;(m4), &amp;(m5))</font></strong>

<a name="line1084">1084: </a><font color="#B22222">/*MC</font>
<a name="line1085">1085: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscFree6.html">PetscFree6</a> - Frees 6 chunks of memory obtained with `<a href="../manualpages/Sys/PetscMalloc6.html">PetscMalloc6</a>()`</font>

<a name="line1087">1087: </a><font color="#B22222">   Synopsis:</font>
<a name="line1088">1088: </a>#include <A href="../include/petscsys.h.html">&lt;petscsys.h&gt;</A>
<a name="line1089">1089: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscFree6.html">PetscFree6</a>(void *m1,void *m2,void *m3,void *m4,void *m5,void *m6)</font>

<a name="line1091">1091: </a><font color="#B22222">   Not Collective</font>

<a name="line1093">1093: </a><font color="#B22222">   Input Parameters:</font>
<a name="line1094">1094: </a><font color="#B22222">+   m1 - memory to free</font>
<a name="line1095">1095: </a><font color="#B22222">.   m2 - 2nd memory to free</font>
<a name="line1096">1096: </a><font color="#B22222">.   m3 - 3rd memory to free</font>
<a name="line1097">1097: </a><font color="#B22222">.   m4 - 4th memory to free</font>
<a name="line1098">1098: </a><font color="#B22222">.   m5 - 5th memory to free</font>
<a name="line1099">1099: </a><font color="#B22222">-   m6 - 6th memory to free</font>

<a name="line1101">1101: </a><font color="#B22222">   Level: developer</font>

<a name="line1103">1103: </a><font color="#B22222">   Notes:</font>
<a name="line1104">1104: </a><font color="#B22222">    Memory must have been obtained with `<a href="../manualpages/Sys/PetscMalloc6.html">PetscMalloc6</a>()`</font>

<a name="line1106">1106: </a><font color="#B22222">    The arguments need to be in the same order as they were in the call to `<a href="../manualpages/Sys/PetscMalloc6.html">PetscMalloc6</a>()`</font>

<a name="line1108">1108: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscNew.html">PetscNew</a>()`, `<a href="../manualpages/Sys/PetscMalloc.html">PetscMalloc</a>()`, `<a href="../manualpages/Sys/PetscMalloc2.html">PetscMalloc2</a>()`, `<a href="../manualpages/Sys/PetscFree.html">PetscFree</a>()`, `<a href="../manualpages/Sys/PetscMalloc3.html">PetscMalloc3</a>()`, `<a href="../manualpages/Sys/PetscMalloc4.html">PetscMalloc4</a>()`, `<a href="../manualpages/Sys/PetscMalloc5.html">PetscMalloc5</a>()`, `<a href="../manualpages/Sys/PetscMalloc6.html">PetscMalloc6</a>()`</font>
<a name="line1109">1109: </a><font color="#B22222">M*/</font>
<a name="line1110">1110: </a><strong><font color="#228B22">#define <a href="../manualpages/Sys/PetscFree6.html">PetscFree6</a>(m1, m2, m3, m4, m5, m6) <a href="../manualpages/Sys/PetscFreeA.html">PetscFreeA</a>(6, __LINE__, PETSC_FUNCTION_NAME, __FILE__, &amp;(m1), &amp;(m2), &amp;(m3), &amp;(m4), &amp;(m5), &amp;(m6))</font></strong>

<a name="line1112">1112: </a><font color="#B22222">/*MC</font>
<a name="line1113">1113: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscFree7.html">PetscFree7</a> - Frees 7 chunks of memory obtained with `<a href="../manualpages/Sys/PetscMalloc7.html">PetscMalloc7</a>()`</font>

<a name="line1115">1115: </a><font color="#B22222">   Synopsis:</font>
<a name="line1116">1116: </a>#include <A href="../include/petscsys.h.html">&lt;petscsys.h&gt;</A>
<a name="line1117">1117: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscFree7.html">PetscFree7</a>(void *m1,void *m2,void *m3,void *m4,void *m5,void *m6,void *m7)</font>

<a name="line1119">1119: </a><font color="#B22222">   Not Collective</font>

<a name="line1121">1121: </a><font color="#B22222">   Input Parameters:</font>
<a name="line1122">1122: </a><font color="#B22222">+   m1 - memory to free</font>
<a name="line1123">1123: </a><font color="#B22222">.   m2 - 2nd memory to free</font>
<a name="line1124">1124: </a><font color="#B22222">.   m3 - 3rd memory to free</font>
<a name="line1125">1125: </a><font color="#B22222">.   m4 - 4th memory to free</font>
<a name="line1126">1126: </a><font color="#B22222">.   m5 - 5th memory to free</font>
<a name="line1127">1127: </a><font color="#B22222">.   m6 - 6th memory to free</font>
<a name="line1128">1128: </a><font color="#B22222">-   m7 - 7th memory to free</font>

<a name="line1130">1130: </a><font color="#B22222">   Level: developer</font>

<a name="line1132">1132: </a><font color="#B22222">   Notes:</font>
<a name="line1133">1133: </a><font color="#B22222">    Memory must have been obtained with `<a href="../manualpages/Sys/PetscMalloc7.html">PetscMalloc7</a>()`</font>

<a name="line1135">1135: </a><font color="#B22222">    The arguments need to be in the same order as they were in the call to `<a href="../manualpages/Sys/PetscMalloc7.html">PetscMalloc7</a>()`</font>

<a name="line1137">1137: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscNew.html">PetscNew</a>()`, `<a href="../manualpages/Sys/PetscMalloc.html">PetscMalloc</a>()`, `<a href="../manualpages/Sys/PetscMalloc2.html">PetscMalloc2</a>()`, `<a href="../manualpages/Sys/PetscFree.html">PetscFree</a>()`, `<a href="../manualpages/Sys/PetscMalloc3.html">PetscMalloc3</a>()`, `<a href="../manualpages/Sys/PetscMalloc4.html">PetscMalloc4</a>()`, `<a href="../manualpages/Sys/PetscMalloc5.html">PetscMalloc5</a>()`, `<a href="../manualpages/Sys/PetscMalloc6.html">PetscMalloc6</a>()`,</font>
<a name="line1138">1138: </a><font color="#B22222">          `<a href="../manualpages/Sys/PetscMalloc7.html">PetscMalloc7</a>()`</font>
<a name="line1139">1139: </a><font color="#B22222">M*/</font>
<a name="line1140">1140: </a><strong><font color="#228B22">#define <a href="../manualpages/Sys/PetscFree7.html">PetscFree7</a>(m1, m2, m3, m4, m5, m6, m7) <a href="../manualpages/Sys/PetscFreeA.html">PetscFreeA</a>(7, __LINE__, PETSC_FUNCTION_NAME, __FILE__, &amp;(m1), &amp;(m2), &amp;(m3), &amp;(m4), &amp;(m5), &amp;(m6), &amp;(m7))</font></strong>

<a name="line1142">1142: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscMallocA.html">PetscMallocA</a>(int, <a href="../manualpages/Sys/PetscBool.html">PetscBool</a>, int, const char *, const char *, size_t, void *, ...)</font></strong>;
<a name="line1143">1143: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscFreeA.html">PetscFreeA</a>(int, int, const char *, const char *, void *, ...)</font></strong>;
<a name="line1144">1144: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> (*PetscTrMalloc)(size_t, <a href="../manualpages/Sys/PetscBool.html">PetscBool</a>, int, const char[], const char[], void **)</font></strong>;
<a name="line1145">1145: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> (*PetscTrFree)(void *, int, const char[], const char[])</font></strong>;
<a name="line1146">1146: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> (*PetscTrRealloc)(size_t, int, const char[], const char[], void **)</font></strong>;
<a name="line1147">1147: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscMallocSetCoalesce.html">PetscMallocSetCoalesce</a>(<a href="../manualpages/Sys/PetscBool.html">PetscBool</a>)</font></strong>;
<a name="line1148">1148: </a><strong><font color="#4169E1"><a name="PetscMallocSet"></a>PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscMallocSet.html">PetscMallocSet</a>(<a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> (*)(size_t, <a href="../manualpages/Sys/PetscBool.html">PetscBool</a>, int, const char[], const char[], void **), <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> (*)(void *, int, const char[], const char[]), <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> (*)(size_t, int, const char[], const char[], void **)</font></strong>);
<a name="line1149">1149: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscMallocClear.html">PetscMallocClear</a>(void)</font></strong>;

<a name="line1151">1151: </a><font color="#B22222">/*</font>
<a name="line1152">1152: </a><font color="#B22222">  Unlike <a href="../manualpages/Sys/PetscMallocSet.html">PetscMallocSet</a> and <a href="../manualpages/Sys/PetscMallocClear.html">PetscMallocClear</a> which overwrite the existing settings, these two functions save the previous choice of allocator, and should be used in pair.</font>
<a name="line1153">1153: </a><font color="#B22222">*/</font>
<a name="line1154">1154: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscMallocSetDRAM.html">PetscMallocSetDRAM</a>(void)</font></strong>;
<a name="line1155">1155: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscMallocResetDRAM.html">PetscMallocResetDRAM</a>(void)</font></strong>;
<a name="line1156">1156: </a><font color="#A020F0">#if defined(PETSC_HAVE_CUDA)</font>
<a name="line1157">1157: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscMallocSetCUDAHost.html">PetscMallocSetCUDAHost</a>(void)</font></strong>;
<a name="line1158">1158: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscMallocResetCUDAHost.html">PetscMallocResetCUDAHost</a>(void)</font></strong>;
<a name="line1159">1159: </a><font color="#A020F0">#endif</font>
<a name="line1160">1160: </a><font color="#A020F0">#if defined(PETSC_HAVE_HIP)</font>
<a name="line1161">1161: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscMallocSetHIPHost.html">PetscMallocSetHIPHost</a>(void)</font></strong>;
<a name="line1162">1162: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscMallocResetHIPHost.html">PetscMallocResetHIPHost</a>(void)</font></strong>;
<a name="line1163">1163: </a><font color="#A020F0">#endif</font>

<a name="line1165">1165: </a><strong><font color="#228B22">#define MPIU_PETSCLOGDOUBLE  MPI_DOUBLE</font></strong>
<a name="line1166">1166: </a><strong><font color="#228B22">#define MPIU_2PETSCLOGDOUBLE MPI_2DOUBLE_PRECISION</font></strong>

<a name="line1168">1168: </a><font color="#B22222">/*</font>
<a name="line1169">1169: </a><font color="#B22222">   Routines for tracing memory corruption/bleeding with default PETSc memory allocation</font>
<a name="line1170">1170: </a><font color="#B22222">*/</font>
<a name="line1171">1171: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscMallocDump.html">PetscMallocDump</a>(FILE *)</font></strong>;
<a name="line1172">1172: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscMallocView.html">PetscMallocView</a>(FILE *)</font></strong>;
<a name="line1173">1173: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscMallocGetCurrentUsage.html">PetscMallocGetCurrentUsage</a>(<a href="../manualpages/Sys/PetscLogDouble.html">PetscLogDouble</a> *)</font></strong>;
<a name="line1174">1174: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscMallocGetMaximumUsage.html">PetscMallocGetMaximumUsage</a>(<a href="../manualpages/Sys/PetscLogDouble.html">PetscLogDouble</a> *)</font></strong>;
<a name="line1175">1175: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscMallocPushMaximumUsage.html">PetscMallocPushMaximumUsage</a>(int)</font></strong>;
<a name="line1176">1176: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscMallocPopMaximumUsage.html">PetscMallocPopMaximumUsage</a>(int, <a href="../manualpages/Sys/PetscLogDouble.html">PetscLogDouble</a> *)</font></strong>;
<a name="line1177">1177: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscMallocSetDebug.html">PetscMallocSetDebug</a>(<a href="../manualpages/Sys/PetscBool.html">PetscBool</a>, <a href="../manualpages/Sys/PetscBool.html">PetscBool</a>)</font></strong>;
<a name="line1178">1178: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscMallocGetDebug.html">PetscMallocGetDebug</a>(<a href="../manualpages/Sys/PetscBool.html">PetscBool</a> *, <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> *, <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> *)</font></strong>;
<a name="line1179">1179: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscMallocValidate.html">PetscMallocValidate</a>(int, const char[], const char[])</font></strong>;
<a name="line1180">1180: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscMallocViewSet.html">PetscMallocViewSet</a>(<a href="../manualpages/Sys/PetscLogDouble.html">PetscLogDouble</a>)</font></strong>;
<a name="line1181">1181: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscMallocViewGet.html">PetscMallocViewGet</a>(<a href="../manualpages/Sys/PetscBool.html">PetscBool</a> *)</font></strong>;
<a name="line1182">1182: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscMallocLogRequestedSizeSet.html">PetscMallocLogRequestedSizeSet</a>(<a href="../manualpages/Sys/PetscBool.html">PetscBool</a>)</font></strong>;
<a name="line1183">1183: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscMallocLogRequestedSizeGet.html">PetscMallocLogRequestedSizeGet</a>(<a href="../manualpages/Sys/PetscBool.html">PetscBool</a> *)</font></strong>;

<a name="line1185">1185: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscDataTypeToMPIDataType.html">PetscDataTypeToMPIDataType</a>(<a href="../manualpages/Sys/PetscDataType.html">PetscDataType</a>, MPI_Datatype *)</font></strong>;
<a name="line1186">1186: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscMPIDataTypeToPetscDataType.html">PetscMPIDataTypeToPetscDataType</a>(MPI_Datatype, <a href="../manualpages/Sys/PetscDataType.html">PetscDataType</a> *)</font></strong>;
<a name="line1187">1187: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscDataTypeGetSize.html">PetscDataTypeGetSize</a>(<a href="../manualpages/Sys/PetscDataType.html">PetscDataType</a>, size_t *)</font></strong>;
<a name="line1188">1188: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscDataTypeFromString.html">PetscDataTypeFromString</a>(const char *, <a href="../manualpages/Sys/PetscDataType.html">PetscDataType</a> *, <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> *)</font></strong>;

<a name="line1190">1190: </a><font color="#B22222">/*</font>
<a name="line1191">1191: </a><font color="#B22222">   These are MPI operations for <a href="http://www.mpich.org/static/docs/latest/www3/MPI_Allreduce.html#MPI_Allreduce">MPI_Allreduce</a>() etc</font>
<a name="line1192">1192: </a><font color="#B22222">*/</font>
<a name="line1193">1193: </a>PETSC_EXTERN MPI_Op MPIU_MAXSUM_OP;
<a name="line1194">1194: </a><font color="#A020F0">#if defined(PETSC_USE_REAL___FLOAT128) || defined(PETSC_USE_REAL___FP16)</font>
<a name="line1195">1195: </a>PETSC_EXTERN MPI_Op MPIU_SUM;
<a name="line1196">1196: </a>PETSC_EXTERN MPI_Op MPIU_MAX;
<a name="line1197">1197: </a>PETSC_EXTERN MPI_Op MPIU_MIN;
<a name="line1198">1198: </a><font color="#A020F0">#else</font>
<a name="line1199">1199: </a><strong><font color="#228B22">  #define MPIU_SUM MPI_SUM</font></strong>
<a name="line1200">1200: </a><strong><font color="#228B22">  #define MPIU_MAX MPI_MAX</font></strong>
<a name="line1201">1201: </a><strong><font color="#228B22">  #define MPIU_MIN MPI_MIN</font></strong>
<a name="line1202">1202: </a><font color="#A020F0">#endif</font>
<a name="line1203">1203: </a>PETSC_EXTERN MPI_Op         Petsc_Garbage_SetIntersectOp;
<a name="line1204">1204: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscMaxSum.html">PetscMaxSum</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, const <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[], <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *)</font></strong>;

<a name="line1206">1206: </a><font color="#A020F0">#if (defined(PETSC_HAVE_REAL___FLOAT128) &amp;&amp; !defined(PETSC_SKIP_REAL___FLOAT128)) || (defined(PETSC_HAVE_REAL___FP16) &amp;&amp; !defined(PETSC_SKIP_REAL___FP16))</font>
<a name="line1207">1207: </a><font color="#B22222">/*MC</font>
<a name="line1208">1208: </a><font color="#B22222">   <a href="../manualpages/Sys/MPIU_SUM___FP16___FLOAT128.html">MPIU_SUM___FP16___FLOAT128</a> - MPI_Op that acts as a replacement for `MPI_SUM` with</font>
<a name="line1209">1209: </a><font color="#B22222">   custom `MPI_Datatype` `MPIU___FLOAT128`, `MPIU___COMPLEX128`, and `MPIU___FP16`.</font>

<a name="line1211">1211: </a><font color="#B22222">   Level: advanced</font>

<a name="line1213">1213: </a><font color="#B22222">   Developer Note:</font>
<a name="line1214">1214: </a><font color="#B22222">   This should be unified with `MPIU_SUM`</font>

<a name="line1216">1216: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/MPIU_REAL.html">MPIU_REAL</a>`, `<a href="../manualpages/Sys/MPIU_SCALAR.html">MPIU_SCALAR</a>`, `<a href="../manualpages/Sys/MPIU_COMPLEX.html">MPIU_COMPLEX</a>`</font>
<a name="line1217">1217: </a><font color="#B22222">M*/</font>
<a name="line1218">1218: </a>PETSC_EXTERN MPI_Op <a href="../manualpages/Sys/MPIU_SUM___FP16___FLOAT128.html">MPIU_SUM___FP16___FLOAT128</a>;
<a name="line1219">1219: </a><font color="#A020F0">#endif</font>
<a name="line1220">1220: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscMaxSum.html">PetscMaxSum</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, const <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[], <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *)</font></strong>;

<a name="line1222">1222: </a><strong><font color="#4169E1"><a name="MPIULong_Send"></a>PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> MPIULong_Send(void *, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, MPI_Datatype, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>, <a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>)</font></strong> PETSC_ATTRIBUTE_MPI_POINTER_WITH_TYPE(1, 3);
<a name="line1223">1223: </a><strong><font color="#4169E1"><a name="MPIULong_Recv"></a>PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> MPIULong_Recv(void *, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, MPI_Datatype, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>, <a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>)</font></strong> PETSC_ATTRIBUTE_MPI_POINTER_WITH_TYPE(1, 3);

<a name="line1225">1225: </a><font color="#B22222">/*</font>
<a name="line1226">1226: </a><font color="#B22222">     These are so that in extern C code we can cast function pointers to non-extern C</font>
<a name="line1227">1227: </a><font color="#B22222">   function pointers. Since the regular C++ code expects its function pointers to be C++</font>
<a name="line1228">1228: </a><font color="#B22222">*/</font>

<a name="line1230">1230: </a><font color="#B22222">/*S</font>
<a name="line1231">1231: </a><font color="#B22222">  <a href="../manualpages/Sys/PetscVoidFn.html">PetscVoidFn</a> - A prototype of a void (fn)(void) function</font>

<a name="line1233">1233: </a><font color="#B22222">  Level: developer</font>

<a name="line1235">1235: </a><font color="#B22222">  Notes:</font>
<a name="line1236">1236: </a><font color="#B22222">  The deprecated `PetscVoidFunction` works as a replacement for `<a href="../manualpages/Sys/PetscVoidFn.html">PetscVoidFn</a>` *.</font>

<a name="line1238">1238: </a><font color="#B22222">  The deprecated `PetscVoidStarFunction` works as a replacement for `<a href="../manualpages/Sys/PetscVoidFn.html">PetscVoidFn</a>` **.</font>

<a name="line1240">1240: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>`, `<a href="../manualpages/Sys/PetscObjectDestroy.html">PetscObjectDestroy</a>()`</font>
<a name="line1241">1241: </a><font color="#B22222">S*/</font>
<a name="line1242">1242: </a><strong><font color="#4169E1">PETSC_EXTERN_TYPEDEF typedef void(<a href="../manualpages/Sys/PetscVoidFn.html">PetscVoidFn</a>)(void)</font></strong>;

<a name="line1244">1244: </a>PETSC_EXTERN_TYPEDEF <font color="#4169E1">typedef</font> <a href="../manualpages/Sys/PetscVoidFn.html">PetscVoidFn</a>  *PetscVoidFunction;
<a name="line1245">1245: </a>PETSC_EXTERN_TYPEDEF <font color="#4169E1">typedef</font> <a href="../manualpages/Sys/PetscVoidFn.html">PetscVoidFn</a> **PetscVoidStarFunction;

<a name="line1247">1247: </a><font color="#B22222">/*S</font>
<a name="line1248">1248: </a><font color="#B22222">  <a href="../manualpages/Sys/PetscErrorCodeFn.html">PetscErrorCodeFn</a> - A prototype of a <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> (fn)(void) function</font>

<a name="line1250">1250: </a><font color="#B22222">  Level: developer</font>

<a name="line1252">1252: </a><font color="#B22222">  Notes:</font>
<a name="line1253">1253: </a><font color="#B22222">  The deprecated `PetscErrorCodeFunction` works as a replacement for `<a href="../manualpages/Sys/PetscErrorCodeFn.html">PetscErrorCodeFn</a>` *.</font>

<a name="line1255">1255: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>`, `<a href="../manualpages/Sys/PetscObjectDestroy.html">PetscObjectDestroy</a>()`</font>
<a name="line1256">1256: </a><font color="#B22222">S*/</font>
<a name="line1257">1257: </a><strong><font color="#4169E1">PETSC_EXTERN_TYPEDEF typedef <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a>(<a href="../manualpages/Sys/PetscErrorCodeFn.html">PetscErrorCodeFn</a>)(void)</font></strong>;

<a name="line1259">1259: </a>PETSC_EXTERN_TYPEDEF <font color="#4169E1">typedef</font> <a href="../manualpages/Sys/PetscErrorCodeFn.html">PetscErrorCodeFn</a> *PetscErrorCodeFunction;

<a name="line1261">1261: </a><font color="#B22222">/*S</font>
<a name="line1262">1262: </a><font color="#B22222">  <a href="../manualpages/Sys/PetscCtxDestroyFn.html">PetscCtxDestroyFn</a> - A prototype of a `<a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> (*)(void *)` function that is used to free user contexts</font>

<a name="line1264">1264: </a><font color="#B22222">  Level: intermediate</font>

<a name="line1266">1266: </a><font color="#B22222">  Note:</font>
<a name="line1267">1267: </a><font color="#B22222">  Used in the prototype of functions such as `<a href="../manualpages/DM/DMSetApplicationContextDestroy.html">DMSetApplicationContextDestroy</a>()`</font>

<a name="line1269">1269: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>`, `<a href="../manualpages/Sys/PetscCtxDestroyDefault.html">PetscCtxDestroyDefault</a>()`, `<a href="../manualpages/Sys/PetscObjectDestroy.html">PetscObjectDestroy</a>()`, `<a href="../manualpages/DM/DMSetApplicationContextDestroy.html">DMSetApplicationContextDestroy</a>()`</font>
<a name="line1270">1270: </a><font color="#B22222">S*/</font>
<a name="line1271">1271: </a><strong><font color="#4169E1">PETSC_EXTERN_TYPEDEF typedef <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a>(<a href="../manualpages/Sys/PetscCtxDestroyFn.html">PetscCtxDestroyFn</a>)(void **)</font></strong>;

<a name="line1273">1273: </a>PETSC_EXTERN <a href="../manualpages/Sys/PetscCtxDestroyFn.html">PetscCtxDestroyFn</a> <a href="../manualpages/Sys/PetscCtxDestroyDefault.html">PetscCtxDestroyDefault</a>;

<a name="line1275">1275: </a><font color="#B22222">/*</font>
<a name="line1276">1276: </a><font color="#B22222">    Defines PETSc error handling.</font>
<a name="line1277">1277: </a><font color="#B22222">*/</font>
<a name="line1278">1278: </a>#include <A href="../include/petscerror.h.html">&lt;petscerror.h&gt;</A>

<a name="line1280">1280: </a>PETSC_EXTERN <a href="../manualpages/Sys/PetscBool.html">PetscBool</a>   PetscCIEnabled;                    <font color="#B22222">/* code is running in the PETSc test harness CI */</font>
<a name="line1281">1281: </a>PETSC_EXTERN <a href="../manualpages/Sys/PetscBool.html">PetscBool</a>   PetscCIEnabledPortableErrorOutput; <font color="#B22222">/* error output is stripped to ensure portability of error messages across systems */</font>
<a name="line1282">1282: </a><strong><font color="#4169E1">PETSC_EXTERN const char *<a href="../manualpages/Sys/PetscCIFilename.html">PetscCIFilename</a>(const char *)</font></strong>;
<a name="line1283">1283: </a><strong><font color="#4169E1">PETSC_EXTERN int         <a href="../manualpages/Sys/PetscCILinenumber.html">PetscCILinenumber</a>(int)</font></strong>;

<a name="line1285">1285: </a><strong><font color="#228B22">#define PETSC_SMALLEST_CLASSID 1211211</font></strong>
<a name="line1286">1286: </a>PETSC_EXTERN <a href="../manualpages/Sys/PetscClassId.html">PetscClassId</a>   PETSC_LARGEST_CLASSID;
<a name="line1287">1287: </a>PETSC_EXTERN <a href="../manualpages/Sys/PetscClassId.html">PetscClassId</a>   PETSC_OBJECT_CLASSID;
<a name="line1288">1288: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Log/PetscClassIdRegister.html">PetscClassIdRegister</a>(const char[], <a href="../manualpages/Sys/PetscClassId.html">PetscClassId</a> *)</font></strong>;
<a name="line1289">1289: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscObjectGetId.html">PetscObjectGetId</a>(<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>, <a href="../manualpages/Sys/PetscObjectId.html">PetscObjectId</a> *)</font></strong>;
<a name="line1290">1290: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscObjectCompareId.html">PetscObjectCompareId</a>(<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>, <a href="../manualpages/Sys/PetscObjectId.html">PetscObjectId</a>, <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> *)</font></strong>;

<a name="line1292">1292: </a><font color="#B22222">/*</font>
<a name="line1293">1293: </a><font color="#B22222">   Routines that get memory usage information from the OS</font>
<a name="line1294">1294: </a><font color="#B22222">*/</font>
<a name="line1295">1295: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscMemoryGetCurrentUsage.html">PetscMemoryGetCurrentUsage</a>(<a href="../manualpages/Sys/PetscLogDouble.html">PetscLogDouble</a> *)</font></strong>;
<a name="line1296">1296: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscMemoryGetMaximumUsage.html">PetscMemoryGetMaximumUsage</a>(<a href="../manualpages/Sys/PetscLogDouble.html">PetscLogDouble</a> *)</font></strong>;
<a name="line1297">1297: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscMemorySetGetMaximumUsage.html">PetscMemorySetGetMaximumUsage</a>(void)</font></strong>;
<a name="line1298">1298: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> PetscMemoryTrace(const char[])</font></strong>;

<a name="line1300">1300: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSleep.html">PetscSleep</a>(<a href="../manualpages/Sys/PetscReal.html">PetscReal</a>)</font></strong>;

<a name="line1302">1302: </a><font color="#B22222">/*</font>
<a name="line1303">1303: </a><font color="#B22222">   Initialization of PETSc</font>
<a name="line1304">1304: </a><font color="#B22222">*/</font>
<a name="line1305">1305: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscInitialize.html">PetscInitialize</a>(int *, char ***, const char[], const char[])</font></strong>;
<a name="line1306">1306: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscInitializeNoPointers.html">PetscInitializeNoPointers</a>(int, char *[], const char[], const char[])</font></strong>;
<a name="line1307">1307: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> PetscInitializeNoArguments(void)</font></strong>;
<a name="line1308">1308: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscInitialized.html">PetscInitialized</a>(<a href="../manualpages/Sys/PetscBool.html">PetscBool</a> *)</font></strong>;
<a name="line1309">1309: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscFinalized.html">PetscFinalized</a>(<a href="../manualpages/Sys/PetscBool.html">PetscBool</a> *)</font></strong>;
<a name="line1310">1310: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscFinalize.html">PetscFinalize</a>(void)</font></strong>;
<a name="line1311">1311: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscInitializeFortran.html">PetscInitializeFortran</a>(void)</font></strong>;
<a name="line1312">1312: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscGetArgs.html">PetscGetArgs</a>(int *, char ***)</font></strong>;
<a name="line1313">1313: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscGetArguments.html">PetscGetArguments</a>(char ***)</font></strong>;
<a name="line1314">1314: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscFreeArguments.html">PetscFreeArguments</a>(char **)</font></strong>;

<a name="line1316">1316: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscEnd.html">PetscEnd</a>(void)</font></strong>;
<a name="line1317">1317: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Viewer/PetscSysInitializePackage.html">PetscSysInitializePackage</a>(void)</font></strong>;
<a name="line1318">1318: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Viewer/PetscSysFinalizePackage.html">PetscSysFinalizePackage</a>(void)</font></strong>;

<a name="line1320">1320: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscPythonInitialize.html">PetscPythonInitialize</a>(const char[], const char[])</font></strong>;
<a name="line1321">1321: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscPythonFinalize.html">PetscPythonFinalize</a>(void)</font></strong>;
<a name="line1322">1322: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscPythonPrintError.html">PetscPythonPrintError</a>(void)</font></strong>;
<a name="line1323">1323: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscPythonMonitorSet.html">PetscPythonMonitorSet</a>(<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>, const char[])</font></strong>;

<a name="line1325">1325: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Viewer/PetscMonitorCompare.html">PetscMonitorCompare</a>(<a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> (*)(void), void *, <a href="../manualpages/Sys/PetscCtxDestroyFn.html">PetscCtxDestroyFn</a> *, <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> (*)(void), void *, <a href="../manualpages/Sys/PetscCtxDestroyFn.html">PetscCtxDestroyFn</a> *, <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> *)</font></strong>;

<a name="line1327">1327: </a><font color="#B22222">/*</font>
<a name="line1328">1328: </a><font color="#B22222">    Functions that can act on any PETSc object.</font>
<a name="line1329">1329: </a><font color="#B22222">*/</font>
<a name="line1330">1330: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscObjectDestroy.html">PetscObjectDestroy</a>(<a href="../manualpages/Sys/PetscObject.html">PetscObject</a> *)</font></strong>;
<a name="line1331">1331: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscObjectGetComm.html">PetscObjectGetComm</a>(<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>, <a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a> *)</font></strong>;
<a name="line1332">1332: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscObjectGetClassId.html">PetscObjectGetClassId</a>(<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>, <a href="../manualpages/Sys/PetscClassId.html">PetscClassId</a> *)</font></strong>;
<a name="line1333">1333: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscObjectGetClassName.html">PetscObjectGetClassName</a>(<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>, const char *[])</font></strong>;
<a name="line1334">1334: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscObjectGetType.html">PetscObjectGetType</a>(<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>, const char *[])</font></strong>;
<a name="line1335">1335: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscObjectSetName.html">PetscObjectSetName</a>(<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>, const char[])</font></strong>;
<a name="line1336">1336: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscObjectGetName.html">PetscObjectGetName</a>(<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>, const char *[])</font></strong>;
<a name="line1337">1337: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscObjectSetTabLevel.html">PetscObjectSetTabLevel</a>(<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>)</font></strong>;
<a name="line1338">1338: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscObjectGetTabLevel.html">PetscObjectGetTabLevel</a>(<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *)</font></strong>;
<a name="line1339">1339: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscObjectIncrementTabLevel.html">PetscObjectIncrementTabLevel</a>(<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>, <a href="../manualpages/Sys/PetscObject.html">PetscObject</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>)</font></strong>;
<a name="line1340">1340: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscObjectReference.html">PetscObjectReference</a>(<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>)</font></strong>;
<a name="line1341">1341: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscObjectGetReference.html">PetscObjectGetReference</a>(<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *)</font></strong>;
<a name="line1342">1342: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscObjectDereference.html">PetscObjectDereference</a>(<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>)</font></strong>;
<a name="line1343">1343: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscObjectGetNewTag.html">PetscObjectGetNewTag</a>(<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> *)</font></strong>;
<a name="line1344">1344: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscObjectCompose.html">PetscObjectCompose</a>(<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>, const char[], <a href="../manualpages/Sys/PetscObject.html">PetscObject</a>)</font></strong>;
<a name="line1345">1345: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> PetscObjectRemoveReference(<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>, const char[])</font></strong>;
<a name="line1346">1346: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscObjectQuery.html">PetscObjectQuery</a>(<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>, const char[], <a href="../manualpages/Sys/PetscObject.html">PetscObject</a> *)</font></strong>;
<a name="line1347">1347: </a><strong><font color="#4169E1"><a name="PetscObjectComposeFunction_Private"></a>PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> PetscObjectComposeFunction_Private(<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>, const char[], void (*)(void)</font></strong>);
<a name="line1348">1348: </a><strong><font color="#228B22">#define <a href="../manualpages/Sys/PetscObjectComposeFunction.html">PetscObjectComposeFunction</a>(a, b, ...) PetscObjectComposeFunction_Private((a), (b), (<a href="../manualpages/Sys/PetscVoidFn.html">PetscVoidFn</a> *)(__VA_ARGS__))</font></strong>
<a name="line1349">1349: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscObjectSetFromOptions.html">PetscObjectSetFromOptions</a>(<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>)</font></strong>;
<a name="line1350">1350: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscObjectSetUp.html">PetscObjectSetUp</a>(<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>)</font></strong>;
<a name="line1351">1351: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscObjectSetPrintedOptions.html">PetscObjectSetPrintedOptions</a>(<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>)</font></strong>;
<a name="line1352">1352: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscObjectInheritPrintedOptions.html">PetscObjectInheritPrintedOptions</a>(<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>, <a href="../manualpages/Sys/PetscObject.html">PetscObject</a>)</font></strong>;
<a name="line1353">1353: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscCommGetNewTag.html">PetscCommGetNewTag</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> *)</font></strong>;

<a name="line1355">1355: </a><font color="#B22222">/*MC</font>
<a name="line1356">1356: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscObjectParameterSetDefault.html">PetscObjectParameterSetDefault</a> - sets a parameter default value in a `<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>` to a new default value.</font>
<a name="line1357">1357: </a><font color="#B22222">   If the current value matches the old default value, then the current value is also set to the new value.</font>

<a name="line1359">1359: </a><font color="#B22222">   No Fortran Support</font>

<a name="line1361">1361: </a><font color="#B22222">   Synopsis:</font>
<a name="line1362">1362: </a>#include <A href="../include/petscsys.h.html">&lt;petscsys.h&gt;</A>
<a name="line1363">1363: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> <a href="../manualpages/Sys/PetscObjectParameterSetDefault.html">PetscObjectParameterSetDefault</a>(<a href="../manualpages/Sys/PetscObject.html">PetscObject</a> obj, char* NAME, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> value);</font>

<a name="line1365">1365: </a><font color="#B22222">   Input Parameters:</font>
<a name="line1366">1366: </a><font color="#B22222">+  obj - the `<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>`</font>
<a name="line1367">1367: </a><font color="#B22222">.  NAME - the name of the parameter, unquoted</font>
<a name="line1368">1368: </a><font color="#B22222">-  value - the new value</font>

<a name="line1370">1370: </a><font color="#B22222">   Level: developer</font>

<a name="line1372">1372: </a><font color="#B22222">   Notes:</font>
<a name="line1373">1373: </a><font color="#B22222">   The defaults for an object are the values set when the object's type is set.</font>

<a name="line1375">1375: </a><font color="#B22222">   This should only be used in object constructors, such as, `SNESCreate_NGS()`.</font>

<a name="line1377">1377: </a><font color="#B22222">   This only works for parameters that are declared in the struct with `<a href="../manualpages/Sys/PetscObjectParameterDeclare.html">PetscObjectParameterDeclare</a>()`</font>

<a name="line1379">1379: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscObjectParameterDeclare.html">PetscObjectParameterDeclare</a>()`, `<a href="../manualpages/Sys/PetscInitialize.html">PetscInitialize</a>()`, `<a href="../manualpages/Sys/PetscFinalize.html">PetscFinalize</a>()`, `<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>`, `<a href="../manualpages/SNES/SNESParametersInitialize.html">SNESParametersInitialize</a>()`</font>
<a name="line1380">1380: </a><font color="#B22222">M*/</font>
<a name="line1381">1381: </a><strong><font color="#228B22">#define <a href="../manualpages/Sys/PetscObjectParameterSetDefault.html">PetscObjectParameterSetDefault</a>(obj, NAME, value) \</font></strong>
<a name="line1382">1382: </a><strong><font color="#228B22">  do { \</font></strong>
<a name="line1383">1383: </a><strong><font color="#228B22">    if (obj-&gt;NAME == obj-&gt;default_##NAME) obj-&gt;NAME = value; \</font></strong>
<a name="line1384">1384: </a><strong><font color="#228B22">    obj-&gt;default_##NAME = value; \</font></strong>
<a name="line1385">1385: </a><strong><font color="#228B22">  } while (0)</font></strong>

<a name="line1387">1387: </a><font color="#B22222">/*MC</font>
<a name="line1388">1388: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscObjectParameterDeclare.html">PetscObjectParameterDeclare</a> - declares a parameter in a `<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>` and a location to store its default</font>

<a name="line1390">1390: </a><font color="#B22222">   No Fortran Support</font>

<a name="line1392">1392: </a><font color="#B22222">   Synopsis:</font>
<a name="line1393">1393: </a>#include <A href="../include/petscsys.h.html">&lt;petscsys.h&gt;</A>
<a name="line1394">1394: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> <a href="../manualpages/Sys/PetscObjectParameterDeclare.html">PetscObjectParameterDeclare</a>(type, char* NAME)</font>

<a name="line1396">1396: </a><font color="#B22222">   Input Parameters:</font>
<a name="line1397">1397: </a><font color="#B22222">+  type - the type of the parameter, for example `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>`</font>
<a name="line1398">1398: </a><font color="#B22222">-  NAME - the name of the parameter, unquoted</font>

<a name="line1400">1400: </a><font color="#B22222">   Level: developer.</font>

<a name="line1402">1402: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscObjectParameterSetDefault.html">PetscObjectParameterSetDefault</a>()`, `<a href="../manualpages/Sys/PetscInitialize.html">PetscInitialize</a>()`, `<a href="../manualpages/Sys/PetscFinalize.html">PetscFinalize</a>()`, `<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>`, `<a href="../manualpages/SNES/SNESParametersInitialize.html">SNESParametersInitialize</a>()`</font>
<a name="line1403">1403: </a><font color="#B22222">M*/</font>
<a name="line1404">1404: </a><strong><font color="#228B22">#define <a href="../manualpages/Sys/PetscObjectParameterDeclare.html">PetscObjectParameterDeclare</a>(type, NAME) type NAME, default_##NAME</font></strong>

<a name="line1406">1406: </a>#include <A href="../include/petscviewertypes.h.html">&lt;petscviewertypes.h&gt;</A>
<a name="line1407">1407: </a>#include <A href="../include/petscoptions.h.html">&lt;petscoptions.h&gt;</A>

<a name="line1409">1409: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscMallocTraceSet.html">PetscMallocTraceSet</a>(<a href="../manualpages/Viewer/PetscViewer.html">PetscViewer</a>, <a href="../manualpages/Sys/PetscBool.html">PetscBool</a>, <a href="../manualpages/Sys/PetscLogDouble.html">PetscLogDouble</a>)</font></strong>;
<a name="line1410">1410: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscMallocTraceGet.html">PetscMallocTraceGet</a>(<a href="../manualpages/Sys/PetscBool.html">PetscBool</a> *)</font></strong>;

<a name="line1412">1412: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscObjectsListGetGlobalNumbering.html">PetscObjectsListGetGlobalNumbering</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscObject.html">PetscObject</a>[], <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *)</font></strong>;

<a name="line1414">1414: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscMemoryView.html">PetscMemoryView</a>(<a href="../manualpages/Viewer/PetscViewer.html">PetscViewer</a>, const char[])</font></strong>;
<a name="line1415">1415: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscObjectPrintClassNamePrefixType.html">PetscObjectPrintClassNamePrefixType</a>(<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>, <a href="../manualpages/Viewer/PetscViewer.html">PetscViewer</a>)</font></strong>;
<a name="line1416">1416: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscObjectView.html">PetscObjectView</a>(<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>, <a href="../manualpages/Viewer/PetscViewer.html">PetscViewer</a>)</font></strong>;
<a name="line1417">1417: </a><strong><font color="#228B22">#define <a href="../manualpages/Sys/PetscObjectQueryFunction.html">PetscObjectQueryFunction</a>(obj, name, fptr) PetscObjectQueryFunction_Private((obj), (name), (<a href="../manualpages/Sys/PetscVoidFn.html">PetscVoidFn</a> **)(fptr))</font></strong>
<a name="line1418">1418: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscObjectHasFunction.html">PetscObjectHasFunction</a>(<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>, const char[], <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> *)</font></strong>;
<a name="line1419">1419: </a><strong><font color="#4169E1"><a name="PetscObjectQueryFunction_Private"></a>PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> PetscObjectQueryFunction_Private(<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>, const char[], void (**)(void)</font></strong>);
<a name="line1420">1420: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscObjectSetOptionsPrefix.html">PetscObjectSetOptionsPrefix</a>(<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>, const char[])</font></strong>;
<a name="line1421">1421: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscObjectAppendOptionsPrefix.html">PetscObjectAppendOptionsPrefix</a>(<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>, const char[])</font></strong>;
<a name="line1422">1422: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscObjectPrependOptionsPrefix.html">PetscObjectPrependOptionsPrefix</a>(<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>, const char[])</font></strong>;
<a name="line1423">1423: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscObjectGetOptionsPrefix.html">PetscObjectGetOptionsPrefix</a>(<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>, const char *[])</font></strong>;
<a name="line1424">1424: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> PetscObjectChangeTypeName(<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>, const char[])</font></strong>;
<a name="line1425">1425: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscObjectRegisterDestroy.html">PetscObjectRegisterDestroy</a>(<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>)</font></strong>;
<a name="line1426">1426: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscObjectRegisterDestroyAll.html">PetscObjectRegisterDestroyAll</a>(void)</font></strong>;
<a name="line1427">1427: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscObjectViewFromOptions.html">PetscObjectViewFromOptions</a>(<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>, <a href="../manualpages/Sys/PetscObject.html">PetscObject</a>, const char[])</font></strong>;
<a name="line1428">1428: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscObjectName.html">PetscObjectName</a>(<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>)</font></strong>;
<a name="line1429">1429: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscObjectTypeCompare.html">PetscObjectTypeCompare</a>(<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>, const char[], <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> *)</font></strong>;
<a name="line1430">1430: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscObjectObjectTypeCompare.html">PetscObjectObjectTypeCompare</a>(<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>, <a href="../manualpages/Sys/PetscObject.html">PetscObject</a>, <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> *)</font></strong>;
<a name="line1431">1431: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscObjectBaseTypeCompare.html">PetscObjectBaseTypeCompare</a>(<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>, const char[], <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> *)</font></strong>;
<a name="line1432">1432: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscObjectTypeCompareAny.html">PetscObjectTypeCompareAny</a>(<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>, <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> *, const char[], ...)</font></strong>;
<a name="line1433">1433: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscObjectBaseTypeCompareAny.html">PetscObjectBaseTypeCompareAny</a>(<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>, <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> *, const char[], ...)</font></strong>;
<a name="line1434">1434: </a><strong><font color="#4169E1"><a name="PetscRegisterFinalize"></a>PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscRegisterFinalize.html">PetscRegisterFinalize</a>(<a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> (*)(void)</font></strong>);
<a name="line1435">1435: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscRegisterFinalizeAll.html">PetscRegisterFinalizeAll</a>(void)</font></strong>;

<a name="line1437">1437: </a><font color="#A020F0">#if defined(PETSC_HAVE_SAWS)</font>
<a name="line1438">1438: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSAWsBlock.html">PetscSAWsBlock</a>(void)</font></strong>;
<a name="line1439">1439: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> PetscObjectSAWsViewOff(<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>)</font></strong>;
<a name="line1440">1440: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscObjectSAWsSetBlock.html">PetscObjectSAWsSetBlock</a>(<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>, <a href="../manualpages/Sys/PetscBool.html">PetscBool</a>)</font></strong>;
<a name="line1441">1441: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscObjectSAWsBlock.html">PetscObjectSAWsBlock</a>(<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>)</font></strong>;
<a name="line1442">1442: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscObjectSAWsGrantAccess.html">PetscObjectSAWsGrantAccess</a>(<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>)</font></strong>;
<a name="line1443">1443: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscObjectSAWsTakeAccess.html">PetscObjectSAWsTakeAccess</a>(<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>)</font></strong>;
<a name="line1444">1444: </a><strong><font color="#4169E1">PETSC_EXTERN void           <a href="../manualpages/Sys/PetscStackSAWsGrantAccess.html">PetscStackSAWsGrantAccess</a>(void)</font></strong>;
<a name="line1445">1445: </a><strong><font color="#4169E1">PETSC_EXTERN void           <a href="../manualpages/Sys/PetscStackSAWsTakeAccess.html">PetscStackSAWsTakeAccess</a>(void)</font></strong>;
<a name="line1446">1446: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> PetscStackViewSAWs(void)</font></strong>;
<a name="line1447">1447: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> PetscStackSAWsViewOff(void)</font></strong>;

<a name="line1449">1449: </a><font color="#A020F0">#else</font>
<a name="line1450">1450: </a><strong><font color="#228B22">  #define <a href="../manualpages/Sys/PetscSAWsBlock.html">PetscSAWsBlock</a>()                  <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_SUCCESS</a></font></strong>
<a name="line1451">1451: </a><strong><font color="#228B22">  #define PetscObjectSAWsViewOff(obj)       <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_SUCCESS</a></font></strong>
<a name="line1452">1452: </a><strong><font color="#228B22">  #define <a href="../manualpages/Sys/PetscObjectSAWsSetBlock.html">PetscObjectSAWsSetBlock</a>(obj, flg) <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_SUCCESS</a></font></strong>
<a name="line1453">1453: </a><strong><font color="#228B22">  #define <a href="../manualpages/Sys/PetscObjectSAWsBlock.html">PetscObjectSAWsBlock</a>(obj)         <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_SUCCESS</a></font></strong>
<a name="line1454">1454: </a><strong><font color="#228B22">  #define <a href="../manualpages/Sys/PetscObjectSAWsGrantAccess.html">PetscObjectSAWsGrantAccess</a>(obj)   <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_SUCCESS</a></font></strong>
<a name="line1455">1455: </a><strong><font color="#228B22">  #define <a href="../manualpages/Sys/PetscObjectSAWsTakeAccess.html">PetscObjectSAWsTakeAccess</a>(obj)    <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_SUCCESS</a></font></strong>
<a name="line1456">1456: </a><strong><font color="#228B22">  #define PetscStackViewSAWs()              <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_SUCCESS</a></font></strong>
<a name="line1457">1457: </a><strong><font color="#228B22">  #define PetscStackSAWsViewOff()           <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_SUCCESS</a></font></strong>
<a name="line1458">1458: </a><strong><font color="#228B22">  #define <a href="../manualpages/Sys/PetscStackSAWsTakeAccess.html">PetscStackSAWsTakeAccess</a>()</font></strong>
<a name="line1459">1459: </a><strong><font color="#228B22">  #define <a href="../manualpages/Sys/PetscStackSAWsGrantAccess.html">PetscStackSAWsGrantAccess</a>()</font></strong>

<a name="line1461">1461: </a><font color="#A020F0">#endif</font>

<a name="line1463">1463: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscDLOpen.html">PetscDLOpen</a>(const char[], PetscDLMode, PetscDLHandle *)</font></strong>;
<a name="line1464">1464: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscDLClose.html">PetscDLClose</a>(PetscDLHandle *)</font></strong>;
<a name="line1465">1465: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscDLSym.html">PetscDLSym</a>(PetscDLHandle, const char[], void **)</font></strong>;
<a name="line1466">1466: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscDLAddr.html">PetscDLAddr</a>(void (*)(void), char *[])</font></strong>;
<a name="line1467">1467: </a><font color="#A020F0">#ifdef PETSC_HAVE_CXX</font>
<a name="line1468">1468: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> PetscDemangleSymbol(const char *, char *[])</font></strong>;
<a name="line1469">1469: </a><font color="#A020F0">#endif</font>

<a name="line1471">1471: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscMallocGetStack.html">PetscMallocGetStack</a>(void *, PetscStack **)</font></strong>;

<a name="line1473">1473: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscObjectsDump.html">PetscObjectsDump</a>(FILE *, <a href="../manualpages/Sys/PetscBool.html">PetscBool</a>)</font></strong>;
<a name="line1474">1474: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscObjectsView.html">PetscObjectsView</a>(<a href="../manualpages/Viewer/PetscViewer.html">PetscViewer</a>)</font></strong>;
<a name="line1475">1475: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscObjectsGetObject.html">PetscObjectsGetObject</a>(const char *, <a href="../manualpages/Sys/PetscObject.html">PetscObject</a> *, const char *[])</font></strong>;
<a name="line1476">1476: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscObjectListDestroy.html">PetscObjectListDestroy</a>(<a href="../manualpages/Sys/PetscObjectList.html">PetscObjectList</a> *)</font></strong>;
<a name="line1477">1477: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscObjectListFind.html">PetscObjectListFind</a>(<a href="../manualpages/Sys/PetscObjectList.html">PetscObjectList</a>, const char[], <a href="../manualpages/Sys/PetscObject.html">PetscObject</a> *)</font></strong>;
<a name="line1478">1478: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscObjectListReverseFind.html">PetscObjectListReverseFind</a>(<a href="../manualpages/Sys/PetscObjectList.html">PetscObjectList</a>, <a href="../manualpages/Sys/PetscObject.html">PetscObject</a>, const char *[], <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> *)</font></strong>;
<a name="line1479">1479: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscObjectListAdd.html">PetscObjectListAdd</a>(<a href="../manualpages/Sys/PetscObjectList.html">PetscObjectList</a> *, const char[], <a href="../manualpages/Sys/PetscObject.html">PetscObject</a>)</font></strong>;
<a name="line1480">1480: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscObjectListRemoveReference.html">PetscObjectListRemoveReference</a>(<a href="../manualpages/Sys/PetscObjectList.html">PetscObjectList</a> *, const char[])</font></strong>;
<a name="line1481">1481: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscObjectListDuplicate.html">PetscObjectListDuplicate</a>(<a href="../manualpages/Sys/PetscObjectList.html">PetscObjectList</a>, <a href="../manualpages/Sys/PetscObjectList.html">PetscObjectList</a> *)</font></strong>;

<a name="line1483">1483: </a><font color="#B22222">/*</font>
<a name="line1484">1484: </a><font color="#B22222">    Dynamic library lists. Lists of names of routines in objects or in dynamic</font>
<a name="line1485">1485: </a><font color="#B22222">  link libraries that will be loaded as needed.</font>
<a name="line1486">1486: </a><font color="#B22222">*/</font>

<a name="line1488">1488: </a><strong><font color="#228B22">#define <a href="../manualpages/Sys/PetscFunctionListAdd.html">PetscFunctionListAdd</a>(list, name, fptr) PetscFunctionListAdd_Private((list), (name), (<a href="../manualpages/Sys/PetscVoidFn.html">PetscVoidFn</a> *)(fptr))</font></strong>
<a name="line1489">1489: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> PetscFunctionListAdd_Private(<a href="../manualpages/Sys/PetscFunctionList.html">PetscFunctionList</a> *, const char[], <a href="../manualpages/Sys/PetscVoidFn.html">PetscVoidFn</a> *)</font></strong>;
<a name="line1490">1490: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscFunctionListDestroy.html">PetscFunctionListDestroy</a>(<a href="../manualpages/Sys/PetscFunctionList.html">PetscFunctionList</a> *)</font></strong>;
<a name="line1491">1491: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscFunctionListClear.html">PetscFunctionListClear</a>(<a href="../manualpages/Sys/PetscFunctionList.html">PetscFunctionList</a>)</font></strong>;
<a name="line1492">1492: </a><strong><font color="#228B22">#define <a href="../manualpages/Sys/PetscFunctionListFind.html">PetscFunctionListFind</a>(list, name, fptr) PetscFunctionListFind_Private((list), (name), (<a href="../manualpages/Sys/PetscVoidFn.html">PetscVoidFn</a> **)(fptr))</font></strong>
<a name="line1493">1493: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> PetscFunctionListFind_Private(<a href="../manualpages/Sys/PetscFunctionList.html">PetscFunctionList</a>, const char[], <a href="../manualpages/Sys/PetscVoidFn.html">PetscVoidFn</a> **)</font></strong>;
<a name="line1494">1494: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscFunctionListPrintTypes.html">PetscFunctionListPrintTypes</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, FILE *, const char[], const char[], const char[], const char[], <a href="../manualpages/Sys/PetscFunctionList.html">PetscFunctionList</a>, const char[], const char[])</font></strong>;
<a name="line1495">1495: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscFunctionListDuplicate.html">PetscFunctionListDuplicate</a>(<a href="../manualpages/Sys/PetscFunctionList.html">PetscFunctionList</a>, <a href="../manualpages/Sys/PetscFunctionList.html">PetscFunctionList</a> *)</font></strong>;
<a name="line1496">1496: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscFunctionListView.html">PetscFunctionListView</a>(<a href="../manualpages/Sys/PetscFunctionList.html">PetscFunctionList</a>, <a href="../manualpages/Viewer/PetscViewer.html">PetscViewer</a>)</font></strong>;
<a name="line1497">1497: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscFunctionListGet.html">PetscFunctionListGet</a>(<a href="../manualpages/Sys/PetscFunctionList.html">PetscFunctionList</a>, const char ***, int *)</font></strong>;
<a name="line1498">1498: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscFunctionListPrintNonEmpty.html">PetscFunctionListPrintNonEmpty</a>(<a href="../manualpages/Sys/PetscFunctionList.html">PetscFunctionList</a>)</font></strong>;
<a name="line1499">1499: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> PetscFunctionListPrintAll(void)</font></strong>;

<a name="line1501">1501: </a>PETSC_EXTERN <a href="../manualpages/Sys/PetscDLLibrary.html">PetscDLLibrary</a> PetscDLLibrariesLoaded;
<a name="line1502">1502: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscDLLibraryAppend.html">PetscDLLibraryAppend</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, <a href="../manualpages/Sys/PetscDLLibrary.html">PetscDLLibrary</a> *, const char[])</font></strong>;
<a name="line1503">1503: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscDLLibraryPrepend.html">PetscDLLibraryPrepend</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, <a href="../manualpages/Sys/PetscDLLibrary.html">PetscDLLibrary</a> *, const char[])</font></strong>;
<a name="line1504">1504: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscDLLibrarySym.html">PetscDLLibrarySym</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, <a href="../manualpages/Sys/PetscDLLibrary.html">PetscDLLibrary</a> *, const char[], const char[], void **)</font></strong>;
<a name="line1505">1505: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> PetscDLLibraryPrintPath(<a href="../manualpages/Sys/PetscDLLibrary.html">PetscDLLibrary</a>)</font></strong>;
<a name="line1506">1506: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscDLLibraryRetrieve.html">PetscDLLibraryRetrieve</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, const char[], char *, size_t, <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> *)</font></strong>;
<a name="line1507">1507: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscDLLibraryOpen.html">PetscDLLibraryOpen</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, const char[], <a href="../manualpages/Sys/PetscDLLibrary.html">PetscDLLibrary</a> *)</font></strong>;
<a name="line1508">1508: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscDLLibraryClose.html">PetscDLLibraryClose</a>(<a href="../manualpages/Sys/PetscDLLibrary.html">PetscDLLibrary</a>)</font></strong>;

<a name="line1510">1510: </a><font color="#B22222">/*</font>
<a name="line1511">1511: </a><font color="#B22222">     Useful utility routines</font>
<a name="line1512">1512: </a><font color="#B22222">*/</font>
<a name="line1513">1513: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSplitOwnership.html">PetscSplitOwnership</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *)</font></strong>;
<a name="line1514">1514: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSplitOwnershipBlock.html">PetscSplitOwnershipBlock</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *)</font></strong>;
<a name="line1515">1515: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSplitOwnershipEqual.html">PetscSplitOwnershipEqual</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *)</font></strong>;
<a name="line1516">1516: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSequentialPhaseBegin.html">PetscSequentialPhaseBegin</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>)</font></strong>;
<a name="line1517">1517: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSequentialPhaseEnd.html">PetscSequentialPhaseEnd</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>)</font></strong>;
<a name="line1518">1518: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscBarrier.html">PetscBarrier</a>(<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>)</font></strong>;
<a name="line1519">1519: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscMPIDump.html">PetscMPIDump</a>(FILE *)</font></strong>;
<a name="line1520">1520: </a>PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscGlobalMinMaxInt.html">PetscGlobalMinMaxInt</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, const <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[2], <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[2]);
<a name="line1521">1521: </a>PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscGlobalMinMaxReal.html">PetscGlobalMinMaxReal</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[2], <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[2]);

<a name="line1523">1523: </a><font color="#B22222">/*MC</font>
<a name="line1524">1524: </a><font color="#B22222">    <a href="../manualpages/Sys/PetscNot.html">PetscNot</a> - negates a logical type value and returns result as a `<a href="../manualpages/Sys/PetscBool.html">PetscBool</a>`</font>

<a name="line1526">1526: </a><font color="#B22222">    Level: beginner</font>

<a name="line1528">1528: </a><font color="#B22222">    Note:</font>
<a name="line1529">1529: </a><font color="#B22222">    This is useful in cases like</font>
<a name="line1530">1530: </a><font color="#B22222">.vb</font>
<a name="line1531">1531: </a><font color="#B22222">     int        *a;</font>
<a name="line1532">1532: </a><font color="#B22222">     <a href="../manualpages/Sys/PetscBool.html">PetscBool</a>  flag = <a href="../manualpages/Sys/PetscNot.html">PetscNot</a>(a)</font>
<a name="line1533">1533: </a><font color="#B22222">.ve</font>
<a name="line1534">1534: </a><font color="#B22222">     where !a would not return a `<a href="../manualpages/Sys/PetscBool.html">PetscBool</a>` because we cannot provide a cast from int to `<a href="../manualpages/Sys/PetscBool.html">PetscBool</a>` in C.</font>

<a name="line1536">1536: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscBool.html">PetscBool</a>`, `<a href="../manualpages/Sys/PETSC_TRUE.html">PETSC_TRUE</a>`, `<a href="../manualpages/Sys/PETSC_FALSE.html">PETSC_FALSE</a>`</font>
<a name="line1537">1537: </a><font color="#B22222">M*/</font>
<a name="line1538">1538: </a><strong><font color="#228B22">#define <a href="../manualpages/Sys/PetscNot.html">PetscNot</a>(a) ((a) ? <a href="../manualpages/Sys/PETSC_FALSE.html">PETSC_FALSE</a> : <a href="../manualpages/Sys/PETSC_TRUE.html">PETSC_TRUE</a>)</font></strong>

<a name="line1540">1540: </a><font color="#B22222">/*MC</font>
<a name="line1541">1541: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscHelpPrintf.html">PetscHelpPrintf</a> - Prints help messages.</font>

<a name="line1543">1543: </a><font color="#B22222">   Synopsis:</font>
<a name="line1544">1544: </a>#include <A href="../include/petscsys.h.html">&lt;petscsys.h&gt;</A>
<a name="line1545">1545: </a><font color="#B22222">     <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> (*<a href="../manualpages/Sys/PetscHelpPrintf.html">PetscHelpPrintf</a>)(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a> comm, const char format[],args);</font>

<a name="line1547">1547: </a><font color="#B22222">   Not Collective, only applies on MPI rank 0; No Fortran Support</font>

<a name="line1549">1549: </a><font color="#B22222">   Input Parameters:</font>
<a name="line1550">1550: </a><font color="#B22222">+  comm - the MPI communicator over which the help message is printed</font>
<a name="line1551">1551: </a><font color="#B22222">.  format - the usual printf() format string</font>
<a name="line1552">1552: </a><font color="#B22222">-  args - arguments to be printed</font>

<a name="line1554">1554: </a><font color="#B22222">   Level: developer</font>

<a name="line1556">1556: </a><font color="#B22222">   Notes:</font>
<a name="line1557">1557: </a><font color="#B22222">   You can change how help messages are printed by replacing the function pointer with a function that does not simply write to stdout.</font>

<a name="line1559">1559: </a><font color="#B22222">   To use, write your own function, for example,</font>
<a name="line1560">1560: </a><font color="#B22222">.vb</font>
<a name="line1561">1561: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> mypetschelpprintf(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a> comm,const char format[],....)</font>
<a name="line1562">1562: </a><font color="#B22222">   {</font>
<a name="line1563">1563: </a><font color="#B22222">     <a href="../manualpages/Sys/PetscFunctionReturn.html">PetscFunctionReturn</a>(<a href="../manualpages/Sys/PetscErrorCode.html">PETSC_SUCCESS</a>);</font>
<a name="line1564">1564: </a><font color="#B22222">   }</font>
<a name="line1565">1565: </a><font color="#B22222">.ve</font>
<a name="line1566">1566: </a><font color="#B22222">then do the assignment</font>
<a name="line1567">1567: </a><font color="#B22222">.vb</font>
<a name="line1568">1568: </a><font color="#B22222">  <a href="../manualpages/Sys/PetscHelpPrintf.html">PetscHelpPrintf</a> = mypetschelpprintf;</font>
<a name="line1569">1569: </a><font color="#B22222">.ve</font>

<a name="line1571">1571: </a><font color="#B22222">  You can do the assignment before `<a href="../manualpages/Sys/PetscInitialize.html">PetscInitialize</a>()`.</font>

<a name="line1573">1573: </a><font color="#B22222">  The default routine used is called `PetscHelpPrintfDefault()`.</font>

<a name="line1575">1575: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscFPrintf.html">PetscFPrintf</a>()`, `<a href="../manualpages/Sys/PetscSynchronizedPrintf.html">PetscSynchronizedPrintf</a>()`, `<a href="../manualpages/Sys/PetscErrorPrintf.html">PetscErrorPrintf</a>()`, `PetscHelpPrintfDefault()`</font>
<a name="line1576">1576: </a><font color="#B22222">M*/</font>
<a name="line1577">1577: </a><strong><font color="#4169E1"><a name="PetscErrorCode"></a>PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> (*<a href="../manualpages/Sys/PetscHelpPrintf.html">PetscHelpPrintf</a>)(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, const char[], ...)</font></strong> <a href="../manualpages/Sys/PETSC_ATTRIBUTE_FORMAT.html">PETSC_ATTRIBUTE_FORMAT</a>(2, 3);

<a name="line1579">1579: </a><font color="#B22222">/*</font>
<a name="line1580">1580: </a><font color="#B22222">     Defines PETSc profiling.</font>
<a name="line1581">1581: </a><font color="#B22222">*/</font>
<a name="line1582">1582: </a>#include <A href="../include/petsclog.h.html">&lt;petsclog.h&gt;</A>

<a name="line1584">1584: </a><font color="#B22222">/*</font>
<a name="line1585">1585: </a><font color="#B22222">      Simple PETSc parallel IO for ASCII printing</font>
<a name="line1586">1586: </a><font color="#B22222">*/</font>
<a name="line1587">1587: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscFixFilename.html">PetscFixFilename</a>(const char[], char[])</font></strong>;
<a name="line1588">1588: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscFOpen.html">PetscFOpen</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, const char[], const char[], FILE **)</font></strong>;
<a name="line1589">1589: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscFClose.html">PetscFClose</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, FILE *)</font></strong>;
<a name="line1590">1590: </a><strong><font color="#4169E1"><a name="PetscFPrintf"></a>PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscFPrintf.html">PetscFPrintf</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, FILE *, const char[], ...)</font></strong> <a href="../manualpages/Sys/PETSC_ATTRIBUTE_FORMAT.html">PETSC_ATTRIBUTE_FORMAT</a>(3, 4);
<a name="line1591">1591: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscFFlush.html">PetscFFlush</a>(FILE *)</font></strong>;
<a name="line1592">1592: </a><strong><font color="#4169E1"><a name="PetscPrintf"></a>PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscPrintf.html">PetscPrintf</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, const char[], ...)</font></strong> <a href="../manualpages/Sys/PETSC_ATTRIBUTE_FORMAT.html">PETSC_ATTRIBUTE_FORMAT</a>(2, 3);
<a name="line1593">1593: </a><strong><font color="#4169E1"><a name="PetscSNPrintf"></a>PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSNPrintf.html">PetscSNPrintf</a>(char *, size_t, const char[], ...)</font></strong> <a href="../manualpages/Sys/PETSC_ATTRIBUTE_FORMAT.html">PETSC_ATTRIBUTE_FORMAT</a>(3, 4);
<a name="line1594">1594: </a><strong><font color="#4169E1"><a name="PetscSNPrintfCount"></a>PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSNPrintfCount.html">PetscSNPrintfCount</a>(char *, size_t, const char[], size_t *, ...)</font></strong> <a href="../manualpages/Sys/PETSC_ATTRIBUTE_FORMAT.html">PETSC_ATTRIBUTE_FORMAT</a>(3, 5);
<a name="line1595">1595: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> PetscFormatRealArray(char[], size_t, const char *, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[])</font></strong>;

<a name="line1597">1597: </a><strong><font color="#4169E1"><a name="PetscErrorPrintfDefault"></a>PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> PetscErrorPrintfDefault(const char[], ...)</font></strong> <a href="../manualpages/Sys/PETSC_ATTRIBUTE_FORMAT.html">PETSC_ATTRIBUTE_FORMAT</a>(1, 2);
<a name="line1598">1598: </a><strong><font color="#4169E1"><a name="PetscErrorPrintfNone"></a>PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> PetscErrorPrintfNone(const char[], ...)</font></strong> <a href="../manualpages/Sys/PETSC_ATTRIBUTE_FORMAT.html">PETSC_ATTRIBUTE_FORMAT</a>(1, 2);
<a name="line1599">1599: </a><strong><font color="#4169E1"><a name="PetscHelpPrintfDefault"></a>PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> PetscHelpPrintfDefault(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, const char[], ...)</font></strong> <a href="../manualpages/Sys/PETSC_ATTRIBUTE_FORMAT.html">PETSC_ATTRIBUTE_FORMAT</a>(2, 3);

<a name="line1601">1601: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscFormatConvertGetSize.html">PetscFormatConvertGetSize</a>(const char *, size_t *)</font></strong>;
<a name="line1602">1602: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscFormatConvert.html">PetscFormatConvert</a>(const char *, char *)</font></strong>;

<a name="line1604">1604: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscPOpen.html">PetscPOpen</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, const char[], const char[], const char[], FILE **)</font></strong>;
<a name="line1605">1605: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscPClose.html">PetscPClose</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, FILE *)</font></strong>;
<a name="line1606">1606: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscPOpenSetMachine.html">PetscPOpenSetMachine</a>(const char[])</font></strong>;

<a name="line1608">1608: </a><strong><font color="#4169E1"><a name="PetscSynchronizedPrintf"></a>PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSynchronizedPrintf.html">PetscSynchronizedPrintf</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, const char[], ...)</font></strong> <a href="../manualpages/Sys/PETSC_ATTRIBUTE_FORMAT.html">PETSC_ATTRIBUTE_FORMAT</a>(2, 3);
<a name="line1609">1609: </a><strong><font color="#4169E1"><a name="PetscSynchronizedFPrintf"></a>PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSynchronizedFPrintf.html">PetscSynchronizedFPrintf</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, FILE *, const char[], ...)</font></strong> <a href="../manualpages/Sys/PETSC_ATTRIBUTE_FORMAT.html">PETSC_ATTRIBUTE_FORMAT</a>(3, 4);
<a name="line1610">1610: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSynchronizedFlush.html">PetscSynchronizedFlush</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, FILE *)</font></strong>;
<a name="line1611">1611: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSynchronizedFGets.html">PetscSynchronizedFGets</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, FILE *, size_t, char[])</font></strong>;
<a name="line1612">1612: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscStartMatlab.html">PetscStartMatlab</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, const char[], const char[], FILE **)</font></strong>;
<a name="line1613">1613: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscGetPetscDir.html">PetscGetPetscDir</a>(const char *[])</font></strong>;

<a name="line1615">1615: </a><font color="#B22222">/*MC</font>
<a name="line1616">1616: </a><font color="#B22222">   <a href="../manualpages/Sys/PeCtx.html">PeCtx</a> - indicates an argument that returns a pointer to a user defined C struct (or Fortran derived type)</font>

<a name="line1618">1618: </a><font color="#B22222">   Level: developer</font>

<a name="line1620">1620: </a><font color="#B22222">   Notes:</font>
<a name="line1621">1621: </a><font color="#B22222">   This is not part of the PETSc public API and should only be used in PETSc source code.</font>

<a name="line1623">1623: </a><font color="#B22222">   This should not be used for functions that return PETSc objects, or pointers to arrays of unknown type. Thus it is used for, for example,</font>
<a name="line1624">1624: </a><font color="#B22222">   `<a href="../manualpages/KSP/KSPGetApplicationContext.html">KSPGetApplicationContext</a>()` but not used for `<a href="../manualpages/DMNetwork/DMNetworkGetComponent.html">DMNetworkGetComponent</a>()`</font>

<a name="line1626">1626: </a><font color="#B22222">   For pointers to arrays of unknown type and for functions that return PETSc internal objects that are opaque to users, such</font>
<a name="line1627">1627: </a><font color="#B22222">   as `<a href="../manualpages/KSP/KSPMonitorDynamicToleranceCreate.html">KSPMonitorDynamicToleranceCreate</a>()` a `void **` should be used.</font>

<a name="line1629">1629: </a><font color="#B22222">   Fortran Note:</font>
<a name="line1630">1630: </a><font color="#B22222">   Should only be used with user defined Fortran datatypes</font>
<a name="line1631">1631: </a><font color="#B22222">.vb</font>
<a name="line1632">1632: </a><font color="#B22222">   type(tUserType), pointer :: ctx</font>
<a name="line1633">1633: </a><font color="#B22222">.ve</font>

<a name="line1635">1635: </a><font color="#B22222">   Developer Note:</font>
<a name="line1636">1636: </a><font color="#B22222">   Put this in function declaration for the argument type instead of `void *`, or `void **`.</font>

<a name="line1638">1638: </a><font color="#B22222">   C compilers generate a warning or error if one passes a pointer to a pointer to a specific type (instead of `void`), for example,</font>
<a name="line1639">1639: </a><font color="#B22222">.vb</font>
<a name="line1640">1640: </a><font color="#B22222">   extern calledfunction(void **);</font>
<a name="line1641">1641: </a><font color="#B22222">   SomeCtx *ctx;</font>
<a name="line1642">1642: </a><font color="#B22222">   calledfunction(&amp;ctx);   &lt;&lt; warning that it is passing a pointer to a pointer to a SomeCtx instead of a void **</font>
<a name="line1643">1643: </a><font color="#B22222">.ve</font>
<a name="line1644">1644: </a><font color="#B22222">   By using the common practice of prototyping the function as</font>
<a name="line1645">1645: </a><font color="#B22222">.vb</font>
<a name="line1646">1646: </a><font color="#B22222">   extern calledfunction(void *);</font>
<a name="line1647">1647: </a><font color="#B22222">.ve</font>
<a name="line1648">1648: </a><font color="#B22222">   the warning message is averted. `<a href="../manualpages/Sys/PeCtx.html">PeCtx</a>` is used in PETSc source code so that the getAPI() code processor knows the argument is</font>
<a name="line1649">1649: </a><font color="#B22222">   actually handled internally as `void **` so it can generate correct bindings for other languages.</font>

<a name="line1651">1651: </a><font color="#B22222">.seealso: `PeOp`, `<a href="../manualpages/Sys/PeNS.html">PeNS</a>`, `<a href="../manualpages/Sys/PetscInitialize.html">PetscInitialize</a>()`</font>
<a name="line1652">1652: </a><font color="#B22222">M*/</font>
<a name="line1653">1653: </a><font color="#4169E1">typedef void *<a href="../manualpages/Sys/PeCtx.html">PeCtx</a>;</font>

<a name="line1655">1655: </a>PETSC_EXTERN <a href="../manualpages/Sys/PetscClassId.html">PetscClassId</a>   PETSC_CONTAINER_CLASSID;
<a name="line1656">1656: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscContainerGetPointer.html">PetscContainerGetPointer</a>(<a href="../manualpages/Sys/PetscContainer.html">PetscContainer</a>, void *)</font></strong>;
<a name="line1657">1657: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscContainerSetPointer.html">PetscContainerSetPointer</a>(<a href="../manualpages/Sys/PetscContainer.html">PetscContainer</a>, void *)</font></strong>;
<a name="line1658">1658: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscContainerDestroy.html">PetscContainerDestroy</a>(<a href="../manualpages/Sys/PetscContainer.html">PetscContainer</a> *)</font></strong>;
<a name="line1659">1659: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscContainerCreate.html">PetscContainerCreate</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, <a href="../manualpages/Sys/PetscContainer.html">PetscContainer</a> *)</font></strong>;
<a name="line1660">1660: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscContainerSetCtxDestroy.html">PetscContainerSetCtxDestroy</a>(<a href="../manualpages/Sys/PetscContainer.html">PetscContainer</a>, <a href="../manualpages/Sys/PetscCtxDestroyFn.html">PetscCtxDestroyFn</a> *)</font></strong>;
<a name="line1661">1661: </a>PETSC_EXTERN PETSC_DEPRECATED_FUNCTION(3, 23, 0, <font color="#666666">"<a href="../manualpages/Sys/PetscContainerSetCtxDestroy.html">PetscContainerSetCtxDestroy</a>()"</font>, ) <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscContainerSetUserDestroy.html">PetscContainerSetUserDestroy</a>(<a href="../manualpages/Sys/PetscContainer.html">PetscContainer</a>, <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> (*)(void *));
<a name="line1662">1662: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscObjectContainerCompose.html">PetscObjectContainerCompose</a>(<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>, const char *name, void *, <a href="../manualpages/Sys/PetscCtxDestroyFn.html">PetscCtxDestroyFn</a> *)</font></strong>;
<a name="line1663">1663: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscObjectContainerQuery.html">PetscObjectContainerQuery</a>(<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>, const char *, <a href="../manualpages/Sys/PeCtx.html">PeCtx</a>)</font></strong>;

<a name="line1665">1665: </a>PETSC_DEPRECATED_FUNCTION(3, 23, 0, <font color="#666666">"<a href="../manualpages/Sys/PetscCtxDestroyDefault.html">PetscCtxDestroyDefault</a>()"</font>, ) static inline <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> PetscContainerCtxDestroyDefault(void **a)
<a name="line1666">1666: </a>{
<a name="line1667">1667: </a>  <font color="#4169E1">return</font> <a href="../manualpages/Sys/PetscCtxDestroyDefault.html">PetscCtxDestroyDefault</a>(a);
<a name="line1668">1668: </a>}

<a name="line1670">1670: </a><font color="#B22222">/*</font>
<a name="line1671">1671: </a><font color="#B22222">   For use in debuggers</font>
<a name="line1672">1672: </a><font color="#B22222">*/</font>
<a name="line1673">1673: </a>PETSC_EXTERN <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>    PetscGlobalRank;
<a name="line1674">1674: </a>PETSC_EXTERN <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>    PetscGlobalSize;
<a name="line1675">1675: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscIntViewNumColumns.html">PetscIntViewNumColumns</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, const <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[], <a href="../manualpages/Viewer/PetscViewer.html">PetscViewer</a>)</font></strong>;
<a name="line1676">1676: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscRealViewNumColumns.html">PetscRealViewNumColumns</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], <a href="../manualpages/Viewer/PetscViewer.html">PetscViewer</a>)</font></strong>;
<a name="line1677">1677: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscScalarViewNumColumns.html">PetscScalarViewNumColumns</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, const <a href="../manualpages/Sys/PetscScalar.html">PetscScalar</a>[], <a href="../manualpages/Viewer/PetscViewer.html">PetscViewer</a>)</font></strong>;
<a name="line1678">1678: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscIntView.html">PetscIntView</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, const <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[], <a href="../manualpages/Viewer/PetscViewer.html">PetscViewer</a>)</font></strong>;
<a name="line1679">1679: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscRealView.html">PetscRealView</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], <a href="../manualpages/Viewer/PetscViewer.html">PetscViewer</a>)</font></strong>;
<a name="line1680">1680: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscScalarView.html">PetscScalarView</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, const <a href="../manualpages/Sys/PetscScalar.html">PetscScalar</a>[], <a href="../manualpages/Viewer/PetscViewer.html">PetscViewer</a>)</font></strong>;

<a name="line1682">1682: </a><font color="#B22222">/*</font>
<a name="line1683">1683: </a><font color="#B22222">    Basic memory and string operations. These are usually simple wrappers</font>
<a name="line1684">1684: </a><font color="#B22222">   around the basic Unix system calls, but a few of them have additional</font>
<a name="line1685">1685: </a><font color="#B22222">   functionality and/or error checking.</font>
<a name="line1686">1686: </a><font color="#B22222">*/</font>
<a name="line1687">1687: </a>#include <A href="../include/petscstring.h.html">&lt;petscstring.h&gt;</A>

<a name="line1689">1689: </a><font color="#A020F0">#include &lt;stddef.h&gt;</font>
<a name="line1690">1690: </a><font color="#A020F0">#include &lt;stdlib.h&gt;</font>

<a name="line1692">1692: </a><font color="#A020F0">#if defined(PETSC_CLANG_STATIC_ANALYZER)</font>
<a name="line1693">1693: </a><strong><font color="#228B22">  #define <a href="../manualpages/Sys/PetscPrefetchBlock.html">PetscPrefetchBlock</a>(a, b, c, d)</font></strong>
<a name="line1694">1694: </a><font color="#A020F0">#else</font>
<a name="line1695">1695: </a>  <font color="#B22222">/*MC</font>
<a name="line1696">1696: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscPrefetchBlock.html">PetscPrefetchBlock</a> - Prefetches a block of memory</font>

<a name="line1698">1698: </a><font color="#B22222">   Synopsis:</font>
<a name="line1699">1699: </a>#include <A href="../include/petscsys.h.html">&lt;petscsys.h&gt;</A>
<a name="line1700">1700: </a><font color="#B22222">    void <a href="../manualpages/Sys/PetscPrefetchBlock.html">PetscPrefetchBlock</a>(const anytype *a,size_t n,int rw,int t)</font>

<a name="line1702">1702: </a><font color="#B22222">   Not Collective</font>

<a name="line1704">1704: </a><font color="#B22222">   Input Parameters:</font>
<a name="line1705">1705: </a><font color="#B22222">+  a  - pointer to first element to fetch (any type but usually `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` or `<a href="../manualpages/Sys/PetscScalar.html">PetscScalar</a>`)</font>
<a name="line1706">1706: </a><font color="#B22222">.  n  - number of elements to fetch</font>
<a name="line1707">1707: </a><font color="#B22222">.  rw - 1 if the memory will be written to, otherwise 0 (ignored by many processors)</font>
<a name="line1708">1708: </a><font color="#B22222">-  t  - temporal locality (PETSC_PREFETCH_HINT_{NTA,T0,T1,T2}), see note</font>

<a name="line1710">1710: </a><font color="#B22222">   Level: developer</font>

<a name="line1712">1712: </a><font color="#B22222">   Notes:</font>
<a name="line1713">1713: </a><font color="#B22222">   The last two arguments (`rw` and `t`) must be compile-time constants.</font>

<a name="line1715">1715: </a><font color="#B22222">   Adopting Intel's x86/x86-64 conventions, there are four levels of temporal locality.  Not all architectures offer</font>
<a name="line1716">1716: </a><font color="#B22222">   equivalent locality hints, but the following macros are always defined to their closest analogue.</font>
<a name="line1717">1717: </a><font color="#B22222">+  `PETSC_PREFETCH_HINT_NTA` - Non-temporal.  Prefetches directly to L1, evicts to memory (skips higher level cache unless it was already there when prefetched).</font>
<a name="line1718">1718: </a><font color="#B22222">.  `PETSC_PREFETCH_HINT_T0`  - Fetch to all levels of cache and evict to the closest level.  Use this when the memory will be reused regularly despite necessary eviction from L1.</font>
<a name="line1719">1719: </a><font color="#B22222">.  `PETSC_PREFETCH_HINT_T1`  - Fetch to level 2 and higher (not L1).</font>
<a name="line1720">1720: </a><font color="#B22222">-  `PETSC_PREFETCH_HINT_T2`  - Fetch to high-level cache only.  (On many systems, T0 and T1 are equivalent.)</font>

<a name="line1722">1722: </a><font color="#B22222">   This function does nothing on architectures that do not support prefetch and never errors (even if passed an invalid</font>
<a name="line1723">1723: </a><font color="#B22222">   address).</font>

<a name="line1725">1725: </a><font color="#B22222">M*/</font>
<a name="line1726">1726: </a><strong><font color="#228B22">  #define <a href="../manualpages/Sys/PetscPrefetchBlock.html">PetscPrefetchBlock</a>(a, n, rw, t) \</font></strong>
<a name="line1727">1727: </a><strong><font color="#228B22">    do { \</font></strong>
<a name="line1728">1728: </a><strong><font color="#228B22">      const char *_p = (const char *)(a), *_end = (const char *)((a) + (n)); \</font></strong>
<a name="line1729">1729: </a><strong><font color="#228B22">      for (; _p &lt; _end; _p += PETSC_LEVEL1_DCACHE_LINESIZE) PETSC_Prefetch(_p, (rw), (t)); \</font></strong>
<a name="line1730">1730: </a><strong><font color="#228B22">    } while (0)</font></strong>
<a name="line1731">1731: </a><font color="#A020F0">#endif</font>
<a name="line1732">1732: </a><font color="#B22222">/*</font>
<a name="line1733">1733: </a><font color="#B22222">      Determine if some of the kernel computation routines use</font>
<a name="line1734">1734: </a><font color="#B22222">   Fortran (rather than C) for the numerical calculations. On some machines</font>
<a name="line1735">1735: </a><font color="#B22222">   and compilers (like complex numbers) the Fortran version of the routines</font>
<a name="line1736">1736: </a><font color="#B22222">   is faster than the C/C++ versions. The flag --with-fortran-kernels</font>
<a name="line1737">1737: </a><font color="#B22222">   should be used with ./configure to turn these on.</font>
<a name="line1738">1738: </a><font color="#B22222">*/</font>
<a name="line1739">1739: </a><font color="#A020F0">#if defined(PETSC_USE_FORTRAN_KERNELS)</font>

<a name="line1741">1741: </a><font color="#A020F0">  #if !defined(PETSC_USE_FORTRAN_KERNEL_MULTCRL)</font>
<a name="line1742">1742: </a><strong><font color="#228B22">    #define PETSC_USE_FORTRAN_KERNEL_MULTCRL</font></strong>
<a name="line1743">1743: </a><font color="#A020F0">  #endif</font>

<a name="line1745">1745: </a><font color="#A020F0">  #if !defined(PETSC_USE_FORTRAN_KERNEL_MULTAIJ)</font>
<a name="line1746">1746: </a><strong><font color="#228B22">    #define PETSC_USE_FORTRAN_KERNEL_MULTAIJ</font></strong>
<a name="line1747">1747: </a><font color="#A020F0">  #endif</font>

<a name="line1749">1749: </a><font color="#A020F0">  #if !defined(PETSC_USE_FORTRAN_KERNEL_MULTTRANSPOSEAIJ)</font>
<a name="line1750">1750: </a><strong><font color="#228B22">    #define PETSC_USE_FORTRAN_KERNEL_MULTTRANSPOSEAIJ</font></strong>
<a name="line1751">1751: </a><font color="#A020F0">  #endif</font>

<a name="line1753">1753: </a><font color="#A020F0">  #if !defined(PETSC_USE_FORTRAN_KERNEL_MAXPY)</font>
<a name="line1754">1754: </a><strong><font color="#228B22">    #define PETSC_USE_FORTRAN_KERNEL_MAXPY</font></strong>
<a name="line1755">1755: </a><font color="#A020F0">  #endif</font>

<a name="line1757">1757: </a><font color="#A020F0">  #if !defined(PETSC_USE_FORTRAN_KERNEL_SOLVEAIJ)</font>
<a name="line1758">1758: </a><strong><font color="#228B22">    #define PETSC_USE_FORTRAN_KERNEL_SOLVEAIJ</font></strong>
<a name="line1759">1759: </a><font color="#A020F0">  #endif</font>

<a name="line1761">1761: </a><font color="#A020F0">  #if !defined(PETSC_USE_FORTRAN_KERNEL_SOLVEBAIJ)</font>
<a name="line1762">1762: </a><strong><font color="#228B22">    #define PETSC_USE_FORTRAN_KERNEL_SOLVEBAIJ</font></strong>
<a name="line1763">1763: </a><font color="#A020F0">  #endif</font>

<a name="line1765">1765: </a><font color="#A020F0">  #if !defined(PETSC_USE_FORTRAN_KERNEL_MULTADDAIJ)</font>
<a name="line1766">1766: </a><strong><font color="#228B22">    #define PETSC_USE_FORTRAN_KERNEL_MULTADDAIJ</font></strong>
<a name="line1767">1767: </a><font color="#A020F0">  #endif</font>

<a name="line1769">1769: </a><font color="#A020F0">  #if !defined(PETSC_USE_FORTRAN_KERNEL_MDOT)</font>
<a name="line1770">1770: </a><strong><font color="#228B22">    #define PETSC_USE_FORTRAN_KERNEL_MDOT</font></strong>
<a name="line1771">1771: </a><font color="#A020F0">  #endif</font>

<a name="line1773">1773: </a><font color="#A020F0">  #if !defined(PETSC_USE_FORTRAN_KERNEL_XTIMESY)</font>
<a name="line1774">1774: </a><strong><font color="#228B22">    #define PETSC_USE_FORTRAN_KERNEL_XTIMESY</font></strong>
<a name="line1775">1775: </a><font color="#A020F0">  #endif</font>

<a name="line1777">1777: </a><font color="#A020F0">  #if !defined(PETSC_USE_FORTRAN_KERNEL_AYPX)</font>
<a name="line1778">1778: </a><strong><font color="#228B22">    #define PETSC_USE_FORTRAN_KERNEL_AYPX</font></strong>
<a name="line1779">1779: </a><font color="#A020F0">  #endif</font>

<a name="line1781">1781: </a><font color="#A020F0">  #if !defined(PETSC_USE_FORTRAN_KERNEL_WAXPY)</font>
<a name="line1782">1782: </a><strong><font color="#228B22">    #define PETSC_USE_FORTRAN_KERNEL_WAXPY</font></strong>
<a name="line1783">1783: </a><font color="#A020F0">  #endif</font>

<a name="line1785">1785: </a><font color="#A020F0">#endif</font>

<a name="line1787">1787: </a><font color="#B22222">/*</font>
<a name="line1788">1788: </a><font color="#B22222">    Macros for indicating code that should be compiled with a C interface,</font>
<a name="line1789">1789: </a><font color="#B22222">   rather than a C++ interface. Any routines that are dynamically loaded</font>
<a name="line1790">1790: </a><font color="#B22222">   (such as the PCCreate_XXX() routines) must be wrapped so that the name</font>
<a name="line1791">1791: </a><font color="#B22222">   mangler does not change the functions symbol name. This just hides the</font>
<a name="line1792">1792: </a><font color="#B22222">   ugly extern "C" {} wrappers.</font>
<a name="line1793">1793: </a><font color="#B22222">*/</font>
<a name="line1794">1794: </a><font color="#A020F0">#if defined(__cplusplus)</font>
<a name="line1795">1795: </a><strong><font color="#228B22">  #define EXTERN_C_BEGIN extern </font><font color="#666666">"C"</font><font color="#228B22"> {</font></strong>
<a name="line1796">1796: </a><strong><font color="#228B22">  #define EXTERN_C_END   }</font></strong>
<a name="line1797">1797: </a><font color="#A020F0">#else</font>
<a name="line1798">1798: </a><strong><font color="#228B22">  #define EXTERN_C_BEGIN</font></strong>
<a name="line1799">1799: </a><strong><font color="#228B22">  #define EXTERN_C_END</font></strong>
<a name="line1800">1800: </a><font color="#A020F0">#endif</font>

<a name="line1802">1802: </a><font color="#B22222">/*MC</font>
<a name="line1803">1803: </a><font color="#B22222">   <a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a> - the basic object used by MPI to determine which processes are involved in a</font>
<a name="line1804">1804: </a><font color="#B22222">   communication</font>

<a name="line1806">1806: </a><font color="#B22222">   Level: beginner</font>

<a name="line1808">1808: </a><font color="#B22222">   Note:</font>
<a name="line1809">1809: </a><font color="#B22222">   This manual page is a place-holder because MPICH does not have a manual page for `<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>`</font>

<a name="line1811">1811: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PETSC_COMM_WORLD.html">PETSC_COMM_WORLD</a>`, `<a href="../manualpages/Sys/PETSC_COMM_SELF.html">PETSC_COMM_SELF</a>`</font>
<a name="line1812">1812: </a><font color="#B22222">M*/</font>

<a name="line1814">1814: </a><font color="#A020F0">#if defined(PETSC_HAVE_MPIIO)</font>
<a name="line1815">1815: </a><strong><font color="#4169E1"><a name="MPIU_File_write_all"></a>PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> MPIU_File_write_all(MPI_File, void *, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>, MPI_Datatype, MPI_Status *)</font></strong> PETSC_ATTRIBUTE_MPI_POINTER_WITH_TYPE(2, 4);
<a name="line1816">1816: </a><strong><font color="#4169E1"><a name="MPIU_File_read_all"></a>PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> MPIU_File_read_all(MPI_File, void *, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>, MPI_Datatype, MPI_Status *)</font></strong> PETSC_ATTRIBUTE_MPI_POINTER_WITH_TYPE(2, 4);
<a name="line1817">1817: </a><strong><font color="#4169E1"><a name="MPIU_File_write_at"></a>PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> MPIU_File_write_at(MPI_File, MPI_Offset, void *, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>, MPI_Datatype, MPI_Status *)</font></strong> PETSC_ATTRIBUTE_MPI_POINTER_WITH_TYPE(3, 5);
<a name="line1818">1818: </a><strong><font color="#4169E1"><a name="MPIU_File_read_at"></a>PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> MPIU_File_read_at(MPI_File, MPI_Offset, void *, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>, MPI_Datatype, MPI_Status *)</font></strong> PETSC_ATTRIBUTE_MPI_POINTER_WITH_TYPE(3, 5);
<a name="line1819">1819: </a><strong><font color="#4169E1"><a name="MPIU_File_write_at_all"></a>PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> MPIU_File_write_at_all(MPI_File, MPI_Offset, void *, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>, MPI_Datatype, MPI_Status *)</font></strong> PETSC_ATTRIBUTE_MPI_POINTER_WITH_TYPE(3, 5);
<a name="line1820">1820: </a><strong><font color="#4169E1"><a name="MPIU_File_read_at_all"></a>PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> MPIU_File_read_at_all(MPI_File, MPI_Offset, void *, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>, MPI_Datatype, MPI_Status *)</font></strong> PETSC_ATTRIBUTE_MPI_POINTER_WITH_TYPE(3, 5);
<a name="line1821">1821: </a><font color="#A020F0">#endif</font>

<a name="line1823">1823: </a><font color="#A020F0">#if defined(PETSC_HAVE_MPI_COUNT)</font>
<a name="line1824">1824: </a><font color="#4169E1">typedef MPI_Count MPIU_Count;</font>
<a name="line1825">1825: </a><font color="#A020F0">#else</font>
<a name="line1826">1826: </a><font color="#4169E1">typedef PetscInt64 MPIU_Count;</font>
<a name="line1827">1827: </a><font color="#A020F0">#endif</font>

<a name="line1829">1829: </a><font color="#B22222">/*@C</font>
<a name="line1830">1830: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscIntCast.html">PetscIntCast</a> - casts a `MPI_Count`, `PetscInt64`, `<a href="../manualpages/Sys/PetscCount.html">PetscCount</a>`, or `size_t` to a `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` (which may be 32-bits in size), generates an</font>
<a name="line1831">1831: </a><font color="#B22222">   error if the `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` is not large enough to hold the number.</font>

<a name="line1833">1833: </a><font color="#B22222">   Not Collective; No Fortran Support</font>

<a name="line1835">1835: </a><font color="#B22222">   Input Parameter:</font>
<a name="line1836">1836: </a><font color="#B22222">.  a - the `PetscInt64` value</font>

<a name="line1838">1838: </a><font color="#B22222">   Output Parameter:</font>
<a name="line1839">1839: </a><font color="#B22222">.  b - the resulting `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` value, or `NULL` if the result is not needed</font>

<a name="line1841">1841: </a><font color="#B22222">   Level: advanced</font>

<a name="line1843">1843: </a><font color="#B22222">   Note:</font>
<a name="line1844">1844: </a><font color="#B22222">   If integers needed for the applications are too large to fit in 32-bit ints you can ./configure using `--with-64-bit-indices` to make `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` use 64-bit integers</font>

<a name="line1846">1846: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscBLASInt.html">PetscBLASInt</a>`, `<a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>`, `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>`, `<a href="../manualpages/Sys/PetscMPIIntCast.html">PetscMPIIntCast</a>()`, `<a href="../manualpages/Sys/PetscBLASIntCast.html">PetscBLASIntCast</a>()`, `<a href="../manualpages/Sys/PetscCIntCast.html">PetscCIntCast</a>()`, `<a href="../manualpages/Sys/PetscIntMultError.html">PetscIntMultError</a>()`, `<a href="../manualpages/Sys/PetscIntSumError.html">PetscIntSumError</a>()`</font>
<a name="line1847">1847: </a><font color="#B22222">@*/</font>
<a name="line1848">1848: </a><strong><font color="#4169E1"><a name="PetscIntCast"></a>static inline <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscIntCast.html">PetscIntCast</a>(MPIU_Count a, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *b)</font></strong>
<a name="line1849">1849: </a>{
<a name="line1850">1850: </a>  <a href="../manualpages/Sys/PetscFunctionBegin.html">PetscFunctionBegin</a>;
<a name="line1851">1851: </a>  <font color="#4169E1">if</font> (b) *b = 0; <font color="#B22222">/* to prevent compilers erroneously suggesting uninitialized variable */</font>
<a name="line1852">1852: </a>  <a href="../manualpages/Sys/PetscCheck.html">PetscCheck</a>(<font color="#4169E1">sizeof</font>(MPIU_Count) &lt;= <font color="#4169E1">sizeof</font>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>) || (a &lt;= (MPIU_Count)PETSC_INT_MAX &amp;&amp; a &gt;= (MPIU_Count)PETSC_INT_MIN), <a href="../manualpages/Sys/PETSC_COMM_SELF.html">PETSC_COMM_SELF</a>, <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_ARG_OUTOFRANGE</a>, <font color="#666666">"%"</font> PetscInt64_FMT <font color="#666666">" is too big for <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, you may need to ./configure using --with-64-bit-indices"</font>, (PetscInt64)a);
<a name="line1853">1853: </a>  <font color="#4169E1">if</font> (b) *b = (<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>)a;
<a name="line1854">1854: </a>  <a href="../manualpages/Sys/PetscFunctionReturn.html">PetscFunctionReturn</a>(<a href="../manualpages/Sys/PetscErrorCode.html">PETSC_SUCCESS</a>);
<a name="line1855">1855: </a>}

<a name="line1857">1857: </a><font color="#B22222">/*@C</font>
<a name="line1858">1858: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscBLASIntCast.html">PetscBLASIntCast</a> - casts a `MPI_Count`, `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>`, `<a href="../manualpages/Sys/PetscCount.html">PetscCount</a>` or `PetscInt64` to a `<a href="../manualpages/Sys/PetscBLASInt.html">PetscBLASInt</a>` (which may be 32-bits in size), generates an</font>
<a name="line1859">1859: </a><font color="#B22222">   error if the `<a href="../manualpages/Sys/PetscBLASInt.html">PetscBLASInt</a>` is not large enough to hold the number.</font>

<a name="line1861">1861: </a><font color="#B22222">   Not Collective; No Fortran Support</font>

<a name="line1863">1863: </a><font color="#B22222">   Input Parameter:</font>
<a name="line1864">1864: </a><font color="#B22222">.  a - the `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` value</font>

<a name="line1866">1866: </a><font color="#B22222">   Output Parameter:</font>
<a name="line1867">1867: </a><font color="#B22222">.  b - the resulting `<a href="../manualpages/Sys/PetscBLASInt.html">PetscBLASInt</a>` value, or `NULL` if the result is not needed</font>

<a name="line1869">1869: </a><font color="#B22222">   Level: advanced</font>

<a name="line1871">1871: </a><font color="#B22222">   Note:</font>
<a name="line1872">1872: </a><font color="#B22222">   Errors if the integer is negative since PETSc calls to BLAS/LAPACK never need to cast negative integer inputs</font>

<a name="line1874">1874: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscBLASInt.html">PetscBLASInt</a>`, `<a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>`, `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>`, `<a href="../manualpages/Sys/PetscMPIIntCast.html">PetscMPIIntCast</a>()`, `<a href="../manualpages/Sys/PetscCIntCast.html">PetscCIntCast</a>()`, `<a href="../manualpages/Sys/PetscIntCast.html">PetscIntCast</a>()`</font>
<a name="line1875">1875: </a><font color="#B22222">@*/</font>
<a name="line1876">1876: </a><strong><font color="#4169E1"><a name="PetscBLASIntCast"></a>static inline <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscBLASIntCast.html">PetscBLASIntCast</a>(MPIU_Count a, <a href="../manualpages/Sys/PetscBLASInt.html">PetscBLASInt</a> *b)</font></strong>
<a name="line1877">1877: </a>{
<a name="line1878">1878: </a>  <a href="../manualpages/Sys/PetscFunctionBegin.html">PetscFunctionBegin</a>;
<a name="line1879">1879: </a>  <font color="#4169E1">if</font> (b) *b = 0; <font color="#B22222">/* to prevent compilers erroneously suggesting uninitialized variable */</font>
<a name="line1880">1880: </a>  <a href="../manualpages/Sys/PetscCheck.html">PetscCheck</a>(<font color="#4169E1">sizeof</font>(MPIU_Count) &lt;= <font color="#4169E1">sizeof</font>(<a href="../manualpages/Sys/PetscBLASInt.html">PetscBLASInt</a>) || a &lt;= (MPIU_Count)PETSC_BLAS_INT_MAX, <a href="../manualpages/Sys/PETSC_COMM_SELF.html">PETSC_COMM_SELF</a>, <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_ARG_OUTOFRANGE</a>, <font color="#666666">"%"</font> PetscInt64_FMT <font color="#666666">" is too big for BLAS/LAPACK, which is restricted to 32-bit integers. Either you have an invalidly large integer error in your code or you must ./configure PETSc with --with-64-bit-blas-indices for the case you are running"</font>, (PetscInt64)a);
<a name="line1881">1881: </a>  <a href="../manualpages/Sys/PetscCheck.html">PetscCheck</a>(a &gt;= 0, <a href="../manualpages/Sys/PETSC_COMM_SELF.html">PETSC_COMM_SELF</a>, <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_ARG_OUTOFRANGE</a>, <font color="#666666">"Passing negative integer to BLAS/LAPACK routine"</font>);
<a name="line1882">1882: </a>  <font color="#4169E1">if</font> (b) *b = (<a href="../manualpages/Sys/PetscBLASInt.html">PetscBLASInt</a>)a;
<a name="line1883">1883: </a>  <a href="../manualpages/Sys/PetscFunctionReturn.html">PetscFunctionReturn</a>(<a href="../manualpages/Sys/PetscErrorCode.html">PETSC_SUCCESS</a>);
<a name="line1884">1884: </a>}

<a name="line1886">1886: </a><font color="#B22222">/*@C</font>
<a name="line1887">1887: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscCuBLASIntCast.html">PetscCuBLASIntCast</a> - like `<a href="../manualpages/Sys/PetscBLASIntCast.html">PetscBLASIntCast</a>()`, but for `<a href="../manualpages/Sys/PetscCuBLASInt.html">PetscCuBLASInt</a>`.</font>

<a name="line1889">1889: </a><font color="#B22222">   Not Collective; No Fortran Support</font>

<a name="line1891">1891: </a><font color="#B22222">   Input Parameter:</font>
<a name="line1892">1892: </a><font color="#B22222">.  a - the `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` value</font>

<a name="line1894">1894: </a><font color="#B22222">   Output Parameter:</font>
<a name="line1895">1895: </a><font color="#B22222">.  b - the resulting `<a href="../manualpages/Sys/PetscCuBLASInt.html">PetscCuBLASInt</a>` value, or `NULL` if the result is not needed</font>

<a name="line1897">1897: </a><font color="#B22222">   Level: advanced</font>

<a name="line1899">1899: </a><font color="#B22222">   Note:</font>
<a name="line1900">1900: </a><font color="#B22222">   Errors if the integer is negative since PETSc calls to cuBLAS and friends never need to cast negative integer inputs</font>

<a name="line1902">1902: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscCuBLASInt.html">PetscCuBLASInt</a>`, `<a href="../manualpages/Sys/PetscBLASInt.html">PetscBLASInt</a>`, `<a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>`, `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>`, `<a href="../manualpages/Sys/PetscBLASIntCast.html">PetscBLASIntCast</a>()`, `<a href="../manualpages/Sys/PetscMPIIntCast.html">PetscMPIIntCast</a>()`, `<a href="../manualpages/Sys/PetscCIntCast.html">PetscCIntCast</a>()`, `<a href="../manualpages/Sys/PetscIntCast.html">PetscIntCast</a>()`</font>
<a name="line1903">1903: </a><font color="#B22222">@*/</font>
<a name="line1904">1904: </a><strong><font color="#4169E1"><a name="PetscCuBLASIntCast"></a>static inline <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscCuBLASIntCast.html">PetscCuBLASIntCast</a>(MPIU_Count a, <a href="../manualpages/Sys/PetscCuBLASInt.html">PetscCuBLASInt</a> *b)</font></strong>
<a name="line1905">1905: </a>{
<a name="line1906">1906: </a>  <a href="../manualpages/Sys/PetscFunctionBegin.html">PetscFunctionBegin</a>;
<a name="line1907">1907: </a>  <font color="#4169E1">if</font> (b) *b = 0; <font color="#B22222">/* to prevent compilers erroneously suggesting uninitialized variable */</font>
<a name="line1908">1908: </a>  <a href="../manualpages/Sys/PetscCheck.html">PetscCheck</a>(<font color="#4169E1">sizeof</font>(MPIU_Count) &lt;= <font color="#4169E1">sizeof</font>(<a href="../manualpages/Sys/PetscCuBLASInt.html">PetscCuBLASInt</a>) || a &lt;= (MPIU_Count)PETSC_CUBLAS_INT_MAX, <a href="../manualpages/Sys/PETSC_COMM_SELF.html">PETSC_COMM_SELF</a>, <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_ARG_OUTOFRANGE</a>, <font color="#666666">"%"</font> PetscInt64_FMT <font color="#666666">" is too big for cuBLAS, which is restricted to 32-bit integers."</font>, (PetscInt64)a);
<a name="line1909">1909: </a>  <a href="../manualpages/Sys/PetscCheck.html">PetscCheck</a>(a &gt;= 0, <a href="../manualpages/Sys/PETSC_COMM_SELF.html">PETSC_COMM_SELF</a>, <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_ARG_OUTOFRANGE</a>, <font color="#666666">"Passing negative integer %"</font> PetscInt64_FMT <font color="#666666">"to cuBLAS routine"</font>, (PetscInt64)a);
<a name="line1910">1910: </a>  <font color="#4169E1">if</font> (b) *b = (<a href="../manualpages/Sys/PetscCuBLASInt.html">PetscCuBLASInt</a>)a;
<a name="line1911">1911: </a>  <a href="../manualpages/Sys/PetscFunctionReturn.html">PetscFunctionReturn</a>(<a href="../manualpages/Sys/PetscErrorCode.html">PETSC_SUCCESS</a>);
<a name="line1912">1912: </a>}

<a name="line1914">1914: </a><font color="#B22222">/*@C</font>
<a name="line1915">1915: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscHipBLASIntCast.html">PetscHipBLASIntCast</a> - like `<a href="../manualpages/Sys/PetscBLASIntCast.html">PetscBLASIntCast</a>()`, but for `<a href="../manualpages/Sys/PetscHipBLASInt.html">PetscHipBLASInt</a>`.</font>

<a name="line1917">1917: </a><font color="#B22222">   Not Collective; No Fortran Support</font>

<a name="line1919">1919: </a><font color="#B22222">   Input Parameter:</font>
<a name="line1920">1920: </a><font color="#B22222">.  a - the `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` value</font>

<a name="line1922">1922: </a><font color="#B22222">   Output Parameter:</font>
<a name="line1923">1923: </a><font color="#B22222">.  b - the resulting `<a href="../manualpages/Sys/PetscHipBLASInt.html">PetscHipBLASInt</a>` value, or `NULL` if the result is not needed</font>

<a name="line1925">1925: </a><font color="#B22222">   Level: advanced</font>

<a name="line1927">1927: </a><font color="#B22222">   Note:</font>
<a name="line1928">1928: </a><font color="#B22222">   Errors if the integer is negative since PETSc calls to hipBLAS and friends never need to cast negative integer inputs</font>

<a name="line1930">1930: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscHipBLASInt.html">PetscHipBLASInt</a>`, `<a href="../manualpages/Sys/PetscBLASInt.html">PetscBLASInt</a>`, `<a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>`, `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>`, `<a href="../manualpages/Sys/PetscBLASIntCast.html">PetscBLASIntCast</a>()`, `<a href="../manualpages/Sys/PetscMPIIntCast.html">PetscMPIIntCast</a>()`, `<a href="../manualpages/Sys/PetscCIntCast.html">PetscCIntCast</a>()`, `<a href="../manualpages/Sys/PetscIntCast.html">PetscIntCast</a>()`</font>
<a name="line1931">1931: </a><font color="#B22222">@*/</font>
<a name="line1932">1932: </a><strong><font color="#4169E1"><a name="PetscHipBLASIntCast"></a>static inline <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscHipBLASIntCast.html">PetscHipBLASIntCast</a>(MPIU_Count a, <a href="../manualpages/Sys/PetscHipBLASInt.html">PetscHipBLASInt</a> *b)</font></strong>
<a name="line1933">1933: </a>{
<a name="line1934">1934: </a>  <a href="../manualpages/Sys/PetscFunctionBegin.html">PetscFunctionBegin</a>;
<a name="line1935">1935: </a>  <font color="#4169E1">if</font> (b) *b = 0; <font color="#B22222">/* to prevent compilers erroneously suggesting uninitialized variable */</font>
<a name="line1936">1936: </a>  <a href="../manualpages/Sys/PetscCheck.html">PetscCheck</a>(<font color="#4169E1">sizeof</font>(MPIU_Count) &lt;= <font color="#4169E1">sizeof</font>(<a href="../manualpages/Sys/PetscHipBLASInt.html">PetscHipBLASInt</a>) || a &lt;= (MPIU_Count)PETSC_HIPBLAS_INT_MAX, <a href="../manualpages/Sys/PETSC_COMM_SELF.html">PETSC_COMM_SELF</a>, <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_ARG_OUTOFRANGE</a>, <font color="#666666">"%"</font> PetscInt64_FMT <font color="#666666">" is too big for hipBLAS, which is restricted to 32-bit integers."</font>, (PetscInt64)a);
<a name="line1937">1937: </a>  <a href="../manualpages/Sys/PetscCheck.html">PetscCheck</a>(a &gt;= 0, <a href="../manualpages/Sys/PETSC_COMM_SELF.html">PETSC_COMM_SELF</a>, <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_ARG_OUTOFRANGE</a>, <font color="#666666">"Passing negative integer %"</font> PetscInt64_FMT <font color="#666666">"to hipBLAS routine"</font>, (PetscInt64)a);
<a name="line1938">1938: </a>  <font color="#4169E1">if</font> (b) *b = (<a href="../manualpages/Sys/PetscHipBLASInt.html">PetscHipBLASInt</a>)a;
<a name="line1939">1939: </a>  <a href="../manualpages/Sys/PetscFunctionReturn.html">PetscFunctionReturn</a>(<a href="../manualpages/Sys/PetscErrorCode.html">PETSC_SUCCESS</a>);
<a name="line1940">1940: </a>}

<a name="line1942">1942: </a><font color="#B22222">/*@C</font>
<a name="line1943">1943: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscMPIIntCast.html">PetscMPIIntCast</a> - casts a `MPI_Count`, `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>`, `<a href="../manualpages/Sys/PetscCount.html">PetscCount</a>`, or `PetscInt64` to a `<a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>` (which is always 32-bits in size), generates an</font>
<a name="line1944">1944: </a><font color="#B22222">   error if the `<a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>` is not large enough to hold the number.</font>

<a name="line1946">1946: </a><font color="#B22222">   Not Collective; No Fortran Support</font>

<a name="line1948">1948: </a><font color="#B22222">   Input Parameter:</font>
<a name="line1949">1949: </a><font color="#B22222">.  a - the `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` value</font>

<a name="line1951">1951: </a><font color="#B22222">   Output Parameter:</font>
<a name="line1952">1952: </a><font color="#B22222">.  b - the resulting `<a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>` value, or `NULL` if the result is not needed</font>

<a name="line1954">1954: </a><font color="#B22222">   Level: advanced</font>

<a name="line1956">1956: </a><font color="#B22222">.seealso: [](stylePetscCount), `<a href="../manualpages/Sys/PetscBLASInt.html">PetscBLASInt</a>`, `<a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>`, `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>`, `<a href="../manualpages/Sys/PetscBLASIntCast.html">PetscBLASIntCast</a>()`, `<a href="../manualpages/Sys/PetscIntCast.html">PetscIntCast</a>()`</font>
<a name="line1957">1957: </a><font color="#B22222">@*/</font>
<a name="line1958">1958: </a><strong><font color="#4169E1"><a name="PetscMPIIntCast"></a>static inline <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscMPIIntCast.html">PetscMPIIntCast</a>(MPIU_Count a, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> *b)</font></strong>
<a name="line1959">1959: </a>{
<a name="line1960">1960: </a>  <a href="../manualpages/Sys/PetscFunctionBegin.html">PetscFunctionBegin</a>;
<a name="line1961">1961: </a>  <font color="#4169E1">if</font> (b) *b = 0; <font color="#B22222">/* to prevent compilers erroneously suggesting uninitialized variable */</font>
<a name="line1962">1962: </a>  <a href="../manualpages/Sys/PetscCheck.html">PetscCheck</a>(a &lt;= (MPIU_Count)PETSC_MPI_INT_MAX &amp;&amp; a &gt;= (MPIU_Count)PETSC_MPI_INT_MIN, <a href="../manualpages/Sys/PETSC_COMM_SELF.html">PETSC_COMM_SELF</a>, <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_ARG_OUTOFRANGE</a>, <font color="#666666">"%"</font> PetscInt64_FMT <font color="#666666">" is too big for MPI buffer length. Maximum supported value is %d"</font>, (PetscInt64)a, PETSC_MPI_INT_MAX);
<a name="line1963">1963: </a>  <font color="#4169E1">if</font> (b) *b = (<a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>)a;
<a name="line1964">1964: </a>  <a href="../manualpages/Sys/PetscFunctionReturn.html">PetscFunctionReturn</a>(<a href="../manualpages/Sys/PetscErrorCode.html">PETSC_SUCCESS</a>);
<a name="line1965">1965: </a>}

<a name="line1967">1967: </a><font color="#B22222">/*@C</font>
<a name="line1968">1968: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscCIntCast.html">PetscCIntCast</a> - casts a `MPI_Count`, `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>`, `<a href="../manualpages/Sys/PetscCount.html">PetscCount</a>`, or `PetscInt64` to a `int`, generates an error if the `int` is not large enough to hold the number.</font>

<a name="line1970">1970: </a><font color="#B22222">   Not Collective; No Fortran Support</font>

<a name="line1972">1972: </a><font color="#B22222">   Input Parameter:</font>
<a name="line1973">1973: </a><font color="#B22222">.  a - the `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` value</font>

<a name="line1975">1975: </a><font color="#B22222">   Output Parameter:</font>
<a name="line1976">1976: </a><font color="#B22222">.  b - the resulting `int` value, or `NULL` if the result is not needed</font>

<a name="line1978">1978: </a><font color="#B22222">   Level: advanced</font>

<a name="line1980">1980: </a><font color="#B22222">.seealso: [](stylePetscCount), `<a href="../manualpages/Sys/PetscBLASInt.html">PetscBLASInt</a>`, `<a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>`, `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>`, `<a href="../manualpages/Sys/PetscMPIIntCast.html">PetscMPIIntCast</a>()`, `<a href="../manualpages/Sys/PetscBLASIntCast.html">PetscBLASIntCast</a>()`, `<a href="../manualpages/Sys/PetscIntCast.html">PetscIntCast</a>()`</font>
<a name="line1981">1981: </a><font color="#B22222">@*/</font>
<a name="line1982">1982: </a><strong><font color="#4169E1"><a name="PetscCIntCast"></a>static inline <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscCIntCast.html">PetscCIntCast</a>(MPIU_Count a, int *b)</font></strong>
<a name="line1983">1983: </a>{
<a name="line1984">1984: </a>  <a href="../manualpages/Sys/PetscFunctionBegin.html">PetscFunctionBegin</a>;
<a name="line1985">1985: </a>  <font color="#4169E1">if</font> (b) *b = 0; <font color="#B22222">/* to prevent compilers erroneously suggesting uninitialized variable */</font>
<a name="line1986">1986: </a>  <a href="../manualpages/Sys/PetscCheck.html">PetscCheck</a>(a &lt;= INT_MAX &amp;&amp; a &gt;= INT_MIN, <a href="../manualpages/Sys/PETSC_COMM_SELF.html">PETSC_COMM_SELF</a>, <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_ARG_OUTOFRANGE</a>, <font color="#666666">"%"</font> PetscInt64_FMT <font color="#666666">" is too big to be casted to an int. Maximum supported value is %d"</font>, (PetscInt64)a, INT_MAX);
<a name="line1987">1987: </a>  <font color="#4169E1">if</font> (b) *b = (int)a;
<a name="line1988">1988: </a>  <a href="../manualpages/Sys/PetscFunctionReturn.html">PetscFunctionReturn</a>(<a href="../manualpages/Sys/PetscErrorCode.html">PETSC_SUCCESS</a>);
<a name="line1989">1989: </a>}

<a name="line1991">1991: </a><font color="#B22222">/*MC</font>
<a name="line1992">1992: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscInt64Mult.html">PetscInt64Mult</a> - Computes the product of two variables after casting them to `PetscInt64`.</font>

<a name="line1994">1994: </a><font color="#B22222">   Not Collective; No Fortran Support</font>

<a name="line1996">1996: </a><font color="#B22222">   Input Parameters:</font>
<a name="line1997">1997: </a><font color="#B22222">+  a - the first variable</font>
<a name="line1998">1998: </a><font color="#B22222">-  b - the second variable</font>

<a name="line2000">2000: </a><font color="#B22222">   Level: advanced</font>

<a name="line2002">2002: </a><font color="#B22222">.seealso: [](stylePetscCount), `<a href="../manualpages/Sys/PetscIntMultError.html">PetscIntMultError</a>()`, `<a href="../manualpages/Sys/PetscIntMultTruncate.html">PetscIntMultTruncate</a>()`</font>
<a name="line2003">2003: </a><font color="#B22222">M*/</font>
<a name="line2004">2004: </a><font color="#A020F0">#if defined(PETSC_USE_64BIT_INDICES)</font>
<a name="line2005">2005: </a><strong><font color="#228B22">  #define <a href="../manualpages/Sys/PetscInt64Mult.html">PetscInt64Mult</a>(a, b) ((a) * (b))</font></strong>
<a name="line2006">2006: </a><font color="#A020F0">#else</font>
<a name="line2007">2007: </a><strong><font color="#228B22">  #define <a href="../manualpages/Sys/PetscInt64Mult.html">PetscInt64Mult</a>(a, b) (((PetscInt64)(a)) * ((PetscInt64)(b)))</font></strong>
<a name="line2008">2008: </a><font color="#A020F0">#endif</font>

<a name="line2010">2010: </a><font color="#B22222">/*@C</font>
<a name="line2011">2011: </a><font color="#B22222">  <a href="../manualpages/Sys/PetscRealIntMultTruncate.html">PetscRealIntMultTruncate</a> - Computes the product of a positive `<a href="../manualpages/Sys/PetscReal.html">PetscReal</a>` and a positive</font>
<a name="line2012">2012: </a><font color="#B22222">  `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` and truncates the value to slightly less than the maximal possible value.</font>

<a name="line2014">2014: </a><font color="#B22222">  Not Collective; No Fortran Support</font>

<a name="line2016">2016: </a><font color="#B22222">  Input Parameters:</font>
<a name="line2017">2017: </a><font color="#B22222">+ a - The `<a href="../manualpages/Sys/PetscReal.html">PetscReal</a>` value</font>
<a name="line2018">2018: </a><font color="#B22222">- b - The `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` value</font>

<a name="line2020">2020: </a><font color="#B22222">  Level: advanced</font>

<a name="line2022">2022: </a><font color="#B22222">  Notes:</font>
<a name="line2023">2023: </a><font color="#B22222">  Returns the result as a `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` value.</font>

<a name="line2025">2025: </a><font color="#B22222">  Use `<a href="../manualpages/Sys/PetscInt64Mult.html">PetscInt64Mult</a>()` to compute the product of two `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` as a `PetscInt64`.</font>

<a name="line2027">2027: </a><font color="#B22222">  Use `<a href="../manualpages/Sys/PetscIntMultTruncate.html">PetscIntMultTruncate</a>()` to compute the product of two positive `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` and truncate</font>
<a name="line2028">2028: </a><font color="#B22222">  to fit a `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>`.</font>

<a name="line2030">2030: </a><font color="#B22222">  Use `<a href="../manualpages/Sys/PetscIntMultError.html">PetscIntMultError</a>()` to compute the product of two `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` if you wish to generate an</font>
<a name="line2031">2031: </a><font color="#B22222">  error if the result will not fit in a `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>`.</font>

<a name="line2033">2033: </a><font color="#B22222">  Developer Notes:</font>
<a name="line2034">2034: </a><font color="#B22222">  We currently assume that `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` addition can never overflow, this is obviously wrong but</font>
<a name="line2035">2035: </a><font color="#B22222">  requires many more checks.</font>

<a name="line2037">2037: </a><font color="#B22222">  This is used where we compute approximate sizes for workspace and need to insure the</font>
<a name="line2038">2038: </a><font color="#B22222">  workspace is index-able.</font>

<a name="line2040">2040: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscReal.html">PetscReal</a>`, `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>`, `<a href="../manualpages/Sys/PetscInt64Mult.html">PetscInt64Mult</a>()`, `<a href="../manualpages/Sys/PetscIntMultError.html">PetscIntMultError</a>()`, `<a href="../manualpages/Sys/PetscIntSumError.html">PetscIntSumError</a>()`</font>
<a name="line2041">2041: </a><font color="#B22222">@*/</font>
<a name="line2042">2042: </a><strong><font color="#4169E1"><a name="PetscRealIntMultTruncate"></a>static inline <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> <a href="../manualpages/Sys/PetscRealIntMultTruncate.html">PetscRealIntMultTruncate</a>(<a href="../manualpages/Sys/PetscReal.html">PetscReal</a> a, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> b)</font></strong>
<a name="line2043">2043: </a>{
<a name="line2044">2044: </a>  PetscInt64 r = (PetscInt64)(a * (<a href="../manualpages/Sys/PetscReal.html">PetscReal</a>)b);
<a name="line2045">2045: </a>  <font color="#4169E1">if</font> (r &gt; PETSC_INT_MAX - 100) r = PETSC_INT_MAX - 100;
<a name="line2046">2046: </a><font color="#A020F0">#if defined(PETSC_USE_64BIT_INDICES)</font>
<a name="line2047">2047: </a>  <font color="#4169E1">return</font> r;
<a name="line2048">2048: </a><font color="#A020F0">#else</font>
<a name="line2049">2049: </a>  <font color="#4169E1">return</font> (<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>)r;
<a name="line2050">2050: </a><font color="#A020F0">#endif</font>
<a name="line2051">2051: </a>}

<a name="line2053">2053: </a><font color="#B22222">/*@C</font>
<a name="line2054">2054: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscIntMultTruncate.html">PetscIntMultTruncate</a> - Computes the product of two positive `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` and truncates the value to slightly less than the maximal possible value</font>

<a name="line2056">2056: </a><font color="#B22222">   Not Collective; No Fortran Support</font>

<a name="line2058">2058: </a><font color="#B22222">   Input Parameters:</font>
<a name="line2059">2059: </a><font color="#B22222">+  a - the `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` value</font>
<a name="line2060">2060: </a><font color="#B22222">-  b - the second value</font>

<a name="line2062">2062: </a><font color="#B22222">   Returns:</font>
<a name="line2063">2063: </a><font color="#B22222">   The result as a `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` value</font>

<a name="line2065">2065: </a><font color="#B22222">   Level: advanced</font>

<a name="line2067">2067: </a><font color="#B22222">   Notes:</font>
<a name="line2068">2068: </a><font color="#B22222">   Use `<a href="../manualpages/Sys/PetscInt64Mult.html">PetscInt64Mult</a>()` to compute the product of two `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` as a `PetscInt64`</font>

<a name="line2070">2070: </a><font color="#B22222">   Use `<a href="../manualpages/Sys/PetscRealIntMultTruncate.html">PetscRealIntMultTruncate</a>()` to compute the product of a `<a href="../manualpages/Sys/PetscReal.html">PetscReal</a>` and a `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` and truncate to fit a `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>`</font>

<a name="line2072">2072: </a><font color="#B22222">   Use `<a href="../manualpages/Sys/PetscIntMultError.html">PetscIntMultError</a>()` to compute the product of two `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` if you wish to generate an error if the result will not fit in a `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>`</font>

<a name="line2074">2074: </a><font color="#B22222">   Developer Notes:</font>
<a name="line2075">2075: </a><font color="#B22222">   We currently assume that `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` addition can never overflow, this is obviously wrong but requires many more checks.</font>

<a name="line2077">2077: </a><font color="#B22222">   This is used where we compute approximate sizes for workspace and need to insure the workspace is index-able.</font>

<a name="line2079">2079: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscBLASInt.html">PetscBLASInt</a>`, `<a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>`, `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>`, `<a href="../manualpages/Sys/PetscBLASIntCast.html">PetscBLASIntCast</a>()`, `<a href="../manualpages/Sys/PetscInt64Mult.html">PetscInt64Mult</a>()`, `<a href="../manualpages/Sys/PetscIntMultError.html">PetscIntMultError</a>()`, `<a href="../manualpages/Sys/PetscIntSumError.html">PetscIntSumError</a>()`,</font>
<a name="line2080">2080: </a><font color="#B22222">          `<a href="../manualpages/Sys/PetscIntSumTruncate.html">PetscIntSumTruncate</a>()`</font>
<a name="line2081">2081: </a><font color="#B22222">@*/</font>
<a name="line2082">2082: </a><strong><font color="#4169E1"><a name="PetscIntMultTruncate"></a>static inline <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> <a href="../manualpages/Sys/PetscIntMultTruncate.html">PetscIntMultTruncate</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a> a, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> b)</font></strong>
<a name="line2083">2083: </a>{
<a name="line2084">2084: </a>  PetscInt64 r = <a href="../manualpages/Sys/PetscInt64Mult.html">PetscInt64Mult</a>(a, b);
<a name="line2085">2085: </a>  <font color="#4169E1">if</font> (r &gt; PETSC_INT_MAX - 100) r = PETSC_INT_MAX - 100;
<a name="line2086">2086: </a><font color="#A020F0">#if defined(PETSC_USE_64BIT_INDICES)</font>
<a name="line2087">2087: </a>  <font color="#4169E1">return</font> r;
<a name="line2088">2088: </a><font color="#A020F0">#else</font>
<a name="line2089">2089: </a>  <font color="#4169E1">return</font> (<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>)r;
<a name="line2090">2090: </a><font color="#A020F0">#endif</font>
<a name="line2091">2091: </a>}

<a name="line2093">2093: </a><font color="#B22222">/*@C</font>
<a name="line2094">2094: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscIntSumTruncate.html">PetscIntSumTruncate</a> - Computes the sum of two positive `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` and truncates the value to slightly less than the maximal possible value</font>

<a name="line2096">2096: </a><font color="#B22222">   Not Collective; No Fortran Support</font>

<a name="line2098">2098: </a><font color="#B22222">   Input Parameters:</font>
<a name="line2099">2099: </a><font color="#B22222">+  a - the `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` value</font>
<a name="line2100">2100: </a><font color="#B22222">-  b - the second value</font>

<a name="line2102">2102: </a><font color="#B22222">   Returns:</font>
<a name="line2103">2103: </a><font color="#B22222">   The result as a `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` value</font>

<a name="line2105">2105: </a><font color="#B22222">   Level: advanced</font>

<a name="line2107">2107: </a><font color="#B22222">   Notes:</font>
<a name="line2108">2108: </a><font color="#B22222">   Use `<a href="../manualpages/Sys/PetscInt64Mult.html">PetscInt64Mult</a>()` to compute the product of two `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` as a `PetscInt64`</font>

<a name="line2110">2110: </a><font color="#B22222">   Use `<a href="../manualpages/Sys/PetscRealIntMultTruncate.html">PetscRealIntMultTruncate</a>()` to compute the product of a `<a href="../manualpages/Sys/PetscReal.html">PetscReal</a>` and a `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` and truncate to fit a `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>`</font>

<a name="line2112">2112: </a><font color="#B22222">   Use `<a href="../manualpages/Sys/PetscIntMultError.html">PetscIntMultError</a>()` to compute the product of two `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` if you wish to generate an error if the result will not fit in a `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>`</font>

<a name="line2114">2114: </a><font color="#B22222">   Developer Note:</font>
<a name="line2115">2115: </a><font color="#B22222">   This is used where we compute approximate sizes for workspace and need to insure the workspace is index-able.</font>

<a name="line2117">2117: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscBLASInt.html">PetscBLASInt</a>`, `<a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>`, `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>`, `<a href="../manualpages/Sys/PetscBLASIntCast.html">PetscBLASIntCast</a>()`, `<a href="../manualpages/Sys/PetscInt64Mult.html">PetscInt64Mult</a>()`, `<a href="../manualpages/Sys/PetscIntMultError.html">PetscIntMultError</a>()`</font>
<a name="line2118">2118: </a><font color="#B22222">@*/</font>
<a name="line2119">2119: </a><strong><font color="#4169E1"><a name="PetscIntSumTruncate"></a>static inline <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> <a href="../manualpages/Sys/PetscIntSumTruncate.html">PetscIntSumTruncate</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a> a, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> b)</font></strong>
<a name="line2120">2120: </a>{
<a name="line2121">2121: </a>  PetscInt64 r = a;

<a name="line2123">2123: </a>  r += b;
<a name="line2124">2124: </a>  <font color="#4169E1">if</font> (r &gt; PETSC_INT_MAX - 100) r = PETSC_INT_MAX - 100;
<a name="line2125">2125: </a><font color="#A020F0">#if defined(PETSC_USE_64BIT_INDICES)</font>
<a name="line2126">2126: </a>  <font color="#4169E1">return</font> r;
<a name="line2127">2127: </a><font color="#A020F0">#else</font>
<a name="line2128">2128: </a>  <font color="#4169E1">return</font> (<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>)r;
<a name="line2129">2129: </a><font color="#A020F0">#endif</font>
<a name="line2130">2130: </a>}

<a name="line2132">2132: </a><font color="#B22222">/*@C</font>
<a name="line2133">2133: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscIntMultError.html">PetscIntMultError</a> - Computes the product of two positive `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` and generates an error with overflow.</font>

<a name="line2135">2135: </a><font color="#B22222">   Not Collective; No Fortran Support</font>

<a name="line2137">2137: </a><font color="#B22222">   Input Parameters:</font>
<a name="line2138">2138: </a><font color="#B22222">+  a - the `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` value</font>
<a name="line2139">2139: </a><font color="#B22222">-  b - the second value</font>

<a name="line2141">2141: </a><font color="#B22222">   Output Parameter:</font>
<a name="line2142">2142: </a><font color="#B22222">.  result - the result as a `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` value, or `NULL` if you do not want the result, you just want to check if it overflows</font>

<a name="line2144">2144: </a><font color="#B22222">   Level: advanced</font>

<a name="line2146">2146: </a><font color="#B22222">   Notes:</font>
<a name="line2147">2147: </a><font color="#B22222">   Use `<a href="../manualpages/Sys/PetscInt64Mult.html">PetscInt64Mult</a>()` to compute the product of two `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` and store in a `PetscInt64`</font>

<a name="line2149">2149: </a><font color="#B22222">   Use `<a href="../manualpages/Sys/PetscIntMultTruncate.html">PetscIntMultTruncate</a>()` to compute the product of two `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` and truncate it to fit in a `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>`</font>

<a name="line2151">2151: </a><font color="#B22222">   Developer Note:</font>
<a name="line2152">2152: </a><font color="#B22222">   In most places in the source code we currently assume that `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` addition does not overflow, this is obviously wrong but requires many more checks.</font>
<a name="line2153">2153: </a><font color="#B22222">   `<a href="../manualpages/Sys/PetscIntSumError.html">PetscIntSumError</a>()` can be used to check for this situation.</font>

<a name="line2155">2155: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscBLASInt.html">PetscBLASInt</a>`, `<a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>`, `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>`, `<a href="../manualpages/Sys/PetscBLASIntCast.html">PetscBLASIntCast</a>()`, `<a href="../manualpages/Sys/PetscInt64Mult.html">PetscInt64Mult</a>()`, `<a href="../manualpages/Sys/PetscIntSumError.html">PetscIntSumError</a>()`</font>
<a name="line2156">2156: </a><font color="#B22222">@*/</font>
<a name="line2157">2157: </a><strong><font color="#4169E1"><a name="PetscIntMultError"></a>static inline <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscIntMultError.html">PetscIntMultError</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a> a, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> b, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *result)</font></strong>
<a name="line2158">2158: </a>{
<a name="line2159">2159: </a>  PetscInt64 r = <a href="../manualpages/Sys/PetscInt64Mult.html">PetscInt64Mult</a>(a, b);

<a name="line2161">2161: </a>  <a href="../manualpages/Sys/PetscFunctionBegin.html">PetscFunctionBegin</a>;
<a name="line2162">2162: </a><font color="#A020F0">#if defined(PETSC_USE_64BIT_INDICES)</font>
<a name="line2163">2163: </a>  <font color="#4169E1">if</font> (result) *result = r;
<a name="line2164">2164: </a><font color="#A020F0">#else</font>
<a name="line2165">2165: </a>  <font color="#4169E1">if</font> (result) *result = (<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>)r;
<a name="line2166">2166: </a><font color="#A020F0">#endif</font>
<a name="line2167">2167: </a>  <font color="#4169E1">if</font> (!<a href="../manualpages/Sys/PetscDefined.html">PetscDefined</a>(USE_64BIT_INDICES)) {
<a name="line2168">2168: </a>    <a href="../manualpages/Sys/PetscCheck.html">PetscCheck</a>(r &lt;= PETSC_INT_MAX, <a href="../manualpages/Sys/PETSC_COMM_SELF.html">PETSC_COMM_SELF</a>, <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_SUP</a>, <font color="#666666">"Product of two integers %"</font> PetscInt_FMT <font color="#666666">" %"</font> PetscInt_FMT <font color="#666666">" overflow, either you have an invalidly large integer error in your code or you must ./configure PETSc with --with-64-bit-indices for the case you are running"</font>, a, b);
<a name="line2169">2169: </a>  }
<a name="line2170">2170: </a>  <a href="../manualpages/Sys/PetscFunctionReturn.html">PetscFunctionReturn</a>(<a href="../manualpages/Sys/PetscErrorCode.html">PETSC_SUCCESS</a>);
<a name="line2171">2171: </a>}

<a name="line2173">2173: </a><font color="#B22222">/*@C</font>

<a name="line2175">2175: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscIntSumError.html">PetscIntSumError</a> - Computes the sum of two positive `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` and generates an error with overflow.</font>

<a name="line2177">2177: </a><font color="#B22222">   Not Collective; No Fortran Support</font>

<a name="line2179">2179: </a><font color="#B22222">   Input Parameters:</font>
<a name="line2180">2180: </a><font color="#B22222">+  a - the `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` value</font>
<a name="line2181">2181: </a><font color="#B22222">-  b - the second value</font>

<a name="line2183">2183: </a><font color="#B22222">   Output Parameter:</font>
<a name="line2184">2184: </a><font color="#B22222">.  c - the result as a `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` value,  or `NULL` if you do not want the result, you just want to check if it overflows</font>

<a name="line2186">2186: </a><font color="#B22222">   Level: advanced</font>

<a name="line2188">2188: </a><font color="#B22222">   Notes:</font>
<a name="line2189">2189: </a><font color="#B22222">   Use `<a href="../manualpages/Sys/PetscInt64Mult.html">PetscInt64Mult</a>()` to compute the product of two 32-bit `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` and store in a `PetscInt64`</font>

<a name="line2191">2191: </a><font color="#B22222">   Use `<a href="../manualpages/Sys/PetscIntMultTruncate.html">PetscIntMultTruncate</a>()` to compute the product of two `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` and truncate it to fit in a `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>`</font>

<a name="line2193">2193: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscBLASInt.html">PetscBLASInt</a>`, `<a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>`, `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>`, `<a href="../manualpages/Sys/PetscBLASIntCast.html">PetscBLASIntCast</a>()`, `<a href="../manualpages/Sys/PetscInt64Mult.html">PetscInt64Mult</a>()`, `<a href="../manualpages/Sys/PetscIntMultError.html">PetscIntMultError</a>()`</font>
<a name="line2194">2194: </a><font color="#B22222">@*/</font>
<a name="line2195">2195: </a><strong><font color="#4169E1"><a name="PetscIntSumError"></a>static inline <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscIntSumError.html">PetscIntSumError</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a> a, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> b, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *result)</font></strong>
<a name="line2196">2196: </a>{
<a name="line2197">2197: </a>  PetscInt64 r = a;

<a name="line2199">2199: </a>  <a href="../manualpages/Sys/PetscFunctionBegin.html">PetscFunctionBegin</a>;
<a name="line2200">2200: </a>  r += b;
<a name="line2201">2201: </a><font color="#A020F0">#if defined(PETSC_USE_64BIT_INDICES)</font>
<a name="line2202">2202: </a>  <font color="#4169E1">if</font> (result) *result = r;
<a name="line2203">2203: </a><font color="#A020F0">#else</font>
<a name="line2204">2204: </a>  <font color="#4169E1">if</font> (result) *result = (<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>)r;
<a name="line2205">2205: </a><font color="#A020F0">#endif</font>
<a name="line2206">2206: </a>  <font color="#4169E1">if</font> (!<a href="../manualpages/Sys/PetscDefined.html">PetscDefined</a>(USE_64BIT_INDICES)) {
<a name="line2207">2207: </a>    <a href="../manualpages/Sys/PetscCheck.html">PetscCheck</a>(r &lt;= PETSC_INT_MAX, <a href="../manualpages/Sys/PETSC_COMM_SELF.html">PETSC_COMM_SELF</a>, <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_SUP</a>, <font color="#666666">"Sum of two integers %"</font> PetscInt_FMT <font color="#666666">" %"</font> PetscInt_FMT <font color="#666666">" overflow, either you have an invalidly large integer error in your code or you must ./configure PETSc with --with-64-bit-indices for the case you are running"</font>, a, b);
<a name="line2208">2208: </a>  }
<a name="line2209">2209: </a>  <a href="../manualpages/Sys/PetscFunctionReturn.html">PetscFunctionReturn</a>(<a href="../manualpages/Sys/PetscErrorCode.html">PETSC_SUCCESS</a>);
<a name="line2210">2210: </a>}

<a name="line2212">2212: </a><font color="#B22222">/*</font>
<a name="line2213">2213: </a><font color="#B22222">     The IBM include files define hz, here we hide it so that it may be used as a regular user variable.</font>
<a name="line2214">2214: </a><font color="#B22222">*/</font>
<a name="line2215">2215: </a><font color="#A020F0">#if defined(hz)</font>
<a name="line2216">2216: </a><strong><font color="#228B22">  #undef hz</font></strong>
<a name="line2217">2217: </a><font color="#A020F0">#endif</font>

<a name="line2219">2219: </a><font color="#A020F0">#if defined(PETSC_HAVE_SYS_TYPES_H)</font>
<a name="line2220">2220: </a><font color="#A020F0">  #include &lt;sys/types.h&gt;</font>
<a name="line2221">2221: </a><font color="#A020F0">#endif</font>

<a name="line2223">2223: </a><font color="#B22222">/*MC</font>

<a name="line2225">2225: </a><font color="#B22222">    <a href="../manualpages/Sys/PETSC_VERSION.html">PETSC_VERSION</a> - This manual page provides information about how PETSc documents and uses its version information. This information is available to both C/C++</font>
<a name="line2226">2226: </a><font color="#B22222">                    and Fortran compilers when `petscsys.h` is included.</font>

<a name="line2228">2228: </a><font color="#B22222">    The current PETSc version and the API for accessing it are defined in &lt;A HREF="../include/petscversion.h.html"&gt;include/petscversion.html&lt;/A&gt;</font>

<a name="line2230">2230: </a><font color="#B22222">    The complete version number is given as the triple  PETSC_VERSION_MAJOR.PETSC_VERSION_MINOR.PETSC_VERSION_SUBMINOR (in short hand x.y.z)</font>

<a name="line2232">2232: </a><font color="#B22222">    A change in the minor version number (y) indicates possible/likely changes in the PETSc API. Note this is different than with the semantic versioning convention</font>
<a name="line2233">2233: </a><font color="#B22222">    where only a change in the major version number (x) indicates a change in the API.</font>

<a name="line2235">2235: </a><font color="#B22222">    A subminor greater than zero indicates a patch release. Version x.y.z maintains source and binary compatibility with version x.y.w for all z and w</font>

<a name="line2237">2237: </a><font color="#B22222">    Use the macros PETSC_VERSION_EQ(x,y,z), PETSC_VERSION_LT(x,y,z), PETSC_VERSION_LE(x,y,z), PETSC_VERSION_GT(x,y,z),</font>
<a name="line2238">2238: </a><font color="#B22222">    PETSC_VERSION_GE(x,y,z) to determine if the current version is equal to, less than, less than or equal to, greater than or greater than or equal to a given</font>
<a name="line2239">2239: </a><font color="#B22222">    version number (x.y.z).</font>

<a name="line2241">2241: </a><font color="#B22222">    `PETSC_RELEASE_DATE` is the date the x.y version was released (i.e. the version before any patch releases)</font>

<a name="line2243">2243: </a><font color="#B22222">    `PETSC_VERSION_DATE` is the date the x.y.z version was released</font>

<a name="line2245">2245: </a><font color="#B22222">    `PETSC_VERSION_GIT` is the last git commit to the repository given in the form vx.y.z-wwwww</font>

<a name="line2247">2247: </a><font color="#B22222">    `PETSC_VERSION_DATE_GIT` is the date of the last git commit to the repository</font>

<a name="line2249">2249: </a><font color="#B22222">    `PETSC_VERSION_()` is deprecated and will eventually be removed.</font>

<a name="line2251">2251: </a><font color="#B22222">    Level: intermediate</font>
<a name="line2252">2252: </a><font color="#B22222">M*/</font>

<a name="line2254">2254: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscGetArchType.html">PetscGetArchType</a>(char[], size_t)</font></strong>;
<a name="line2255">2255: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscGetHostName.html">PetscGetHostName</a>(char[], size_t)</font></strong>;
<a name="line2256">2256: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscGetUserName.html">PetscGetUserName</a>(char[], size_t)</font></strong>;
<a name="line2257">2257: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscGetProgramName.html">PetscGetProgramName</a>(char[], size_t)</font></strong>;
<a name="line2258">2258: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> PetscSetProgramName(const char[])</font></strong>;
<a name="line2259">2259: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscGetDate.html">PetscGetDate</a>(char[], size_t)</font></strong>;
<a name="line2260">2260: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscGetVersion.html">PetscGetVersion</a>(char[], size_t)</font></strong>;
<a name="line2261">2261: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscGetVersionNumber.html">PetscGetVersionNumber</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *)</font></strong>;

<a name="line2263">2263: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSortedInt.html">PetscSortedInt</a>(<a href="../manualpages/Sys/PetscCount.html">PetscCount</a>, const <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[], <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> *)</font></strong>;
<a name="line2264">2264: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSortedInt64.html">PetscSortedInt64</a>(<a href="../manualpages/Sys/PetscCount.html">PetscCount</a>, const PetscInt64[], <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> *)</font></strong>;
<a name="line2265">2265: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSortedMPIInt.html">PetscSortedMPIInt</a>(<a href="../manualpages/Sys/PetscCount.html">PetscCount</a>, const <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>[], <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> *)</font></strong>;
<a name="line2266">2266: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSortedReal.html">PetscSortedReal</a>(<a href="../manualpages/Sys/PetscCount.html">PetscCount</a>, const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> *)</font></strong>;
<a name="line2267">2267: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSortInt.html">PetscSortInt</a>(<a href="../manualpages/Sys/PetscCount.html">PetscCount</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[])</font></strong>;
<a name="line2268">2268: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSortInt64.html">PetscSortInt64</a>(<a href="../manualpages/Sys/PetscCount.html">PetscCount</a>, PetscInt64[])</font></strong>;
<a name="line2269">2269: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSortCount.html">PetscSortCount</a>(<a href="../manualpages/Sys/PetscCount.html">PetscCount</a>, <a href="../manualpages/Sys/PetscCount.html">PetscCount</a>[])</font></strong>;
<a name="line2270">2270: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSortReverseInt.html">PetscSortReverseInt</a>(<a href="../manualpages/Sys/PetscCount.html">PetscCount</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[])</font></strong>;
<a name="line2271">2271: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSortedRemoveDupsInt.html">PetscSortedRemoveDupsInt</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[])</font></strong>;
<a name="line2272">2272: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSortedCheckDupsInt.html">PetscSortedCheckDupsInt</a>(<a href="../manualpages/Sys/PetscCount.html">PetscCount</a>, const <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[], <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> *)</font></strong>;
<a name="line2273">2273: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSortedCheckDupsCount.html">PetscSortedCheckDupsCount</a>(<a href="../manualpages/Sys/PetscCount.html">PetscCount</a>, const <a href="../manualpages/Sys/PetscCount.html">PetscCount</a>[], <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> *)</font></strong>;
<a name="line2274">2274: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSortRemoveDupsInt.html">PetscSortRemoveDupsInt</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[])</font></strong>;
<a name="line2275">2275: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscCheckDupsInt.html">PetscCheckDupsInt</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, const <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[], <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> *)</font></strong>;
<a name="line2276">2276: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscFindInt.html">PetscFindInt</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscCount.html">PetscCount</a>, const <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[], <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *)</font></strong>;
<a name="line2277">2277: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscFindMPIInt.html">PetscFindMPIInt</a>(<a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>, <a href="../manualpages/Sys/PetscCount.html">PetscCount</a>, const <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>[], <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *)</font></strong>;
<a name="line2278">2278: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscFindCount.html">PetscFindCount</a>(<a href="../manualpages/Sys/PetscCount.html">PetscCount</a>, <a href="../manualpages/Sys/PetscCount.html">PetscCount</a>, const <a href="../manualpages/Sys/PetscCount.html">PetscCount</a>[], <a href="../manualpages/Sys/PetscCount.html">PetscCount</a> *)</font></strong>;
<a name="line2279">2279: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSortIntWithPermutation.html">PetscSortIntWithPermutation</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, const <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[], <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[])</font></strong>;
<a name="line2280">2280: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSortStrWithPermutation.html">PetscSortStrWithPermutation</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, const char *[], <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[])</font></strong>;
<a name="line2281">2281: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSortIntWithArray.html">PetscSortIntWithArray</a>(<a href="../manualpages/Sys/PetscCount.html">PetscCount</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[], <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[])</font></strong>;
<a name="line2282">2282: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSortIntWithCountArray.html">PetscSortIntWithCountArray</a>(<a href="../manualpages/Sys/PetscCount.html">PetscCount</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[], <a href="../manualpages/Sys/PetscCount.html">PetscCount</a>[])</font></strong>;
<a name="line2283">2283: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSortIntWithMPIIntArray.html">PetscSortIntWithMPIIntArray</a>(<a href="../manualpages/Sys/PetscCount.html">PetscCount</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[], <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>[])</font></strong>;
<a name="line2284">2284: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSortIntWithArrayPair.html">PetscSortIntWithArrayPair</a>(<a href="../manualpages/Sys/PetscCount.html">PetscCount</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[], <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[], <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[])</font></strong>;
<a name="line2285">2285: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSortIntWithIntCountArrayPair.html">PetscSortIntWithIntCountArrayPair</a>(<a href="../manualpages/Sys/PetscCount.html">PetscCount</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[], <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[], <a href="../manualpages/Sys/PetscCount.html">PetscCount</a>[])</font></strong>;
<a name="line2286">2286: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSortMPIInt.html">PetscSortMPIInt</a>(<a href="../manualpages/Sys/PetscCount.html">PetscCount</a>, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>[])</font></strong>;
<a name="line2287">2287: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSortRemoveDupsMPIInt.html">PetscSortRemoveDupsMPIInt</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>[])</font></strong>;
<a name="line2288">2288: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSortMPIIntWithArray.html">PetscSortMPIIntWithArray</a>(<a href="../manualpages/Sys/PetscCount.html">PetscCount</a>, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>[], <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>[])</font></strong>;
<a name="line2289">2289: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSortMPIIntWithIntArray.html">PetscSortMPIIntWithIntArray</a>(<a href="../manualpages/Sys/PetscCount.html">PetscCount</a>, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>[], <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[])</font></strong>;
<a name="line2290">2290: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSortIntWithScalarArray.html">PetscSortIntWithScalarArray</a>(<a href="../manualpages/Sys/PetscCount.html">PetscCount</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[], <a href="../manualpages/Sys/PetscScalar.html">PetscScalar</a>[])</font></strong>;
<a name="line2291">2291: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSortIntWithDataArray.html">PetscSortIntWithDataArray</a>(<a href="../manualpages/Sys/PetscCount.html">PetscCount</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[], void *, size_t, void *)</font></strong>;
<a name="line2292">2292: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSortReal.html">PetscSortReal</a>(<a href="../manualpages/Sys/PetscCount.html">PetscCount</a>, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[])</font></strong>;
<a name="line2293">2293: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSortRealWithArrayInt.html">PetscSortRealWithArrayInt</a>(<a href="../manualpages/Sys/PetscCount.html">PetscCount</a>, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[])</font></strong>;
<a name="line2294">2294: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSortRealWithPermutation.html">PetscSortRealWithPermutation</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[])</font></strong>;
<a name="line2295">2295: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSortRemoveDupsReal.html">PetscSortRemoveDupsReal</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[])</font></strong>;
<a name="line2296">2296: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscFindReal.html">PetscFindReal</a>(<a href="../manualpages/Sys/PetscReal.html">PetscReal</a>, <a href="../manualpages/Sys/PetscCount.html">PetscCount</a>, const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *)</font></strong>;
<a name="line2297">2297: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSortSplit.html">PetscSortSplit</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscScalar.html">PetscScalar</a>[], <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[])</font></strong>;
<a name="line2298">2298: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSortSplitReal.html">PetscSortSplitReal</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[])</font></strong>;
<a name="line2299">2299: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscProcessTree.html">PetscProcessTree</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, const <a href="../manualpages/Sys/PetscBool.html">PetscBool</a>[], const <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[], <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *[], <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *[], <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *[], <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *[])</font></strong>;
<a name="line2300">2300: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscMergeIntArrayPair.html">PetscMergeIntArrayPair</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, const <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[], const <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[], <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, const <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[], const <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[], <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *[], <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *[])</font></strong>;
<a name="line2301">2301: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscMergeIntArray.html">PetscMergeIntArray</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, const <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[], <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, const <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[], <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *[])</font></strong>;
<a name="line2302">2302: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscMergeMPIIntArray.html">PetscMergeMPIIntArray</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, const <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>[], <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, const <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>[], <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> *[])</font></strong>;
<a name="line2303">2303: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscParallelSortedInt.html">PetscParallelSortedInt</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, const <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[], <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> *)</font></strong>;

<a name="line2305">2305: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscTimSort.html">PetscTimSort</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, void *, size_t, int (*)(const void *, const void *, void *), void *)</font></strong>;
<a name="line2306">2306: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscIntSortSemiOrdered.html">PetscIntSortSemiOrdered</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[])</font></strong>;
<a name="line2307">2307: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscMPIIntSortSemiOrdered.html">PetscMPIIntSortSemiOrdered</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>[])</font></strong>;
<a name="line2308">2308: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscRealSortSemiOrdered.html">PetscRealSortSemiOrdered</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[])</font></strong>;
<a name="line2309">2309: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscTimSortWithArray.html">PetscTimSortWithArray</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, void *, size_t, void *, size_t, int (*)(const void *, const void *, void *), void *)</font></strong>;
<a name="line2310">2310: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscIntSortSemiOrderedWithArray.html">PetscIntSortSemiOrderedWithArray</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[], <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[])</font></strong>;
<a name="line2311">2311: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscMPIIntSortSemiOrderedWithArray.html">PetscMPIIntSortSemiOrderedWithArray</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>[], <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>[])</font></strong>;
<a name="line2312">2312: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscRealSortSemiOrderedWithArrayInt.html">PetscRealSortSemiOrderedWithArrayInt</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[])</font></strong>;

<a name="line2314">2314: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> PetscSetDisplay(void)</font></strong>;
<a name="line2315">2315: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscGetDisplay.html">PetscGetDisplay</a>(char[], size_t)</font></strong>;

<a name="line2317">2317: </a><font color="#B22222">/*J</font>
<a name="line2318">2318: </a><font color="#B22222">    <a href="../manualpages/Sys/PetscRandomType.html">PetscRandomType</a> - String with the name of a PETSc randomizer</font>

<a name="line2320">2320: </a><font color="#B22222">   Level: beginner</font>

<a name="line2322">2322: </a><font color="#B22222">   Note:</font>
<a name="line2323">2323: </a><font color="#B22222">   To use `<a href="../manualpages/Sys/PETSCSPRNG.html">PETSCSPRNG</a>` or `<a href="../manualpages/Sys/PETSCRANDOM123.html">PETSCRANDOM123</a>` you must have ./configure PETSc</font>
<a name="line2324">2324: </a><font color="#B22222">   with the option `--download-sprng` or `--download-random123`. We recommend the default provided with PETSc.</font>

<a name="line2326">2326: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscRandomSetType.html">PetscRandomSetType</a>()`, `<a href="../manualpages/Sys/PetscRandom.html">PetscRandom</a>`, `<a href="../manualpages/Sys/PetscRandomCreate.html">PetscRandomCreate</a>()`</font>
<a name="line2327">2327: </a><font color="#B22222">J*/</font>
<a name="line2328">2328: </a><font color="#4169E1">typedef const char *<a href="../manualpages/Sys/PetscRandomType.html">PetscRandomType</a>;</font>
<a name="line2329">2329: </a><strong><font color="#228B22">#define <a href="../manualpages/Sys/PETSCRAND.html">PETSCRAND</a>      </font><font color="#666666">"rand"</font><font color="#228B22"></font></strong>
<a name="line2330">2330: </a><strong><font color="#228B22">#define <a href="../manualpages/Sys/PETSCRAND48.html">PETSCRAND48</a>    </font><font color="#666666">"rand48"</font><font color="#228B22"></font></strong>
<a name="line2331">2331: </a><strong><font color="#228B22">#define <a href="../manualpages/Sys/PETSCSPRNG.html">PETSCSPRNG</a>     </font><font color="#666666">"sprng"</font><font color="#228B22"></font></strong>
<a name="line2332">2332: </a><strong><font color="#228B22">#define <a href="../manualpages/Sys/PETSCRANDER48.html">PETSCRANDER48</a>  </font><font color="#666666">"rander48"</font><font color="#228B22"></font></strong>
<a name="line2333">2333: </a><strong><font color="#228B22">#define <a href="../manualpages/Sys/PETSCRANDOM123.html">PETSCRANDOM123</a> </font><font color="#666666">"random123"</font><font color="#228B22"></font></strong>
<a name="line2334">2334: </a><strong><font color="#228B22">#define <a href="../manualpages/Sys/PETSCCURAND.html">PETSCCURAND</a>    </font><font color="#666666">"curand"</font><font color="#228B22"></font></strong>

<a name="line2336">2336: </a><font color="#B22222">/* Logging support */</font>
<a name="line2337">2337: </a>PETSC_EXTERN <a href="../manualpages/Sys/PetscClassId.html">PetscClassId</a> PETSC_RANDOM_CLASSID;

<a name="line2339">2339: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscRandomInitializePackage.html">PetscRandomInitializePackage</a>(void)</font></strong>;
<a name="line2340">2340: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscRandomFinalizePackage.html">PetscRandomFinalizePackage</a>(void)</font></strong>;

<a name="line2342">2342: </a><font color="#B22222">/* Dynamic creation and loading functions */</font>
<a name="line2343">2343: </a>PETSC_EXTERN <a href="../manualpages/Sys/PetscFunctionList.html">PetscFunctionList</a> PetscRandomList;

<a name="line2345">2345: </a><strong><font color="#4169E1"><a name="PetscRandomRegister"></a>PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscRandomRegister.html">PetscRandomRegister</a>(const char[], <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> (*)(<a href="../manualpages/Sys/PetscRandom.html">PetscRandom</a>)</font></strong>);
<a name="line2346">2346: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscRandomSetType.html">PetscRandomSetType</a>(<a href="../manualpages/Sys/PetscRandom.html">PetscRandom</a>, <a href="../manualpages/Sys/PetscRandomType.html">PetscRandomType</a>)</font></strong>;
<a name="line2347">2347: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscRandomSetOptionsPrefix.html">PetscRandomSetOptionsPrefix</a>(<a href="../manualpages/Sys/PetscRandom.html">PetscRandom</a>, const char[])</font></strong>;
<a name="line2348">2348: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscRandomSetFromOptions.html">PetscRandomSetFromOptions</a>(<a href="../manualpages/Sys/PetscRandom.html">PetscRandom</a>)</font></strong>;
<a name="line2349">2349: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscRandomGetType.html">PetscRandomGetType</a>(<a href="../manualpages/Sys/PetscRandom.html">PetscRandom</a>, <a href="../manualpages/Sys/PetscRandomType.html">PetscRandomType</a> *)</font></strong>;
<a name="line2350">2350: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscRandomViewFromOptions.html">PetscRandomViewFromOptions</a>(<a href="../manualpages/Sys/PetscRandom.html">PetscRandom</a>, <a href="../manualpages/Sys/PetscObject.html">PetscObject</a>, const char[])</font></strong>;
<a name="line2351">2351: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscRandomView.html">PetscRandomView</a>(<a href="../manualpages/Sys/PetscRandom.html">PetscRandom</a>, <a href="../manualpages/Viewer/PetscViewer.html">PetscViewer</a>)</font></strong>;

<a name="line2353">2353: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscRandomCreate.html">PetscRandomCreate</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, <a href="../manualpages/Sys/PetscRandom.html">PetscRandom</a> *)</font></strong>;
<a name="line2354">2354: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscRandomGetValue.html">PetscRandomGetValue</a>(<a href="../manualpages/Sys/PetscRandom.html">PetscRandom</a>, <a href="../manualpages/Sys/PetscScalar.html">PetscScalar</a> *)</font></strong>;
<a name="line2355">2355: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscRandomGetValueReal.html">PetscRandomGetValueReal</a>(<a href="../manualpages/Sys/PetscRandom.html">PetscRandom</a>, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *)</font></strong>;
<a name="line2356">2356: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscRandomGetValues.html">PetscRandomGetValues</a>(<a href="../manualpages/Sys/PetscRandom.html">PetscRandom</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscScalar.html">PetscScalar</a> *)</font></strong>;
<a name="line2357">2357: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscRandomGetValuesReal.html">PetscRandomGetValuesReal</a>(<a href="../manualpages/Sys/PetscRandom.html">PetscRandom</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *)</font></strong>;
<a name="line2358">2358: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscRandomGetInterval.html">PetscRandomGetInterval</a>(<a href="../manualpages/Sys/PetscRandom.html">PetscRandom</a>, <a href="../manualpages/Sys/PetscScalar.html">PetscScalar</a> *, <a href="../manualpages/Sys/PetscScalar.html">PetscScalar</a> *)</font></strong>;
<a name="line2359">2359: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscRandomSetInterval.html">PetscRandomSetInterval</a>(<a href="../manualpages/Sys/PetscRandom.html">PetscRandom</a>, <a href="../manualpages/Sys/PetscScalar.html">PetscScalar</a>, <a href="../manualpages/Sys/PetscScalar.html">PetscScalar</a>)</font></strong>;
<a name="line2360">2360: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscRandomSetSeed.html">PetscRandomSetSeed</a>(<a href="../manualpages/Sys/PetscRandom.html">PetscRandom</a>, PetscInt64)</font></strong>;
<a name="line2361">2361: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscRandomGetSeed.html">PetscRandomGetSeed</a>(<a href="../manualpages/Sys/PetscRandom.html">PetscRandom</a>, PetscInt64 *)</font></strong>;
<a name="line2362">2362: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscRandomSeed.html">PetscRandomSeed</a>(<a href="../manualpages/Sys/PetscRandom.html">PetscRandom</a>)</font></strong>;
<a name="line2363">2363: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscRandomDestroy.html">PetscRandomDestroy</a>(<a href="../manualpages/Sys/PetscRandom.html">PetscRandom</a> *)</font></strong>;

<a name="line2365">2365: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscGetFullPath.html">PetscGetFullPath</a>(const char[], char[], size_t)</font></strong>;
<a name="line2366">2366: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscGetRelativePath.html">PetscGetRelativePath</a>(const char[], char[], size_t)</font></strong>;
<a name="line2367">2367: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscGetWorkingDirectory.html">PetscGetWorkingDirectory</a>(char[], size_t)</font></strong>;
<a name="line2368">2368: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscGetRealPath.html">PetscGetRealPath</a>(const char[], char[])</font></strong>;
<a name="line2369">2369: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscGetHomeDirectory.html">PetscGetHomeDirectory</a>(char[], size_t)</font></strong>;
<a name="line2370">2370: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscTestFile.html">PetscTestFile</a>(const char[], char, <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> *)</font></strong>;
<a name="line2371">2371: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscTestDirectory.html">PetscTestDirectory</a>(const char[], char, <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> *)</font></strong>;
<a name="line2372">2372: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscMkdir.html">PetscMkdir</a>(const char[])</font></strong>;
<a name="line2373">2373: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscMkdtemp.html">PetscMkdtemp</a>(char[])</font></strong>;
<a name="line2374">2374: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscRMTree.html">PetscRMTree</a>(const char[])</font></strong>;

<a name="line2376">2376: </a><font color="#B22222">/*MC</font>
<a name="line2377">2377: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscBinaryBigEndian.html">PetscBinaryBigEndian</a> - indicates if values in memory are stored with big endian format</font>

<a name="line2379">2379: </a><font color="#B22222">   Synopsis:</font>
<a name="line2380">2380: </a>#include <A href="../include/petscsys.h.html">&lt;petscsys.h&gt;</A>
<a name="line2381">2381: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> <a href="../manualpages/Sys/PetscBinaryBigEndian.html">PetscBinaryBigEndian</a>(void);</font>

<a name="line2383">2383: </a><font color="#B22222">   No Fortran Support</font>

<a name="line2385">2385: </a><font color="#B22222">   Level: developer</font>

<a name="line2387">2387: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscInitialize.html">PetscInitialize</a>()`, `<a href="../manualpages/Sys/PetscFinalize.html">PetscFinalize</a>()`, `PetscInitializeCalled`</font>
<a name="line2388">2388: </a><font color="#B22222">M*/</font>
<a name="line2389">2389: </a><strong><font color="#4169E1"><a name="PetscBinaryBigEndian"></a>static inline <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> <a href="../manualpages/Sys/PetscBinaryBigEndian.html">PetscBinaryBigEndian</a>(void)</font></strong>
<a name="line2390">2390: </a>{
<a name="line2391">2391: </a>  long _petsc_v = 1;
<a name="line2392">2392: </a>  <font color="#4169E1">return</font> ((char *)&amp;_petsc_v)[0] ? <a href="../manualpages/Sys/PETSC_FALSE.html">PETSC_FALSE</a> : <a href="../manualpages/Sys/PETSC_TRUE.html">PETSC_TRUE</a>;
<a name="line2393">2393: </a>}

<a name="line2395">2395: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscBinaryRead.html">PetscBinaryRead</a>(int, void *, <a href="../manualpages/Sys/PetscCount.html">PetscCount</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *, <a href="../manualpages/Sys/PetscDataType.html">PetscDataType</a>)</font></strong>;
<a name="line2396">2396: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscBinarySynchronizedRead.html">PetscBinarySynchronizedRead</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, int, void *, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *, <a href="../manualpages/Sys/PetscDataType.html">PetscDataType</a>)</font></strong>;
<a name="line2397">2397: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscBinaryWrite.html">PetscBinaryWrite</a>(int, const void *, <a href="../manualpages/Sys/PetscCount.html">PetscCount</a>, <a href="../manualpages/Sys/PetscDataType.html">PetscDataType</a>)</font></strong>;
<a name="line2398">2398: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscBinarySynchronizedWrite.html">PetscBinarySynchronizedWrite</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, int, const void *, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscDataType.html">PetscDataType</a>)</font></strong>;
<a name="line2399">2399: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscBinaryOpen.html">PetscBinaryOpen</a>(const char[], <a href="../manualpages/Sys/PetscFileMode.html">PetscFileMode</a>, int *)</font></strong>;
<a name="line2400">2400: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscBinaryClose.html">PetscBinaryClose</a>(int)</font></strong>;
<a name="line2401">2401: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSharedTmp.html">PetscSharedTmp</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> *)</font></strong>;
<a name="line2402">2402: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSharedWorkingDirectory.html">PetscSharedWorkingDirectory</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> *)</font></strong>;
<a name="line2403">2403: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscGetTmp.html">PetscGetTmp</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, char[], size_t)</font></strong>;
<a name="line2404">2404: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscFileRetrieve.html">PetscFileRetrieve</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, const char[], char[], size_t, <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> *)</font></strong>;
<a name="line2405">2405: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscLs.html">PetscLs</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, const char[], char[], size_t, <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> *)</font></strong>;
<a name="line2406">2406: </a><font color="#A020F0">#if defined(PETSC_USE_SOCKET_VIEWER)</font>
<a name="line2407">2407: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Viewer/PetscOpenSocket.html">PetscOpenSocket</a>(const char[], int, int *)</font></strong>;
<a name="line2408">2408: </a><font color="#A020F0">#endif</font>

<a name="line2410">2410: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscBinarySeek.html">PetscBinarySeek</a>(int, off_t, <a href="../manualpages/Sys/PetscBinarySeekType.html">PetscBinarySeekType</a>, off_t *)</font></strong>;
<a name="line2411">2411: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscBinarySynchronizedSeek.html">PetscBinarySynchronizedSeek</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, int, off_t, <a href="../manualpages/Sys/PetscBinarySeekType.html">PetscBinarySeekType</a>, off_t *)</font></strong>;
<a name="line2412">2412: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> PetscByteSwap(void *, <a href="../manualpages/Sys/PetscDataType.html">PetscDataType</a>, <a href="../manualpages/Sys/PetscCount.html">PetscCount</a>)</font></strong>;

<a name="line2414">2414: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSetDebugTerminal.html">PetscSetDebugTerminal</a>(const char[])</font></strong>;
<a name="line2415">2415: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSetDebugger.html">PetscSetDebugger</a>(const char[], <a href="../manualpages/Sys/PetscBool.html">PetscBool</a>)</font></strong>;
<a name="line2416">2416: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSetDefaultDebugger.html">PetscSetDefaultDebugger</a>(void)</font></strong>;
<a name="line2417">2417: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSetDebuggerFromString.html">PetscSetDebuggerFromString</a>(const char *)</font></strong>;
<a name="line2418">2418: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscAttachDebugger.html">PetscAttachDebugger</a>(void)</font></strong>;
<a name="line2419">2419: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscStopForDebugger.html">PetscStopForDebugger</a>(void)</font></strong>;
<a name="line2420">2420: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscWaitOnError.html">PetscWaitOnError</a>(void)</font></strong>;

<a name="line2422">2422: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscGatherNumberOfMessages.html">PetscGatherNumberOfMessages</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, const <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>[], const <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>[], <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> *)</font></strong>;
<a name="line2423">2423: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscGatherMessageLengths.html">PetscGatherMessageLengths</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>, const <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>[], <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> *[], <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> *[])</font></strong>;
<a name="line2424">2424: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscGatherMessageLengths2.html">PetscGatherMessageLengths2</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>, const <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>[], const <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>[], <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> *[], <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> *[], <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> *[])</font></strong>;
<a name="line2425">2425: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> PetscPostIrecvInt(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>, const <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>[], const <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>[], <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> ***, MPI_Request **)</font></strong>;
<a name="line2426">2426: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> PetscPostIrecvScalar(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>, const <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>[], const <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>[], <a href="../manualpages/Sys/PetscScalar.html">PetscScalar</a> ***, MPI_Request **)</font></strong>;
<a name="line2427">2427: </a><strong><font color="#4169E1"><a name="PetscCommBuildTwoSided"></a>PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscCommBuildTwoSided.html">PetscCommBuildTwoSided</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>, MPI_Datatype, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>, const <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>[], const void *, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> *, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> *[], void *)</font></strong> PETSC_ATTRIBUTE_MPI_POINTER_WITH_TYPE(6, 3);
<a name="line2428">2428: </a><strong><font color="#4169E1"><a name="PetscCommBuildTwoSidedF"></a>PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscCommBuildTwoSidedF.html">PetscCommBuildTwoSidedF</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>, MPI_Datatype, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>, const <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>[], const void *, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> *, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> **, void *, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>, <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> (*send)(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, const <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>[], <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>, void *, MPI_Request[], void *), <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> (*recv)(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, const <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>[], <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>, void *, MPI_Request[], void *), void *ctx)</font></strong> PETSC_ATTRIBUTE_MPI_POINTER_WITH_TYPE(6, 3);
<a name="line2429">2429: </a><strong><font color="#4169E1"><a name="PetscCommBuildTwoSidedFReq"></a>PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscCommBuildTwoSidedFReq.html">PetscCommBuildTwoSidedFReq</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>, MPI_Datatype, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>, const <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>[], const void *, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> *, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> **, void *, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>, MPI_Request **, MPI_Request **, <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> (*send)(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, const <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>[], <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>, void *, MPI_Request[], void *), <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> (*recv)(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, const <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>[], <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>, void *, MPI_Request[], void *), void *ctx)</font></strong> PETSC_ATTRIBUTE_MPI_POINTER_WITH_TYPE(6, 3);

<a name="line2431">2431: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscCommBuildTwoSidedSetType.html">PetscCommBuildTwoSidedSetType</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, <a href="../manualpages/Sys/PetscBuildTwoSidedType.html">PetscBuildTwoSidedType</a>)</font></strong>;
<a name="line2432">2432: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscCommBuildTwoSidedGetType.html">PetscCommBuildTwoSidedGetType</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, <a href="../manualpages/Sys/PetscBuildTwoSidedType.html">PetscBuildTwoSidedType</a> *)</font></strong>;

<a name="line2434">2434: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSSEIsEnabled.html">PetscSSEIsEnabled</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> *, <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> *)</font></strong>;

<a name="line2436">2436: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a> <a href="../manualpages/Sys/PetscObjectComm.html">PetscObjectComm</a>(<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>)</font></strong>;

<a name="line2438">2438: </a><font color="#4169E1"><a name="_n_PetscSubcomm"></a>struct _n_PetscSubcomm </font>{
<a name="line2439">2439: </a>  <a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>         parent;    <font color="#B22222">/* parent communicator */</font>
<a name="line2440">2440: </a>  <a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>         dupparent; <font color="#B22222">/* duplicate parent communicator, under which the processors of this subcomm have contiguous rank */</font>
<a name="line2441">2441: </a>  <a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>         child;     <font color="#B22222">/* the sub-communicator */</font>
<a name="line2442">2442: </a>  <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>      n;         <font color="#B22222">/* num of subcommunicators under the parent communicator */</font>
<a name="line2443">2443: </a>  <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>      color;     <font color="#B22222">/* color of processors belong to this communicator */</font>
<a name="line2444">2444: </a>  <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>     *subsize;   <font color="#B22222">/* size of subcommunicator[color] */</font>
<a name="line2445">2445: </a>  PetscSubcommType type;
<a name="line2446">2446: </a>  char            *subcommprefix;
<a name="line2447">2447: </a>};

<a name="line2449">2449: </a><strong><font color="#4169E1"><a name="PetscSubcommParent"></a>static inline <a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a> PetscSubcommParent(<a href="../manualpages/Sys/PetscSubcomm.html">PetscSubcomm</a> scomm)</font></strong>
<a name="line2450">2450: </a>{
<a name="line2451">2451: </a>  <font color="#4169E1">return</font> scomm-&gt;parent;
<a name="line2452">2452: </a>}
<a name="line2453">2453: </a><strong><font color="#4169E1"><a name="PetscSubcommChild"></a>static inline <a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a> PetscSubcommChild(<a href="../manualpages/Sys/PetscSubcomm.html">PetscSubcomm</a> scomm)</font></strong>
<a name="line2454">2454: </a>{
<a name="line2455">2455: </a>  <font color="#4169E1">return</font> scomm-&gt;child;
<a name="line2456">2456: </a>}
<a name="line2457">2457: </a><strong><font color="#4169E1"><a name="PetscSubcommContiguousParent"></a>static inline <a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a> PetscSubcommContiguousParent(<a href="../manualpages/Sys/PetscSubcomm.html">PetscSubcomm</a> scomm)</font></strong>
<a name="line2458">2458: </a>{
<a name="line2459">2459: </a>  <font color="#4169E1">return</font> scomm-&gt;dupparent;
<a name="line2460">2460: </a>}
<a name="line2461">2461: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSubcommCreate.html">PetscSubcommCreate</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, <a href="../manualpages/Sys/PetscSubcomm.html">PetscSubcomm</a> *)</font></strong>;
<a name="line2462">2462: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSubcommDestroy.html">PetscSubcommDestroy</a>(<a href="../manualpages/Sys/PetscSubcomm.html">PetscSubcomm</a> *)</font></strong>;
<a name="line2463">2463: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSubcommSetNumber.html">PetscSubcommSetNumber</a>(<a href="../manualpages/Sys/PetscSubcomm.html">PetscSubcomm</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>)</font></strong>;
<a name="line2464">2464: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSubcommSetType.html">PetscSubcommSetType</a>(<a href="../manualpages/Sys/PetscSubcomm.html">PetscSubcomm</a>, PetscSubcommType)</font></strong>;
<a name="line2465">2465: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSubcommSetTypeGeneral.html">PetscSubcommSetTypeGeneral</a>(<a href="../manualpages/Sys/PetscSubcomm.html">PetscSubcomm</a>, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>)</font></strong>;
<a name="line2466">2466: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSubcommView.html">PetscSubcommView</a>(<a href="../manualpages/Sys/PetscSubcomm.html">PetscSubcomm</a>, <a href="../manualpages/Viewer/PetscViewer.html">PetscViewer</a>)</font></strong>;
<a name="line2467">2467: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSubcommSetFromOptions.html">PetscSubcommSetFromOptions</a>(<a href="../manualpages/Sys/PetscSubcomm.html">PetscSubcomm</a>)</font></strong>;
<a name="line2468">2468: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSubcommSetOptionsPrefix.html">PetscSubcommSetOptionsPrefix</a>(<a href="../manualpages/Sys/PetscSubcomm.html">PetscSubcomm</a>, const char[])</font></strong>;
<a name="line2469">2469: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSubcommGetParent.html">PetscSubcommGetParent</a>(<a href="../manualpages/Sys/PetscSubcomm.html">PetscSubcomm</a>, <a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a> *)</font></strong>;
<a name="line2470">2470: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSubcommGetContiguousParent.html">PetscSubcommGetContiguousParent</a>(<a href="../manualpages/Sys/PetscSubcomm.html">PetscSubcomm</a>, <a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a> *)</font></strong>;
<a name="line2471">2471: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSubcommGetChild.html">PetscSubcommGetChild</a>(<a href="../manualpages/Sys/PetscSubcomm.html">PetscSubcomm</a>, <a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a> *)</font></strong>;

<a name="line2473">2473: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> PetscHeapCreate(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscHeap.html">PetscHeap</a> *)</font></strong>;
<a name="line2474">2474: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> PetscHeapAdd(<a href="../manualpages/Sys/PetscHeap.html">PetscHeap</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>)</font></strong>;
<a name="line2475">2475: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> PetscHeapPop(<a href="../manualpages/Sys/PetscHeap.html">PetscHeap</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *)</font></strong>;
<a name="line2476">2476: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> PetscHeapPeek(<a href="../manualpages/Sys/PetscHeap.html">PetscHeap</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *)</font></strong>;
<a name="line2477">2477: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> PetscHeapStash(<a href="../manualpages/Sys/PetscHeap.html">PetscHeap</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>)</font></strong>;
<a name="line2478">2478: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> PetscHeapUnstash(<a href="../manualpages/Sys/PetscHeap.html">PetscHeap</a>)</font></strong>;
<a name="line2479">2479: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> PetscHeapDestroy(<a href="../manualpages/Sys/PetscHeap.html">PetscHeap</a> *)</font></strong>;
<a name="line2480">2480: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> PetscHeapView(<a href="../manualpages/Sys/PetscHeap.html">PetscHeap</a>, <a href="../manualpages/Viewer/PetscViewer.html">PetscViewer</a>)</font></strong>;

<a name="line2482">2482: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscProcessPlacementView.html">PetscProcessPlacementView</a>(<a href="../manualpages/Viewer/PetscViewer.html">PetscViewer</a>)</font></strong>;
<a name="line2483">2483: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscShmCommGet.html">PetscShmCommGet</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, PetscShmComm *)</font></strong>;
<a name="line2484">2484: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscShmCommGlobalToLocal.html">PetscShmCommGlobalToLocal</a>(PetscShmComm, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> *)</font></strong>;
<a name="line2485">2485: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscShmCommLocalToGlobal.html">PetscShmCommLocalToGlobal</a>(PetscShmComm, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> *)</font></strong>;
<a name="line2486">2486: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscShmCommGetMpiShmComm.html">PetscShmCommGetMpiShmComm</a>(PetscShmComm, <a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a> *)</font></strong>;

<a name="line2488">2488: </a><font color="#B22222">/* routines to better support OpenMP multithreading needs of some PETSc third party libraries */</font>
<a name="line2489">2489: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscOmpCtrlCreate.html">PetscOmpCtrlCreate</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, PetscOmpCtrl *)</font></strong>;
<a name="line2490">2490: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscOmpCtrlGetOmpComms.html">PetscOmpCtrlGetOmpComms</a>(PetscOmpCtrl, <a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a> *, <a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a> *, <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> *)</font></strong>;
<a name="line2491">2491: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscOmpCtrlDestroy.html">PetscOmpCtrlDestroy</a>(PetscOmpCtrl *)</font></strong>;
<a name="line2492">2492: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscOmpCtrlBarrier.html">PetscOmpCtrlBarrier</a>(PetscOmpCtrl)</font></strong>;
<a name="line2493">2493: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscOmpCtrlOmpRegionOnMasterBegin.html">PetscOmpCtrlOmpRegionOnMasterBegin</a>(PetscOmpCtrl)</font></strong>;
<a name="line2494">2494: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscOmpCtrlOmpRegionOnMasterEnd.html">PetscOmpCtrlOmpRegionOnMasterEnd</a>(PetscOmpCtrl)</font></strong>;

<a name="line2496">2496: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSegBufferCreate.html">PetscSegBufferCreate</a>(size_t, <a href="../manualpages/Sys/PetscCount.html">PetscCount</a>, <a href="../manualpages/Sys/PetscSegBuffer.html">PetscSegBuffer</a> *)</font></strong>;
<a name="line2497">2497: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSegBufferDestroy.html">PetscSegBufferDestroy</a>(<a href="../manualpages/Sys/PetscSegBuffer.html">PetscSegBuffer</a> *)</font></strong>;
<a name="line2498">2498: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSegBufferGet.html">PetscSegBufferGet</a>(<a href="../manualpages/Sys/PetscSegBuffer.html">PetscSegBuffer</a>, <a href="../manualpages/Sys/PetscCount.html">PetscCount</a>, void *)</font></strong>;
<a name="line2499">2499: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSegBufferExtractAlloc.html">PetscSegBufferExtractAlloc</a>(<a href="../manualpages/Sys/PetscSegBuffer.html">PetscSegBuffer</a>, void *)</font></strong>;
<a name="line2500">2500: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSegBufferExtractTo.html">PetscSegBufferExtractTo</a>(<a href="../manualpages/Sys/PetscSegBuffer.html">PetscSegBuffer</a>, void *)</font></strong>;
<a name="line2501">2501: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSegBufferExtractInPlace.html">PetscSegBufferExtractInPlace</a>(<a href="../manualpages/Sys/PetscSegBuffer.html">PetscSegBuffer</a>, void *)</font></strong>;
<a name="line2502">2502: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSegBufferGetSize.html">PetscSegBufferGetSize</a>(<a href="../manualpages/Sys/PetscSegBuffer.html">PetscSegBuffer</a>, <a href="../manualpages/Sys/PetscCount.html">PetscCount</a> *)</font></strong>;
<a name="line2503">2503: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSegBufferUnuse.html">PetscSegBufferUnuse</a>(<a href="../manualpages/Sys/PetscSegBuffer.html">PetscSegBuffer</a>, <a href="../manualpages/Sys/PetscCount.html">PetscCount</a>)</font></strong>;

<a name="line2505">2505: </a><font color="#B22222">/*MC</font>
<a name="line2506">2506: </a><font color="#B22222">  <a href="../manualpages/Sys/PetscSegBufferGetInts.html">PetscSegBufferGetInts</a> - access an array of `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` from a `<a href="../manualpages/Sys/PetscSegBuffer.html">PetscSegBuffer</a>`</font>

<a name="line2508">2508: </a><font color="#B22222">  Synopsis:</font>
<a name="line2509">2509: </a>#include <A href="../include/petscsys.h.html">&lt;petscsys.h&gt;</A>
<a name="line2510">2510: </a><font color="#B22222">  <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSegBufferGetInts.html">PetscSegBufferGetInts</a>(<a href="../manualpages/Sys/PetscSegBuffer.html">PetscSegBuffer</a> seg, size_t count, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *PETSC_RESTRICT *slot);</font>

<a name="line2512">2512: </a><font color="#B22222">  No Fortran Support</font>

<a name="line2514">2514: </a><font color="#B22222">  Input Parameters:</font>
<a name="line2515">2515: </a><font color="#B22222">+ seg   - `<a href="../manualpages/Sys/PetscSegBuffer.html">PetscSegBuffer</a>` buffer</font>
<a name="line2516">2516: </a><font color="#B22222">- count - number of entries needed</font>

<a name="line2518">2518: </a><font color="#B22222">  Output Parameter:</font>
<a name="line2519">2519: </a><font color="#B22222">. buf - address of new buffer for contiguous data</font>

<a name="line2521">2521: </a><font color="#B22222">  Level: intermediate</font>

<a name="line2523">2523: </a><font color="#B22222">  Developer Note:</font>
<a name="line2524">2524: </a><font color="#B22222">  Type-safe wrapper to encourage use of PETSC_RESTRICT. Does not use <a href="../manualpages/Sys/PetscFunctionBegin.html">PetscFunctionBegin</a> because the error handling</font>
<a name="line2525">2525: </a><font color="#B22222">  prevents the compiler from completely erasing the stub. This is called in inner loops so it has to be as fast as</font>
<a name="line2526">2526: </a><font color="#B22222">  possible.</font>

<a name="line2528">2528: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscSegBuffer.html">PetscSegBuffer</a>`, `<a href="../manualpages/Sys/PetscSegBufferGet.html">PetscSegBufferGet</a>()`, `<a href="../manualpages/Sys/PetscInitialize.html">PetscInitialize</a>()`, `<a href="../manualpages/Sys/PetscFinalize.html">PetscFinalize</a>()`, `PetscInitializeCalled`</font>
<a name="line2529">2529: </a><font color="#B22222">M*/</font>
<a name="line2530">2530: </a><strong><font color="#4169E1"><a name="PetscSegBufferGetInts"></a>static inline <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscSegBufferGetInts.html">PetscSegBufferGetInts</a>(<a href="../manualpages/Sys/PetscSegBuffer.html">PetscSegBuffer</a> seg, <a href="../manualpages/Sys/PetscCount.html">PetscCount</a> count, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *PETSC_RESTRICT *slot)</font></strong>
<a name="line2531">2531: </a>{
<a name="line2532">2532: </a>  <font color="#4169E1">return</font> <a href="../manualpages/Sys/PetscSegBufferGet.html">PetscSegBufferGet</a>(seg, count, (void **)slot);
<a name="line2533">2533: </a>}

<a name="line2535">2535: </a>extern PetscOptionsHelpPrinted PetscOptionsHelpPrintedSingleton;
<a name="line2536">2536: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a>    PetscOptionsHelpPrintedDestroy(PetscOptionsHelpPrinted *)</font></strong>;
<a name="line2537">2537: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a>    <a href="../manualpages/Viewer/PetscOptionsHelpPrintedCreate.html">PetscOptionsHelpPrintedCreate</a>(PetscOptionsHelpPrinted *)</font></strong>;
<a name="line2538">2538: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a>    <a href="../manualpages/Viewer/PetscOptionsHelpPrintedCheck.html">PetscOptionsHelpPrintedCheck</a>(PetscOptionsHelpPrinted, const char *, const char *, <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> *)</font></strong>;

<a name="line2540">2540: </a><font color="#A020F0">#include &lt;stdarg.h&gt;</font>
<a name="line2541">2541: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscVSNPrintf.html">PetscVSNPrintf</a>(char *, size_t, const char[], size_t *, va_list)</font></strong>;
<a name="line2542">2542: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> (*PetscVFPrintf)(FILE *, const char[], va_list)</font></strong>;

<a name="line2544">2544: </a>PETSC_EXTERN <a href="../manualpages/Sys/PetscSegBuffer.html">PetscSegBuffer</a> PetscCitationsList;

<a name="line2546">2546: </a><font color="#B22222">/*@</font>
<a name="line2547">2547: </a><font color="#B22222">     <a href="../manualpages/Sys/PetscCitationsRegister.html">PetscCitationsRegister</a> - Register a bibtex item to obtain credit for an implemented algorithm used in the code.</font>

<a name="line2549">2549: </a><font color="#B22222">     Not Collective; No Fortran Support</font>

<a name="line2551">2551: </a><font color="#B22222">     Input Parameters:</font>
<a name="line2552">2552: </a><font color="#B22222">+    cite - the bibtex item, formatted to displayed on multiple lines nicely</font>
<a name="line2553">2553: </a><font color="#B22222">-    set - a boolean variable initially set to `<a href="../manualpages/Sys/PETSC_FALSE.html">PETSC_FALSE</a>`; this is used to insure only a single registration of the citation</font>

<a name="line2555">2555: </a><font color="#B22222">     Options Database Key:</font>
<a name="line2556">2556: </a><font color="#B22222">.     -citations [filename]   - print out the bibtex entries for the given computation</font>

<a name="line2558">2558: </a><font color="#B22222">     Level: intermediate</font>
<a name="line2559">2559: </a><font color="#B22222">@*/</font>
<a name="line2560">2560: </a><strong><font color="#4169E1"><a name="PetscCitationsRegister"></a>static inline <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscCitationsRegister.html">PetscCitationsRegister</a>(const char cit[], <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> *set)</font></strong>
<a name="line2561">2561: </a>{
<a name="line2562">2562: </a>  size_t len;
<a name="line2563">2563: </a>  char  *vstring;

<a name="line2565">2565: </a>  <a href="../manualpages/Sys/PetscFunctionBegin.html">PetscFunctionBegin</a>;
<a name="line2566">2566: </a>  <font color="#4169E1">if</font> (set &amp;&amp; *set) <a href="../manualpages/Sys/PetscFunctionReturn.html">PetscFunctionReturn</a>(<a href="../manualpages/Sys/PetscErrorCode.html">PETSC_SUCCESS</a>);
<a name="line2567">2567: </a>  <a href="../manualpages/Sys/PetscCall.html">PetscCall</a>(<a href="../manualpages/Sys/PetscStrlen.html">PetscStrlen</a>(cit, &amp;len));
<a name="line2568">2568: </a>  <a href="../manualpages/Sys/PetscCall.html">PetscCall</a>(<a href="../manualpages/Sys/PetscSegBufferGet.html">PetscSegBufferGet</a>(PetscCitationsList, (<a href="../manualpages/Sys/PetscCount.html">PetscCount</a>)len, &amp;vstring));
<a name="line2569">2569: </a>  <a href="../manualpages/Sys/PetscCall.html">PetscCall</a>(<a href="../manualpages/Sys/PetscArraycpy.html">PetscArraycpy</a>(vstring, cit, len));
<a name="line2570">2570: </a>  <font color="#4169E1">if</font> (set) *set = <a href="../manualpages/Sys/PETSC_TRUE.html">PETSC_TRUE</a>;
<a name="line2571">2571: </a>  <a href="../manualpages/Sys/PetscFunctionReturn.html">PetscFunctionReturn</a>(<a href="../manualpages/Sys/PetscErrorCode.html">PETSC_SUCCESS</a>);
<a name="line2572">2572: </a>}

<a name="line2574">2574: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscGoogleDriveAuthorize.html">PetscGoogleDriveAuthorize</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, char[], char[], size_t)</font></strong>;
<a name="line2575">2575: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscGoogleDriveRefresh.html">PetscGoogleDriveRefresh</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, const char[], char[], size_t)</font></strong>;
<a name="line2576">2576: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscGoogleDriveUpload.html">PetscGoogleDriveUpload</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, const char[], const char[])</font></strong>;

<a name="line2578">2578: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscBoxAuthorize.html">PetscBoxAuthorize</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, char[], char[], size_t)</font></strong>;
<a name="line2579">2579: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscBoxRefresh.html">PetscBoxRefresh</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, const char[], char[], char[], size_t)</font></strong>;
<a name="line2580">2580: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscBoxUpload.html">PetscBoxUpload</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, const char[], const char[])</font></strong>;

<a name="line2582">2582: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscGlobusGetTransfers.html">PetscGlobusGetTransfers</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, const char[], char[], size_t)</font></strong>;
<a name="line2583">2583: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscGlobusAuthorize.html">PetscGlobusAuthorize</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, char[], size_t)</font></strong>;
<a name="line2584">2584: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscGlobusUpload.html">PetscGlobusUpload</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, const char[], const char[])</font></strong>;

<a name="line2586">2586: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscPullJSONValue.html">PetscPullJSONValue</a>(const char[], const char[], char[], size_t, <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> *)</font></strong>;
<a name="line2587">2587: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscPushJSONValue.html">PetscPushJSONValue</a>(char[], const char[], const char[], size_t)</font></strong>;

<a name="line2589">2589: </a><font color="#A020F0">#if defined(PETSC_HAVE_MPI_PROCESS_SHARED_MEMORY)</font>
<a name="line2590">2590: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> MPIU_Win_allocate_shared(MPI_Aint, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>, MPI_Info, <a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, void *, MPI_Win *)</font></strong>;
<a name="line2591">2591: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> MPIU_Win_shared_query(MPI_Win, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>, MPI_Aint *, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> *, void *)</font></strong>;
<a name="line2592">2592: </a><font color="#A020F0">#endif</font>

<a name="line2594">2594: </a><font color="#A020F0">#if !defined(PETSC_HAVE_MPI_LARGE_COUNT)</font>
<a name="line2595">2595: </a>  <font color="#B22222">/*</font>
<a name="line2596">2596: </a><font color="#B22222">   Cast <a href="../manualpages/Sys/PetscCount.html">PetscCount</a> &lt;a&gt; to <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> &lt;b&gt;, where &lt;a&gt; is likely used for the 'count' argument in MPI routines.</font>
<a name="line2597">2597: </a><font color="#B22222">   It is similar to <a href="../manualpages/Sys/PetscMPIIntCast.html">PetscMPIIntCast</a>() except that here it returns an MPI error code.</font>
<a name="line2598">2598: </a><font color="#B22222">*/</font>
<a name="line2599">2599: </a><strong><font color="#228B22">  #define PetscMPIIntCast_Internal(a, b) \</font></strong>
<a name="line2600">2600: </a><strong><font color="#228B22">    do { \</font></strong>
<a name="line2601">2601: </a><strong><font color="#228B22">      *b = 0; \</font></strong>
<a name="line2602">2602: </a><strong><font color="#228B22">      if (<a href="../manualpages/Sys/PetscUnlikely.html">PetscUnlikely</a>(a &gt; (MPIU_Count)PETSC_MPI_INT_MAX)) return MPI_ERR_COUNT; \</font></strong>
<a name="line2603">2603: </a><strong><font color="#228B22">      *b = (<a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>)a; \</font></strong>
<a name="line2604">2604: </a><strong><font color="#228B22">    } while (0)</font></strong>

<a name="line2606">2606: </a><strong><font color="#4169E1"><a name="MPIU_Get_count"></a>static inline <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> MPIU_Get_count(MPI_Status *status, MPI_Datatype dtype, <a href="../manualpages/Sys/PetscCount.html">PetscCount</a> *count)</font></strong>
<a name="line2607">2607: </a>{
<a name="line2608">2608: </a>  <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> count2, err;

<a name="line2610">2610: </a>  *count = 0; <font color="#B22222">/* to prevent incorrect warnings of uninitialized variables */</font>
<a name="line2611">2611: </a>  err    = <a href="http://www.mpich.org/static/docs/latest/www3/MPI_Get_count.html#MPI_Get_count">MPI_Get_count</a>(status, dtype, &amp;count2);
<a name="line2612">2612: </a>  *count = count2;
<a name="line2613">2613: </a>  <font color="#4169E1">return</font> err;
<a name="line2614">2614: </a>}

<a name="line2616">2616: </a><strong><font color="#4169E1"><a name="MPIU_Send"></a>static inline <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> MPIU_Send(const void *buf, MPIU_Count count, MPI_Datatype dtype, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> dest, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> tag, <a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a> comm)</font></strong>
<a name="line2617">2617: </a>{
<a name="line2618">2618: </a>  <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> count2, err;

<a name="line2620">2620: </a>  PetscMPIIntCast_Internal(count, &amp;count2);
<a name="line2621">2621: </a>  err = <a href="http://www.mpich.org/static/docs/latest/www3/MPI_Send.html#MPI_Send">MPI_Send</a>((void *)buf, count2, dtype, dest, tag, comm);
<a name="line2622">2622: </a>  <font color="#4169E1">return</font> err;
<a name="line2623">2623: </a>}

<a name="line2625">2625: </a><strong><font color="#4169E1"><a name="MPIU_Send_init"></a>static inline <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> MPIU_Send_init(const void *buf, MPIU_Count count, MPI_Datatype dtype, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> dest, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> tag, <a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a> comm, MPI_Request *request)</font></strong>
<a name="line2626">2626: </a>{
<a name="line2627">2627: </a>  <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> count2, err;

<a name="line2629">2629: </a>  PetscMPIIntCast_Internal(count, &amp;count2);
<a name="line2630">2630: </a>  err = <a href="http://www.mpich.org/static/docs/latest/www3/MPI_Send_init.html#MPI_Send_init">MPI_Send_init</a>((void *)buf, count2, dtype, dest, tag, comm, request);
<a name="line2631">2631: </a>  <font color="#4169E1">return</font> err;
<a name="line2632">2632: </a>}

<a name="line2634">2634: </a><strong><font color="#4169E1"><a name="MPIU_Isend"></a>static inline <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> MPIU_Isend(const void *buf, MPIU_Count count, MPI_Datatype dtype, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> dest, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> tag, <a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a> comm, MPI_Request *request)</font></strong>
<a name="line2635">2635: </a>{
<a name="line2636">2636: </a>  <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> count2, err;

<a name="line2638">2638: </a>  PetscMPIIntCast_Internal(count, &amp;count2);
<a name="line2639">2639: </a>  err = <a href="http://www.mpich.org/static/docs/latest/www3/MPI_Isend.html#MPI_Isend">MPI_Isend</a>((void *)buf, count2, dtype, dest, tag, comm, request);
<a name="line2640">2640: </a>  <font color="#4169E1">return</font> err;
<a name="line2641">2641: </a>}

<a name="line2643">2643: </a><strong><font color="#4169E1"><a name="MPIU_Recv"></a>static inline <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> MPIU_Recv(const void *buf, MPIU_Count count, MPI_Datatype dtype, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> source, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> tag, <a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a> comm, MPI_Status *status)</font></strong>
<a name="line2644">2644: </a>{
<a name="line2645">2645: </a>  <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> count2, err;

<a name="line2647">2647: </a>  PetscMPIIntCast_Internal(count, &amp;count2);
<a name="line2648">2648: </a>  err = <a href="http://www.mpich.org/static/docs/latest/www3/MPI_Recv.html#MPI_Recv">MPI_Recv</a>((void *)buf, count2, dtype, source, tag, comm, status);
<a name="line2649">2649: </a>  <font color="#4169E1">return</font> err;
<a name="line2650">2650: </a>}

<a name="line2652">2652: </a><strong><font color="#4169E1"><a name="MPIU_Recv_init"></a>static inline <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> MPIU_Recv_init(const void *buf, MPIU_Count count, MPI_Datatype dtype, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> source, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> tag, <a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a> comm, MPI_Request *request)</font></strong>
<a name="line2653">2653: </a>{
<a name="line2654">2654: </a>  <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> count2, err;

<a name="line2656">2656: </a>  PetscMPIIntCast_Internal(count, &amp;count2);
<a name="line2657">2657: </a>  err = <a href="http://www.mpich.org/static/docs/latest/www3/MPI_Recv_init.html#MPI_Recv_init">MPI_Recv_init</a>((void *)buf, count2, dtype, source, tag, comm, request);
<a name="line2658">2658: </a>  <font color="#4169E1">return</font> err;
<a name="line2659">2659: </a>}

<a name="line2661">2661: </a><strong><font color="#4169E1"><a name="MPIU_Irecv"></a>static inline <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> MPIU_Irecv(const void *buf, MPIU_Count count, MPI_Datatype dtype, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> source, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> tag, <a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a> comm, MPI_Request *request)</font></strong>
<a name="line2662">2662: </a>{
<a name="line2663">2663: </a>  <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> count2, err;

<a name="line2665">2665: </a>  PetscMPIIntCast_Internal(count, &amp;count2);
<a name="line2666">2666: </a>  err = <a href="http://www.mpich.org/static/docs/latest/www3/MPI_Irecv.html#MPI_Irecv">MPI_Irecv</a>((void *)buf, count2, dtype, source, tag, comm, request);
<a name="line2667">2667: </a>  <font color="#4169E1">return</font> err;
<a name="line2668">2668: </a>}

<a name="line2670">2670: </a><strong><font color="#4169E1"><a name="MPIU_Reduce"></a>static inline <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> MPIU_Reduce(const void *inbuf, void *outbuf, MPIU_Count count, MPI_Datatype dtype, MPI_Op op, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> root, <a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a> comm)</font></strong>
<a name="line2671">2671: </a>{
<a name="line2672">2672: </a>  <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> count2, err;

<a name="line2674">2674: </a>  PetscMPIIntCast_Internal(count, &amp;count2);
<a name="line2675">2675: </a>  err = <a href="http://www.mpich.org/static/docs/latest/www3/MPI_Reduce.html#MPI_Reduce">MPI_Reduce</a>((void *)inbuf, outbuf, count2, dtype, op, root, comm);
<a name="line2676">2676: </a>  <font color="#4169E1">return</font> err;
<a name="line2677">2677: </a>}

<a name="line2679">2679: </a><font color="#A020F0">  #if defined(PETSC_HAVE_MPI_REDUCE_LOCAL)</font>
<a name="line2680">2680: </a><strong><font color="#4169E1"><a name="MPIU_Reduce_local"></a>static inline <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> MPIU_Reduce_local(const void *inbuf, void *inoutbuf, MPIU_Count count, MPI_Datatype dtype, MPI_Op op)</font></strong>
<a name="line2681">2681: </a>{
<a name="line2682">2682: </a>  <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> count2, err;

<a name="line2684">2684: </a>  PetscMPIIntCast_Internal(count, &amp;count2);
<a name="line2685">2685: </a>  err = <a href="http://www.mpich.org/static/docs/latest/www3/MPI_Reduce_local.html#MPI_Reduce_local">MPI_Reduce_local</a>((void *)inbuf, inoutbuf, count2, dtype, op);
<a name="line2686">2686: </a>  <font color="#4169E1">return</font> err;
<a name="line2687">2687: </a>}
<a name="line2688">2688: </a><font color="#A020F0">  #endif</font>

<a name="line2690">2690: </a><font color="#A020F0">  #if !defined(PETSC_USE_64BIT_INDICES)</font>
<a name="line2691">2691: </a><strong><font color="#228B22">    #define <a href="../manualpages/Sys/MPIU_Scatterv.html">MPIU_Scatterv</a>(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, comm) <a href="http://www.mpich.org/static/docs/latest/www3/MPI_Scatterv.html#MPI_Scatterv">MPI_Scatterv</a>(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, comm)</font></strong>
<a name="line2692">2692: </a><strong><font color="#228B22">    #define MPIU_Gatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, root, comm)  <a href="http://www.mpich.org/static/docs/latest/www3/MPI_Gatherv.html#MPI_Gatherv">MPI_Gatherv</a>(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, root, comm)</font></strong>
<a name="line2693">2693: </a><font color="#A020F0">  #else</font>
<a name="line2694">2694: </a><strong><font color="#228B22">    #define <a href="../manualpages/Sys/MPIU_Scatterv.html">MPIU_Scatterv</a>(sendbuf, sendcount, displs, sendtype, recvbuf, recvcount, recvtype, root, comm) \</font></strong>
<a name="line2695">2695: </a><strong><font color="#228B22">      ((void)<a href="../manualpages/Sys/PetscError.html">PetscError</a>(comm, __LINE__, PETSC_FUNCTION_NAME, __FILE__, <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_SUP</a>, <a href="../manualpages/Sys/PetscErrorType.html">PETSC_ERROR_INITIAL</a>, </font><font color="#666666">"Must have MPI 4 support for MPI_Scatterv_c() for this functionality, upgrade your MPI"</font><font color="#228B22">), MPI_ERR_COUNT)</font></strong>
<a name="line2696">2696: </a><strong><font color="#228B22">    #define MPIU_Gatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, root, comm) \</font></strong>
<a name="line2697">2697: </a><strong><font color="#228B22">      ((void)<a href="../manualpages/Sys/PetscError.html">PetscError</a>(comm, __LINE__, PETSC_FUNCTION_NAME, __FILE__, <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_SUP</a>, <a href="../manualpages/Sys/PetscErrorType.html">PETSC_ERROR_INITIAL</a>, </font><font color="#666666">"Must have MPI 4 support for MPI_Scatterv_c() for this functionality, upgrade your MPI"</font><font color="#228B22">), MPI_ERR_COUNT)</font></strong>
<a name="line2698">2698: </a><font color="#A020F0">  #endif</font>

<a name="line2700">2700: </a><font color="#A020F0">#else</font>

<a name="line2702">2702: </a>  <font color="#B22222">/* on 32 bit systems MPI_Count maybe 64-bit while <a href="../manualpages/Sys/PetscCount.html">PetscCount</a> is 32-bit */</font>
<a name="line2703">2703: </a><strong><font color="#228B22">  #define PetscCountCast_Internal(a, b) \</font></strong>
<a name="line2704">2704: </a><strong><font color="#228B22">    do { \</font></strong>
<a name="line2705">2705: </a><strong><font color="#228B22">      *b = 0; \</font></strong>
<a name="line2706">2706: </a><strong><font color="#228B22">      if (<a href="../manualpages/Sys/PetscUnlikely.html">PetscUnlikely</a>(a &gt; (MPI_Count)PETSC_COUNT_MAX)) return MPI_ERR_COUNT; \</font></strong>
<a name="line2707">2707: </a><strong><font color="#228B22">      *b = (<a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>)a; \</font></strong>
<a name="line2708">2708: </a><strong><font color="#228B22">    } while (0)</font></strong>

<a name="line2710">2710: </a><strong><font color="#4169E1"><a name="MPIU_Get_count"></a>static inline <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> MPIU_Get_count(MPI_Status *status, MPI_Datatype dtype, <a href="../manualpages/Sys/PetscCount.html">PetscCount</a> *count)</font></strong>
<a name="line2711">2711: </a>{
<a name="line2712">2712: </a>  MPI_Count   count2;
<a name="line2713">2713: </a>  <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> err;

<a name="line2715">2715: </a>  *count = 0; <font color="#B22222">/* to prevent incorrect warnings of uninitialized variables */</font>
<a name="line2716">2716: </a>  err    = MPI_Get_count_c(status, dtype, &amp;count2);
<a name="line2717">2717: </a>  <font color="#4169E1">if</font> (err) <font color="#4169E1">return</font> err;
<a name="line2718">2718: </a>  PetscCountCast_Internal(count2, count);
<a name="line2719">2719: </a>  <font color="#4169E1">return</font> MPI_SUCCESS;
<a name="line2720">2720: </a>}

<a name="line2722">2722: </a><strong><font color="#228B22">  #define MPIU_Reduce(inbuf, outbuf, count, dtype, op, root, comm)      MPI_Reduce_c(inbuf, outbuf, (MPI_Count)(count), dtype, op, root, comm)</font></strong>
<a name="line2723">2723: </a><strong><font color="#228B22">  #define MPIU_Send(buf, count, dtype, dest, tag, comm)                 MPI_Send_c(buf, (MPI_Count)(count), dtype, dest, tag, comm)</font></strong>
<a name="line2724">2724: </a><strong><font color="#228B22">  #define MPIU_Send_init(buf, count, dtype, dest, tag, comm, request)   MPI_Send_init_c(buf, (MPI_Count)(count), dtype, dest, tag, comm, request)</font></strong>
<a name="line2725">2725: </a><strong><font color="#228B22">  #define MPIU_Isend(buf, count, dtype, dest, tag, comm, request)       MPI_Isend_c(buf, (MPI_Count)(count), dtype, dest, tag, comm, request)</font></strong>
<a name="line2726">2726: </a><strong><font color="#228B22">  #define MPIU_Recv(buf, count, dtype, source, tag, comm, status)       MPI_Recv_c(buf, (MPI_Count)(count), dtype, source, tag, comm, status)</font></strong>
<a name="line2727">2727: </a><strong><font color="#228B22">  #define MPIU_Recv_init(buf, count, dtype, source, tag, comm, request) MPI_Recv_init_c(buf, (MPI_Count)(count), dtype, source, tag, comm, request)</font></strong>
<a name="line2728">2728: </a><strong><font color="#228B22">  #define MPIU_Irecv(buf, count, dtype, source, tag, comm, request)     MPI_Irecv_c(buf, (MPI_Count)(count), dtype, source, tag, comm, request)</font></strong>
<a name="line2729">2729: </a><font color="#A020F0">  #if defined(PETSC_HAVE_MPI_REDUCE_LOCAL)</font>
<a name="line2730">2730: </a><strong><font color="#228B22">    #define MPIU_Reduce_local(inbuf, inoutbuf, count, dtype, op) MPI_Reduce_local_c(inbuf, inoutbuf, (MPI_Count)(count), dtype, op)</font></strong>
<a name="line2731">2731: </a><font color="#A020F0">  #endif</font>

<a name="line2733">2733: </a><font color="#B22222">/*MC</font>
<a name="line2734">2734: </a><font color="#B22222">  <a href="../manualpages/Sys/MPIU_Scatterv.html">MPIU_Scatterv</a> - A replacement for `<a href="http://www.mpich.org/static/docs/latest/www3/MPI_Scatterv.html#MPI_Scatterv">MPI_Scatterv</a>()` that can be called with `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` types when PETSc is built for either 32-bit indices or 64-bit indices.</font>

<a name="line2736">2736: </a><font color="#B22222">  Synopsis:</font>
<a name="line2737">2737: </a>#include <A href="../include/petscsys.h.html">&lt;petscsys.h&gt;</A>
<a name="line2738">2738: </a><font color="#B22222">  <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> <a href="../manualpages/Sys/MPIU_Scatterv.html">MPIU_Scatterv</a>(const void *sendbuf, const <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> sendcounts[], const <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> displs[], MPI_Datatype sendtype, void *recvbuf, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> recvcount, MPI_Datatype recvtype, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> root, <a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a> comm)</font>

<a name="line2740">2740: </a><font color="#B22222">  Collective</font>

<a name="line2742">2742: </a><font color="#B22222">  Input Parameters:</font>
<a name="line2743">2743: </a><font color="#B22222">+ sendbuf    - address of send buffer</font>
<a name="line2744">2744: </a><font color="#B22222">. sendcounts - non-negative `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` array (of length `comm` group size) specifying the number of elements to send to each MPI process</font>
<a name="line2745">2745: </a><font color="#B22222">. displs     - `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` array (of length `comm` group size). Entry i specifies the displacement (relative to `sendbuf`) from which to take the outgoing data to process i</font>
<a name="line2746">2746: </a><font color="#B22222">. sendtype   - data type of `sendbuf` elements</font>
<a name="line2747">2747: </a><font color="#B22222">. recvcount  - number of elements in `recvbuf` (non-negative integer)</font>
<a name="line2748">2748: </a><font color="#B22222">. recvtype   - data type of `recvbuf` elements</font>
<a name="line2749">2749: </a><font color="#B22222">. root       - Rank of the MPI root process, which will dispatch the data to scatter</font>
<a name="line2750">2750: </a><font color="#B22222">- comm       - `<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>` communicator</font>

<a name="line2752">2752: </a><font color="#B22222">  Output Parameter:</font>
<a name="line2753">2753: </a><font color="#B22222">. recvbuf - the resulting scattered values on this MPI process</font>

<a name="line2755">2755: </a><font color="#B22222">  Level: developer</font>

<a name="line2757">2757: </a><font color="#B22222">  Notes:</font>
<a name="line2758">2758: </a><font color="#B22222">  Should be wrapped with `<a href="../manualpages/Sys/PetscCallMPI.html">PetscCallMPI</a>()` for error checking</font>

<a name="line2760">2760: </a><font color="#B22222">  This is different than most of the `MPIU_` wrappers in that all the count arguments are in `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>`</font>

<a name="line2762">2762: </a><font color="#B22222">.seealso: [](stylePetscCount), `<a href="http://www.mpich.org/static/docs/latest/www3/MPI_Allreduce.html#MPI_Allreduce">MPI_Allreduce</a>()`, `MPIU_Gatherv()`</font>
<a name="line2763">2763: </a><font color="#B22222">M*/</font>

<a name="line2765">2765: </a><font color="#A020F0">  #if !defined(PETSC_USE_64BIT_INDICES)</font>
<a name="line2766">2766: </a><strong><font color="#228B22">    #define <a href="../manualpages/Sys/MPIU_Scatterv.html">MPIU_Scatterv</a>(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, comm) <a href="http://www.mpich.org/static/docs/latest/www3/MPI_Scatterv.html#MPI_Scatterv">MPI_Scatterv</a>(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, comm)</font></strong>
<a name="line2767">2767: </a><strong><font color="#228B22">    #define MPIU_Gatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, root, comm)  <a href="http://www.mpich.org/static/docs/latest/www3/MPI_Gatherv.html#MPI_Gatherv">MPI_Gatherv</a>(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, root, comm)</font></strong>
<a name="line2768">2768: </a><font color="#A020F0">  #else</font>
<a name="line2769">2769: </a><strong><font color="#228B22">    #define <a href="../manualpages/Sys/MPIU_Scatterv.html">MPIU_Scatterv</a>(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, comm) MPI_Scatterv_c(sendbuf, (const MPI_Count *)(sendcounts), (const MPI_Aint *)(displs), sendtype, recvbuf, recvcount, recvtype, root, comm)</font></strong>
<a name="line2770">2770: </a><strong><font color="#228B22">    #define MPIU_Gatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, root, comm)  MPI_Gatherv_c(sendbuf, sendcount, sendtype, recvbuf, (const MPI_Count *)(recvcounts), (const MPI_Aint *)(displs), recvtype, root, comm)</font></strong>
<a name="line2771">2771: </a><font color="#A020F0">  #endif</font>

<a name="line2773">2773: </a><font color="#A020F0">#endif</font>

<a name="line2775">2775: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> MPIU_Allreduce_Private(const void *, void *, MPIU_Count, MPI_Datatype, MPI_Op, <a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>)</font></strong>;

<a name="line2777">2777: </a><font color="#A020F0">#if defined(PETSC_USE_DEBUG)</font>
<a name="line2778">2778: </a><strong><font color="#4169E1"><a name="PetscStrHash"></a>static inline unsigned int PetscStrHash(const char *str)</font></strong>
<a name="line2779">2779: </a>{
<a name="line2780">2780: </a>  unsigned int c, hash = 5381;

<a name="line2782">2782: </a>  <font color="#4169E1">while</font> ((c = (unsigned int)*str++)) hash = ((hash &lt;&lt; 5) + hash) + c; <font color="#B22222">/* hash * 33 + c */</font>
<a name="line2783">2783: </a>  <font color="#4169E1">return</font> hash;
<a name="line2784">2784: </a>}
<a name="line2785">2785: </a><font color="#A020F0">#endif</font>

<a name="line2787">2787: </a><font color="#B22222">/*MC</font>
<a name="line2788">2788: </a><font color="#B22222">  <a href="../manualpages/Sys/MPIU_Allreduce.html">MPIU_Allreduce</a> - A replacement for `<a href="http://www.mpich.org/static/docs/latest/www3/MPI_Allreduce.html#MPI_Allreduce">MPI_Allreduce</a>()` that (1) performs single-count `<a href="../manualpages/Sys/MPIU_INT.html">MPIU_INT</a>` operations in `PetscInt64` to detect</font>
<a name="line2789">2789: </a><font color="#B22222">                   integer overflows and (2) tries to determine if the call from all the MPI ranks occur in the</font>
<a name="line2790">2790: </a><font color="#B22222">                   same place in the PETSc code. This helps to detect bugs where different MPI ranks follow different code paths</font>
<a name="line2791">2791: </a><font color="#B22222">                   resulting in inconsistent and incorrect calls to `<a href="http://www.mpich.org/static/docs/latest/www3/MPI_Allreduce.html#MPI_Allreduce">MPI_Allreduce</a>()`.</font>

<a name="line2793">2793: </a><font color="#B22222">  Synopsis:</font>
<a name="line2794">2794: </a>#include <A href="../include/petscsys.h.html">&lt;petscsys.h&gt;</A>
<a name="line2795">2795: </a><font color="#B22222">  <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> <a href="../manualpages/Sys/MPIU_Allreduce.html">MPIU_Allreduce</a>(void *indata,void *outdata,<a href="../manualpages/Sys/PetscCount.html">PetscCount</a> count,MPI_Datatype dtype, MPI_Op op, <a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a> comm);</font>

<a name="line2797">2797: </a><font color="#B22222">  Collective</font>

<a name="line2799">2799: </a><font color="#B22222">  Input Parameters:</font>
<a name="line2800">2800: </a><font color="#B22222">+ a     - pointer to the input data to be reduced</font>
<a name="line2801">2801: </a><font color="#B22222">. count - the number of MPI data items in `a` and `b`</font>
<a name="line2802">2802: </a><font color="#B22222">. dtype - the MPI datatype, for example `MPI_INT`</font>
<a name="line2803">2803: </a><font color="#B22222">. op    - the MPI operation, for example `MPI_SUM`</font>
<a name="line2804">2804: </a><font color="#B22222">- comm   - the MPI communicator on which the operation occurs</font>

<a name="line2806">2806: </a><font color="#B22222">  Output Parameter:</font>
<a name="line2807">2807: </a><font color="#B22222">. b - the reduced values</font>

<a name="line2809">2809: </a><font color="#B22222">  Level: developer</font>

<a name="line2811">2811: </a><font color="#B22222">  Note:</font>
<a name="line2812">2812: </a><font color="#B22222">  Should be wrapped with `<a href="../manualpages/Sys/PetscCallMPI.html">PetscCallMPI</a>()` for error checking</font>

<a name="line2814">2814: </a><font color="#B22222">.seealso: [](stylePetscCount), `<a href="http://www.mpich.org/static/docs/latest/www3/MPI_Allreduce.html#MPI_Allreduce">MPI_Allreduce</a>()`</font>
<a name="line2815">2815: </a><font color="#B22222">M*/</font>
<a name="line2816">2816: </a><font color="#A020F0">#if defined(PETSC_USE_DEBUG)</font>
<a name="line2817">2817: </a><strong><font color="#228B22">  #define <a href="../manualpages/Sys/MPIU_Allreduce.html">MPIU_Allreduce</a>(a, b, c, d, e, fcomm) \</font></strong>
<a name="line2818">2818: </a><strong><font color="#228B22">    PetscMacroReturnStandard( \</font></strong>
<a name="line2819">2819: </a><strong><font color="#228B22">    <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> a_b1[6], a_b2[6]; \</font></strong>
<a name="line2820">2820: </a><strong><font color="#228B22">    int _mpiu_allreduce_c_int = (int)(c); \</font></strong>
<a name="line2821">2821: </a><strong><font color="#228B22">    a_b1[0] = -(<a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>)__LINE__; \</font></strong>
<a name="line2822">2822: </a><strong><font color="#228B22">    a_b1[1] = -a_b1[0]; \</font></strong>
<a name="line2823">2823: </a><strong><font color="#228B22">    a_b1[2] = -(<a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>)PetscStrHash(PETSC_FUNCTION_NAME); \</font></strong>
<a name="line2824">2824: </a><strong><font color="#228B22">    a_b1[3] = -a_b1[2]; \</font></strong>
<a name="line2825">2825: </a><strong><font color="#228B22">    a_b1[4] = -(<a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>)(c); \</font></strong>
<a name="line2826">2826: </a><strong><font color="#228B22">    a_b1[5] = -a_b1[4]; \</font></strong>
<a name="line2827">2827: </a><strong><font color="#228B22">    \</font></strong>
<a name="line2828">2828: </a><strong><font color="#228B22">    <a href="../manualpages/Sys/PetscCallMPI.html">PetscCallMPI</a>(<a href="http://www.mpich.org/static/docs/latest/www3/MPI_Allreduce.html#MPI_Allreduce">MPI_Allreduce</a>(a_b1, a_b2, 6, MPI_INT, MPI_MAX, fcomm)); \</font></strong>
<a name="line2829">2829: </a><strong><font color="#228B22">    <a href="../manualpages/Sys/PetscCheck.html">PetscCheck</a>(-a_b2[0] == a_b2[1], (fcomm), <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_PLIB</a>, </font><font color="#666666">"<a href="../manualpages/Sys/MPIU_Allreduce.html">MPIU_Allreduce</a>() called in different locations (code lines) on different processors"</font><font color="#228B22">); \</font></strong>
<a name="line2830">2830: </a><strong><font color="#228B22">    <a href="../manualpages/Sys/PetscCheck.html">PetscCheck</a>(-a_b2[2] == a_b2[3], (fcomm), <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_PLIB</a>, </font><font color="#666666">"<a href="../manualpages/Sys/MPIU_Allreduce.html">MPIU_Allreduce</a>() called in different locations (functions) on different processors"</font><font color="#228B22">); \</font></strong>
<a name="line2831">2831: </a><strong><font color="#228B22">    <a href="../manualpages/Sys/PetscCheck.html">PetscCheck</a>(-a_b2[4] == a_b2[5], (fcomm), <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_PLIB</a>, </font><font color="#666666">"<a href="../manualpages/Sys/MPIU_Allreduce.html">MPIU_Allreduce</a>() called with different counts %d on different processors"</font><font color="#228B22">, _mpiu_allreduce_c_int); \</font></strong>
<a name="line2832">2832: </a><strong><font color="#228B22">    <a href="../manualpages/Sys/PetscCallMPI.html">PetscCallMPI</a>(MPIU_Allreduce_Private((a), (b), (c), (d), (e), (fcomm)));)</font></strong>
<a name="line2833">2833: </a><font color="#A020F0">#else</font>
<a name="line2834">2834: </a><strong><font color="#228B22">  #define <a href="../manualpages/Sys/MPIU_Allreduce.html">MPIU_Allreduce</a>(a, b, c, d, e, fcomm) MPIU_Allreduce_Private((a), (b), (c), (d), (e), (fcomm))</font></strong>
<a name="line2835">2835: </a><font color="#A020F0">#endif</font>

<a name="line2837">2837: </a><font color="#A020F0">#if defined(PETSC_HAVE_MPI_PROCESS_SHARED_MEMORY)</font>
<a name="line2838">2838: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> MPIU_Win_allocate_shared(MPI_Aint, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>, MPI_Info, <a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, void *, MPI_Win *)</font></strong>;
<a name="line2839">2839: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> MPIU_Win_shared_query(MPI_Win, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>, MPI_Aint *, <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> *, void *)</font></strong>;
<a name="line2840">2840: </a><font color="#A020F0">#endif</font>

<a name="line2842">2842: </a><font color="#B22222">/* this is a vile hack */</font>
<a name="line2843">2843: </a><font color="#A020F0">#if defined(PETSC_HAVE_NECMPI)</font>
<a name="line2844">2844: </a><font color="#A020F0">  #if !defined(PETSC_NECMPI_VERSION_MAJOR) || !defined(PETSC_NECMPI_VERSION_MINOR) || PETSC_NECMPI_VERSION_MAJOR &lt; 2 || (PETSC_NECMPI_VERSION_MAJOR == 2 &amp;&amp; PETSC_NECMPI_VERSION_MINOR &lt; 18)</font>
<a name="line2845">2845: </a><strong><font color="#228B22">    #define <a href="http://www.mpich.org/static/docs/latest/www3/MPI_Type_free.html#MPI_Type_free">MPI_Type_free</a>(a) (*(a) = MPI_DATATYPE_NULL, 0);</font></strong>
<a name="line2846">2846: </a><font color="#A020F0">  #endif</font>
<a name="line2847">2847: </a><font color="#A020F0">#endif</font>

<a name="line2849">2849: </a><font color="#B22222">/*</font>
<a name="line2850">2850: </a><font color="#B22222">    List of external packages and queries on it</font>
<a name="line2851">2851: </a><font color="#B22222">*/</font>
<a name="line2852">2852: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscHasExternalPackage.html">PetscHasExternalPackage</a>(const char[], <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> *)</font></strong>;

<a name="line2854">2854: </a><font color="#B22222">/* this cannot go here because it may be in a different shared library */</font>
<a name="line2855">2855: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/PC/PCMPIServerBegin.html">PCMPIServerBegin</a>(void)</font></strong>;
<a name="line2856">2856: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/PC/PCMPIServerEnd.html">PCMPIServerEnd</a>(void)</font></strong>;
<a name="line2857">2857: </a>PETSC_EXTERN <a href="../manualpages/Sys/PetscBool.html">PetscBool</a>      PCMPIServerActive;
<a name="line2858">2858: </a>PETSC_EXTERN <a href="../manualpages/Sys/PetscBool.html">PetscBool</a>      PCMPIServerInSolve;
<a name="line2859">2859: </a>PETSC_EXTERN <a href="../manualpages/Sys/PetscBool.html">PetscBool</a>      PCMPIServerUseShmget;
<a name="line2860">2860: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscShmgetAllocateArray.html">PetscShmgetAllocateArray</a>(size_t, size_t, void **)</font></strong>;
<a name="line2861">2861: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscShmgetDeallocateArray.html">PetscShmgetDeallocateArray</a>(void **)</font></strong>;
<a name="line2862">2862: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscShmgetMapAddresses.html">PetscShmgetMapAddresses</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, const void **, void **)</font></strong>;
<a name="line2863">2863: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscShmgetUnmapAddresses.html">PetscShmgetUnmapAddresses</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, void **)</font></strong>;
<a name="line2864">2864: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscShmgetAddressesFinalize.html">PetscShmgetAddressesFinalize</a>(void)</font></strong>;

<a name="line2866">2866: </a><font color="#4169E1">typedef</font> <font color="#4169E1">struct</font> {
<a name="line2867">2867: </a>  <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> n;
<a name="line2868">2868: </a>  void    *addr[3];
<a name="line2869">2869: </a>} PCMPIServerAddresses;
<a name="line2870">2870: </a>PETSC_EXTERN <a href="../manualpages/Sys/PetscCtxDestroyFn.html">PetscCtxDestroyFn</a> PCMPIServerAddressesDestroy;

<a name="line2872">2872: </a><strong><font color="#228B22">#define PETSC_HAVE_FORTRAN PETSC_DEPRECATED_MACRO(3, 20, 0, </font><font color="#666666">"PETSC_USE_FORTRAN_BINDINGS"</font><font color="#228B22">, ) PETSC_USE_FORTRAN_BINDINGS</font></strong>

<a name="line2874">2874: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscBLASSetNumThreads.html">PetscBLASSetNumThreads</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>)</font></strong>;
<a name="line2875">2875: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/Sys/PetscBLASGetNumThreads.html">PetscBLASGetNumThreads</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *)</font></strong>;

<a name="line2877">2877: </a><font color="#B22222">/*MC</font>
<a name="line2878">2878: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscSafePointerPlusOffset.html">PetscSafePointerPlusOffset</a> - Checks that a pointer is not `NULL` before applying an offset</font>

<a name="line2880">2880: </a><font color="#B22222">   Level: beginner</font>

<a name="line2882">2882: </a><font color="#B22222">   Note:</font>
<a name="line2883">2883: </a><font color="#B22222">   This is needed to avoid errors with undefined-behavior sanitizers such as</font>
<a name="line2884">2884: </a><font color="#B22222">   UBSan, assuming PETSc has been configured with `-fsanitize=undefined` as part of the compiler flags</font>
<a name="line2885">2885: </a><font color="#B22222">M*/</font>
<a name="line2886">2886: </a><strong><font color="#228B22">#define <a href="../manualpages/Sys/PetscSafePointerPlusOffset.html">PetscSafePointerPlusOffset</a>(ptr, offset) ((ptr) ? (ptr) + (offset) : NULL)</font></strong>

<a name="line2888">2888: </a><font color="#B22222">/* this is required to force <a href="../manualpages/Sys/PetscDevice.html">PetscDevice</a> to be visible at the system level for the Fortran interface */</font>
<a name="line2889">2889: </a>#include <A href="../include/petscdevicetypes.h.html">&lt;petscdevicetypes.h&gt;</A>
</pre>
</body>

</html>