5.1 psb_halo — Halo Data Communication

These subroutines gathers the values of the halo elements:

x ← x

where:

x
is a global dense submatrix.




α, x Subroutine


Integer psb_halo
Short Precision Real psb_halo
Long Precision Real psb_halo
Short Precision Complexpsb_halo
Long Precision Complex psb_halo



Table 17: Data types

call psb_halo(x, desc_a, info) 
call psb_halo(x, desc_a, info, work, data)
Type:
Synchronous.
On Entry
x
global dense matrix x.
Scope: local
Type: required
Intent: inout.
Specified as: a rank one or two array or an object of type psb_T_vect_type containing numbers of type specified in Table 17.
desc_a
contains data structures for communications.
Scope: local
Type: required
Intent: in.
Specified as: a structured data of type psb_desc_type.
work
the work array.
Scope: local
Type: optional
Intent: inout.
Specified as: a rank one array of the same type of x.
data
index list selector.
Scope: global
Type: optional
Specified as: an integer. Values:psb_comm_halo_,psb_comm_mov_, psb_comm_ext_, default: psb_comm_halo_. Chooses the index list on which to base the data exchange.
On Return
x
global dense result matrix x.
Scope: local
Type: required
Intent: inout.
Returned as: a rank one or two array containing numbers of type specified in Table 17.
info
the local portion of result submatrix y.
Scope: local
Type: required
Intent: out.
An integer value that contains an error code.


PIC


Figure 7: Sample discretization mesh.


Usage Example Consider the discretization mesh depicted in fig. 7, partitioned among two processes as shown by the dashed line; the data distribution is such that each process will own 32 entries in the index space, with a halo made of 8 entries placed at local indices 33 through 40. If process 0 assigns an initial value of 1 to its entries in the x vector, and process 1 assigns a value of 2, then after a call to psb_halo the contents of the local vectors will be the following:


Process 0
Process 1
IGLOB(I)X(I) IGLOB(I)X(I)
1 1 1.0 1 33 2.0
2 2 1.0 2 34 2.0
3 3 1.0 3 35 2.0
4 4 1.0 4 36 2.0
5 5 1.0 5 37 2.0
6 6 1.0 6 38 2.0
7 7 1.0 7 39 2.0
8 8 1.0 8 40 2.0
9 9 1.0 9 41 2.0
10 10 1.010 42 2.0
11 11 1.011 43 2.0
12 12 1.012 44 2.0
13 13 1.013 45 2.0
14 14 1.014 46 2.0
15 15 1.015 47 2.0
16 16 1.016 48 2.0
17 17 1.017 49 2.0
18 18 1.018 50 2.0
19 19 1.019 51 2.0
20 20 1.020 52 2.0
21 21 1.021 53 2.0
22 22 1.022 54 2.0
23 23 1.023 55 2.0
24 24 1.024 56 2.0
25 25 1.025 57 2.0
26 26 1.026 58 2.0
27 27 1.027 59 2.0
28 28 1.028 60 2.0
29 29 1.029 61 2.0
30 30 1.030 62 2.0
31 31 1.031 63 2.0
32 32 1.032 64 2.0
33 33 2.033 25 1.0
34 34 2.034 26 1.0
35 35 2.035 27 1.0
36 36 2.036 28 1.0
37 37 2.037 29 1.0
38 38 2.038 30 1.0
39 39 2.039 31 1.0
40 40 2.040 32 1.0