npadmana / DistributedFFT

6 stars 2 forks source link

Can we clean up plan creation with partial instantiations? #53

Open npadmana opened 4 years ago

npadmana commented 4 years ago

See notes from @ronawho below...

Coincidently I was thinking about how to clean up plan creation earlier today as I was learning about some new partial instantiation features in 1.20 ('partial instantiation' section of https://chapel-lang.org/releaseNotes/1.20/01-language.pdf)

With that, I was wondering if we could avoid some of the duplicate array and ft Type stuff and push the setup logic into an initializer. Something roughly like:


record FFTWplan {
  type arrType;
  param ftType: FFTtype;
  ...
  proc init(dom: domain, numTransforms: int, signOrKind, flags : c_uint = FFTW_MEASURE) {
    ...
  }
}
type Plan = FFTWplan(T, ftType);
var xPlan = new Plan({xDst, zSrc}, 1, signOrKind);
var yPlan = new Plan({ySrc, zSrc}, 1, signOrKind);
var zPlan = new Plan({zSrc},       1, signOrKind);

But anyway, I think what's here is a nice cleanup, just some misc thoughts I had earlier today.

Originally posted by @ronawho in https://github.com/npadmana/DistributedFFT/pull/52#issuecomment-542465816

npadmana commented 4 years ago

Also see this if we're cleaning up.

https://github.com/npadmana/DistributedFFT/pull/52#discussion_r335238756