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
kale[m] has quit [Ping timeout: 240 seconds]
kale[m] has joined #ste||ar
kale[m] has quit [Ping timeout: 260 seconds]
Yorlik has quit [Ping timeout: 256 seconds]
K-ballo has quit [Read error: Connection reset by peer]
K-ballo has joined #ste||ar
hkaiser has quit [Quit: bye]
bita_ has quit [Read error: Connection reset by peer]
bita_ has joined #ste||ar
bita_ has quit [Ping timeout: 260 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 [Read error: Connection reset by peer]
kale[m] has joined #ste||ar
kale[m] has quit [Ping timeout: 246 seconds]
kale[m] has joined #ste||ar
kale[m] has quit [Ping timeout: 260 seconds]
kale[m] has joined #ste||ar
kale[m] has quit [Ping timeout: 240 seconds]
kale[m] has joined #ste||ar
kale[m] has quit [Ping timeout: 240 seconds]
kale[m] has joined #ste||ar
Yorlik has joined #ste||ar
kale[m] has quit [Ping timeout: 244 seconds]
kale[m] has joined #ste||ar
kale[m] has quit [Ping timeout: 240 seconds]
kale[m] has joined #ste||ar
kale[m] has quit [Ping timeout: 256 seconds]
kale[m] has joined #ste||ar
kale[m] has quit [Ping timeout: 260 seconds]
kale[m] has joined #ste||ar
kale[m] has quit [Ping timeout: 240 seconds]
kale[m] has joined #ste||ar
kale[m] has quit [Ping timeout: 256 seconds]
diehlpk_work has quit [Ping timeout: 260 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: 240 seconds]
kale[m] has joined #ste||ar
kale[m] has quit [Ping timeout: 260 seconds]
hkaiser has joined #ste||ar
kale[m] has joined #ste||ar
kale[m] has quit [Ping timeout: 260 seconds]
kale[m] has joined #ste||ar
kale[m] has quit [Ping timeout: 260 seconds]
kale[m] has joined #ste||ar
kale[m] has quit [Ping timeout: 246 seconds]
kale[m] has joined #ste||ar
akheir has joined #ste||ar
weilewei has joined #ste||ar
hkaiser has quit [Quit: bye]
kale[m] has quit [Ping timeout: 256 seconds]
kale[m] has joined #ste||ar
diehlpk has joined #ste||ar
diehlpk has quit [Changing host]
diehlpk has joined #ste||ar
hkaiser has joined #ste||ar
diehlpk has quit [Remote host closed the connection]
diehlpk has joined #ste||ar
diehlpk has quit [Ping timeout: 260 seconds]
hkaiser has quit [Ping timeout: 260 seconds]
diehlpk_work has joined #ste||ar
nanmiao11 has joined #ste||ar
kale[m] has quit [Ping timeout: 264 seconds]
kale[m] has joined #ste||ar
hkaiser has joined #ste||ar
hkaiser has quit [Quit: bye]
hkaiser has joined #ste||ar
kale[m] has quit [Ping timeout: 240 seconds]
kale[m] has joined #ste||ar
<gonidelis[m]> Here are defined two overloads for `copy`. One with `expolicy` and one without
<gonidelis[m]> According to standard http://eel.is/c++draft/alg.copy#9 these are the first declaration and the one after "5" ?
<hkaiser> gonidelis[m]: please elaborate, I don't understand what you're asking
<hkaiser> http://eel.is/c++draft/alg.copy#9 specifies copy_n, not copy
<gonidelis[m]> ok first of all sorry for asking over and over again the same question I just want to be sure that I doing this the proper way. I am trying to match the `copy` definitions here to the definitions in std. Ahhh... sorry for the wrong permalink. I meant http://eel.is/c++draft/alg.copy#5
<gonidelis[m]> hkaiser:
<gonidelis[m]> I mean the definition under "5"
<hkaiser> yes, the standard specifies 4 overloads for copy
<gonidelis[m]> (it' s pretty bad that the definiots are not enumerated btw)
<hkaiser> two in namespace std, and two in std::ranges
<hkaiser> we add two overloads in hpx::ranges taking the execution policy
<gonidelis[m]> K-ballo: how?? I really need this
<hkaiser> gonidelis[m]: so what's your question?
<K-ballo> move the mouse to where the number would be, and you'll get the link
<gonidelis[m]> hkaiser: I need to learn how to link the defs in order not to confuse you
<gonidelis[m]> great! K-ballo thanks
<gonidelis[m]> hkaiser: so...
<hkaiser> sure, that's your seconday question, but what was the primary one?
<gonidelis[m]> is this one?
<hkaiser> yes
<gonidelis[m]> and the first one from here http://eel.is/c++draft/alg.copy#itemdecl:1 is this one
<hkaiser> yes
<gonidelis[m]> hkaiser: ahh thanks...
<gonidelis[m]> hkaiser: how do you write the body of `tag_invoke` ? Is it just the return type?
<gonidelis[m]> and thus I just get from standard the return type and just return that inside tag_invoke?
<hkaiser> not sure I understand
kale[m] has quit [Ping timeout: 264 seconds]
kale[m] has joined #ste||ar
<gonidelis[m]> I mean this one
<hkaiser> ok?
<gonidelis[m]> Do you just take the returns from the standard?
<hkaiser> yes
<gonidelis[m]> isn't there functionallity inside the body?
<hkaiser> sure, you need to somehow implement the algorithm, no?
<gonidelis[m]> yeah... do you take it from the pre-existing implementations? or you just write it from scratch?
<weilewei> hkaiser would you mind taking a look into this issue again https://github.com/STEllAR-GROUP/hpx/issues/4879
<hkaiser> weilewei: no idea where to even start looking, frankly
<hkaiser> gonidelis[m]: mostly just the code from the old algorithms, slightly modified, if needed
weilewei has quit [Remote host closed the connection]
<gonidelis[m]> hkaiser: ok ok .... sorry for being confusing I just want to get this messed PR of mine, right
weilewei has joined #ste||ar
<hkaiser> sure
<weilewei> hkaiser this issue does not happen in any other platforms... If it does not work on Cori GPU, shall we skip that machine...
<hkaiser> weilewei: no idea where to even start looking, frankly
<weilewei> ok...
<hkaiser> could be a problem with the memory allocator, or some other problem with dca, I don't know
<gonidelis[m]> hkaiser: Do I need to make the result_type change in the deprecated versions?
<gonidelis[m]> from pair,tuple -> in_out_result?
<K-ballo> they are deprecated? who is deprecating them?
<gonidelis[m]> K-ballo: we do
<weilewei> hkaiser yea, I don't know, DCA itself runs file
<weilewei> fine
<gonidelis[m]> K-ballo: I render them deprecated as the users now use hpx::algo instead of hpx::parallel::algo
<weilewei> But let me get some profiling from Wombat and Summit first
bita_ has joined #ste||ar
nanmiao11 has quit [Remote host closed the connection]
nanmiao11 has joined #ste||ar
kale[m] has quit [Ping timeout: 260 seconds]
kale[m] has joined #ste||ar
<gonidelis[m]> hkaiser: on the definitions here
<gonidelis[m]> http://eel.is/c++draft/algorithms#alg.transform
<hkaiser> ok?
<gonidelis[m]> the return type is `constexpr OutputIterator`. So I just return sth like `FwdIter2` and the hpx counterpart for `constexpr` ?
<hkaiser> doubt we can make our algorithms constexpr at this point
<gonidelis[m]> So I just return fwditer2?
<hkaiser> also, 'OutputIterator' is just a name, you can use whatever you like
<gonidelis[m]> yeah yeah... as I said we write it like `fwditer1` `fwditer2`
<gonidelis[m]> or `typename util::detail::algorithm_result<FwdIter2>` maybe???
<hkaiser> depends on which algorithm overload you're talking about
<gonidelis[m]> the non-ranges one
<gonidelis[m]> ones*
weilewei has quit [Remote host closed the connection]
<hkaiser> ok, the one with policies or the one without?
<gonidelis[m]> without
<hkaiser> then it's just FwdIter2
<hkaiser> (for copy)
<hkaiser> for for_each it's probably something else, like F
<gonidelis[m]> ok I am working on `transform` btw....
<gonidelis[m]> why do we use the `friend` keyword in front of the return type?
<hkaiser> read p1895
<gonidelis[m]> hkaiser: ohh ok... thnx ;)
weilewei has joined #ste||ar
<K-ballo> they are not just names, they carry requirements with them.. OutputIterator requires an output iterator, FwdIter requires a forward iterator
kale[m] has quit [Ping timeout: 260 seconds]
kale[m] has joined #ste||ar
bita_ has quit [Ping timeout: 260 seconds]
<hkaiser> K-ballo: in c++20, yes, before that it's just names
<K-ballo> no, the template param names from [algorithms] have semantic requirements attached
<hkaiser> ok
<hkaiser> but not enforced
<K-ballo> define enforced?
<K-ballo> they are implicit Requires:
<hkaiser> compiler enforced
<hkaiser> yes, I understand
<K-ballo> that's implementation QoI
kale[m] has quit [Ping timeout: 264 seconds]
kale[m] has joined #ste||ar
<gnikunj[m]> hkaiser: yt?
<gnikunj[m]> hkaiser: I had a question about having multiple destructors in C++20
<gnikunj[m]> my question being, you said SFINAE is bad and we shouldn't use it, but it seems that they're using concepts to get multiple destructors working
<gnikunj[m]> K-ballo: ^^
<K-ballo> who said sfinae is bad?
<gnikunj[m]> I've always had this notion
<gnikunj[m]> and hartmut usually asks me to not have sfinae in the code
<K-ballo> sfinae isn't bad, concepts is nothing but sfinae and in itself it's not bad
<gnikunj[m]> that's why I was a bit wary when I got to know about this feature. What is it that I'm missing?
<K-ballo> having gratuituos sfinae in code, that's bad
<gnikunj[m]> how do you know if sfinae was not required?
<K-ballo> you'd know, it's a fundamental property of the design
<K-ballo> or are you asking when would you choose to design something to sfinae?
<gnikunj[m]> I'm asking when do I decide if I want to design it with sfinae
<K-ballo> so, you begin with a constraint which is a precondition for your function, for instance is_iterator<X>
<K-ballo> and then you ask if when calling fun(x) with a non-iterator X it's important for your overload to disappear so that a different fun overload may take over
<K-ballo> take the algorithms for instance, since you are already familiar with them..
<K-ballo> an is_iterator requirement may make sense, someone else may come up with a similar minded algorithm to operate on non iterators
<gnikunj[m]> hkaiser told that the compilers handle functions in a single pass and structs in two passes (given a compiler is a 2 pass one) so ordering in sfinae is important. Isn't that a bad thing?
<K-ballo> however, if the requirement is say bidirectional_iterator, then that's because your algorithm can't reasonably be implemented with iterators less than bidirectional
<K-ballo> so you may want to sfinae on non-iterators, but not sfinae and fail hard on iterators that aren't bidirectional
<K-ballo> a similar reason for sfinae is when someone may have a legitimate use case to ask programmatically whether some function is viable or not
<gnikunj[m]> ok it is starting to make more sense. What is the difference between having a template specialization vs sfinae in that case? I think a sfinae implementation can handled using template specialization as well
<gnikunj[m]> s/can handled/can be handled
<K-ballo> in which case?
diehlpk has joined #ste||ar
diehlpk has quit [Changing host]
diehlpk has joined #ste||ar
<gnikunj[m]> like have a base struct and then multiple variations of it that inherits from the base struct and have partial template specialization of some sort?
<K-ballo> I can't picture it
<gnikunj[m]> ok let me put up an example real quick
<K-ballo> if specializations can actually do the job then they would be prefered to gratuituos sfinae
<K-ballo> sometimes specializations need to be sfinae driven though, and that's fine too
<gnikunj[m]> K-ballo: https://godbolt.org/z/nr9jGn
<gnikunj[m]> in this scenario, we can do both sfinae and template specialization. What should one prefer?
<K-ballo> if you could actually do both, always specialization, but you can't really..
<K-ballo> uhm, the condition doesn't look right, it misses random access iterators
<K-ballo> the iterator category tags, in particular, where meant to be used for tag dispatching overloads
<gnikunj[m]> aah ok, so how do I use them in this scenario?
<K-ballo> something like this https://godbolt.org/z/ezbddK, pseudocode
<K-ballo> ups, there are some leftovers in there, here https://godbolt.org/z/br1Kfn
<K-ballo> i'm completely ignoring the non-iterator case, just as the original
<gnikunj[m]> nice. so we don't need sfinae in the first place.
<gnikunj[m]> it looks like simple function overloading to me
<K-ballo> yeah, don't use sfinae for tag dispatching.. use constexpr if if possible, else use tag dispatching
<gnikunj[m]> got it. Thanks!
<gnikunj[m]> using if constexpr we limit the if statement check at compile time, right?
<K-ballo> yes.. and it can handle the same kind of scenarios tag dispatching can
<gnikunj[m]> right
<K-ballo> (it was designed specifically as a replacement for tag dispatching)
<gnikunj[m]> essentially make a single function that does the tag dispatching using if constexpr
<K-ballo> yes
<gnikunj[m]> wow, nice! I had an incorrect notion of if constexpr in that case. I used to think that it is meant only for optimizing constant if evaluations at compile time (which is essentially the code you shared but I never thought of using it in that way)
<K-ballo> constant if evaluations are already optimized at compile time without constexpr
<K-ballo> there are some subtle differences in semantics to a regular if, which makes each branch work as if it were a separate function body
<gnikunj[m]> got it
diehlpk has quit [Ping timeout: 260 seconds]
<gnikunj[m]> hkaiser: do have have a cluster with 20 or more nodes per processor type? rostam has a maximum of 16