aserio 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/
eschnett has quit [Quit: eschnett]
ABresting[m] has joined #ste||ar
EverYoun_ has joined #ste||ar
EverYoung has quit [Ping timeout: 260 seconds]
hkaiser has joined #ste||ar
ABresting[m] has quit [Ping timeout: 272 seconds]
<github> [hpx] hkaiser pushed 3 new commits to fixing_msvc_win32: https://git.io/vHex4
<github> hpx/fixing_msvc_win32 afcd1fa Hartmut Kaiser: Changing some uses of #ifdef HPX_MSVC to #ifdef WIN32
<github> hpx/fixing_msvc_win32 1db987d Agustin K-ballo Berge: Add and use HPX_MSVC_WARNING_PRAGMA for #pragma warning
<github> hpx/fixing_msvc_win32 c228d68 Hartmut Kaiser: Merge pull request #2636 from K-ballo/fixing_msvc_win32...
Matombo has quit [Remote host closed the connection]
<Smasher> hkaiser still workin? ;)
<hkaiser> Smasher: just came back home
<Smasher> and i feel like im working for the fbi or the nsa :)
<hkaiser> careful, certain three-letter-acronyms invite unwanted lurkers
<Smasher> :D
<github> [hpx] K-ballo deleted algorithm-overloads-msvc12-fix at bbb29a3: https://git.io/vHepE
<K-ballo> that stacktrace :'(
<github> [hpx] hkaiser pushed 1 new commit to fixing_2439_2: https://git.io/vHepS
<github> hpx/fixing_2439_2 e39cd05 Hartmut Kaiser: Merge branch 'master' into fixing_2439_2
vamatya_ has quit [Ping timeout: 255 seconds]
EverYoun_ has quit [Ping timeout: 260 seconds]
K-ballo has quit [Quit: K-ballo]
hkaiser has quit [Quit: bye]
mcopik has joined #ste||ar
ABresting[m] has joined #ste||ar
mcopik has quit [Ping timeout: 260 seconds]
mcopik has joined #ste||ar
ABresting[m] has quit [Ping timeout: 255 seconds]
mcopik has quit [Ping timeout: 246 seconds]
mcopik has joined #ste||ar
ajaivgeorge has joined #ste||ar
ajaivgeorge has quit [Client Quit]
<heller__> Smasher: come in
<heller__> Come on...
<heller__> Try both localities with the same build type...
<heller__> Anything else is doomed to fail. No wonder you are getting that error....
vamatya_ has joined #ste||ar
mcopik has quit [Ping timeout: 268 seconds]
jaafar has joined #ste||ar
EverYoung has joined #ste||ar
pree has joined #ste||ar
EverYoung has quit [Remote host closed the connection]
vamatya_ has quit [Ping timeout: 268 seconds]
Remko has joined #ste||ar
Remko has quit [Remote host closed the connection]
Remko has joined #ste||ar
jaafar has quit [Ping timeout: 240 seconds]
shoshijak has joined #ste||ar
david_pfander has joined #ste||ar
pree has quit []
bikineev has joined #ste||ar
bikineev has quit [Ping timeout: 246 seconds]
Remko has quit [Remote host closed the connection]
thundergroudon has joined #ste||ar
thunderGroudon|2 has joined #ste||ar
thundergroudon has quit [Read error: Connection reset by peer]
<Smasher> ive noticed if i write to a stream from for_loop_n it is synchronized
<Smasher> magic?
<github> [hpx] taeguk opened pull request #2639: Fix a tiny typo in tutorial. (master...taeguk-patch-typo-2) https://git.io/vHvRK
<taeguk> I'm not a narrow-minded person :)
<jbjnr> synchronized in what sense?
<jbjnr> Smasher: ^
bikineev has joined #ste||ar
thundergroudon has joined #ste||ar
<jbjnr> heller__: yt?
<heller__> jbjnr: hey
<jbjnr> good morning - Raffaele has a new problem ...
<heller__> tell me
thunderGroudon|2 has quit [Ping timeout: 246 seconds]
<Smasher> jbjnr well if you have a concurrency and write to the same stream from different threads its usually messed up
<jbjnr> he is running out of memory, and it appears that when he creates many many tasks, the stack allocation code in hpx, is creating stacks for tasks, when those tasks complete, the stacks get placed in a 'used stacks' list, but instead of them being recycled, mostly new stacks are created when tasks become ready to run - instead of recycling ones that are done with. Consequently, stack usage...
<jbjnr> ...consumes all the memory and he gets memunmap errors etc etc
<jbjnr> some are recycled, but new ones keep getting created even when old stacks area vailable
<jbjnr> are there any knobs and settings I can twiddle to change the stack use behaviour
thundergroudon has quit [Read error: Connection reset by peer]
<heller__> jbjnr: ugh. that sounds like a severe bug
<heller__> the old ones should really get recycled
<heller__> he is using a lot of mixed high priority and regular priority tasks, right? what about different stack sizes?
<jbjnr> who knows most about thsat code - you or hk?
<github> [hpx] taeguk closed pull request #2639: Fix a tiny typo in tutorial. (master...taeguk-patch-typo-2) https://git.io/vHvRK
<heller__> does he turn of guard pages?
<jbjnr> yes, I think so usually
<heller__> both :P
<heller__> i have to dig a little though
<heller__> a small test program reproducing the issue would help though
<jbjnr> I'm wondering if completed tasks are going onto the 'completed' queue, but have not been 'deleted' yet, so the stacks are not considered re-usable ...
<heller__> that sounds about right, yes
<heller__> let me check...
<jbjnr> so is there a setting I can tweak that incresases the fequency of clean of dead tasks
<heller__> nothing exposed, you'd have to change the code
<heller__> I'll have a quick look
<jbjnr> no prob
<heller__> what's the ration of high vs. low priority threads at the moment?
<heller__> jbjnr: there is a define, HPX_MAX_TERMINATED_THREADS which controls the frequency
<heller__> which is of course not exposed :P
<heller__> it is set to 1000 right now
<jbjnr> I see it. set to 1000 bt default. I'll lower it and see what gives ...
<jbjnr> thanks
Matombo has joined #ste||ar
<heller__> jbjnr: don't hesitate changing it to a runtime controllable variable
<jbjnr> ooh. this is per worker thread too I think
<heller__> yes, each time a thread terminates, we put it on the terminated list
<jbjnr> so on daint, we could have 32k dead stacks before cleanup is guaranteed
<heller__> once the count exceeds the maximum, we clean them up
<heller__> indeed
<heller__> well, take that times two
<heller__> since you are using high priority tasks extensively
<jbjnr> ouch!
<jbjnr> related question : if a task suspends, and then resumes on a differnt worker thread - the stack will move from one to the other - are the stacks originally pinned (first touch) to the worker they were first created on
<jbjnr> (or are they memcopied across from one to another)
<github> [hpx] StellarBot pushed 1 new commit to gh-pages: https://git.io/vHvuo
<github> hpx/gh-pages 079f61f StellarBot: Updating docs
<heller__> the stacks are originally unmaped
<heller__> but when we suspend, we have to copy everything
pree has joined #ste||ar
<heller__> so there is your first touch
<heller__> we don't migrate the stack memory to different NUMA domains right now
<heller__> jbjnr: we need to switch to hwloc 2 ASAP
<heller__> lots of awesome new stuff regarding memory colocation in there
<jbjnr> interesting. That's a new feature in hwloc2 is it - ability to move pinned memopry around
<heller__> yes
<jbjnr> I do not see hwloc2 mentione on their webpage ....
<heller__> only on their github...
<heller__> still in development
<jbjnr> aha. thnks
<heller__> the KNLs shook them up quite a bit
<jbjnr> heller__: indeed. I saw some article a while back that intel/ibm/someone was working on a user level api to allow better memory pinning from use code. I guess the hwloc people are in the best place to work on it
<heller__> yeah
<heller__> intel developed memkind
<heller__> horrible code, mostly to support legacy applications without modification to take advantage of hbm
<jbjnr> do we have any idea when hwloc2 will be uable?
<jbjnr> ^usable
<jbjnr> I'm subscribed to the hwloc ml, but I only ever read it when I have problems (which is never now)
bikineev has quit [Read error: No route to host]
bikineev has joined #ste||ar
<heller__> jbjnr: no idea
bikineev has quit [Ping timeout: 245 seconds]
shoshijak has quit [Quit: Ex-Chat]
shoshijak has joined #ste||ar
pree has quit [Ping timeout: 260 seconds]
shoshijak has quit [Quit: Ex-Chat]
shoshijak has joined #ste||ar
<Smasher> my own command line arguent which i define with boost::program_options::options_description often collide with hpx's ones
<Smasher> that's pretty annoying
<shoshijak> Smasher : how so?
<Smasher> desc_commandline.add_options()("probedir,pd", value<std::string>()->default_value("probe"), "The directory containing the probe fingerprints. Default: \"probe\"");
<Smasher> now i run it with my_exe -pd=myfolder
<Smasher> and it throws an exception
<shoshijak> shouldn't it be --pd=myfolder (with 2 '-'s)
<shoshijak> ah no sorry, forget what I said
<Smasher> my_exe -h says it must be one '-'
<shoshijak> what does the exception say?
<Smasher> cant figure it out yet
<Smasher> without debug the application just crashes
<Smasher> and with debug "what" is an empty string
<Smasher> HPX_THROW_EXCEPTION(no_success, "section::line_msg", msg);
<Smasher> this line throws it
<Smasher> ini.cpp:809
<Smasher> msg = "Cannot open file: robedir=probe_different"
<Smasher> it thinks -p is --hpx:app-config
<jbjnr> Smasher: I think the program options allows --first or -second, but the second one is a single char, "pd" might not be allowed as the second version (the short version)
<Smasher> ah wait, i have another argument this time
<jbjnr> but I agree that we should be able to disable or override the default hpx ones as they use most of the alphabet already and user code might need -t or op or os etc etc
thundergroudon has joined #ste||ar
<Smasher> --probedir=.. works
<jbjnr> -t or -p or -s I meant to write
<Smasher> but i would like to have my own shortcut
<Smasher> we should be able to disable or override the default hpx ones
<Smasher> ^
<jbjnr> file an issue requesting the ability to disable the default hpx shortcuts.
<jbjnr> it might already be possible, but I don't know how
<Smasher> but havent found anything yet
<jbjnr> " It is possible to define your own shortcut options. In fact, all of the shortcuts listed above are pre-defined using the technique described here. Also, it is possible to redefine any of the pre-defined shortcuts to expand differently as well."
<Smasher> ah no, that is something different
<Smasher> ah
<Smasher> well i dont have an .ini
hkaiser has joined #ste||ar
<Smasher> and not planning to add one
<jbjnr> quite right. we should add a compile time option in cmake to disable all that cruft
<shoshijak> Hi hkaiser! I'm working on allowing several thread-pools to run in HPX. With the changes I made, the threadmanager now holds several pointers to threadpools. I now run into a bunch of difficulties because of functions like threadmanager_impl::register_work(...) which calls thread_pool::create_thread(...). There will have to besome sort of mechanism for the user to specify which threadpool the task should be created on
<shoshijak> and I'm not sure how to go about this
<hkaiser> shoshijak: for now I'd suggest that the thread-manager API uses one of the thread-pools as before
<shoshijak> [note that with my changes, runtime and threadmanager are not templated on the scheduler type anymore, but thread_pool still, and uses type-erasure so that threadmanager can hold a pointer to thread_pool_base]
<shoshijak> hkaiser: you mean just schedules everything on a default thread pool?
<hkaiser> any extensions should go into executors which can go through a new API for scheduling on a separate thread-pool
<hkaiser> yes
<shoshijak> oh I see
<hkaiser> shoshijak: wrt type erasing runtime and thread_manager - good! that's something which was in preparation for a while
<hkaiser> shoshijak: in the end I think we will get rid of the register_work API and replace it with executors
<shoshijak> hkaiser: that's great :)
pree has joined #ste||ar
<shoshijak> the threadmanager does very little now ... mostly just forwards stuff to the pool
<shoshijak> that class doesn't really have a good raison d'être
<shoshijak> probably should be deleted at some point, right?
<shoshijak> and another question: should I just merge the now-untemplated runtime with runtime_impl, or do you want to keep them separate in case?
<shoshijak> *just in case
<hkaiser> jbjnr: you can disable the shortcuts by add --hox:ini=hpx.commandline.aliasing!=0
<jbjnr> ooh. Smasher ^^^ see that ^^^
<jbjnr> s/hox/hpx/
<hkaiser> shoshijak: so have you moved the perf-counters to the thread-poll as well?
thundergroudon has quit [Ping timeout: 246 seconds]
<hkaiser> jbjnr: right, thanks - typo
<jbjnr> thanks hkaiser been wondering about that for a while - pity it isn't mentioned on the command line options docs page ;)
<zao> Hah, wrote a horrible program to stable sort the build logs from a devenv.exe invocation into Build Order.
<hkaiser> sorry
<zao> Now I can reliably get HPX build logs without VS crashing :D
bikineev has joined #ste||ar
<jbjnr> hkaiser: the perf counbters is temporarily commented out, but I think(hope) shoshijak has a plan
<shoshijak> hkaiser : no, since I know very little about the perf counter code, I commented the whole part about perf counter in threadmanager.cpp out. But this will have to be moved to thread-pool, so that the user can get perf info about each threadpool separately
<jbjnr> we were thinking that the default pool will always be pool#0 and then each user pool gets an Id 1,2,3 ... so that perf counters can be requested by pool using an index - or if the user has named them, using the name
<hkaiser> shoshijak: the actual perf-counters live in the thread-pools and below (scheduler, queues, etc.) but their definition is in the thread-manager and I think we should keep it that way (YMMV)
<hkaiser> jbjnr: nod, sounds about right
<hkaiser> having a class which does nothing more than encapsulate the whole things is not a bad thing, so I'd be hesitant to completely remove it - but you have a better understanding of where you'd like to go
<shoshijak> hkaiser : I'd rather get to a working solution first, and then once it's more clear to me which role each class has taken on, think of whether this needs cleaning up
<hkaiser> right, +1
<jbjnr> hkaiser: when you're looking for PhD students ... I know where you can find one
<shoshijak> about the perf counters: I haven't looked at that part of the code at all yet... I'd rather leave them commented out for the moment and get back to that also once I have a working solution
<hkaiser> ohh
<hkaiser> jbjnr: tell me ;)
<hkaiser> shoshijak: ok, fine with me
<jbjnr> I can't - she's reading this!
<hkaiser> I wouldn't like to lose those, though
<hkaiser> lol
<hkaiser> by all means, let's talk about this at som epoint
<pree> Hi all
<pree> When applying hpx::apply on global plain action should we care about return value from the action?
bikineev has quit [Ping timeout: 268 seconds]
<jbjnr> no. apply doesn't return anything, so you can just drop any return value
<pree> In docs states that return value is ignored
<pree> solved thank you
K-ballo has joined #ste||ar
<jbjnr> c++ wizards : I have a new question regarding allocators. If I use a std:::vector<T, rma::allocator<T>> and the vector is resized to a from a large length M to a smaller length N. then the chunk of memory I've got pinned will be length M, and how can I make the vector tell the allocator that only N bytes are in use?
shoshijak has quit [Ping timeout: 246 seconds]
<hkaiser> jbjnr: why do you have to?
<hkaiser> pree: apply() invokes a fire&forget operation, it will ignore the result
<pree> https://gist.github.com/Praveenv98/094b98c144f23d86bd346fb07d277cc2 - please see this I have mentioned in description
Matombo has quit [Remote host closed the connection]
<jbjnr> hkaiser: during serialization/deserialization, the rma chunks have 'size' and 'used space' vars that are used to control the rma operations, now when I serialize the vector I can set the used space flag accordingly, but it occrs to me that there is scope for problems when these two don't agree. everything should work fine, but it'd be nice to make sure by setting the used space in the region...
<jbjnr> ...to be correct
<hkaiser> pree: apply returns a bool which is true if the operation was executed locally, false otherwise
<pree> That's the catch. I thought it
<pree> Thanks !
<hkaiser> jbjnr: the allocator does not care how much of the allocated memory is actually 'used'
<hkaiser> it may care about how much memory was allocated for the block, though
<hkaiser> so I think it shouldn't be problematic if those two numbers diverge as long as used <= allocated
<jbjnr> the used space is used to limit the rma length when rma put/get operations happen and I need to make sure that the vector sets it correctly during serialization. it should be fine.
<hkaiser> sure, but that's nothing concerning the allocator
<jbjnr> I used that flag in some places in the code and I need to be careful
<hkaiser> your rma_object<> should know how much memory is 'used', so does vector<>
<jbjnr> yes
bikineev has joined #ste||ar
Matombo has joined #ste||ar
Matombo has quit [Remote host closed the connection]
jaafar has joined #ste||ar
taeguk[m] has joined #ste||ar
EverYoung has joined #ste||ar
EverYoung has quit [Remote host closed the connection]
EverYoung has joined #ste||ar
EverYoung has quit [Remote host closed the connection]
EverYoung has joined #ste||ar
hkaiser has quit [Quit: bye]
jaafar has quit [Ping timeout: 260 seconds]
jaafar has joined #ste||ar
ABresting has joined #ste||ar
aserio has joined #ste||ar
jaafar has quit [Read error: Connection reset by peer]
denis_blank has joined #ste||ar
EverYoung has quit [Ping timeout: 255 seconds]
hkaiser has joined #ste||ar
EverYoung has joined #ste||ar
<github> [hpx] KhalidHasanov opened pull request #2640: A new throttling policy with public APIs to suspend/resume (master...master) https://git.io/vHvpL
EverYoung has quit [Remote host closed the connection]
EverYoung has joined #ste||ar
<taeguk> I have a question. Is there specific reason for using pass-by-value instead of pass-by-reference in examples.queue (https://github.com/STEllAR-GROUP/hpx/blob/master/examples/queue/queue_client.cpp#L19)
<taeguk> In my environment, sizeof(hpx::lcos::queue<int>) == 48.
<hkaiser> taeguk: none
<taeguk> thank you.
<heller__> this should be pretty much the size of a shared_future
<heller__> hkaiser: hmm, could we consider queue being deprecated by channel?
<heller__> or rather should...
<hkaiser> fine by me
<hkaiser> it's broken anyways ;)
eschnett has joined #ste||ar
<heller__> hkaiser: exactly ;)
<heller__> hkaiser: btw, https://jupyter.nersc.gov
<heller__> not sure how useful it is though
bikineev has quit [Ping timeout: 268 seconds]
<heller__> useful for our purposes that is
<hkaiser> k
<hkaiser> heller__: care to create a ticket for removing queue?
<github> [hpx] hkaiser pushed 1 new commit to Resource_manager_fixes: https://git.io/vHffY
<github> hpx/Resource_manager_fixes 03cb228 Hartmut Kaiser: Using new executor API
<heller__> hkaiser: done.
<hkaiser> tks
bikineev has joined #ste||ar
pree has quit []
jaafar has joined #ste||ar
ABresting_ has joined #ste||ar
ABresting has quit [Quit: Page closed]
ABresting_ is now known as ABresting
ABresting_ has joined #ste||ar
ABresting_ has quit [Client Quit]
jaafar has quit [Ping timeout: 258 seconds]
jaafar has joined #ste||ar
david_pfander has quit [Ping timeout: 268 seconds]
bikineev has quit [Ping timeout: 240 seconds]
EverYoung has quit [Remote host closed the connection]
EverYoung has joined #ste||ar
EverYoung has quit [Ping timeout: 260 seconds]
vamatya_ has joined #ste||ar
ajaivgeorge has joined #ste||ar
<jbjnr> someone asked the question "if an action is invoked on the local locality (find_here()), is the serialization bypassed - and I said, yes it is. Was that correct - or does it still get serialized and then deserialized
<hkaiser> jbjnr: yes, correct
<jbjnr> ok. thanks. just wanted to be sure - I started doubting myself
<K-ballo> it would still require serialization to exist, though, right? it's a runtime decision
<K-ballo> it's basically serialization elision :)
<hkaiser> yes
pree has joined #ste||ar
<heller__> hkaiser: thanks for reacting on khalids PR so quickly
bikineev has joined #ste||ar
<jbjnr> what does the new scheduler do that differentiates it from others?
<jbjnr> (I didn't look at the code yet)
<heller__> jbjnr: it allows use to shut of cores and enable cores again
<heller__> wasn't doable with the old policy, IIRC
<jbjnr> ok. hopefully the new resource manager stuff will allow that too
pree has quit [Ping timeout: 260 seconds]
<jbjnr> (we'll just borrow the code from the old RM and throttling scheduler if/when we need it)
<hkaiser> heller__: that's something shoshiak will want to be involved so we can do that through the resource manager and not through special magic in the scheduler
<heller__> hkaiser: yeah
pree has joined #ste||ar
<heller__> the use case is to have N executors, where N is the number of NUMA domains
<heller__> each of those executors should get 0 to M cores to run on
<jbjnr> our RM will allow N pools, each with an executor
<heller__> and a runtime adaptive measure to adapt
<heller__> which should not be tied into HPX, imho
<jbjnr> version 1 - will be static, no resizing of pools, or moving of threads from one to another, but V2 will expose that - and that functionality will need what you've got in the throttler to drain a core of tasks and shut it down before moving it, etc etc)
<heller__> *nod*
<heller__> I'll make Khalid aware of the development and let him make contact with shoshiak
<jbjnr> It's a real shame. shoshana only has a month left, and we're now starting to make proper progress - we have so much still to do
<heller__> yeah
<heller__> what can we do keep her (assuming she wants to continue)?
EverYoung has joined #ste||ar
mcopik has joined #ste||ar
<github> [hpx] atrantan opened pull request #2642: Fix issue #2638 (master...master) https://git.io/vHfc3
aserio has quit [Ping timeout: 255 seconds]
<heller__> yay. got my allscale runtime to perform at 80% of OpenMP stream ...
jaafar has quit [Ping timeout: 240 seconds]
pree has quit [Ping timeout: 260 seconds]
akheir has joined #ste||ar
akheir has quit [Remote host closed the connection]
<K-ballo> hkaiser: do you happen to have a config/defines.hpp for vs2015 at hand?
<hkaiser> K-ballo: only an older one (4 weeks ago)
<K-ballo> works for me
<K-ballo> I'm trying to avoid having to build boost for it
<K-ballo> just want to see the _HAVE_s
<K-ballo> thanks
<zao> K-ballo: Just download the binary Boost dists :P
<K-ballo> pff, that's for rookies
akheir has joined #ste||ar
pree has joined #ste||ar
mcopik has quit [Ping timeout: 240 seconds]
aserio has joined #ste||ar
<K-ballo> it doesn't seem HPX_HAVE_CXX11_STD_TYPE_TRAITS is useful in any way
<K-ballo> it was meant to be required, but it is not for some reason
<K-ballo> it also gained *all the type traits!* for some reason
akheir has quit [Read error: Connection reset by peer]
akheir has joined #ste||ar
<Smasher> HPX_LET_ME_FINALLY_FINISH_MY_THESIS=On
<Smasher> i dont think my shit is gonna work till monday
pree has quit [Ping timeout: 260 seconds]
pree has joined #ste||ar
<github> [hpx] K-ballo created drop-vs2013 (+3 new commits): https://git.io/vHf2p
<github> hpx/drop-vs2013 4fe68a6 Agustin K-ballo Berge: Remove support for VS2013
<github> hpx/drop-vs2013 372f6fc Agustin K-ballo Berge: Mark C++11 defaulted functions as required
<github> hpx/drop-vs2013 74bb193 Agustin K-ballo Berge: Mark C++11 noexcept as required
aserio has quit [Ping timeout: 260 seconds]
pree has quit [Ping timeout: 260 seconds]
aserio has joined #ste||ar
<hkaiser> Smasher: I doubt this is a problem of hpx after all
<zao> History has shown that HPX is a great way of generating publishable materials.
<Smasher> hkaiser im not blaiming
<Smasher> im just publicly suffering
<hkaiser> lol
<Smasher> checking all the numbers now
<Smasher> before they go onto the wire
<Smasher> and after deserialization
<Smasher> maybe i will found the bug
<Smasher> find*
shoshijak has joined #ste||ar
shoshijak has quit [Ping timeout: 246 seconds]
thundergroudon has joined #ste||ar
<Smasher> smart pointers to objects should be serialized automatically, right?
<Smasher> i checked all data and its all good apart from that one smart pointer
<Smasher> protected:
<Smasher> /// The encryption modulus
<Smasher> std::shared_ptr<BigInteger> encryptionModulus;
<Smasher> protected?!
<Smasher> sorry thats another place in the code
pree has joined #ste||ar
bikineev has quit [Ping timeout: 240 seconds]
ajaivgeorge has quit [Ping timeout: 260 seconds]
<hkaiser> Smasher: if you serialize a shared_ptr it will automatically serialize the data it refers to
<hkaiser> but a shared_ptr will not be automatically serialized
<Smasher> uhmmm
<Smasher> what may cause this: i send(gdb) p p_itafc_crypt[0][0].encryptionModulus.get()->data
<Smasher> $10 = {{_mp_alloc = 64, _mp_size = 64, _mp_d = 0xb1143000}}
<Smasher> on one side and receive (gdb) p encryptionModulus.get().data
<Smasher> $8 = {{_mp_alloc = 63, _mp_size = 63, _mp_d = 0x3350f350}}
<Smasher> on the other
<hkaiser> you're looking at different objects
<Smasher> i dont think so
<Smasher> but im gonna recheck it now
<hkaiser> well, how would you explain the difference otherwise?
<Smasher> the encryptionModulus should be one for all the same
<Smasher> maybe its precomputated wrong though
<hkaiser> are you sure you actually serialize it?
<Smasher> yes
<Smasher> but the point is... the encryption provider has an encryption modulus too, which is derived from public key on the server side.. i.e. computated after the transmission
<Smasher> and maybe it differs from the deserialized one
<Smasher> which it shouldnt
<hkaiser> just print the values in the serialize function
jaafar has joined #ste||ar
<zao> I had to try to parse that pointer as a string. Old habits die hard.
<zao> 0xf3 ruins it :(
<Smasher> void Paillier::doPrecomputations () { this->nSquared = this->publicKey.n.GetPow(2);
<Smasher> it derives the encryptionModulus from the public key, which is right
<Smasher> but... we are on x64 machine, hence:
<Smasher> (gdb) p this->publicKey.n.GetPow(2).data->_mp_d[0]
<Smasher> $5 = 6803618674718328961
<Smasher> this is what it returns on pi:
<Smasher> (gdb) p this->GetPublicKey().n.GetPow(2).data._mp_d[0]
<Smasher> $16 = 902613121
<Smasher> 32 - 64 problems
<zao> It's quite possible that you're going to need to serialize your bignum as something a bit less platform dependent.
<zao> Like a string or some other format that you can cheaply ingest into gmp on the other end.
<zao> Your current code just blindly serializes the limb array or something?
<Smasher> the problem is, that that value is derived
<Smasher> its not serialized
<Smasher> mpz_pow_ui(output.data, input.data, power);
<Smasher> gmp's limbs are unsigned long long, which is 64 bit on x64
<Smasher> on pi its 32 bit
<zao> If your input value is constructed from bogus internals, the result of pow_ui is most likely bogus as well.
<Smasher> hence the problem
<Smasher> nein
<Smasher> the input value is corerct
<Smasher> correct
<Smasher> the calculation result is wrong because its done 64 bit
<Smasher> i would need to force gmp to work with 32 bit somehow ...
<zao> What I'm saying is that you seem to be blitting internal representations of mismatching shape.
<zao> Either figure out how to reinterpret your internals into the desired shape, or convert to a format that can be cheaply parsed on the other end.
pree has quit [Ping timeout: 260 seconds]
<Smasher> i dont think i can reinterpret 32bit bigintegers as 64bit on pi
<Smasher> so i need a solution on the other end
<hkaiser> Smasher: how does gmp solve this on the pi?
<Smasher> pff.. no idea
<zao> hkaiser: Solve what?
<hkaiser> zao: he is using gmp on the pi, right?
<Smasher> yes
<zao> I'm of the impression that GMP itself works perfectly fine on 32-bit pi, except that you may be slightly limited in using the integer constructor.
<hkaiser> so if gmp uses 64bits to represent something on x64, how does it represent the same thing on the pi?
<Smasher> in fact this i quite strange... that value has _mp_alloc = 64, _mp_size = 64 on pi... and _mp_alloc = 64, _mp_size = 63 on x64 machine
<zao> hkaiser: The innards of a bigint is a few book-keeping figures and an allocated array of limbs.
<Smasher> it needs one limb less
<hkaiser> god knows what tricks they play internally
<zao> A limb is a 32/64-bit integer, which together make up the bigint.
<Smasher> maybe i just have to rebuild gmp as 32 bit somehow
<zao> Naively blitting limbs together is likely to result in horror.
<Smasher> gimme that ./configure --help
<hkaiser> Smasher: so you can't blindly serialize a gmp type
<hkaiser> you have to reinterpret the data on the other end to construct an equivalent gmp instance
<hkaiser> serialize to a string a reconstruct or something
<Smasher> the problem are the calculations
<hkaiser> and*
<Smasher> it starts with the encryption modulus with is derived wrong
<zao> Doing the same operation on any implementation should result in the same result.
<hkaiser> zao: yes
<zao> If not, you've found a bug in GMP or are using specific functionality.
<Smasher> but actually it should represent the same value
<hkaiser> but the internals may differ significantly between 32 and 64 bit gmp
<zao> I would recommend altering your serialization to go the slow and safe way by rendering the number to a string, and constructing from the string on the other end in deserialization.
<zao> Or run some tests with string literals on both ends to verify that your operations result in the same results.
<hkaiser> right, that's what I said ^^
<Smasher> i dont think it helps
<Smasher> the data which is received on the other end looks okay
<Smasher> but who tells us that gmp on x64 interprets it in the same way
<zao> As components or as a fully reconstructed GMP value?
<Smasher> i receive a public key on the other side which consists of two big integers, one of them is a modulus n
<Smasher> then the server constructs an encryption modulus from that n by powering it to 2
<Smasher> and that pow operations gives a seemingly different result
<Smasher> sheesh i have installed both
<Smasher> mingw32/mingw-w64-i686-gmp 6.1.2-1 [Installiert]
<Smasher> mingw64/mingw-w64-x86_64-gmp 6.1.2-1 [Installiert]
<Smasher> which one do i link to?
<Smasher> well thats 64 for sure
<hkaiser> Smasher: the linker will pick the one matching the architecture
<Smasher> hhmmhm
<Smasher> do i have any chance to get it linked with 32 bit version?
<Smasher> i could try
<zao> No.
<zao> Not unless you build your whole world as a 32-bit executable.
<zao> And that still doesn't guarantee anything about the _internal_ representation.
<Smasher> i thinks thats what im going to do
<Smasher> installing 32bit toolchain now
hkaiser has quit [Quit: bye]
<zao> (ah, there's an gmp_init_set_str too, sneaky docs)
<Smasher> mhm maybe i made that conclusion too fast...
<Smasher> [21:43:55] <Smasher> but actually it should represent the same value
pree has joined #ste||ar
<Smasher> the limbs look different, but they are the same bigint, arent they
<Smasher> maybe that's a good question for so :)
<zao> Those limbs represent exactly the same value.
<zao> mpz_get_str on the corresponding platform would render the same string as the input used.
<Smasher> but
<Smasher> what if i get a bigint created on 32 bit machine and would render it on 64 bit?
<Smasher> lets try it
<zao> I would recommend investigating mpz_export/mpz_import as a way to render a mpz_t to a portable representation that can be understood by both ends.
<zao> The meaning of the limbs is very dependent on the way GMP is built on a particular platform, which somehow encodes the sign and the value bits of a bigint in a bunch of native words.
<zao> Not all bits in a native word may be used, and there may be differences in encoding as it uses them.
<zao> The algorithms are written to leverage the particular encoding on a particular platform.
<Smasher> so the serialization just wont work like that between several architechtures
<zao> A hypothetical representation could be that you have the sign in the lowest bit of the first limb, and value bits in the remaining bits of the first limb, and filling out additional limbs completely.
bikineev has joined #ste||ar
<zao> Or using say 29 bits out of 32, as algorithms need a bit of headroom anyway to operate.
<zao> Or something completely different.
<Smasher> so i seem to be on the right track now
<zao> The key takeaway is that unless documented to be transmittable, the innards of a mpz_t is mostly opaque.
<Smasher> im gonna call ToString on both sides now and see what happens
<zao> Please do.
<Smasher> (gdb) p paillier.GetPublicKey().n.ToString(10).c_str()
<Smasher> Thread 2 received signal SIGSEGV, Segmentation fault.
<Smasher> :D
<zao> I'm getting fond memories of when I wrote my bignum for ICPC competition practice.
<Smasher> gdb cant print c++ strings?
<zao> Figured it was a moot thing to do when I got to division and used MPFR instead.
<zao> Smasher: I would say that it's more likely that the ToString implementation ran into inconsistent internal state of your value and blew up.
<Smasher> the first call looked fine though
<Smasher> (gdb) p paillier.GetPublicKey().n.ToString(10)
<Smasher> $1 = {static npos = 4294967295, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0xb105c3c0 "14860108387351257576784561293414461817332734845463131766707884297336151337056678290392694693756357897692395318253824637677667639000005961798960563433149938401739707939190188103190982365488202492505568"...}, _M_string_length = 309,
<Smasher> { _M_local_buf = "5\001\000\000,\371\177\255\000\300\351\266\350\370\177\255", _M_allocated_capacity = 309}}
<zao> Might've scribbled a bit somewhere. Or your gdb is actually broken :)
<Smasher> im remote debugging so yeah
<Smasher> im remote debugging on a gdb from cross compiler toolchain*
<Smasher> so yeah :D
<zao> I'm building test programs natively on a Pi2.
<zao> Not snappy :)
<zao> Also runs FreeBSD, because why not.
<github> [hpx] K-ballo pushed 1 new commit to drop-vs2013: https://git.io/vHfhR
<github> hpx/drop-vs2013 5f9f0e2 Agustin K-ballo Berge: Mark C++11 inline namespaces as required
<Smasher> well maybe gdb just cant print a string which is 309 chars
<Smasher> okay i did this
<Smasher> altough printing c_str() still fails i can see the value now by calling "p string"
thundergroudon has quit [Read error: Connection reset by peer]
<Smasher> ^the whole value
thundergroudon has joined #ste||ar
jaafar has quit [Ping timeout: 260 seconds]
<Smasher> fug, it crashes gdb on the other side too
pree has quit [Ping timeout: 260 seconds]
<Smasher> since there are such thick parametrized mpz_import / mpz_export functions, i think the gmp's representation really differs on different architectures
<Smasher> ^ zao
<zao> Smasher: They're also designed to encompass the case where you have bit bits of a bigint lying around so you can try to reconstruct one.
<Smasher> so im gonna mpz_export my bigint to an array and send it then via the wire
<Smasher> not sure what you mean with "bit bits of a bigint lying "
<Smasher> around*
<zao> "lying around" as in pre-existing.
jaafar has joined #ste||ar
<zao> You've got a bigint in some particular format from another library or device.
<Smasher> i see
<zao> In this case, we'd use them to emit words of a known format, so we can ingest them again.
pree has joined #ste||ar
<pree> There are some typos in docs (compiling hpx components with pkg-config section). Can someone correct it? I don't know how to correct it
<pree> Thanks :)
jaafar has quit [Ping timeout: 246 seconds]
<zao> Note that mpz_export/mpz_import doesn't do anything with the sign, you have to communicate that separately.
<zao> pree: The documentation is generated from files somewhere in the source tree, so you could edit the sources and make pull requests.
<zao> (or so I believe)
<pree> thanks @zao
<Smasher> strange, they have the header but doent link to the binary https://ideone.com/Rod4SG
<zao> How odd. I get an exceptionally large number of words exported, where only a prefix matches.
<zao> Smasher: You nede to init your x there btw.
<zao> mpz_init(x); mpz_set_str(x, ...) or just mpz_init_set_str(x, ...)
<zao> Heh, cute.
<zao> (heh, didn't realize that I could export as 8-bit bytes, as http://stackoverflow.com/a/27328836/87969 suggests)
<zao> Time to go fly ships in space, toodles.
<zao> (do ask silly questions if you have them)
<K-ballo> zao: what kind of ships?
<github> [hpx] K-ballo created feature-tests (+3 new commits): https://git.io/vHJJ9
<github> hpx/feature-tests f4c1f8b Agustin K-ballo Berge: Integrate N3276 feature test with base decltype feature test
<github> hpx/feature-tests 8257c7b Agustin K-ballo Berge: Mark C++11 lambdas as required
<github> hpx/feature-tests c3143cb Agustin K-ballo Berge: Drop unused feature test for C++11 <type_traits>
<zao> K-ballo: Playing Elite:Dangerous, so varying.
<zao> Fer-de-Lance, Anaconda, Imperial Courier, Asp Explorer.
<K-ballo> looks full of wallpaper material
<zao> K-ballo: Did you see the incident in #boost where fixing msvc-14.0 accidentally fixed gcc-4.7? :)
<K-ballo> uhm, I heard pdimov talk about it, I did not see it
<K-ballo> where?
<zao> Sometime yesterday, I think.
<zao> Not sure what it was about, some sort of traits madness.
<zao> Regarding pointers.
<K-ballo> nope, I missed it :/
eschnett has quit [Quit: eschnett]
<Smasher> [22:22:23] <Smasher> http://sprunge.us/Ucdf
<Smasher> zao maybe it crashes just because that mpz_t representation is really wrong?
<zao> That is my guess.
<Smasher> i just tried it without ide in bare console gdb
<Smasher> same result
hkaiser has joined #ste||ar
<zao> (proper use of mpz_export with allocation needs to use the gmp free function, btw)
<Smasher> i have no idea what im doing :DD
<zao> Smasher: There's two modes you can use mpz_export in.
<zao> You either figure out how much storage you need pessimistically and pass storage in and a pointer to the number of "words" for that storage as the first two args.
<zao> Or you pass in nullptr for the storage and a pointer to a size_t that is filled with the count of words the function allocates for you.
<Smasher> oh
<zao> In either way, it returns a pointer to the storage, which you get to free if you use the lazy allocating form.
<zao> There's also a special case for a mpz_t that holds a zero, for which it returns nullptr and a count of 0.
<zao> You should also note that it ignores the sign, so you have to persist/copy that yourself with mpz_sgn and mpz_neg if you care about negative numbers.
<Smasher> i have only postive numbers
<Smasher> i have found the docs
<Smasher> they are hard to digest to me though
<zao> Takes a few reads to get the nuances.
<Smasher> but what i understand is that the format doesnt really matter
<zao> You can indeed pick almost any representation, as long as it's not machine dependent.
pree has quit [Quit: :)]
<zao> Passing endian=0 would be dumb, for example.
<Smasher> as long as i read it with the same format as the one what i save in
<zao> (0 endian means whatever the code runs on, which will break when going between endianesses)
<Smasher> mhmm
<Smasher> im not sure about those "words"
<Smasher> we are talking about word as 32 bit right?
<Smasher> or even 16
<Smasher> 32 is dword
<zao> "words" because the size we talk about depends on the value you pass in as "size" parameter.
<zao> If you say size=8, a "word" in the function description is a byte.
<Smasher> okay... so its kinda chunk if we call it more general
<zao> Indeed, chunk is a much better word.
<Smasher> what mode would you suggest to go for
<Smasher> lazy or pessimistic?
<zao> You also have the related parameters "nails" if you want to skip some of the top bits in each output chunk.
<Smasher> why in heaven i would want to skip bits?
<zao> Smasher: If you know something up-front about the storage and can acquire storage cheaper than GMP's allocator, acquire memory up-front and use the one where you pass in a data pointer.
<zao> If you don't know or don't care, use the allocating form and remember to properly free the storage.
<zao> Smasher: As the documentation for mpz_import says, some implementations have stupid hardware implementations that creep into user space.
<Smasher> i dont know and i dont care
<zao> Where not all bits of a value contribute to the value :)
<Smasher> :)
<Smasher> great
<zao> That's straying quite a bit away from standards C++ and what we care about :)
<Smasher> so the explicit strorage allocation is safer
<zao> Smasher: Oh, those were about the "skip bits" part.
<Smasher> ah, nails
<Smasher> that would be the beginning, right? char* to_send = mpz_export (nullptr,
<zao> Aye.
<Smasher> then you say "a pointer to a size_t that is filled with the count of words the function allocates for you."
<Smasher> doesnt make sense yet
<zao> Word salad!
<Smasher> ah, that just a pointer
<zao> In a C API, you tend to have input parameters as values, and output or inout parameters as pointerse.
<Smasher> uallocated
<zao> So size_t x; f(&x); to get a value out into x from f()
<Smasher> size_t* count; char* to_send = mpz_export (nullptr, count... ?
<zao> It needs to be a valid size_t object.
<Smasher> size_t count; char* to_send = mpz_export (nullptr, &count, ... then
<zao> The function expects a pointer to a valid size_t it can write into.
<zao> Indeed.
<zao> In a C++ interface, you would typically have such an output parameters as a reference, while in C it's by necessity by pointer.
<zao> (in the alternate pre-allocated form of the function, this is an input parameter pointing to the size of the pre-allocated storage)
diehlpk_work has quit [Quit: Leaving]
<zao> (the form is chosen based on the first argument, as we've seen)
thundergroudon[m has joined #ste||ar
<Smasher> i understand
<Smasher> already seen this before
<Smasher> input and output both as parameters
<Smasher> what about that size_t size?
<Smasher> Each word will be size bytes
<Smasher> ist up to me here, right?
<zao> That's the aforementioned "word" width, in bytes.
<Smasher> chunk size
<zao> (I now realize that I made a mistake in my code, I thought it was bits :D)
<Smasher> hehe
<Smasher> would that work and be compatible?
<Smasher> size_t count; char* to_send = mpz_export (nullptr, &count, 1, 1, 1, 0, x);
<zao> I believe so, yes.
<Smasher> as long as i use the same parameters for import
<zao> Woo, »54 bytes, most significant first, sign 1: 0x1c 0x7f 0x31 0x62 0xf6 0x64 0x4e 0x04 0x6b 0x39 0xf1 0xa2 0x4d 0x60 0xcc 0xc2 0xf2 0x7e 0x89 0xe9 0xa2 0x62 0x81 0x9d 0x98 0xb4 0x9f 0xec 0x23 0xfc 0xd8 0xea 0x24 0x30 0xf3 0x53 0x69 0x56 0x24 0x3d 0x11 0x61 0xef 0x7b 0xf1 0x4b 0xac 0xcf 0xf1 0x96 0xce 0x3f 0x0a 0xd2»
<Smasher> 8)
<Smasher> now i bump in an issue, that hpx:serialization doesnt serialize raw pointers
<zao> Should be able to serialize a sequence of bytes somehow.
<Smasher> how does it look?
<Smasher> oh, x = mpz
<Smasher> oh
<Smasher> new version :) http://sprunge.us/ITBY
<zao> Need a cast from mpz_export, need to properly free to_send.
<zao> Otherwise, sure, looks fine at first glance.
<zao> Please see this to get hold of the free function needed: https://gmplib.org/manual/Custom-Allocation.html#Custom-Allocation
<zao> Default GMP functions are malloc/free, but depending on how GMP is built and what platform you are on, your 'free' may not be their 'free'.
<Smasher> yep already familiar with this
<zao> Great, just making sure.
<Smasher> kinda
<Smasher> thanks pal :)
thundergroudon has quit [Quit: KVIrc 4.0.4 Insomnia http://www.kvirc.net/]
<Smasher> k?
<zao> LGTM.
<zao> Oh, wait.
<zao> count is size_t, platform dependent sized.
<Smasher> oh
<zao> Use an explicit uint32_t or uint64_t.
<zao> or something smaller if you know it'll do, but that's a bit microoptimizing.
<Smasher> #include <stdint.h> i guess?
<zao> Those are defined in <stdint.h> or <cstdint>, indeed.
<zao> With varying rules for where they're defined and all that which I never remember)
<Smasher> can i just hmm
<Smasher> cast from size_t to uint32_t ?
<zao> Assuming you know that you won't have more than 4 gigabytes of number, indeed.
<Smasher> 4gb o_0
<Smasher> should be sufficent :D
<Smasher> for now :D
<Smasher> http://sprunge.us/bFTI?c++ final version (?)
<Smasher> i hope so :)
<zao> Could technically desync the stream if count ever exceeds the size of an uint32_t, but that's an assumption we've made already.
<Smasher> should work like this
akheir has quit [Remote host closed the connection]
<Smasher> but i think i should use sizeof(char) there to kinda keep it connected
<hkaiser> sizeof(char) == 1, always
<Smasher> nod
<zao> Would only be for readability of mpz_export call, but that's a doomed mission to begin with :)
aserio has quit [Quit: aserio]
<zao> I'd just comment "export to chunks of byte size, most significant chunk first, large-endian (irrelevant) chunks, no padding bits"
<zao> Or something along those lines to cover the intent.
<zao> Saves the reader a Bing search unless they want to know exactly what the args mean.
aserio has joined #ste||ar
<Smasher> finally got rid of the compile errors http://sprunge.us/MNVj?c++
aserio has quit [Client Quit]
<zao> Smasher: Line 8 is a GNU extension.
<zao> VLAs is not standard C++.
<zao> And you most definitely do not want to stack-allocate something large.
<zao> (anyway)
EverYoun_ has joined #ste||ar
<Smasher> sigh
<Smasher> i am always scared to use malloc :)
<Smasher> char* buf = (char*)malloc(sizeof(char) * count); amirite?
<zao> K-ballo: Do we have std::unique_ptr<T[]> and make_unique?
<zao> Smasher: Might as well use new[] and delete[] as we're in C++ land.
<Smasher> not familiar with those :DD
EverYoung has quit [Ping timeout: 246 seconds]
<zao> T* p = new T[n]; delete[] p;
<Smasher> char* buf = new char[count]; delete[] buf; ?
<zao> Better not throw exceptions inbetween and leak :D
<K-ballo> do we as hpx?
<zao> K-ballo: Yeah.
<K-ballo> those sound 14 to me, so probably not
<zao> K-ballo: unique_ptr arrived before make_shared, didn't it?
<zao> err, make_unique.
EverYoun_ has quit [Ping timeout: 260 seconds]
<zao> I should probably stop typing soon, soo tired.
<zao> Smasher: Heck, std::vector<char> buf(count);
<K-ballo> make_unique arrived late
<K-ballo> and unique_ptr<T[]> later?
<zao> My timeline is very tainted by how things arrived in MSVC++>
<zao> Which is rather distorted.
<Smasher> delete buf would only delete the first element, right?
<Smasher> hence delete[] function
<zao> Smasher: Even worse, it'd burn your house down.
<Smasher> lol :D
<zao> Mismatching new[]/delete[] and new/delete is a mortal sin.
<Smasher> it has been a while i visited c/c++ course
<Smasher> but i really visited one :)
<Smasher> hey, lets run that serialization test i wrote >(
<Smasher> :D
<Smasher> wew
<Smasher> [ PASSED ] 4 tests.
<Smasher> lets hope it works via the network as well
<zao> Smasher: Also beware the case of value 0 in the mpz_t value.
<zao> The function will return nullptr then, and you'll have a possibly bad day.
<zao> Probably safe.
<Smasher> //todo: take care of that 0 case
<zao> Scary thing about writing a s11n function is that it may be sufficient for your particular use case, but someone down the line may be using it for zero or negative values :D
<Smasher> and then burn me :)
<Smasher> in curses
<Smasher> welp, a simple if (bla = nullptr) would be enough i guess
<K-ballo> yey assignment!
<Smasher> ==`
<Smasher> ==
<Smasher> ^
<K-ballo> sorry, matter of habit
<Smasher> np :3
<Smasher> i use sometimes assignments in if statements though :P
<Smasher> lol i remember a case when a student once said "an if loop"
<Smasher> his ass got kicked by the docent
<zao> I still write some of my hobby code with yoda conditionals.
<zao> if (3 == n)
* K-ballo shakes his head in disapproval
<zao> K-ballo: At work I'm compiling the competition now, StarPU.
<K-ballo> fun! cmake based?
<zao> Very configure.
<zao> At least 1.2.x
<zao> trunk may be different.
jaafar has joined #ste||ar
<github> [hpx] K-ballo force-pushed drop-vs2013 from 5f9f0e2 to e0af8c3: https://git.io/vHJsA
<github> hpx/drop-vs2013 98e2b41 Agustin K-ballo Berge: Remove support for VS2013
<github> hpx/drop-vs2013 8f56767 Agustin K-ballo Berge: Mark C++11 defaulted functions as required
<github> hpx/drop-vs2013 7352fed Agustin K-ballo Berge: Mark C++11 noexcept as required
<Smasher> zao ready to learn if it worked?
<Smasher> finger triple crossed here
<Smasher> teh gdb still crashes on the server side eheh
<zao> Smasher: Oh, have you ensured that the mpz_t is mpz_init (or equivalent) on the outside of the deserialization call?
<zao> (using the C++ wrapper or whatnot)
<Smasher> ohm.. nope
<Smasher> i dont really have access, becaue i dont send bare mpz_z
<Smasher> zao this could be right, whatcha think? http://sprunge.us/INSd
<Smasher> would make sense to me
<Smasher> number of limbs is half because the size of one limb is doubled
<zao> Seems legit.
bikineev has quit [Ping timeout: 260 seconds]
bikineev has joined #ste||ar
<Smasher> seems working
<Smasher> fingers still crossed
<Smasher> the performance is a joke but it doesnt matter
<Smasher> running since 7 minutes now which is a good sign
<Smasher> 100% cpu load thoughput
bikineev has quit [Remote host closed the connection]
EverYoung has joined #ste||ar
<Smasher> [00:02:03] <zao> Better not throw exceptions inbetween and leak :D
<Smasher> zao so remove std::throw_exception?
bikineev has joined #ste||ar
<zao> Smasher: If you're dealing with allocated storage not held by smart pointer or other RAII functionality, you get the pleasure of finding out if anything inbetween the point of allocation and the point of release, if there's anything that might throw and unwind there.
<zao> If so, you get to intercept the exceptions and clean up, or better, wrap your allocations in something that destructs properly on unwind.
<Smasher> zao i think i can skip this part and just leave it as is
<Smasher> there is no allocation before the line where the exception can be thrown
EverYoung has quit [Ping timeout: 272 seconds]
<zao> Don't you allocate, attempt to serialize, and then free?
<zao> If (ar & blargh) may throw, you're hosed.
<Smasher> hosed :)
<Smasher> i see now what you mean
<Smasher> satisfied now? )
<Smasher> uh... running since 31 minutes now
<zao> Smasher: Not sure that that's a kosher way of rethrowing.
<zao> I believe you're pointing to a dangling exception object there, and if you want to rethrow, you throw; inside the same clause.
<zao> If you want to store away an exception, you need to use std::current_exception and exception_ptr, which we don't have yet.
EverYoung has joined #ste||ar
EverYoung has quit [Remote host closed the connection]
<Smasher> java world:
EverYoung has joined #ste||ar
<Smasher> Exception e;
<Smasher> try {} catch (Exception ex) { e = ex; } throw e;
<Smasher> hm almost
<Smasher> Exception e = null; try {...} catch (Exception ex) { e = ex; } if (e != null) throw e;
<Smasher> just easy as that :)
<zao> Smasher: You get the joy of cleaning up in the catch handler and then rethrowing.
<zao> Unless you feel like you can somehow recover from the s11n exception (if there's actually any).
<zao> (I haven't investigated if our s11n can throw)
<zao> I'd just dig around for a RAII buffer type, or handroll one.
<Smasher> ho ho ho ho,... that protocol runs since 40 now.... for one single comparison of one single fingerprint with another single fingerprint
<Smasher> but it's SAFE AS HELL
<Smasher> consuming 100% cpu all the time
<Smasher> im just laughng
<zao> Smasher: I know of ancient DNS servers out in the wild that are secure simply because a login attempt takes too long time to validate thanks to crypto strength.
<zao> Anyway, getting somewhere \o/
<Smasher> zao u afk now?
<zao> Mostly. been playing Elite all along.
mcopik has joined #ste||ar
<zao> Hard to type behind the flight stick :)
<Smasher> '84 what an oldschool game lul
<zao> Elite:Dangerous, the current incarnation.
<Smasher> ahh
<Smasher> i hope u have fun :)
<Smasher> i'll do a chess round now
<zao> A bit surprised to see an exponentiation without builtin modulo there, but I guess that your crypto may be different from what I'm used to see :)
<zao> I don't begin to pretend to understand it.