Skip to content

Commit 00b7254

Browse files
committed
Update ParallelRotationsPencil.jl
1 parent 7c486a2 commit 00b7254

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

ext/ParallelRotationsPencil.jl

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -266,12 +266,10 @@ function SHTnsKit.dist_SH_Yrotate_packed(cfg::SHTnsKit.SHTConfig,
266266
@inbounds for m in 0:mmax, l in m:lmax
267267
Alm[l+1, m+1] = Qlm[SHTnsKit.LM_index(lmax, cfg.mres, l, m) + 1]
268268
end
269-
# Create PencilArrays for the spectral coefficients
269+
# Create PencilArrays for the spectral coefficients (decompose along m)
270270
comm = MPI.COMM_WORLD
271-
pen = Pencil((lmax+1, mmax+1), comm)
272-
Alm_p = PencilArray{ComplexF64}(undef, pen)
273-
copyto!(parent(Alm_p), Alm)
274-
R_p = PencilArray{ComplexF64}(undef, pen)
271+
Alm_p = SHTnsKit.matrix_to_spectral_pencil(cfg, Alm; comm)
272+
R_p = PencilArray{ComplexF64}(undef, pencil(Alm_p))
275273
SHTnsKit.dist_SH_Yrotate(cfg, Alm_p, β, R_p)
276274
Rlm_mat = zeros(ComplexF64, lmax+1, mmax+1)
277275
lloc = axes(R_p, 1); mloc = axes(R_p, 2)
@@ -309,12 +307,10 @@ function SHTnsKit.dist_SH_Xrotate90_packed(cfg::SHTnsKit.SHTConfig,
309307
@inbounds for m in 0:mmax, l in m:lmax
310308
Alm[l+1, m+1] = Qlm[SHTnsKit.LM_index(lmax, cfg.mres, l, m) + 1]
311309
end
312-
# Create PencilArrays for the spectral coefficients
310+
# Create PencilArrays for the spectral coefficients (decompose along m)
313311
comm = MPI.COMM_WORLD
314-
pen = Pencil((lmax+1, mmax+1), comm)
315-
Alm_p = PencilArray{ComplexF64}(undef, pen)
316-
copyto!(parent(Alm_p), Alm)
317-
R_p = PencilArray{ComplexF64}(undef, pen)
312+
Alm_p = SHTnsKit.matrix_to_spectral_pencil(cfg, Alm; comm)
313+
R_p = PencilArray{ComplexF64}(undef, pencil(Alm_p))
318314
SHTnsKit.dist_SH_rotate_euler(cfg, Alm_p, π/2, π/2, -π/2, R_p)
319315
Rlm_mat = zeros(ComplexF64, lmax+1, mmax+1)
320316
lloc = axes(R_p, 1); mloc = axes(R_p, 2)

0 commit comments

Comments
 (0)