Commit 4f0ce04f authored by Martin Reinecke's avatar Martin Reinecke
Browse files

Merge branch 'tweak_wgridder_cost_model' into 'ducc0'

Tweak wgridder cost model

See merge request !109
parents b29698ef 4a659b81
Pipeline #105889 passed with stages
in 21 minutes and 36 seconds
......@@ -175,7 +175,7 @@ def test_adjointness_ms2dirty(nx, ny, nrow, nchan, epsilon,
pixsizey, nu, nv, epsilon, wstacking, nthreads, 0,
mask).astype("f8")
ms2 = ng.dirty2ms(uvw, freq, dirty, wgt, pixsizex, pixsizey, nu, nv,
epsilon, wstacking, nthreads+1, 0, mask).astype("c16")
epsilon, wstacking, nthreads, 0, mask).astype("c16")
check(dirty2, ms2)
......@@ -188,7 +188,7 @@ def test_adjointness_ms2dirty(nx, ny, nrow, nchan, epsilon,
ms2 = dirty2vis_with_faceting(nxfacets, nyfacets, uvw=uvw, freq=freq,
dirty=dirty, wgt=wgt, pixsize_x=pixsizex,
pixsize_y=pixsizey, epsilon=epsilon,
do_wgridding=wstacking, nthreads=nthreads+1,
do_wgridding=wstacking, nthreads=nthreads,
mask=mask).astype("c16")
check(dirty2, ms2)
......
......@@ -1360,6 +1360,17 @@ auto ix = ix_+ranges.size()/2; if (ix>=ranges.size()) ix -=ranges.size();
fftcost *= nplanes;
gridcost *= supp;
}
// FIXME: heuristics could be improved
gridcost /= nthreads; // assume perfect scaling for now
constexpr double max_fft_scaling = 6;
constexpr double scaling_power=2;
auto sigmoid = [](double x, double m, double s)
{
auto x2 = x-1;
auto m2 = m-1;
return 1.+x2/pow((1.+pow(x2/m2,s)),1./s);
};
fftcost /= sigmoid(nthreads, max_fft_scaling, scaling_power);
double cost = fftcost+gridcost;
if (cost<mincost)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment