sbrisard / janus

Discretization of the Lippmann--Schwinger equation with periodic boundary conditions
BSD 3-Clause "New" or "Revised" License
9 stars 3 forks source link

Parallel FFT objects should be aware of the global shape of the output #7

Closed sbrisard closed 9 years ago

sbrisard commented 9 years ago

In module janus.fft.parallel transform objects are aware of the global shape of the input (the shape attribute), the local shape of the input (the rshape attribute), the local shape of the output (the cshape attribute), but not the global shape of the output.

This leads to rather clumsy constructs when one wants to gather the results of a FFT transform. The array which holds the global output must be allocated as follows


if comm.rank == root:
    y = np.empty((transform.shape[0],) + transform.cshape[1:],
                 dtype=np.float64)
else:
    y = None
comm.Gatherv(y_loc, y, root)

It would be much nicer if transform had an attribute holding the global shape of the output.

sbrisard commented 9 years ago

In 289062e117713dc0ce61db48edaa5377ebe51c97, FFT objects define a global_oshape attribute (tuple).

sbrisard commented 9 years ago

In d56debd911a6d2eaa56234ad1196488c828e9eca, renamed attribute of FFT objects: shape -> global_ishape (see Issue #7).