Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Martin Reinecke
ducc
Commits
def1d303
Commit
def1d303
authored
Sep 08, 2020
by
Martin Reinecke
Browse files
rearranging to fit the original function order; convenience version of execParallel()
parent
ae170dd0
Pipeline
#81801
passed with stages
in 12 minutes and 44 seconds
Changes
3
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
python/gridder_cxx.h
View file @
def1d303
This diff is collapsed.
Click to expand it.
python/test/test_wgridder_experiments.py
View file @
def1d303
...
...
@@ -56,13 +56,13 @@ def explicit_gridder(uvw, freq, ms, wgt, nxdirty, nydirty, xpixsize, ypixsize,
@
pmp
(
'nxdirty'
,
[
16
,
64
])
@
pmp
(
'nydirty'
,
[
64
])
@
pmp
(
"nrow"
,
(
1
,
100
,
10000
))
@
pmp
(
"nchan"
,
(
1
,))
@
pmp
(
"nrow"
,
(
1
,
100
))
@
pmp
(
"nchan"
,
(
1
,
7
))
@
pmp
(
"epsilon"
,
list
(
10.
**
np
.
linspace
(
-
2.
,
-
12.
,
100
)))
@
pmp
(
"singleprec"
,
(
False
,))
@
pmp
(
"wstacking"
,
(
True
,))
@
pmp
(
"use_wgt"
,
(
True
,))
@
pmp
(
"nthreads"
,
(
1
,))
@
pmp
(
"nthreads"
,
(
1
,
10
))
@
pmp
(
"fov"
,
(
10.
,))
def
test_ms2dirty_against_wdft2
(
nxdirty
,
nydirty
,
nrow
,
nchan
,
epsilon
,
singleprec
,
wstacking
,
use_wgt
,
fov
,
nthreads
):
if
singleprec
and
epsilon
<
5e-5
:
...
...
src/ducc0/infra/threading.h
View file @
def1d303
...
...
@@ -23,6 +23,7 @@
#define DUCC0_THREADING_H
#include <functional>
#include "ducc0/infra/misc_utils.h"
namespace
ducc0
{
...
...
@@ -61,6 +62,28 @@ void execGuided(size_t nwork, size_t nthreads, size_t chunksize_min,
double
fact_max
,
std
::
function
<
void
(
Scheduler
&
)
>
func
);
void
execParallel
(
size_t
nthreads
,
std
::
function
<
void
(
Scheduler
&
)
>
func
);
inline
void
execParallel
(
size_t
nwork
,
size_t
nthreads
,
std
::
function
<
void
(
size_t
,
size_t
)
>
func
)
{
execParallel
(
nthreads
,
[
&
](
Scheduler
&
sched
)
{
auto
tid
=
sched
.
thread_num
();
auto
[
lo
,
hi
]
=
calcShare
(
nthreads
,
tid
,
nwork
);
func
(
lo
,
hi
);
});
}
inline
void
execParallel
(
size_t
nwork
,
size_t
nthreads
,
std
::
function
<
void
(
size_t
,
size_t
,
size_t
)
>
func
)
{
execParallel
(
nthreads
,
[
&
](
Scheduler
&
sched
)
{
auto
tid
=
sched
.
thread_num
();
auto
[
lo
,
hi
]
=
calcShare
(
nthreads
,
tid
,
nwork
);
func
(
tid
,
lo
,
hi
);
});
}
}
// end of namespace detail_threading
using
detail_threading
::
max_threads
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment