Parallel Engineering and Scientific Subroutine Library for AIX Version 2 Release 3: Guide and Reference
This sparse utility subroutine is used by each process to insert all blocks
of data it owns into its local part of the general sparse matrix
A.
Fortran
| CALL PDSPINS (as, ia1, ia2, infoa,
desc_a, ia, ja, blcks, ib1,
ib2, infob)
|
C and C++
| pdspins (as, ia1, ia2, infoa,
desc_a, ia, ja, blcks, ib1,
ib2, infob);
|
- as
- is the local part of the global general sparse matrix A that is
produced on a preceding call to PDSPINIT or previous call(s) to this
subroutine.
Scope: local
Specified as: a one-dimensional array of (at least) length
INFOA(1), containing long-precision real numbers.
- ia1
- is the local part of array IA1 that is produced on a preceding
call to PDSPINIT or previous call(s) to this subroutine.
Scope: local
Specified as: a one-dimensional array of (at least) length
INFOA(2), containing fullword integers.
- ia2
- is the local part of the array IA2 that is produced on a
preceding call to PDSPINIT or previous call(s) to this subroutine.
Scope: local
Specified as: a one-dimensional array of (at least) length
INFOA(3), containing fullword integers.
- infoa
- is the array INFOA that is produced on a preceding call to
PDSPINIT or previous call(s) to this subroutine.
Specified as: an array of length 30, containing fullword
integers.
- desc_a
- is the array descriptor for a global general sparse matrix A
that is produced on a preceding call to PDSPINIT or previous call(s) to this
subroutine.
Specified as: an array of length DLEN, containing fullword
integers.
- ia
- is the first global row index of the general sparse matrix A
that receives data from the submatrix BLCK.
Scope: local
Specified as: a fullword integer;
1 <= ia <= M.
- ja
- is the first global column index of the general sparse matrix A
that receives data from the submatrix BLCK.
Scope: local
Specified as: a fullword integer, where:
ja = 1.
- blcks
- is the local part of the sparse submatrix BLCK, referred to as
BLCKS, to be inserted into the global general sparse matrix
A. Each call to this subroutine inserts one contiguous block
of rows into the local part of the sparse matrix corresponding to the global
submatrix
Aia:ia+INFOB(6)-1,
ja:ja+INFOB(7)-1. This
subroutine only can insert blocks of data it owns into its local part of the
general sparse matrix A.
Scope: local
Specified as: a one-dimensional array of (at least) length
INFOB(1), containing long-precision real numbers.
- ib1
- is an array, referred to as IB1, containing column numbers of
each non-zero element in the submatrix BLCK.
Scope: local
Specified as: a one-dimensional array of (at least) length
INFOB(2), containing fullword integers.
- ib2
- is the array, referred to as IB2, containing the starting
positions of each row of the submatrix BLCK in array
BLCKS and one position past the end of BLCKS.
Scope: local
Specified as: a one-dimensional array of (at least) length
INFOB(3), containing fullword integers:
- IB2(1) = 1
- IB2(INFOB(6)+1) = 1+nz and
nz is the actual number of non-zero elements in the
submatrix BLCK.
- infob
- is an array, referred to as INFOB, providing information about
the submatrix BLCK. You must specify INFOB(1)
through INFOB(7), as follows:
- INFOB(1) is the length of the array BLCKS,
where: INFOB(1) >= nz.
- INFOB(2) is the length of the array IB1,
where: INFOB(2) >= nz.
- INFOB(3) is the length of the array IB2,
where:
INFOB(3) >= (INFOB(6)+1).
- INFOB(4) is the storage format of submatrix BLCK,
where:
If INFOB(4) = 1, submatrix BLCK is stored by
rows.
- INFOB(5) indicates the matrix type, where:
If INFOB(5) = 1, BLCK is a general sparse
matrix.
- INFOB(6) is the number of local rows in the submatrix
BLCK, where:
1 <= INFOB(6) <= N_ROW.
- INFOB(7) is an upper bound on the number of local columns in
the submatrix BLCK, where:
1 <= INFOB(7) <= n. n
is the order of the global general sparse matrix A.
- INFOB(8) through INFOB(30) are reserved.
Specified as: an array of length 30, containing fullword
integers.
- as
- is the updated local part of the global general sparse matrix
A, updated with data from the submatrix BLCK.
Scope: local
Returned as: a one-dimensional array of (at least) length
INFOA(1), containing long-precision real numbers.
- ia1
- is the updated local part of array IA1.
Scope: local
Returned as: a one-dimensional array of (at least) length
INFOA(2), containing fullword integers.
- ia2
- is the updated local part of the array IA2.
Scope: local
Returned as: a one-dimensional array of (at least) length
INFOA(3), containing fullword integers.
- infoa
- is the updated local part of array INFOA.
Returned as: an array of length 30, containing fullword
integers.
- desc_a
- is the updated array descriptor for the global general sparse matrix
A.
Returned as: an array of length DLEN, containing fullword
integers.
- Before you call this subroutine, you must have called PADINIT and
PDSPINIT.
- Arguments BLCK and A must not have common
elements; otherwise, results are unpredictable.
- For more details about N_ROW, N_COL, and other elements of
desc_a, see Table 28.
- For details about some of the elements stored in infoa or
infob, see Table 27.
- The submatrix BLCK must be stored by rows; that is
INFOB(4) = 1. For information about the
storage-by-rows storage mode, see the ESSL Version 3 Guide and
Reference.
- Each process has to call PDSPINS as many times as necessary to insert the
local rows it owns. It is also possible to call PDSPINS multiple times
to insert different or duplicate coefficients of the same local row it
owns. For information on how duplicate coefficients are handled, see
the dupflag argument description in PDSPASB. For an example of
inserting coefficients of the same local row, see Example.
None.
None.
Stage 1:
- The BLACS context is invalid.
Stage 2:
- This subroutine was called from outside the process grid.
Stage 3:
- The process grid is not np × 1.
- ja <> 1
- desc_a is not valid.
- The sparse matrix A is not valid.
- INFOB(4) <> 1
- INFOB(5) <> 1
- INFOB(6) < 1 or
INFOB(6) > N_ROW
- INFOB(7) < 1 or
INFOB(7) > n
- ia < 1 or ia > M
- One or more rows to be inserted into submatrix A does not
belong to the process.
- DLEN is too small. For valid values, see Array Descriptor.
- INFOB(1) < nz; that is, the size of
BLCKS < nz
- INFOB(2) < nz; that is, the size of
IB1 < nz
- INFOB(3) < (INFOB(6)+1); that
is, the size of IB2 < (INFOB(6)+1)
- INFOA(1) < max(2,nnze); that is, the
size of AS < max(2,nnze)
- INFOA(2) < max(3,(nnze+N_ROW));
that is, the size of
IA1 < max(3,(nnze+N_ROW))
- INFOA(3) < max(3,(nnze+N_COL));
that is, the size of
IA2 < max(3,(nnze+N_COL))
This piece of an example shows how to insert coefficients into the same
GLOB_ROW row by calling PDSPINS multiple times. This example would be
useful in finite element applications, where PDSPINS inserts one element at a
time into the global matrix, but more than one element may contribute to the
same matrix row. In this case, PDSPINS is called with the same value of
ia by all the elements contributing to that row.
For a complete example, see Example--Using the Fortran 77 Sparse Subroutines.
.
.
.
DO GLOB_ROW = 1, N
RINFOA(1) = 20
RINFOA(2) = 20
RINFOA(3) = 20
RINFOA(4) = 1
RINFOA(5) = 1
RINFOA(6) = 1
RINFOA(7) = N
RIA2(1) = 1
RIA2(2) = 2
IA = GLOB_ROW
C ! (x-1,y)
RAS(1) = COEFF(X-1,Y,X,Y)
RIA1(1) = IDX(X-1,Y)
CALL PDSPINS(AS,IA1,IA2,INFOA,DESC_A,
+ IA,1,RAS,RIA1,RIA2,RINFOA)
C ! (x,y-1)
RAS(1) = COEFF(X,Y-1,X,Y)
RIA1(1) = IDX(X,Y-1)
CALL PDSPINS(AS,IA1,IA2,INFOA,DESC_A,
+ IA,1,RAS,RIA1,RIA2,RINFOA)
C ! (x,y)
RAS(1) = COEFF(X,Y,X,Y)
RIA1(1) = IDX(X,Y)
CALL PDSPINS(AS,IA1,IA2,INFOA,DESC_A,
+ IA,1,RAS,RIA1,RIA2,RINFOA)
C ! (x,y+1)
RAS(1) = COEFF(X,Y+1,X,Y)
RIA1(1) = IDX(X,Y+1)
CALL PDSPINS(AS,IA1,IA2,INFOA,DESC_A,
+ IA,1,RAS,RIA1,RIA2,RINFOA)
C ! (x+1,y)
RAS(1) = COEFF(X+1,Y,X,Y)
RIA1(1) = IDX(X+1,Y)
CALL PDSPINS(AS,IA1,IA2,INFOA,DESC_A,
+ IA,1,RAS,RIA1,RIA2,RINFOA)
END DO
.
.
.
[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]