mpip / pfft

Parallel fast Fourier transforms
GNU General Public License v3.0
54 stars 23 forks source link

2D on 2D #29

Open rainwoodman opened 7 years ago

rainwoodman commented 7 years ago

Is it possible to do 2D transforms on a 2D procmesh? I tried this and it seem to have ran into a divide by zero error. Here is the stack trace. There are test cases in the source code doing 3D on 3D, so I imaging it may not be very difficult to extend the library to support 2D on 2D?


#0  0x00007fffe2bc744a in pfft_num_blocks (global_block_size=0, 
    global_array_size=0) at ../../pfft-1.0.8-alpha2-fftw3/kernel/block.c:84
#1  pfft_local_block_offset (which_block=0, global_block_size=0, 
    global_array_size=0) at ../../pfft-1.0.8-alpha2-fftw3/kernel/block.c:58
#2  pfft_local_block_size_and_offset (global_array_size=0, 
    global_block_size=0, which_block=0, 
    local_block_size=local_block_size@entry=0x108f230, 
    local_block_start=local_block_start@entry=0x108f250)
    at ../../pfft-1.0.8-alpha2-fftw3/kernel/block.c:37
#3  0x00007fffe2bbdc98 in pfft_decompose_1d (local_n_start=0x108f250, 
    local_n=0x108f230, which_block=<optimized out>, 
    block_size=<optimized out>, pn=<optimized out>)
    at ../../pfft-1.0.8-alpha2-fftw3/util/util.c:58
#4  pfft_decompose (pn=<optimized out>, block=<optimized out>, 
    rnk_pm=<optimized out>, coords_pm=<optimized out>, 
    local_n=<optimized out>, local_start=<optimized out>)
    at ../../pfft-1.0.8-alpha2-fftw3/util/util.c:50
#5  0x00007fffe2bd4f33 in decompose_nontransposed (
    local_start=<optimized out>, local_n=<optimized out>, 
    trafo_flag=<optimized out>, coords_pm=<optimized out>, 
    rnk_pm=<optimized out>, blk=<optimized out>, n=<optimized out>, 
    rnk_n=<optimized out>)
    at ../../pfft-1.0.8-alpha2-fftw3/kernel/partrafo-transposed.c:381
---Type <return> to continue, or q <return> to quit---
#6  local_size_transposed (rnk_n=2, ni=<optimized out>, no=0x10db6f0, iblock=0x10db7f0, oblock=0x10db810, rnk_pm=2, coords_pm=0x10db850, trafo_flag=8194, 
    transp_flag=2, local_ni=0x108f210, local_i_start=0x108f230, local_no=0x108f220, local_o_start=0x108f240)
    at ../../pfft-1.0.8-alpha2-fftw3/kernel/partrafo-transposed.c:358
#7  0x00007fffe2bd54cf in pfft_local_size_partrafo_transposed (rnk_n=rnk_n@entry=2, n=n@entry=0x10db630, ni=ni@entry=0x109ccc0, no=no@entry=0x10db6f0, 
    howmany=howmany@entry=1, iblock=iblock@entry=0x10db7f0, oblock=0x10db810, rnk_pm=2, comms_pm=0x109cc60, transp_flag=2, trafo_flags=0x10db770, 
    local_ni=0x108f210, local_i_start=0x108f230, local_no=0x108f220, local_o_start=0x108f240) at ../../pfft-1.0.8-alpha2-fftw3/kernel/partrafo-transposed.c:108
#8  0x00007fffe2bc9906 in pfft_local_size_partrafo (rnk_n=2, n=0x10af590, ni=0x10af590, no=0x10af590, howmany=howmany@entry=1, 
    iblock_user=iblock_user@entry=0x0, oblock_user=0x0, comm=-2080374780, trafo_flag_user=8194, pfft_flags=2050, local_ni=0x108f210, local_i_start=0x108f230, 
    local_no=<optimized out>, local_o_start=0x108f240) at ../../pfft-1.0.8-alpha2-fftw3/kernel/partrafo.c:261
#9  0x00007fffe2bd1551 in pfft_local_size_many_dft_r2c (rnk_n=<optimized out>, n=<optimized out>, ni=<optimized out>, no=<optimized out>, 
    howmany=howmany@entry=1, iblock=iblock@entry=0x0, oblock=0x0, comm_cart=-2080374780, pfft_flags=2050, local_ni=0x108f210, local_i_start=0x108f230, 
    local_no=0x108f220, local_o_start=0x108f240) at ../../pfft-1.0.8-alpha2-fftw3/api/api-adv.c:54
#10 0x00007fffe2bc3008 in pfft_local_size_dft_r2c (rnk_n=<optimized out>, n=<optimized out>, comm_cart=<optimized out>, pfft_flags=<optimized out>, 
    local_ni=<optimized out>, local_i_start=<optimized out>, local_no=0x108f220, local_o_start=0x108f240) at ../../pfft-1.0.8-alpha2-fftw3/api/api-basic.c:910
rainwoodman commented 6 years ago

@mpip Do you have any hints where to hack to get this working?

It appears the routines in remap_3d_to_2d.c are the key.

According to the manual this stage is working on the remapping from 3d to 2d and the other way around. For a 2d on 2d transfer, then I shall slightly tweak the code to do a 2d to 1d remapping.