IBM Books

Parallel Engineering and Scientific Subroutine Library for AIX Version 2 Release 3: Guide and Reference

PSCRFT2 and PDCRFT2--Complex-to-Real Fourier Transforms in Two Dimensions

These subroutines compute the mixed-radix two-dimensional real discrete Fourier transform of complex conjugate even data:



FFT Graphic

for:

k1 = 0, 1, ..., n1-1
k2 = 0, 1, ..., n2-1

where:



FFT Graphic

and where:

xj1,j2 are elements of array X.
yk1,k2 are elements of array Y.
Isign is + or - (determined by argument isign).
scale is a scalar value.

For scale = 1 and isign being positive, you obtain the discrete Fourier transform. For scale = 1/((n1)(n2)) and isign being negative, you obtain the inverse Fourier transform.

See references [1] and [3].

Table 111. Data Types

X Y, scale Subroutine
Short-precision complex Short-precision real PSCRFT2
Long-precision complex Long-precision real PDCRFT2

Syntax

Fortran CALL PSCRFT2 | PDCRFT2 (x, y, n1, n2, isign, scale, icontxt, ip)
C and C++ pscrft2 | pdcrft2 (x, y, n1, n2, isign, scale, icontxt, ip);

On Entry

x
is the local array X, containing the two-dimensional data to be transformed that has been block-column distributed over a 1 × q process grid, where q is the number of processes. (The value of ldx is set in the IP array.) Array X is stored in FFT-packed storage mode.

Scope: local

Specified as: an array of (at least) length ldx × LOCq(n1/2), containing numbers of the data type indicated in Table 111. This array must be aligned on a doubleword boundary.

y
See On Return.

n1
is the length of the second dimension of the two-dimensional data of the array to be transformed.

Scope: global

Specified as: a fullword integer; n1 <= 37748736 and must be one of the values listed in Figure 9.

n2
is the length of the first dimension of two-dimensional data of the array to be transformed.

Scope: global

Specified as: a fullword integer; n2 <= 37748736 and must be one of the values listed in Figure 9.

isign
controls the direction of the transform, determining the sign, isign, of the exponent of Wn, where:

If isign = positive value, Isign = + (transforming time to frequency).

If isign = negative value, Isign = - (transforming frequency to time).

Scope: global

Specified as: a fullword integer; where isign > 0 or isign < 0.

scale
is the scaling constant scale.

Scope: global

Specified as: a number of the data type indicated in Table 111, where scale > 0.0 or scale < 0.0.

icontxt
is the BLACS context parameter.

Scope: global

Specified as: the fullword integer that was returned by a prior call to BLACS_GRIDINIT or BLACS_GRIDMAP.

ip
is an array of parameters, IP(i), where:

Scope: global

Specified as: a one-dimensional array of (at least) length 40, containing fullword integers, where:

IP(1) is any integer

IP(20) >= n2 or IP(20) = 0

IP(21) >= n1 or IP(21) = 0

On Return

y
is the local array Y that is block-column distributed and contains the results of the computation, where:

If IP(1) = 0, the local array Y is stored in normal form and has dimensions n1 × LOCq(n2).

If IP(1) <> 0 and IP(21) = 0, the local array Y is stored in normal form and has dimensions n1 × LOCq(n2).

If IP(1) <> 0 and IP(21) <> 0, the local array Y is stored in normal form and has dimensions ldy × LOCq(n2).

Scope: local

Returned as: an ldy × LOCq(n2) array, containing the numbers of the data type indicated in Table 111. This array must be aligned on a doubleword boundary.

Notes and Coding Rules
  1. These subroutines always return Y in normal form.
  2. For the output array Y, these subroutines may use any extra space available when ldy is greater than its minimum value.
  3. For more information on LOCq(_), and how sequences are block-column distributed and stored in FFT-packed storage mode, see Two-Dimensional Sequence.

    In general, distributing your data evenly provides the best work load balance among the processes and allows the use of the most efficient collective communication. However, for your specific problem size and number of processes available, experimentation is necessary to achieve optimal performance.

  4. You may specify the same array for X and Y. In this case, output overwrites input. If you specify different arrays X and Y, they must have no common elements; otherwise, results are unpredictable.

Error Conditions

Computational Errors

None

Resource Errors
  1. Unable to allocate work space.

Input-Argument and Miscellaneous Errors

Stage 1 

  1. icontxt is invalid

Stage 2 

  1. Process grid is not 1 × q
  2. The subroutine was called from outside the process grid.

Stage 3 

  1. n1 > 37748736
  2. n2 > 37748736
  3. The length of n1 or n2 is not an allowable transform length.
  4. isign = 0
  5. scale = 0.0
  6. IP(1) <> 0 and IP(20) <> 0 and IP(20) < n2 (that is, ldx < n2)
  7. IP(1) <> 0 and IP(21) <> 0 and IP(21) < n1 (that is, ldy < n1)

Example

This example shows how to compute a two-dimensional transform. The data is block-column distributed over a 1 × 2 process grid. The arrays are declared as follows:

  COMPLEX*16 X(0:6,0:1)
  REAL*8 Y(0:11,0:1)
  INTEGER*4 IP(40)
  REAL*8 SCALE

Call Statements and Input
ORDER = 'R'
NPROW = 1
NPCOL = 2
CALL BLACS_GET(0, 0, ICONTXT)
CALL BLACS_GRIDINIT(ICONTXT, ORDER, NPROW, NPCOL)
CALL BLACS_GRIDINFO(ICONTXT, NPROW, NPCOL, MYROW, MYCOL)
IP(1) = 1
IP(20) = 7 (that is, ldx = 7)
IP(21) = 12 (that is, ldy = 12)
 
              X   Y   N1  N2  ISIGN     SCALE       ICONTXT   IP
              |   |   |   |     |         |            |      |
CALL PDCRFT2( X , Y , 8 , 4 ,  -1  , 1.0D0/32.0D0 , ICONTXT , IP)

The following global matrix X is stored in FFT-packed storage mode:

B,D              0                          1
     *                                                   *
     |  (1.0,1.0)  (1.0,0.0)  |     (1.0,0.0)  (1.0,0.0) |
     |  (1.0,0.0)  (1.0,0.0)  |     (1.0,0.0)  (1.0,0.0) |
     |  (1.0,1.0)  (1.0,0.0)  |     (1.0,0.0)  (1.0,0.0) |
 0   |  (1.0,0.0)  (1.0,0.0)  |     (1.0,0.0)  (1.0,0.0) |
     |      .          .      |         .          .     |
     |      .          .      |         .          .     |
     |      .          .      |         .          .     |
     *                                                   *

The following is the 1 × 2 process grid:

B,D  |    0    |  1  
-----| ------- |-----
0    |   P00   |  P01

The following local arrays for X are stored in FFT-packed storage mode:

p,q  |           0            |            1
-----|------------------------|------------------------
     |  (1.0,1.0)  (1.0,0.0)  |   (1.0,0.0)  (1.0,0.0)
     |  (1.0,0.0)  (1.0,0.0)  |   (1.0,0.0)  (1.0,0.0)
     |  (1.0,1.0)  (1.0,0.0)  |   (1.0,0.0)  (1.0,0.0)
 0   |  (1.0,0.0)  (1.0,0.0)  |   (1.0,0.0)  (1.0,0.0)
     |      .          .      |       .          .
     |      .          .      |       .          .
     |      .          .      |       .          .

Output

Global matrix Y:

B,D        0              1
     *                           *
     |  1.0   0.0  |   0.0   0.0 |
     |  0.0   0.0  |   0.0   0.0 |
     |  0.0   0.0  |   0.0   0.0 |
     |  0.0   0.0  |   0.0   0.0 |
     |  0.0   0.0  |   0.0   0.0 |
     |  0.0   0.0  |   0.0   0.0 |
 0   |  0.0   0.0  |   0.0   0.0 |
     |  0.0   0.0  |   0.0   0.0 |
     |   .     .   |    .     .  |
     |   .     .   |    .     .  |
     |   .     .   |    .     .  |
     |   .     .   |    .     .  |
     *                           *

The following is the 1 × 2 process grid:

B,D  |    0    |  1  
-----| ------- |-----
0    |   P00   |  P01

Local arrays for Y:

p,q  |     0      |      1
-----|------------|------------
     |  1.0  0.0  |   0.0  0.0
     |  0.0  0.0  |   0.0  0.0
     |  0.0  0.0  |   0.0  0.0
     |  0.0  0.0  |   0.0  0.0
     |  0.0  0.0  |   0.0  0.0
     |  0.0  0.0  |   0.0  0.0
 0   |  0.0  0.0  |   0.0  0.0
     |  0.0  0.0  |   0.0  0.0
     |   .    .   |    .    .
     |   .    .   |    .    .
     |   .    .   |    .    .
     |   .    .   |    .    .


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]