These subroutines compute the mixed-radix two-dimensional complex conjugate even discrete Fourier transform of real data:
for:
where:
and where:
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.
X, scale | Y | Subroutine |
Short-precision real | Short-precision complex | PSRCFT2 |
Long-precision real | Long-precision complex | PDRCFT2 |
Fortran | CALL PSRCFT2 | PDRCFT2 (x, y, n1, n2, isign, scale, icontxt, ip) |
C and C++ | psrcft2 | pdrcft2 (x, y, n1, n2, isign, scale, icontxt, ip); |
Scope: local
Specified as: an array of (at least) length ldx × LOCq(n2), containing numbers of the data type indicated in Table 110. This array must be aligned on a doubleword boundary.
Scope: global
Specified as: a fullword integer; n1 <= 37748736 and must be one of the values listed in Figure 9.
Scope: global
Specified as: a fullword integer; n2 <= 37748736 and must be one of the values listed in Figure 9.
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.
Scope: global
Specified as: a number of the data type indicated in Table 110, where scale > 0.0 or scale < 0.0.
Scope: global
Specified as: the fullword integer that was returned by a prior call to BLACS_GRIDINIT or BLACS_GRIDMAP.
If IP(1) = 0, then the following default values are used:
The remaining parameters of the array IP are ignored.
If IP(1) <> 0, then you set the remaining values of ip to indicate values for ldx and ldy.
If IP(20) = 0, then ldx = n1.
If IP(20) <> 0, then ldx is this value of IP(20).
If IP(21) = 0, then ldy = n2.
If IP(21) <> 0, then ldy is this value of IP(21).
Scope: global
Specified as: a one-dimensional array of (at least) length 40, containing fullword integers, where:
IP(1) is any integer
IP(20) >= n1 or IP(20) = 0
IP(21) >= n2 or IP(21) = 0
If IP(1) = 0, the local array Y has dimensions n2 × LOCq(n1/2).
If IP(1) <> 0 and IP(21) = 0, the local array Y has dimensions n2 × LOCq(n1/2).
If IP(1) <> 0 and IP(21) <> 0, the local array Y has dimensions ldy × LOCq(n1/2).
Scope: local
Returned as: an ldy × LOCq(n1/2) array, containing the numbers of the data type indicated in Table 110. This array must be aligned on a doubleword boundary.
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.
None
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:
REAL*8 X(0:11,0:1) COMPLEX*16 Y(0:6,0:1) INTEGER*4 IP(40) REAL*8 SCALE
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) = 12 (that is, ldx = 12) IP(21) = 7 (that is, ldy = 7) X Y N1 N2 ISIGN SCALE ICONTXT IP | | | | | | | | CALL PDRCFT2( X , Y , 8 , 4 , 1 , 1.0D0 , ICONTXT , IP)
Global matrix X of order 8 × 4:
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 X:
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 | . . | . . | . . | . . | . . | . . | . . | . .
The following global matrix Y is returned in transposed form and 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 Y are returned in transposed form and 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) | . . | . . | . . | . . | . . | . .