-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathuserhtmlse3.html
2702 lines (2512 loc) · 120 KB
/
userhtmlse3.html
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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html >
<head><title>Data Structures and Classes</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="generator" content="TeX4ht (https://tug.org/tex4ht/)">
<meta name="originator" content="TeX4ht (https://tug.org/tex4ht/)">
<!-- html,3 -->
<meta name="src" content="userhtml.tex">
<link rel="stylesheet" type="text/css" href="userhtml.css">
</head><body
>
<!--l. 1--><div class="crosslinks"><p class="noindent">[<a
href="userhtmlse7.html" >next</a>] [<a
href="userhtmlse2.html" >prev</a>] [<a
href="userhtmlse2.html#tailuserhtmlse2.html" >prev-tail</a>] [<a
href="#tailuserhtmlse3.html">tail</a>] [<a
href="userhtml.html#userhtmlse6.html" >up</a>] </p></div>
<h3 class="sectionHead"><span class="titlemark">3 </span> <a
id="x8-90003"></a>Data Structures and Classes</h3>
<!--l. 5--><p class="noindent" >In this chapter we illustrate the data structures used for definition of routines
interfaces. They include data structures for sparse matrices, communication
descriptors and preconditioners.
<!--l. 11--><p class="indent" > All the data types and the basic subroutine interfaces related to descriptors and
sparse matrices are defined in the module <code class="lstinline"><span style="color:#000000">psb_base_mod</span></code>; this will have to be
included by every user subroutine that makes use of the library. The preconditioners
are defined in the module <code class="lstinline"><span style="color:#000000">psb_prec_mod</span></code>
<!--l. 17--><p class="indent" > Integer, real and complex data types are parametrized with a kind type defined in
the library as follows:
<dl class="description"><dt class="description">
<!--l. 20--><p class="noindent" >
<span
class="pplb7t-">psb</span><span
class="pplb7t-">_spk</span><span
class="pplb7t-">_</span> </dt><dd
class="description">
<!--l. 20--><p class="noindent" >Kind parameter for short precision real and complex data; corresponds
to a <code class="lstinline"><span style="color:#000000">REAL</span></code> declaration and is normally 4 bytes;
</dd><dt class="description">
<!--l. 23--><p class="noindent" >
<span
class="pplb7t-">psb</span><span
class="pplb7t-">_dpk</span><span
class="pplb7t-">_</span> </dt><dd
class="description">
<!--l. 23--><p class="noindent" >Kind parameter for long precision real and complex data; corresponds to
a <code class="lstinline"><span style="color:#000000">DOUBLE</span><span style="color:#000000"> </span><span style="color:#000000">PRECISION</span></code> declaration and is normally 8 bytes;
</dd><dt class="description">
<!--l. 26--><p class="noindent" >
<span
class="pplb7t-">psb</span><span
class="pplb7t-">_mpk</span><span
class="pplb7t-">_</span> </dt><dd
class="description">
<!--l. 26--><p class="noindent" >Kind parameter for 4-bytes integer data, as is always used by MPI;
</dd><dt class="description">
<!--l. 28--><p class="noindent" >
<span
class="pplb7t-">psb</span><span
class="pplb7t-">_epk</span><span
class="pplb7t-">_</span> </dt><dd
class="description">
<!--l. 28--><p class="noindent" >Kind parameter for 8-bytes integer data, as is always used by the <code class="lstinline"><span style="color:#000000">sizeof</span></code>
methods;
</dd><dt class="description">
<!--l. 30--><p class="noindent" >
<span
class="pplb7t-">psb</span><span
class="pplb7t-">_ipk</span><span
class="pplb7t-">_</span> </dt><dd
class="description">
<!--l. 30--><p class="noindent" >Kind parameter for “local” integer indices and data; with default build
options this is a 4 bytes integer;
</dd><dt class="description">
<!--l. 32--><p class="noindent" >
<span
class="pplb7t-">psb</span><span
class="pplb7t-">_lpk</span><span
class="pplb7t-">_</span> </dt><dd
class="description">
<!--l. 32--><p class="noindent" >Kind parameter for “global” integer indices and data; with default build
options this is an 8 bytes integer;</dd></dl>
<!--l. 35--><p class="noindent" >The integer kinds for local and global indices can be chosen at configure time to hold 4
or 8 bytes, with the global indices at least as large as the local ones. Together with the
classes attributes we also discuss their methods. Most methods detailed here only act
on the local variable, i.e. their action is purely local and asynchronous unless
otherwise stated. The list of methods here is not completely exhaustive; many
methods, especially those that alter the contents of the various objects, are usually
not needed by the end-user, and therefore are described in the developer’s
documentation.
<!--l. 48--><p class="noindent" >
<h4 class="subsectionHead"><span class="titlemark">3.1 </span> <a
id="x8-100003.1"></a>Descriptor data structure</h4>
<!--l. 50--><p class="noindent" >All the general matrix informations and elements to be exchanged among processes
are stored within a data structure of the type <a
id="descdata"></a><span
class="cmtt-10">psb</span><span
class="cmtt-10">_desc</span><span
class="cmtt-10">_type</span>. Every structure of this
type is associated with a discretization pattern and enables data communications
and other operations that are necessary for implementing the various algorithms of
interest to us.
<!--l. 57--><p class="indent" > The data structure itself <code class="lstinline"><span style="color:#000000">psb_desc_type</span></code> can be treated as an opaque object
handled via the tools routines of Sec. <a
href="userhtmlse6.html#x11-770006">6<!--tex4ht:ref: sec:toolsrout --></a> or the query routines detailed below;
nevertheless we include here a description for the curious reader.
<!--l. 63--><p class="indent" > First we describe the <code class="lstinline"><span style="color:#000000">psb_indx_map</span></code> type. This is a data structure that keeps track
of a certain number of basic issues such as:
<ul class="itemize1">
<li class="itemize">
<!--l. 67--><p class="noindent" >The value of the communication context;
</li>
<li class="itemize">
<!--l. 68--><p class="noindent" >The number of indices in the index space, i.e. global number of rows and
columns of a sparse matrix;
</li>
<li class="itemize">
<!--l. 70--><p class="noindent" >The local set of indices, including:
<ul class="itemize2">
<li class="itemize">
<!--l. 72--><p class="noindent" >The number of local indices (and local rows);
</li>
<li class="itemize">
<!--l. 73--><p class="noindent" >The number of halo indices (and therefore local columns);
</li>
<li class="itemize">
<!--l. 74--><p class="noindent" >The global indices corresponding to the local ones.</li></ul>
</li></ul>
<!--l. 77--><p class="noindent" >There are many different schemes for storing these data; therefore there are a number of
types extending the base one, and the descriptor structure holds a polymorphic
object whose dynamic type can be any of the extended types. The methods
associated with this data type answer the following queries:
<ul class="itemize1">
<li class="itemize">
<!--l. 84--><p class="noindent" >For a given set of local indices, find the corresponding indices in the
global numbering;
</li>
<li class="itemize">
<!--l. 86--><p class="noindent" >For a given set of global indices, find the corresponding indices in the
local numbering, if any, or return an invalid
</li>
<li class="itemize">
<!--l. 88--><p class="noindent" >Add a global index to the set of halo indices;
</li>
<li class="itemize">
<!--l. 89--><p class="noindent" >Find the process owner of each member of a set of global indices.</li></ul>
<!--l. 92--><p class="noindent" >All methods but the last are purely local; the last method potentially requires
communication among processes, and thus is a synchronous method. The
choice of a specific dynamic type for the index map is made at the time the
descriptor is initially allocated, according to the mode of initialization (see
also <a
href="userhtmlse6.html#x11-770006">6<!--tex4ht:ref: sec:toolsrout --></a>).
<!--l. 98--><p class="indent" > The descriptor contents are as follows:
<dl class="description"><dt class="description">
<!--l. 100--><p class="noindent" >
<span
class="pplb7t-">indxmap</span> </dt><dd
class="description">
<!--l. 100--><p class="noindent" >A polymorphic variable of a type that is any extension of the indx_map
type described above. <br
class="newline" />
</dd><dt class="description">
<!--l. 102--><p class="noindent" >
<span
class="pplb7t-">halo</span><span
class="pplb7t-">_index</span> </dt><dd
class="description">
<!--l. 102--><p class="noindent" >A list of the halo and boundary elements for the current process to be
exchanged with other processes; for each processes with which it is necessary
to communicate:
<ol class="enumerate1" >
<li
class="enumerate" id="x8-10002x1">
<!--l. 106--><p class="noindent" >Process identifier;
</li>
<li
class="enumerate" id="x8-10004x2">
<!--l. 107--><p class="noindent" >Number of points to be received;
</li>
<li
class="enumerate" id="x8-10006x3">
<!--l. 108--><p class="noindent" >Indices of points to be received;
</li>
<li
class="enumerate" id="x8-10008x4">
<!--l. 109--><p class="noindent" >Number of points to be sent;
</li>
<li
class="enumerate" id="x8-10010x5">
<!--l. 110--><p class="noindent" >Indices of points to be sent;</li></ol>
<!--l. 114--><p class="noindent" >Specified as: a vector of integer type, see <a
href="#x8-460003.3">3.3<!--tex4ht:ref: sec:vecttype --></a>.
</dd><dt class="description">
<!--l. 115--><p class="noindent" >
<span
class="pplb7t-">ext</span><span
class="pplb7t-">_index</span> </dt><dd
class="description">
<!--l. 115--><p class="noindent" >A list of element indices to be exchanged to implement the mapping between a
base descriptor and a descriptor with overlap. <br
class="newline" />Specified as: a vector of integer type, see <a
href="#x8-460003.3">3.3<!--tex4ht:ref: sec:vecttype --></a>.
</dd><dt class="description">
<!--l. 119--><p class="noindent" >
<span
class="pplb7t-">ovrlap</span><span
class="pplb7t-">_index</span> </dt><dd
class="description">
<!--l. 119--><p class="noindent" >A list of the overlap elements for the current process, organized in groups like
the previous vector:
<ol class="enumerate1" >
<li
class="enumerate" id="x8-10012x1">
<!--l. 122--><p class="noindent" >Process identifier;
</li>
<li
class="enumerate" id="x8-10014x2">
<!--l. 123--><p class="noindent" >Number of points to be received;
</li>
<li
class="enumerate" id="x8-10016x3">
<!--l. 124--><p class="noindent" >Indices of points to be received;
</li>
<li
class="enumerate" id="x8-10018x4">
<!--l. 125--><p class="noindent" >Number of points to be sent;
</li>
<li
class="enumerate" id="x8-10020x5">
<!--l. 126--><p class="noindent" >Indices of points to be sent;</li></ol>
<!--l. 130--><p class="noindent" >Specified as: a vector of integer type, see <a
href="#x8-460003.3">3.3<!--tex4ht:ref: sec:vecttype --></a>.
</dd><dt class="description">
<!--l. 131--><p class="noindent" >
<span
class="pplb7t-">ovr</span><span
class="pplb7t-">_mst</span><span
class="pplb7t-">_idx</span> </dt><dd
class="description">
<!--l. 131--><p class="noindent" >A list to retrieve the value of each overlap element from the respective master
process.<br
class="newline" />Specified as: a vector of integer type, see <a
href="#x8-460003.3">3.3<!--tex4ht:ref: sec:vecttype --></a>.
</dd><dt class="description">
<!--l. 134--><p class="noindent" >
<span
class="pplb7t-">ovrlap</span><span
class="pplb7t-">_elem</span> </dt><dd
class="description">
<!--l. 134--><p class="noindent" >For all overlap points belonging to th ecurrent process:
<ol class="enumerate1" >
<li
class="enumerate" id="x8-10022x1">
<!--l. 137--><p class="noindent" >Overlap point index;
</li>
<li
class="enumerate" id="x8-10024x2">
<!--l. 138--><p class="noindent" >Number of processes sharing that overlap points;
</li>
<li
class="enumerate" id="x8-10026x3">
<!--l. 139--><p class="noindent" >Index of a “master” process:</li></ol>
<!--l. 141--><p class="noindent" >Specified as: an allocatable integer array of rank two.
</dd><dt class="description">
<!--l. 142--><p class="noindent" >
<span
class="pplb7t-">bnd</span><span
class="pplb7t-">_elem</span> </dt><dd
class="description">
<!--l. 142--><p class="noindent" >A list of all boundary points, i.e. points that have a connection with other
processes.</dd></dl>
<!--l. 145--><p class="noindent" >The Fortran 2003 declaration for <code class="lstinline"><span style="color:#000000">psb_desc_type</span></code> structures is as follows:
<!--l. 147--><p class="indent" > <a
id="x8-10027r1"></a><hr class="float"><div class="float"
>
<div class="center"
>
<!--l. 162--><p class="noindent" >
<div class="minipage"><pre class="verbatim" id="verbatim-1">
type psb_desc_type
    class(psb_indx_map), allocatable :: indxmap
    type(psb_i_vect_type) :: v_halo_index
    type(psb_i_vect_type) :: v_ext_index
    type(psb_i_vect_type) :: v_ovrlap_index
    type(psb_i_vect_type) :: v_ovr_mst_idx
    integer, allocatable  :: ovrlap_elem(:,:)
    integer, allocatable  :: bnd_elem(:)
end type psb_desc_type
</pre>
<!--l. 174--><p class="nopar" > </div></div>
<br /> <div class="caption"
><span class="id">Listing 1: </span><span
class="content">The PSBLAS defined data type that contains the communication
descriptor.</span></div><!--tex4ht:label?: x8-10027r1 -->
</div><hr class="endfloat" />
<!--l. 186--><p class="indent" > A communication descriptor associated with a sparse matrix has a state, which
can take the following values:
<dl class="description"><dt class="description">
<!--l. 189--><p class="noindent" >
<span
class="pplb7t-">Build:</span> </dt><dd
class="description">
<!--l. 189--><p class="noindent" >State entered after the first allocation, and before the first assembly; in this
state it is possible to add communication requirements among different
processes.
</dd><dt class="description">
<!--l. 192--><p class="noindent" >
<span
class="pplb7t-">Assembled:</span> </dt><dd
class="description">
<!--l. 192--><p class="noindent" >State entered after the assembly; computations using the associated
sparse matrix, such as matrix-vector products, are only possible in this
state.</dd></dl>
<h5 class="subsubsectionHead"><span class="titlemark">3.1.1 </span> <a
id="x8-110003.1.1"></a>Descriptor Methods</h5>
<!--l. 199--><p class="noindent" >
<h5 class="subsubsectionHead"><span class="titlemark">3.1.2 </span> <a
id="x8-120003.1.2"></a>get_local_rows — Get number of local rows</h5>
<pre class="verbatim" id="verbatim-2">
nr = desc%get_local_rows()
</pre>
<!--l. 203--><p class="nopar" >
<!--l. 205--><p class="indent" >
<dl class="description"><dt class="description">
<!--l. 206--><p class="noindent" >
<span
class="pplb7t-">Type:</span> </dt><dd
class="description">
<!--l. 206--><p class="noindent" >Asynchronous.
</dd><dt class="description">
<!--l. 207--><p class="noindent" >
<span
class="pplb7t-">On Entry</span> </dt><dd
class="description">
<!--l. 207--><p class="noindent" >
</dd><dt class="description">
<!--l. 208--><p class="noindent" >
<span
class="pplb7t-">desc</span> </dt><dd
class="description">
<!--l. 208--><p class="noindent" >the communication descriptor.<br
class="newline" />Scope: <span
class="pplb7t-">local</span>.<br
class="newline" /></dd></dl>
<!--l. 215--><p class="indent" >
<dl class="description"><dt class="description">
<!--l. 216--><p class="noindent" >
<span
class="pplb7t-">On Return</span> </dt><dd
class="description">
<!--l. 216--><p class="noindent" >
</dd><dt class="description">
<!--l. 217--><p class="noindent" >
<span
class="pplb7t-">Function value</span> </dt><dd
class="description">
<!--l. 217--><p class="noindent" >The number of local rows, i.e. the number of rows owned by the current
process; as explained in <a
href="userhtmlse1.html#x3-20001">1<!--tex4ht:ref: sec:intro --></a>, it is equal to <span
class="zplmr7y-">|<img
src="zplmr7y-49.png" alt="I" class="x-x-49" /></span><sub><span
class="zplmr7m-x-x-76">i</span></sub><span
class="zplmr7y-">| </span><span
class="zplmr7t-">+ </span><span
class="zplmr7y-">|<img
src="zplmr7y-42.png" alt="B" class="x-x-42" /></span><sub><span
class="zplmr7m-x-x-76">i</span></sub><span
class="zplmr7y-">|</span>. The returned value is
specific to the calling process.</dd></dl>
<!--l. 224--><p class="noindent" >
<h5 class="subsubsectionHead"><span class="titlemark">3.1.3 </span> <a
id="x8-130003.1.3"></a>get_local_cols — Get number of local cols</h5>
<pre class="verbatim" id="verbatim-3">
nc = desc%get_local_cols()
</pre>
<!--l. 228--><p class="nopar" >
<!--l. 230--><p class="indent" >
<dl class="description"><dt class="description">
<!--l. 231--><p class="noindent" >
<span
class="pplb7t-">Type:</span> </dt><dd
class="description">
<!--l. 231--><p class="noindent" >Asynchronous.
</dd><dt class="description">
<!--l. 232--><p class="noindent" >
<span
class="pplb7t-">On Entry</span> </dt><dd
class="description">
<!--l. 232--><p class="noindent" >
</dd><dt class="description">
<!--l. 233--><p class="noindent" >
<span
class="pplb7t-">desc</span> </dt><dd
class="description">
<!--l. 233--><p class="noindent" >the communication descriptor.<br
class="newline" />Scope: <span
class="pplb7t-">local</span>.<br
class="newline" /></dd></dl>
<!--l. 240--><p class="indent" >
<dl class="description"><dt class="description">
<!--l. 241--><p class="noindent" >
<span
class="pplb7t-">On Return</span> </dt><dd
class="description">
<!--l. 241--><p class="noindent" >
</dd><dt class="description">
<!--l. 242--><p class="noindent" >
<span
class="pplb7t-">Function value</span> </dt><dd
class="description">
<!--l. 242--><p class="noindent" >The number of local cols, i.e. the number of indices used by the current
process, including both local and halo indices; as explained in <a
href="userhtmlse1.html#x3-20001">1<!--tex4ht:ref: sec:intro --></a>, it is
equal to <span
class="zplmr7y-">|<img
src="zplmr7y-49.png" alt="I" class="x-x-49" /></span><sub><span
class="zplmr7m-x-x-76">i</span></sub><span
class="zplmr7y-">| </span><span
class="zplmr7t-">+ </span><span
class="zplmr7y-">|<img
src="zplmr7y-42.png" alt="B" class="x-x-42" /></span><sub><span
class="zplmr7m-x-x-76">i</span></sub><span
class="zplmr7y-">| </span><span
class="zplmr7t-">+ </span><span
class="zplmr7y-">|<img
src="zplmr7y-48.png" alt="H" class="x-x-48" /></span><sub><span
class="zplmr7m-x-x-76">i</span></sub><span
class="zplmr7y-">|</span>. The returned value is specific to the calling
process.</dd></dl>
<!--l. 250--><p class="noindent" >
<h5 class="subsubsectionHead"><span class="titlemark">3.1.4 </span> <a
id="x8-140003.1.4"></a>get_global_rows — Get number of global rows</h5>
<pre class="verbatim" id="verbatim-4">
nr = desc%get_global_rows()
</pre>
<!--l. 254--><p class="nopar" >
<!--l. 256--><p class="indent" >
<dl class="description"><dt class="description">
<!--l. 257--><p class="noindent" >
<span
class="pplb7t-">Type:</span> </dt><dd
class="description">
<!--l. 257--><p class="noindent" >Asynchronous.
</dd><dt class="description">
<!--l. 258--><p class="noindent" >
<span
class="pplb7t-">On Entry</span> </dt><dd
class="description">
<!--l. 258--><p class="noindent" >
</dd><dt class="description">
<!--l. 259--><p class="noindent" >
<span
class="pplb7t-">desc</span> </dt><dd
class="description">
<!--l. 259--><p class="noindent" >the communication descriptor.<br
class="newline" />Scope: <span
class="pplb7t-">local</span>.<br
class="newline" /></dd></dl>
<!--l. 266--><p class="indent" >
<dl class="description"><dt class="description">
<!--l. 267--><p class="noindent" >
<span
class="pplb7t-">On Return</span> </dt><dd
class="description">
<!--l. 267--><p class="noindent" >
</dd><dt class="description">
<!--l. 268--><p class="noindent" >
<span
class="pplb7t-">Function value</span> </dt><dd
class="description">
<!--l. 268--><p class="noindent" >The number of global rows, i.e. the size of the global index space.</dd></dl>
<!--l. 272--><p class="noindent" >
<h5 class="subsubsectionHead"><span class="titlemark">3.1.5 </span> <a
id="x8-150003.1.5"></a>get_global_cols — Get number of global cols</h5>
<pre class="verbatim" id="verbatim-5">
nr = desc%get_global_cols()
</pre>
<!--l. 276--><p class="nopar" >
<!--l. 278--><p class="indent" >
<dl class="description"><dt class="description">
<!--l. 279--><p class="noindent" >
<span
class="pplb7t-">Type:</span> </dt><dd
class="description">
<!--l. 279--><p class="noindent" >Asynchronous.
</dd><dt class="description">
<!--l. 280--><p class="noindent" >
<span
class="pplb7t-">On Entry</span> </dt><dd
class="description">
<!--l. 280--><p class="noindent" >
</dd><dt class="description">
<!--l. 281--><p class="noindent" >
<span
class="pplb7t-">desc</span> </dt><dd
class="description">
<!--l. 281--><p class="noindent" >the communication descriptor.<br
class="newline" />Scope: <span
class="pplb7t-">local</span>.<br
class="newline" /></dd></dl>
<!--l. 288--><p class="indent" >
<dl class="description"><dt class="description">
<!--l. 289--><p class="noindent" >
<span
class="pplb7t-">On Return</span> </dt><dd
class="description">
<!--l. 289--><p class="noindent" >
</dd><dt class="description">
<!--l. 290--><p class="noindent" >
<span
class="pplb7t-">Function value</span> </dt><dd
class="description">
<!--l. 290--><p class="noindent" >The number of global cols; usually this is equal to the number of global
rows.</dd></dl>
<!--l. 295--><p class="noindent" >
<h5 class="subsubsectionHead"><span class="titlemark">3.1.6 </span> <a
id="x8-160003.1.6"></a>get_global_indices — Get vector of global indices</h5>
<pre class="verbatim" id="verbatim-6">
myidx = desc%get_global_indices([owned])
</pre>
<!--l. 299--><p class="nopar" >
<!--l. 301--><p class="indent" >
<dl class="description"><dt class="description">
<!--l. 302--><p class="noindent" >
<span
class="pplb7t-">Type:</span> </dt><dd
class="description">
<!--l. 302--><p class="noindent" >Asynchronous.
</dd><dt class="description">
<!--l. 303--><p class="noindent" >
<span
class="pplb7t-">On Entry</span> </dt><dd
class="description">
<!--l. 303--><p class="noindent" >
</dd><dt class="description">
<!--l. 304--><p class="noindent" >
<span
class="pplb7t-">desc</span> </dt><dd
class="description">
<!--l. 304--><p class="noindent" >the communication descriptor.<br
class="newline" />Scope: <span
class="pplb7t-">local</span>.<br
class="newline" />Type: <span
class="pplb7t-">required</span>.<br
class="newline" />
</dd><dt class="description">
<!--l. 307--><p class="noindent" >
<span
class="pplb7t-">owned</span> </dt><dd
class="description">
<!--l. 307--><p class="noindent" >Choose if you only want owned indices (<code class="lstinline"><span style="color:#000000">owned</span><span style="color:#000000">=.</span><span style="color:#000000">true</span><span style="color:#000000">.</span></code>) or also halo
indices (<code class="lstinline"><span style="color:#000000">owned</span><span style="color:#000000">=.</span><span style="color:#000000">false</span><span style="color:#000000">.</span></code>). Scope: <span
class="pplb7t-">local</span>.<br
class="newline" />Type: <span
class="pplb7t-">optional</span>; default: <code class="lstinline"><span style="color:#000000">.</span><span style="color:#000000">true</span><span style="color:#000000">.</span></code>.<br
class="newline" /></dd></dl>
<!--l. 315--><p class="indent" >
<dl class="description"><dt class="description">
<!--l. 316--><p class="noindent" >
<span
class="pplb7t-">On Return</span> </dt><dd
class="description">
<!--l. 316--><p class="noindent" >
</dd><dt class="description">
<!--l. 317--><p class="noindent" >
<span
class="pplb7t-">Function value</span> </dt><dd
class="description">
<!--l. 317--><p class="noindent" >The global indices, returned as an allocatable integer array of kind
<code class="lstinline"><span style="color:#000000">psb_lpk_</span></code> and rank 1.</dd></dl>
<!--l. 323--><p class="noindent" >
<h5 class="subsubsectionHead"><span class="titlemark">3.1.7 </span> <a
id="x8-170003.1.7"></a>get_context — Get communication context</h5>
<pre class="verbatim" id="verbatim-7">
ctxt = desc%get_context()
</pre>
<!--l. 327--><p class="nopar" >
<!--l. 329--><p class="indent" >
<dl class="description"><dt class="description">
<!--l. 330--><p class="noindent" >
<span
class="pplb7t-">Type:</span> </dt><dd
class="description">
<!--l. 330--><p class="noindent" >Asynchronous.
</dd><dt class="description">
<!--l. 331--><p class="noindent" >
<span
class="pplb7t-">On Entry</span> </dt><dd
class="description">
<!--l. 331--><p class="noindent" >
</dd><dt class="description">
<!--l. 332--><p class="noindent" >
<span
class="pplb7t-">desc</span> </dt><dd
class="description">
<!--l. 332--><p class="noindent" >the communication descriptor.<br
class="newline" />Scope: <span
class="pplb7t-">local</span>.<br
class="newline" /></dd></dl>
<!--l. 339--><p class="indent" >
<dl class="description"><dt class="description">
<!--l. 340--><p class="noindent" >
<span
class="pplb7t-">On Return</span> </dt><dd
class="description">
<!--l. 340--><p class="noindent" >
</dd><dt class="description">
<!--l. 341--><p class="noindent" >
<span
class="pplb7t-">Function value</span> </dt><dd
class="description">
<!--l. 341--><p class="noindent" >The communication context.</dd></dl>
<!--l. 344--><p class="noindent" >
<h5 class="subsubsectionHead"><span class="titlemark">3.1.8 </span> <a
id="x8-180003.1.8"></a>Clone — clone current object</h5>
<pre class="verbatim" id="verbatim-8">
call  desc%clone(descout,info)
</pre>
<!--l. 348--><p class="nopar" >
<!--l. 350--><p class="indent" >
<dl class="description"><dt class="description">
<!--l. 351--><p class="noindent" >
<span
class="pplb7t-">Type:</span> </dt><dd
class="description">
<!--l. 351--><p class="noindent" >Asynchronous.
</dd><dt class="description">
<!--l. 352--><p class="noindent" >
<span
class="pplb7t-">On Entry</span> </dt><dd
class="description">
<!--l. 352--><p class="noindent" >
</dd><dt class="description">
<!--l. 353--><p class="noindent" >
<span
class="pplb7t-">desc</span> </dt><dd
class="description">
<!--l. 353--><p class="noindent" >the communication descriptor.<br
class="newline" />Scope: <span
class="pplb7t-">local</span>.<br
class="newline" /></dd></dl>
<!--l. 360--><p class="indent" >
<dl class="description"><dt class="description">
<!--l. 361--><p class="noindent" >
<span
class="pplb7t-">On Return</span> </dt><dd
class="description">
<!--l. 361--><p class="noindent" >
</dd><dt class="description">
<!--l. 362--><p class="noindent" >
<span
class="pplb7t-">descout</span> </dt><dd
class="description">
<!--l. 362--><p class="noindent" >A copy of the input object.
</dd><dt class="description">
<!--l. 363--><p class="noindent" >
<span
class="pplb7t-">info</span> </dt><dd
class="description">
<!--l. 363--><p class="noindent" >Return code.</dd></dl>
<!--l. 367--><p class="noindent" >
<h5 class="subsubsectionHead"><span class="titlemark">3.1.9 </span> <a
id="x8-190003.1.9"></a>CNV — convert internal storage format</h5>
<pre class="verbatim" id="verbatim-9">
call  desc%cnv(mold)
</pre>
<!--l. 371--><p class="nopar" >
<!--l. 373--><p class="indent" >
<dl class="description"><dt class="description">
<!--l. 374--><p class="noindent" >
<span
class="pplb7t-">Type:</span> </dt><dd
class="description">
<!--l. 374--><p class="noindent" >Asynchronous.
</dd><dt class="description">
<!--l. 375--><p class="noindent" >
<span
class="pplb7t-">On Entry</span> </dt><dd
class="description">
<!--l. 375--><p class="noindent" >
</dd><dt class="description">
<!--l. 376--><p class="noindent" >
<span
class="pplb7t-">desc</span> </dt><dd
class="description">
<!--l. 376--><p class="noindent" >the communication descriptor.<br
class="newline" />Scope: <span
class="pplb7t-">local</span>.<br
class="newline" />
</dd><dt class="description">
<!--l. 378--><p class="noindent" >
<span
class="pplb7t-">mold</span> </dt><dd
class="description">
<!--l. 378--><p class="noindent" >the desired integer storage format.<br
class="newline" />Scope: <span
class="pplb7t-">local</span>.<br
class="newline" />Specified as: a object of type derived from (integer)
<a
id="vbasedata"></a><span
class="cmtt-10">psb</span><span
class="cmtt-10">_T</span><span
class="cmtt-10">_base</span><span
class="cmtt-10">_vect</span><span
class="cmtt-10">_type</span>.</dd></dl>
<!--l. 384--><p class="noindent" >The <code class="lstinline"><span style="color:#000000">mold</span></code> arguments may be employed to interface with special devices, such as GPUs
and other accelerators.
<!--l. 391--><p class="noindent" >
<h5 class="subsubsectionHead"><span class="titlemark">3.1.10 </span> <a
id="x8-200003.1.10"></a>psb_cd_get_hash_threshold — Get threshold for index mapping
switch</h5>
<pre class="verbatim" id="verbatim-10">
ith = psb_cd_get_hash_threshold()
</pre>
<!--l. 395--><p class="nopar" >
<!--l. 397--><p class="indent" >
<dl class="description"><dt class="description">
<!--l. 398--><p class="noindent" >
<span
class="pplb7t-">Type:</span> </dt><dd
class="description">
<!--l. 398--><p class="noindent" >Asynchronous.
</dd><dt class="description">
<!--l. 399--><p class="noindent" >
<span
class="pplb7t-">On Return</span> </dt><dd
class="description">
<!--l. 399--><p class="noindent" >
</dd><dt class="description">
<!--l. 400--><p class="noindent" >
<span
class="pplb7t-">Function value</span> </dt><dd
class="description">
<!--l. 400--><p class="noindent" >The current value for the size threshold.
</dd></dl>
<!--l. 407--><p class="noindent" >
<h5 class="subsubsectionHead"><span class="titlemark">3.1.11 </span> <a
id="x8-210003.1.11"></a>psb_cd_set_hash_threshold — Set threshold for index mapping
switch</h5>
<pre class="verbatim" id="verbatim-11">
call psb_cd_set_hash_threshold(ith)
</pre>
<!--l. 412--><p class="nopar" >
<!--l. 414--><p class="indent" >
<dl class="description"><dt class="description">
<!--l. 415--><p class="noindent" >
<span
class="pplb7t-">Type:</span> </dt><dd
class="description">
<!--l. 415--><p class="noindent" >Synchronous.
</dd><dt class="description">
<!--l. 416--><p class="noindent" >
<span
class="pplb7t-">On Entry</span> </dt><dd
class="description">
<!--l. 416--><p class="noindent" >
</dd><dt class="description">
<!--l. 417--><p class="noindent" >
<span
class="pplb7t-">ith</span> </dt><dd
class="description">
<!--l. 417--><p class="noindent" >the new threshold for communication descriptors.<br
class="newline" />Scope: <span
class="pplb7t-">global</span>.<br
class="newline" />Type: <span
class="pplb7t-">required</span>.<br
class="newline" />Intent: <span
class="pplb7t-">in</span>.<br
class="newline" />Specified as: an integer value greater than zero.</dd></dl>
<!--l. 423--><p class="noindent" >This threshold guides the library into using a list based or a hash-table based descriptor
for global to local index conversion; if the size of the global index space is
below this threshold, a list based structure is used, if it is above a hash-table
based structure is used. Note: the threshold value is only queried by the
library at the time a call to <code class="lstinline"><span style="color:#000000">psb_cdall</span></code> is executed, therefore changing the
threshold has no effect on communication descriptors that have already
been initialized. Moreover the threshold must have the same value on all
processes.
<!--l. 435--><p class="noindent" >
<h5 class="subsubsectionHead"><span class="titlemark">3.1.12 </span> <a
id="x8-220003.1.12"></a>get_p_adjcncy — Get process adjacency list</h5>
<pre class="verbatim" id="verbatim-12">
list =  desc%get_p_adjcncy()
</pre>
<!--l. 440--><p class="nopar" >
<!--l. 442--><p class="indent" >
<dl class="description"><dt class="description">
<!--l. 443--><p class="noindent" >
<span
class="pplb7t-">Type:</span> </dt><dd
class="description">
<!--l. 443--><p class="noindent" >Asynchronous.
</dd><dt class="description">
<!--l. 444--><p class="noindent" >
<span
class="pplb7t-">On Return</span> </dt><dd
class="description">
<!--l. 444--><p class="noindent" >
</dd><dt class="description">
<!--l. 445--><p class="noindent" >
<span
class="pplb7t-">Function value</span> </dt><dd
class="description">
<!--l. 445--><p class="noindent" >The current list of adjacent processes, i.e. processes with which the
current one has to exchange halo data.
</dd></dl>
<!--l. 451--><p class="noindent" >
<h5 class="subsubsectionHead"><span class="titlemark">3.1.13 </span> <a
id="x8-230003.1.13"></a>set_p_adjcncy — Set process adjacency list</h5>
<pre class="verbatim" id="verbatim-13">
call desc%set_p_adjcncy(list)
</pre>
<!--l. 456--><p class="nopar" >
<!--l. 458--><p class="indent" >
<dl class="description"><dt class="description">
<!--l. 459--><p class="noindent" >
<span
class="pplb7t-">Type:</span> </dt><dd
class="description">
<!--l. 459--><p class="noindent" >Asynchronous.
</dd><dt class="description">
<!--l. 460--><p class="noindent" >
<span
class="pplb7t-">On Entry</span> </dt><dd
class="description">
<!--l. 460--><p class="noindent" >
</dd><dt class="description">
<!--l. 461--><p class="noindent" >
<span
class="pplb7t-">list</span> </dt><dd
class="description">
<!--l. 461--><p class="noindent" >the list of adjacent processes.<br
class="newline" />Scope: <span
class="pplb7t-">local</span>.<br
class="newline" />Type: <span
class="pplb7t-">required</span>.<br
class="newline" />Intent: <span
class="pplb7t-">in</span>.<br
class="newline" />Specified as: a one-dimensional array of integers of kind <code class="lstinline"><span style="color:#000000">psb_ipk_</span></code>.</dd></dl>
<!--l. 467--><p class="noindent" >Note: this method can be called after a call to <code class="lstinline"><span style="color:#000000">psb_cdall</span></code> and before a call to <code class="lstinline"><span style="color:#000000">psb_cdasb</span></code>.
The user is specifying here some knowledge about which processes are topological
neighbours of the current process. The availability of this information may speed up
the execution of the assembly call <code class="lstinline"><span style="color:#000000">psb_cdasb</span></code>.
<!--l. 474--><p class="noindent" >
<h5 class="subsubsectionHead"><span class="titlemark">3.1.14 </span> <a
id="x8-240003.1.14"></a>fnd_owner — Find the owner process of a set of indices</h5>
<pre class="verbatim" id="verbatim-14">
call desc%fnd_owner(idx,iprc,info)
</pre>
<!--l. 479--><p class="nopar" >
<!--l. 481--><p class="indent" >
<dl class="description"><dt class="description">
<!--l. 482--><p class="noindent" >
<span
class="pplb7t-">Type:</span> </dt><dd
class="description">
<!--l. 482--><p class="noindent" >Synchronous.
</dd><dt class="description">
<!--l. 483--><p class="noindent" >
<span
class="pplb7t-">On Entry</span> </dt><dd
class="description">
<!--l. 483--><p class="noindent" >
</dd><dt class="description">
<!--l. 484--><p class="noindent" >
<span
class="pplb7t-">idx</span> </dt><dd
class="description">
<!--l. 484--><p class="noindent" >the list of global indices for which we need the owning processes.<br
class="newline" />Scope: <span
class="pplb7t-">local</span>.<br
class="newline" />Type: <span
class="pplb7t-">required</span>.<br
class="newline" />Intent: <span
class="pplb7t-">in</span>.<br
class="newline" />Specified as: a one-dimensional array of integers of kind <code class="lstinline"><span style="color:#000000">psb_lpk_</span></code>.
</dd><dt class="description">
<!--l. 489--><p class="noindent" >
<span
class="pplb7t-">On Return</span> </dt><dd
class="description">
<!--l. 489--><p class="noindent" >
</dd><dt class="description">
<!--l. 490--><p class="noindent" >
<span
class="pplb7t-">iprc</span> </dt><dd
class="description">
<!--l. 490--><p class="noindent" >the list of processes owning the indices in <code class="lstinline"><span style="color:#000000">idx</span></code>.<br
class="newline" />Scope: <span
class="pplb7t-">local</span>.<br
class="newline" />Type: <span
class="pplb7t-">required</span>.<br
class="newline" />Intent: <span
class="pplb7t-">in</span>.<br
class="newline" />Specified as: an allocatable one-dimensional array of integers of kind
<code class="lstinline"><span style="color:#000000">psb_ipk_</span></code>.</dd></dl>
<!--l. 496--><p class="noindent" >Note: this method may or may not actually require communications, depending on the
exact internal data storage; given that the choice of storage may be altered by
runtime parameters, it is necessary for safety that this method is called by all
processes.
<!--l. 504--><p class="noindent" >
<h5 class="subsubsectionHead"><span class="titlemark">3.1.15 </span> <a
id="x8-250003.1.15"></a>Named Constants</h5>
<!--l. 506--><p class="noindent" >
<dl class="description"><dt class="description">
<!--l. 507--><p class="noindent" >
<span
class="pplb7t-">psb</span><span
class="pplb7t-">_none</span><span
class="pplb7t-">_</span> </dt><dd
class="description">
<!--l. 507--><p class="noindent" >Generic no-op;
</dd><dt class="description">
<!--l. 508--><p class="noindent" >
<span
class="pplb7t-">psb</span><span
class="pplb7t-">_root</span><span
class="pplb7t-">_</span> </dt><dd
class="description">
<!--l. 508--><p class="noindent" >Default root process for broadcast and scatter operations;
</dd><dt class="description">
<!--l. 509--><p class="noindent" >
<span
class="pplb7t-">psb</span><span
class="pplb7t-">_nohalo</span><span
class="pplb7t-">_</span> </dt><dd
class="description">
<!--l. 509--><p class="noindent" >Do not fetch halo elements;
</dd><dt class="description">
<!--l. 510--><p class="noindent" >
<span
class="pplb7t-">psb</span><span
class="pplb7t-">_halo</span><span
class="pplb7t-">_</span> </dt><dd
class="description">
<!--l. 510--><p class="noindent" >Fetch halo elements from neighbouring processes;
</dd><dt class="description">
<!--l. 511--><p class="noindent" >
<span
class="pplb7t-">psb</span><span
class="pplb7t-">_sum</span><span