hkaiser 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/ | GSoC: https://github.com/STEllAR-GROUP/hpx/wiki/Google-Summer-of-Code-%28GSoC%29-2020
Nikunj__ has quit [Read error: Connection reset by peer]
bita_ has quit [Ping timeout: 264 seconds]
hkaiser has quit [Quit: bye]
bita_ has joined #ste||ar
Yorlik has quit [Ping timeout: 264 seconds]
kale[m] has quit [Ping timeout: 244 seconds]
kale[m] has joined #ste||ar
bita_ has quit [Ping timeout: 264 seconds]
kale[m] has quit [Ping timeout: 244 seconds]
kale[m] has joined #ste||ar
kale[m] has quit [Ping timeout: 264 seconds]
kale[m] has joined #ste||ar
kale[m] has quit [Ping timeout: 244 seconds]
kale[m] has joined #ste||ar
diehlpk__ has quit [Remote host closed the connection]
diehlpk__ has joined #ste||ar
diehlpk__ has quit [Remote host closed the connection]
diehlpk__ has joined #ste||ar
mcopik has joined #ste||ar
mcopik has quit [Client Quit]
kale[m] has quit [Ping timeout: 246 seconds]
kale[m] has joined #ste||ar
hkaiser has joined #ste||ar
<K-ballo> michael wong mentions hpx on the latest cppcast
<hkaiser> K-ballo: nice!
kale[m] has quit [Ping timeout: 256 seconds]
kale[m] has joined #ste||ar
Yorlik has joined #ste||ar
nanmiao11 has joined #ste||ar
diehlpk__ has quit [Ping timeout: 260 seconds]
bita_ has joined #ste||ar
<gonidelis[m]> I am trying really hard to find tests for the adapted `for_each` https://gist.github.com/gonidelis/bcacdec7af2ef079745a26578b94a669 . K-ballo suggested using `iter_sent.hpp` that is to say, the custom sentinel that hkaiser created but I think I need to find other cases too because I am really stuck with the whole adaptation not compiling. (I don't know if the comilation fail comes from the wrong test or the wrongly
<gonidelis[m]> adaptated foreach)
<gonidelis[m]> That's the test I am using thus far
<hkaiser> gonidelis[m]: well, the test can't get any simpler, so I'd assume it's you algorithm implementation
<K-ballo> last I looked the test seemed perfectly fine
nikunj has quit [Read error: Connection reset by peer]
<gonidelis[m]> thank you both
nikunj has joined #ste||ar
<gonidelis[m]> I think that the problem is that `std::forward` cannot convert `Sentinel<long int>` to `Iterator<long int>`
<gonidelis[m]> The thing is that I don't think it has to do that
<gonidelis[m]> So I speculate that since the primal declaration of `for_each` is thisQ
<gonidelis[m]> :
<gonidelis[m]> ` typename util::detail::algorithm_result<ExPolicy, FwdIterB>::type for_each(
<gonidelis[m]> ExPolicy&& policy, FwdIterB first, FwdIterE last, F&& f,
<gonidelis[m]> Proj&& proj = Proj())`
<gonidelis[m]> and I am calling `hpx::parallel::for_each(hpx::parallel::execution::seq,
<gonidelis[m]> Iterator<std::int64_t>{0}, Sentinel<int64_t>{100}, myfunction);
<gonidelis[m]> `
nikunj has quit [Ping timeout: 244 seconds]
<gonidelis[m]> It interpretes `Sentinel<int_64>` as my `F&& f` argument??
nikunj has joined #ste||ar
<gonidelis[m]> ahh... sorry what I said was complete nonsense... Let me look closer
<gonidelis[m]> K-ballo: hkaiser any thoughts?
<gonidelis[m]> and the reason why compiler *wants* to do this convertion is because `for_each_` (it's where `for_each` dispatches) returns `inline typename util::detail::algorithm_result<ExPolicy, FwdIterB>::type
<gonidelis[m]> ` . Does that make sense?
<K-ballo> gonidelis[m]: looks like it is expected to return the iterator, but it is attempting to return the sentinel instead?
<K-ballo> what's the line corresponding to the algorithm_result_impl<>::call ?
<K-ballo> *::get call
<gonidelis[m]> sec
<gonidelis[m]> K-ballo: sorry for the late response
<gonidelis[m]> 9I don't know wether gists is the best way to share)
<gonidelis[m]> (^^
<K-ballo> just link to the line in your fork
<K-ballo> putting all of hpx on a gist would take forever
<gonidelis[m]> just my adapted file
<K-ballo> you ought to get familiar with git
<K-ballo> `last` is a sentinel, indeed
<gonidelis[m]> yeah sure
<K-ballo> that shouldn't be returning the sentinel, it should be returning the iterator
<K-ballo> when they were both iterators and they were equal, it could have returned either
<gonidelis[m]> hmmm....
<gonidelis[m]> okkk so just replace last -> first
<K-ballo> you are working on a branch, aren't you? you should, at least
<gonidelis[m]> yes I do
<K-ballo> and you have your own fork from which you file PRs, right?
<K-ballo> yes, I just found it
<gonidelis[m]> yes
<gonidelis[m]> I was just thinking that I shouldn't push things that do not work
<K-ballo> as long as it is not a plubic branch, like `master`, you should push early and often
<gonidelis[m]> ok thanks for the advise
<K-ballo> and those are your branches, so you can rework them, rebase them, delete them, whatever
<gonidelis[m]> I get what you are saying
<gonidelis[m]> ok... I will push my local now so we can talk better
<gonidelis[m]> just made the change but now it complains in this line
<K-ballo> that one returns a sentinel, for some reason
<hkaiser> gonidelis[m]: I think we can't return last directly (it's a sentinel, we should return std::next(first, numelements) instead
<K-ballo> ideally without an actual call to std::next
<gonidelis[m]> K-ballo: ahh yeah I missed it. thank you very much
<gonidelis[m]> -1 error
<gonidelis[m]> hkaiser: ok I think I missed you here....
<gonidelis[m]> Why just not return `first`
<gonidelis[m]> ?
<hkaiser> gonidelis[m]: because it has to be the end of the input sequence
<gonidelis[m]> But it is `first == last`
<K-ballo> btw it would also help to stop calling the sentinel last (as well as stop calling it an Iter)
<gonidelis[m]> Ok, so what's the suggestion?
<K-ballo> let's call a sentinel a sentienl
<K-ballo> ups, typo, sentinel :)
<gonidelis[m]> haha ok I will change it
<gonidelis[m]> the thing is that `last` or `IterE` could be an iterator too
<gonidelis[m]> Do we consider an `end` iterator as a sentinel?
<K-ballo> an end iterator is a sentinel
<gonidelis[m]> great
<K-ballo> we are not allowed to assume `last` may be an iterator, we have to assume it isn't
<K-ballo> everything should work fine whether it is or isn't
<gonidelis[m]> So sentinel is more of a generalization
<K-ballo> yes
<gonidelis[m]> Ok great. "Sentinel" should cover both cases then
<gonidelis[m]> :)
<gonidelis[m]> So, back to subject: although the first error was fixes with that last change. I still have an error here
<gonidelis[m]> which is `cannot bind non-const lvalue reference of type ‘void (*&)(int)’ to an rvalue of type ‘void (*)(int)’
<gonidelis[m]> `
<K-ballo> do you have actual compiler output? and preferably matching sources
<gonidelis[m]> Do you want me to redirect the whole compiler output to some gist? Or do you just want more details ?
<K-ballo> some gist should do, there's not nearly enough information to diagnose
<K-ballo> supposedly `void (*&)(int)` is the type of IterE, or IterB assuming you changed that already
<K-ballo> a reference to a function pointer is an odd thing to deduce
<K-ballo> the `f` ?
<K-ballo> that's super odd, it doesn't match the source code
<gonidelis[m]> the output comes when I: `make tests.unit.modules.algorithms.foreach_adapt
<gonidelis[m]> `
<K-ballo> the error does make some sense though... and that decay<> is suspicious
<K-ballo> where's the corresponding test line that triggers this error?
<gonidelis[m]> for the source code matching I updated the output gist
<gonidelis[m]> I ran it again with the test that I have updated on the gist that you have so the lines should match now
<gonidelis[m]> It's test.cpp line 18
<gonidelis[m]> foreach_adapt.cpp *
<K-ballo> I don't get any hits for `foreach_adapt.cpp` using the search option
<gonidelis[m]> you mean on my fork's branch?
<K-ballo> try passing &my_function instead, looks like a pre-existin gbug
<gonidelis[m]> ....
<K-ballo> I don't understand, the bug ain't on master
<gonidelis[m]> it worked
<gonidelis[m]> :)))
<K-ballo> file an issue against plain for_each
<K-ballo> caused by e15787bb31917046c814331f40017783e628d97b
<gonidelis[m]> ok could you please explain what's the case with for_each not accepting non-referenced functions ?
<gonidelis[m]> and btw thank you very very much! I am trully amazed
<K-ballo> that decay in invoke_projected is misguided
<K-ballo> decaying a function type gives you a function pointer type
<K-ballo> so it's trying to create a reference *to a pointer* to function given a reference to function
<K-ballo> the proper thing to do is just `F&`, no decay
<gonidelis[m]> wow
<gonidelis[m]> So I am just reading the code
<gonidelis[m]> What's the puprose of `invoke_projected` in the first place?
<K-ballo> hkaiser: ^
<gonidelis[m]> K-ballo: Why would you want to `decay` a function?
<gonidelis[m]> "if T is a function type F or a reference thereto, the member typedef type is std::add_pointer<F>::type"
<K-ballo> I don't know what the intention there was, that's for hkaiser to answer
<gonidelis[m]> No, I am asking about `decay` in general
<gonidelis[m]> Does it convert a &f to a *f?
<K-ballo> if you were to store arguments for later use you'd "decay-copy" them
<gonidelis[m]> or sth
<K-ballo> which is to initialize a decay_t<T> object from it
<K-ballo> it's the kind of transformation you get when you say `auto x = f;`
<K-ballo> auto is as if `decay_t<decltype((f))>` (plus a silly extra rule with initializer_list)
<gonidelis[m]> wow!
<gonidelis[m]> great! Thanks again... I will ask hkaiser about `invoke_projected` on the Friday meeting
<gonidelis[m]> How could I search about e15787bb31917046c814331f40017783e628d97b using git
<gonidelis[m]> i did sth like git log | grep e15787bb31917046c814331f40017783e628d97b but I guess I need some extra lines
<hkaiser> K-ballo: would you mind creating a ticket about invoke_projected?
<hkaiser> please?
<hkaiser> I'll forget otherwise
<K-ballo> I deferred to gonidelis[m] already
<gonidelis[m]> Do you want me to try it?
<gonidelis[m]> please
<gonidelis[m]> I would be glad...
<hkaiser> ahh, ok
<hkaiser> gonidelis[m]: pls go ahead
<K-ballo> gonidelis[m]: on your command line it would be git show e15787bb31917046c814331f40017783e628d97b
<gonidelis[m]> hkaiser: thanks I might need some guidance but that won't be a problem
<gonidelis[m]> K-ballo: thanks... just did it. Great. What about on github?
<hkaiser> sure
<K-ballo> on github I just create the link as above
<gonidelis[m]> ahh great....
<K-ballo> the last component is the commit hash
<gonidelis[m]> duh...
<gonidelis[m]> yeah you are right
nikunj97 has joined #ste||ar
kale[m] has quit [Ping timeout: 256 seconds]
kale[m] has joined #ste||ar
nikunj97 has quit [Ping timeout: 240 seconds]
kale[m] has quit [Read error: Connection reset by peer]
kale[m] has joined #ste||ar