These subroutines compute the mixed-radix three-dimensional discrete Fourier transform of complex data:
for:
where:
and where:
For scale = 1 and isign being positive, you obtain the discrete Fourier transform. For scale = 1/((n1)(n2)(n3)) and isign being negative, you obtain the inverse Fourier transform.
X, Y | scale | Subroutine |
Short-precision complex | Short-precision real | PSCFT3 |
Long-precision complex | Long-precision real | PDCFT3 |
Fortran | CALL PSCFT3 | PDCFT3 (x, y, n1, n2, n3, isign, scale, icontxt, ip) |
C and C++ | pscft3 | pdcft3 (x, y, n1, n2, n3, isign, scale, icontxt, ip); |
Scope: local
Specified as: an array of (at least) length ldx1 × ldx2 × LOCq(n3), containing numbers of the data type indicated in Table 112. 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.
Scope: global
Specified as: a fullword integer; n3 <= 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 112, 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 array IP are ignored.
If IP(1) <> 0, then you set the remaining values of ip to indicate whether y is stored in normal or transposed form, and indicate values for the leading dimensions.
If IP(2)=0, then y is to be stored in transposed form on output.
If IP(2)=1, then y is to be stored in normal form on output.
If IP(20) = 0, then ldx1 = n1.
If IP(20) <> 0, then ldx1 is this value of IP(20).
If IP(21) = 0, then ldx2 = n2.
If IP(21) <> 0, then ldx2 is this value of IP(21).
If IP(22) = 0 and IP(2) = 1, then ldy1 = n1.
If IP(22) = 0 and IP(2) = 0, then ldy1 = n3.
If IP(22) <> 0, then ldy1 is this value of IP(22).
If IP(23) = 0, then ldy2 = n2.
If IP(23) <> 0, then ldy2 is this value of IP(23).
Scope: global
Specified as: a one-dimensional array of (at least) length 40, containing fullword integers, where:
If IP(1) = 0, the local array Y is stored in transposed form and has dimensions n3 × n2 × LOCq(n1).
If IP(1) <> 0 and IP(2)=0, then the local array Y is stored in transposed form and has dimensions ldy1 × ldy2 × LOCq(n1).
If IP(1) <> 0 and IP(2)=1, then the local array Y is stored in normal form and has dimensions ldy1 × ldy2 × LOCq(n3).
Scope: local
Returned as: an ldy1 × ldy2 × LOCq(n3) array (for normal form) or an ldy1 × ldy2 × LOCq(n1) array (for transposed form), containing the numbers of the data type indicated in Table 112. 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 three-dimensional transform. The data is block-plane distributed over a 1 × 2 process grid. The arrays are declared as follows:
COMPLEX*16 X(0:3,0:3,0) COMPLEX*16 Y(0:3,0:3,0) 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(2) = 1 IP(20) = 4 IP(21) = 4 IP(22) = 4 IP(23) = 4 X Y N1 N2 N3 ISIGN SCALE ICONTXT IP | | | | | | | | | CALL PDCFT3( X , Y , 4 , 4 , 2 , 1 , 1.0D0 , ICONTXT , IP)
Global matrix X:
Plane 0:
B,D 0 * * | (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) | * *
Plane 1:
B,D 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.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 | (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)
Global matrix Y:
Plane 0:
B,D 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,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,0.0) (1.0,0.0) | * *
Plane 1:
B,D 1 * * | (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,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,0.0) (1.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) (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,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,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,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,0.0) (1.0,0.0) (1.0,0.0)
This example shows how to compute a three-dimensional transform. In this example, the IP array is set to 0, which means array Y is returned in transposed form, ldx=n1, and ldy=n3. This is an example of uneven block-plane distribution over a 1 × 3 process grid. The arrays are declared as follows:
COMPLEX*16 X(0:3,0:1,0:1), Y(0:5,0:1,0:1) INTEGER*4 IP(40) REAL*8 SCALE
ORDER = 'R' NPROW = 1 NPCOL = 3 CALL BLACS_GET(0, 0, ICONTXT) CALL BLACS_GRIDINIT(ICONTXT, ORDER, NPROW, NPCOL) CALL BLACS_GRIDINFO(ICONTXT, NPROW, NPCOL, MYROW, MYCOL) IP(1) = 0 X Y N1 N2 N3 ISIGN SCALE ICONTXT IP | | | | | | | | | CALL PDCFT3( X , Y , 4 , 2 , 6 , 1 , 1.0D0/8.0D0, ICONTXT , IP)
Global matrix X:
Plane 0: Plane 1: ---------------------------------------------------- B,D 0 ---------------------------------------------------- * * | (4.9,3.9) (5.9,3.1) | (2.2,5.1) (5.9,1.5) | 0 | (6.8,4.6) (6.7,9.8) | (2.1,0.5) (3.5,2.9) | | (4.9,1.9) (1.6,4.9) | (7.0,6.8) (6.4,1.1) | | (2.9,7.6) (7.5,5.5) | (0.6,4.6) (9.0,7.6) | * * Plane 2: Plane 3: ---------------------------------------------------- B,D 1 ---------------------------------------------------- * * | (8.3,2.3) (7.3,7.3) | (4.6,5.9) (3.3,3.0) | 0 | (4.5,8.9) (0.2,0.9) | (3.6,5.0) (3.4,0.4) | | (1.8,6.5) (2.5,1.7) | (8.5,9.3) (0.2,1.7) | | (6.4,5.2) (7.8,5.3) | (8.7,9.1) (9.1,5.5) | * * Plane 4: Plane 5: ---------------------------------------------------- B,D 2 ---------------------------------------------------- * * | (1.0,1.0) (2.2,8.2) | (5.4,3.6) (4.8,4.0) | 0 | (8.8,1.0) (8.9,5.8) | (2.0,2.6) (5.2,9.5) | | (3.3,0.0) (8.9,7.5) | (3.1,9.7) (5.4,7.5) | | (8.7,8.3) (6.3,5.4) | (1.5,9.6) (4.4,4.4) | * *
The following is the 1 × 3 process grid:
B,D | 0 | 1 | 2 -----| ------- | ------- |------- 0 | P00 | P01 | P02
Local arrays for X:
p,q| 0 | 1 | 2 ---|----------------------------------------|----------------------------------------|--------------------------------------- |(4.9,3.9) (5.9,3.1) (2.2,5.1) (5.9,1.5) |(8.3,2.3) (7.3,7.3) (4.6,5.9) (3.3,3.0) |(1.0,1.0) (2.2,8.2) (5.4,3.6) (4.8,4.0) |(6.8,4.6) (6.7,9.8) (2.1,0.5) (3.5,2.9) |(4.5,8.9) (0.2,0.9) (3.6,5.0) (3.4,0.4) |(8.8,1.0) (8.9,5.8) (2.0,2.6) (5.2,9.5) 0 |(4.9,1.9) (1.6,4.9) (7.0,6.8) (6.4,1.1) |(1.8,6.5) (2.5,1.7) (8.5,9.3) (0.2,1.7) |(3.3,0.0) (8.9,7.5) (3.1,9.7) (5.4,7.5) |(2.9,7.6) (7.5,5.5) (0.6,4.6) (9.0,7.6) |(6.4,5.2) (7.8,5.3) (8.7,9.1) (9.1,5.5) |(8.7,8.3) (6.3,5.4) (1.5,9.6) (4.4,4.4)
Global matrix Y:
Plane 0: Plane 1: -------------------------------------------------------- B,D 0 -------------------------------------------------------- * * | (29.8,29.7) (-1.9,1.1) | (-3.0,0.9) (-3.0,-3.8) | | (-3.3,1.0) (0.4,-2.5) | (4.1,-3.9) (-4.6,-1.4) | 0 | (-1.7,-1.2) (0.1,3.4) | (0.9,5.0) (-0.6,1.6) | | (2.3,-0.5) (1.0,-4.6) | (3.1,0.8) (1.7,0.4) | | (3.0,1.9) (4.5,0.6) | (0.5,-3.8) (-3.0,-0.1) | | (1.0,0.1) (-5.7,-1.9) | (-1.4,-1.2) (0.8,2.6) | * * Plane 2: Plane 3: -------------------------------------------------------- B,D 1 -------------------------------------------------------- * * | (-2.4,-2.8) (2.0,0.1) | (3.6,-3.4) (1.4,0.0) | | (2.1,-3.5) (2.8,1.3) | (-1.9,-0.1) (2.3,6.3) | 0 | (-1.7,0.7) (2.8,1.0) | (2.0,1.4) (-0.6,1.0) | | (-3.3,-2.2) (-3.2,-5.1) | (-0.3,3.3) (0.8,0.5) | | (-1.5,-3.1) (1.4,0.1) | (-1.3,-1.7) (-2.7,0.7) | | (1.8,0.6) (-0.7,3.2) | (0.2,2.9) (1.0,-2.1) | * *
The following is the 1 × 3 process grid:
B,D | 0 | 1 | 2 -----| ------- | ------- |------- 0 | P00 | P01 | P02
Local arrays for Y:
p,q | 0 | 1 -----|-------------------------------------------------|----------------------------------------------- | (29.8,29.7) (-1.9,1.1) (-3.0,0.9) (-3.0,-3.8) | (-2.4,-2.8) (2.0,0.1) (3.6,-3.4) (1.4,0.0) | (-3.3,1.0) (0.4,-2.5) (4.1,-3.9) (-4.6,-1.4) | (2.1,-3.5) (2.8,1.3) (-1.9,-0.1) (2.3,6.3) 0 | (-1.7,-1.2) (0.1,3.4) (0.9,5.0) (-0.6,1.6) | (-1.7,0.7) (2.8,1.0) (2.0,1.4) (-0.6,1.0) | (2.3,-0.5) (1.0,-4.6) (3.1,0.8) (1.7,0.4) | (-3.3,-2.2) (-3.2,-5.1) (-0.3,3.3) (0.8,0.5) | (3.0,1.9) (4.5,0.6) (0.5,-3.8) (-3.0,-0.1) | (-1.5,-3.1) (1.4,0.1) (-1.3,-1.7) (-2.7,0.7) | (1.0,0.1) (-5.7,-1.9) (-1.4,-1.2) (0.8,2.6) | (1.8,0.6) (-0.7,3.2) (0.2,2.9) (1.0,-2.1)
There is not any data located on P02.