# p?lacp3

Copies from a global parallel array into a local replicated array or vice versa.

## Syntax

call pslacp3(m, i, a, desca, b, ldb, ii, jj, rev)

call pdlacp3(m, i, a, desca, b, ldb, ii, jj, rev)

## Description

This is an auxiliary routine that copies from a global parallel array into a local replicated array or vise versa. Note that the entire submatrix that is copied gets placed on one node or more. The receiving node can be specified precisely, or all nodes can receive, or just one row or column of nodes.

## Input Parameters

m

  (global) INTEGER.

  m is the order of the square submatrix that is copied.

  m ≥ 0. Unchanged on exit.

i

  (global) INTEGER. A(i, i) is the global location that the copying starts from. Unchanged on exit.

a

  (global). REAL for pslacp3

  DOUBLE PRECISION for pdlacp3

  Array, DIMENSION (desca(lld_),*). On entry, the parallel matrix to be copied into or from.

desca

  (global and local) INTEGER array, DIMENSION (dlen_). The array descriptor for the distributed matrix A.

b

  (local).

  REAL for pslacp3

  DOUBLE PRECISION for pdlacp3

  Array, DIMENSION (ldb, m). If `rev = 0`, this is the global portion of the array `A(i:i+m-1`, `i:i+m-1)`. If `rev = 1`, this is the unchanged on exit.

ldb

  (local)

  INTEGER.

  The leading dimension of B.

ii

  (global) INTEGER. By using rev 0 and 1, data can be sent out and returned again. If `rev = 0`, then ii is destination row index for the node(s) receiving the replicated B. If ii ≥ 0, jj ≥ 0, then node (ii, jj) receives the data. If ii = -1, jj ≥ 0, then all rows in column jj receive the data. If ii ≥ 0, jj = -1, then all cols in row ii receive the data. f ii = -1, jj = -1, then all nodes receive the data. If rev !=0, then ii is the source row index for the node(s) sending the replicated B.

jj

  (global) INTEGER. Similar description as ii above.

rev

  (global) INTEGER. Use `rev = 0` to send global A into locally replicated B (on node (ii, jj)). Use rev != 0 to send locally replicated B from node (ii, jj) to its owner (which changes depending on its location in A) into the global A.

## Output Parameters

a

  (global). On exit, if `rev = 1`, the copied data. Unchanged on exit if `rev = 0`.

b

  (local). If `rev = 1`, this is unchanged on exit.

Parent topic: Auxiliary Routines