K-ballo changed the topic of #ste||ar to: STE||AR: Systems Technology, Emergent Parallelism, and Algorithm Research | stellar.cct.lsu.edu | HPX: A cure for performance impaired parallel applications | github.com/STEllAR-GROUP/hpx | Buildbot: http://rostam.cct.lsu.edu/ | Log: http://irclog.cct.lsu.edu/
bita has joined #ste||ar
parsa[m] has joined #ste||ar
hkaiser has quit [Quit: bye]
bita has quit [Ping timeout: 264 seconds]
hkaiser has joined #ste||ar
<gonidelis[m]>
hkaiser: K-ballo what's the motive behind not having a `::type` thing for `iterator_range` ?
<gonidelis[m]>
`iterator_range`: a custom type of our own
<k-ballo[m]>
it's a range after all, not a metafunction
<gonidelis[m]>
k-ballo: ok that sounds conviencing...
<k-ballo[m]>
`iterator_range::type` that denotes `iterator_range`?
<k-ballo[m]>
what would be the point?
<gonidelis[m]>
ok we mainly use `::type` for metafunctions then. couldn't recall that. cool
<k-ballo[m]>
?
<gonidelis[m]>
nevermind. i am jsut revising some basic concepts.
<hkaiser>
gonidelis[m]: by convention, ::type denotes the 'return value' of a meta function
<hkaiser>
gonidelis[m]: see my lecture about template meta programming and traits
<gonidelis[m]>
hkaiser: yup... already doing that right now ;)
<hkaiser>
it's one of those patterns I refer to the other day
<hkaiser>
referred*
<gonidelis[m]>
hkaiser: exactly :)
<gonidelis[m]>
just one other thing: since `iterator_range` has two template arguments `I` and `S`, can I use it like `iterator_range<range_iterator<Rng>>`
<gonidelis[m]>
sounds like the one cancels the other ;p
<k-ballo[m]>
from the bug it looks like it has only ever been used as `iterator_range<Iter>`
<gonidelis[m]>
I thought `range_iterator<Rng>` was an `Iter`... what bug?
<gonidelis[m]>
hkaiser: ahh... `iterator_range` does not have a `::type` :p
<hkaiser>
well, whatever
<gonidelis[m]>
ok I just wanted to be sure on that.
<hkaiser>
you're certainly right, iterator_range is not a meta function
<gonidelis[m]>
hkaiser: ok great. I have spent my last two days on that. so here is my point: when my result type is an `algorithm_result<ExPolicy, some_type>`, it's like the compiler complains when the `some_type` does not have a `::type` thing
<gonidelis[m]>
where `some_type` is exactly what we talked about 5 minutes ago
<hkaiser>
gonidelis[m]: I would assum it complains about algorithm_result<> not having a ::type, but I might be wrong
<gonidelis[m]>
and I just can't stop suspecting that it's again some `dispatch` overload missing
<hkaiser>
hmmm
<hkaiser>
those overloads are needed for the segmented algorithms only
<gonidelis[m]>
do you see that the problem is turning a `lcos(sth)` to `sth` ?
<gonidelis[m]>
`lcos::futre`
<gonidelis[m]>
yeah.... that's what I thought. But !
<hkaiser>
algorithm_result<..., T>::type can be either T (synchronous invocation) or future<T> (asynchronous invocation
<gonidelis[m]>
async does not mean segmented.... right?
<hkaiser>
right
<hkaiser>
async means par(task) used as an execution policy
<gonidelis[m]>
perfect. that's where it hits actually (on the test).
<gonidelis[m]>
so! when we use `seq(task`
<gonidelis[m]>
`seq(task)` ^^
<hkaiser>
yah, seq(task) is async as well
<gonidelis[m]>
buuut here is the catch
<gonidelis[m]>
does this return an `algorithm_result<...,T>`
diehlpk_work_ has joined #ste||ar
<gonidelis[m]>
I mean... since it's seq, it could have no exec policy at all (???)
<hkaiser>
it returns algorithm_result<>::type
<hkaiser>
sure it can
<hkaiser>
remove_if(seq, ...) is sequential
<gonidelis[m]>
remove_if(seq,...) is exactly the same with remove_if(...)
<gonidelis[m]>
right?
<hkaiser>
right
diehlpk_work has quit [Ping timeout: 264 seconds]
<gonidelis[m]>
ahhhhhh........ I think I got it!!!
<gonidelis[m]>
hkaiser: thanks :))
<gonidelis[m]>
I just needed to communicate it in order to untangle it
<gonidelis[m]>
hkaiser: btw I have seen various talks of yours about our exec policies, but do we have any docs somewhere were I could refer to systematically?
<hkaiser>
probably no :/
<gonidelis[m]>
ok... let's put that on gsoc... or gsod maybe.
<gonidelis[m]>
for example when we call `auto f = remove_if(par, ...)`, could I obtain `f` like `f.get()` ? (I know it's redundant -if possible- but I don't if it's actually possible in the first place)
<gonidelis[m]>
know^^
<gonidelis[m]>
hkaiser:
<hkaiser>
no
<hkaiser>
par makes the algorithm return the straight value (so does seq)
<hkaiser>
par(task) make the algorithm return a future<> of that very same type (so does seq(task))
<gonidelis[m]>
ok great so I think I have finally formed my question then:
<gonidelis[m]>
this is working fine with `test_remove_if(seq, DataType());`
<gonidelis[m]>
and ` test_remove_if(par, DataType());`
<gonidelis[m]>
etc...
<gonidelis[m]>
but when I call `test_remove_if_async(seq(task), DataType());`, it hits on the first argument (which I have highlighted for you) because it returns a future<iterator>`, while `make_iterator_range` expects just an `iterator`
<gonidelis[m]>
`future<iterator>` ^^
<gonidelis[m]>
(sorry for messing the code markup
<gonidelis[m]>
)
<hkaiser>
right, so you can't just use make_iterator_range
<gonidelis[m]>
yeah... I need sth in the middle. but that can't be an `f.get()` where I call the highlighted part before returning `make_iterator_range`
<hkaiser>
if you really need something like that, you will have to create facilities that can handle both cases, similar to what we have with get_second_argument (I forgot the name)
<gonidelis[m]>
yy. i should check the other adapted algos again, I guess.
<gonidelis[m]>
hkaiser: is creating a `make_iterator_range` overload for futures an option?
<hkaiser>
well the async algorithm should return a future<iterator_range<>>, so such an overload should do that
bita has joined #ste||ar
<gonidelis[m]>
can we call `make_future` with just one template argument?