« first day (1798 days earlier)      last day (3151 days later) » 

7:00 PM
@Puppy The code seems to run indefinitely and I'm not sure why.
Or, mostly indefnintely. The memset takes a long time and then the actual run is where it tanks.
 
Just doing run(2) makes everything tank
 
Anyone have a decent project idea for someone new to c++ but has 3+ years experience in c#/Java/Javascript?
 
@Puppy For some reason your std::memcpy eats the dirt.
I don't know why.
 
because
SOMEBODY did not reset the time counter after each iteration!
 
7:03 PM
@melak47 Weird, that should be quite easy to implement (for template classes). I'll check if my copy of CLion does that too.
 
@Gizmo I'm still waiting for him to start playing that piano
 
so the "8-thread throughput" was actually the time for all the iterations.
 
@sehe creepy, I'm playing it in mixcraft now
 
Ell
balls I hope I remembered my phone charger
but I can't see it >.<
 
so I'm glad to say that whilst I haven't figured out why it tanks so much after 1 thread, I can safely state that I actually am in a position where 8 threads beats 5 threads (although not 4 threads)
 
7:05 PM
Mine keeps crashing on coliru. I think I'm going to open it up on VS instead.
 
that's what I've done.
 
@Gizmo how's that creepy. You freakin' linked it here
 
@sehe well, I don't know maybe subcontiousness
ask my programmer, he knows
 
nope. sry mate
 
@milleniumbug thanks
 
7:07 PM
> fact resistant
 
@Puppy You ding dong, it's a division_by_zero error.
> auto per_thread_size = size / thread_num;
 
yeah I'm way past that
 
Oh well. I'll finish building later.
 
pastebin.com/httkdDVu is my current
 
Not in a mood to deal with cabling.
 
Ell
7:09 PM
man how could I have forgotten a phone charger
I'm a right @Nooble
 
lol pastebin
 
user406009
@milleniumbug What's wrong with pastebin. It's quite effective.
 
@Puppy I'm getting some kind of thread lauching error...
 
Crappy layout, ads
 
I decided not to use Coliru as that would cause his server to try to run this code
 
7:11 PM
ok, fair enough
 
Gist is a better general paste thing
 
sure
 
user1804599
yes, LaTeX it is
 
Seriously, Pink Froid is a good take on Pink Floyd.
 
@elyse bondage yesterday, latex today?
 
user1804599
7:12 PM
:3
 
@ThePhD but thread_num starts at one?
 
@melak47 No.
It starts at 0
 
for (auto i = 1; i <= 8; ++i) { /*...*/ run(i); }
 
That's max
 
Hey hi...buddy...
Any buddy know eclipse ?
 
7:14 PM
@melak47 Not in the version I have.
 
May 22 at 19:56, by sehe
Lori is beautiful
 
for (auto i = 0; i != num_threads; ++i)
{
    threads.emplace_back(start_thread, i);
}
 
random find of the day
 
@ThePhD huh, well, dunno which one I clicked :D
 
That's thread_num
 
7:14 PM
These are my results.
 
It seems my test has more than a few mistakes.
 
I want to save my all project data online is it possible automatically sync ?
 
that's seems random as fuck
 
Oh, wait
I'm using a debug build
BUAHAHAHA
 
@Gops just buy sell your soul to VS. You get that for free
 
Ell
7:15 PM
@Puppy can I buy a usb a male to micro b lead
 
of course
 
Not sure what you're measuring but it's probably overpowered by overhead anyway
 
@ThePhD even the mighty ThePhD couldn't avoid falling into that trap
 
Ell
how much do you charge?
 
wait, you mean from me in Bristol right now?
 
Ell
7:16 PM
Yah
 
@Ell 50mA (or ~2100mWh)
 
Ell
@sehe sharp
 
@sehe I am not getting your point what you mean exctly ?
 
user406009
@Ell You have to pay Puppy with your soul.
 
I don't have one available
but you can head to Broadmead and try there
 
7:17 PM
what path should I use to install programs on linux that aren't from any repository?
 
Jul 6 '14 at 18:58, by Borgleader
@AaronKyleKilleen Public service announcement
 
Ell
@Puppy Okay cheers
 
Or /usr/local
 
user406009
@milleniumbug /usr/local
 
7:17 PM
Tesco there does not shut until 10:30
 
Ell
ah thanks
 
Depends on whether they're FSH compliant
 
@Gops And I meant what I said. VS won't even start unless connected to the interwebs, AFAIK
 
user406009
@milleniumbug Although I also chuck things in /home/me/programs
 
user406009
(If I only want them installed for a single user)
 
7:18 PM
@sehe Ok got it...
 
@CatPlusPlus thanks, I'll check if CLion is FSH compliant (and also what does it mean)
 
@StackedCrooked: You know what makes me really suspicious? The time variations. It says here that 8 threads will get between 1.7 and 2.5 bytes/ns, and that's way too much variation.
 
@Puppy My release mode can't run without crashing and burning in VS 2015.
But debug runs fine.
 
mine works fine
 
user406009
Maybe you guys should try pinning the threads to reduce variability?
 
7:19 PM
@sehe why did you search?
 
or just, to be on the safe side, I'll put it into /opt anyway
 
Filesystem Hierarchy Standard, typo
 
This is what I have right now: gist.github.com/ThePhD/7ad942448cc7c953f02b
 
@JohanLarsson someone used a nicer pastebin site the other day (~1-2 weeks ago).
 
7:22 PM
I think there's a bug in VC++...
 
you set num_threads to zero you plonker.
 
What
Where?
 
owait nm
I read the wrong loop
 
OH
I WAS RUNNING TOO MANY THREADS
My b everything is okay now.
 
your machine can't handle 8 threads?
 
7:26 PM
No, I mean I was doing from i = 0; i <= num_threads <--- creates 2 threads when num_threads == 1
 
lol
 
lol "bug in VC++"
 
Shsh.
 
that.. should still not crash your program
1 extra thread too many is nothing
 
But that meant the threadsource variable was indexing a value off the end of the array. Hence the memory access violation deep in the thread's launchpad whatever thingy in <xthread>
 
7:29 PM
oic
 
But now my results look... weird.
 
that was the whole point of why StackedCrooked was asking.
we're all getting similar outcomes.
 
I mean, we're not allocating and we fixed the timing issue...
@Mysticial Help, things don't make sense.
 
user image
13
 
@ThePhD 7.2 is almost exactly 8x of 0.9. Is that a coincidence?
 
7:32 PM
Here's the coliru of the latest.
@Mysticial I don't think I'm dividing wrong.
Coliru shows a similar slow decrease.
 
@Mysticial I've got still confusing but less silly results.
 
Pics or it didn't happen!
 
I've got 4 real cores so I guess I was expecting >4 threads to show similar outcomes.
but I'm surprised to see the nuking of the time
 
Well,they do, but the time just goes right to the shitter after adding 1 more thread.
There's no overlap in the copying we're doing either...
 
user406009
@Columbo We sorta need Cat though. He's the counter to the bleeding heart idealists such as Bartek and me.
 
7:35 PM
More threads than cores mostly works when the threads wait on I/O a lot
 
I guess the next big thing is concurrent RAM access?
 
@ThePhD You guys are adding up the cumulative wall time across all the threads. Not the total wall time.
 
@Mysticial Oh. I don't know how to go about doing that.
How would you measure the "total wall time"?
OH, RIGHT
OF COURSE WE'RE GOING TO LOSE
 
In this case it's trickier since you're doing the allocation and committing inside the threads themselves.
 
@Lalaland Then why isn't he called CatMinusMinus
 
7:37 PM
@ThePhD std::high_resolution_clock::now()?
 
@Mysticial That... shouldn't make such a big difference I think? The total wall time for the threads should still be similar even if the higher thread numbers won't be "faster".
 
We have to measure how long one total copy operation call takes, not how long each different memcpy call takes, right?
 
@ThePhD with the kind of replica explosive device that is forbidden in schools
 
@Puppy No. Let's assume that 1 thread saturates the bandwidth. When you have 8 threads, they'll each be running a 1/8 of the normal throughput. The walltime will still be about the same. But since you have 8 threads running, the total wall time from all threads will be 8x as large.
 
7:39 PM
which I think is a perfectly viable lesson, since if you were trying to multithread memory copying, you would blow way more CPU cycles waiting on memory if you used 8 threads.
is effectively what you're saying.
 
As a consequence, yes.
 
so effectively
the original result still holds if you need to use your CPU efficiently, but maybe not if you want to just copy the shit over in the lowest possible total time and have nothing else to use the CPU on.
 
If you want to properly benchmark a threaded memcpy, you need to do a single wallclock over the entire process. (not one within each thread.) Alternatively, you need to normalize the total walltime by dividing by the # of threads. This is what I do when I do throughput benchmarks for my pi program.
@Puppy The original results give you the throughput for each thread.
Which decreases as you increase the # of threads since you're bottlenecked.
 
which it's fair to say is substantially lowered
 
Wtf
 
7:43 PM
hmm
 
I was supposed to be ignoring the professor and doing my own work
Now I ignored the Professor and worked on a memcpy timing thing
 
even with your fix I still read more threads as being slower than one thread.
 
Thanks, Lounge.
 
You have no will, sheep
 
@ThePhD 👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍
 
7:44 PM
@Puppy I would expect some backwards scaling at some point. But not something massive like what we thought we were seeing initially.
1 or 2 threads should be enough to saturate memory bandwidth.
 
@ThePhD I now feel inadequate. You're way ahead of me in your non-native API. I hope you're happy :P
 
 
@Borgleader What? Noooo. ;~;
I'm not even close to you yet.
 
@Puppy That looks right.
 
what that the total wall time increases even if you just add 1 extra thread?
 
7:45 PM
I don't have instancing, I still can't do things like create a stitched-together shader from individual pieces, and other important things like that!
 
I would have expected that the per-process wall time would not increase, since the primary bottleneck has not changed.
 
Please indent your code, for our sakes and yours :) — Borgleader 8 secs ago
 
@Puppy The total wall-time to an outside observer should be relatively constant with any number of threads.
 
@melak47 Indeed, after installing CLion on Linux, #includeing <map>, waiting for building symbols and typing in std::map<, there was no completion. Suckage. (I guess that's one of the "it needs two another major versions" thing)
 
aw.
thanks for checking, though
 
7:48 PM
But originally, you were measuring the walltime for each thread and adding that up in the end. So 1 second of "real" wall-time becomes multiple seconds in the final aggregate.
 
Ah.
@Mysticial So the real answer would be to have an atomic timestamp that gets set once when the first memcpy gets hits, and then a second atomic timestamp that is set after the last memcpy finishes?
 
@Mysticial Which I think is quite fair, since in a multi-thread situation, you could use those threads for other productive work.
 
@Puppy It comes down to what you're trying to measure.
 
@Mysticial thread-hours versus just hours
 
@ThePhD Or you know measure from before thread start to after thread join
 
7:51 PM
@CatPlusPlus Yeah, but that takes into account thread spin up / join time too, no?
 
Sure 1 thread will be the most for a memcpy. But don't expect any of the other threads to be able to do anything productive that needs memory access. (or rather, the total bandwidth will be split up)
 
... Which, I guess is a fair count.
Since that is the cost the user would have to experience too.
 
@Mysticial That's true.
 
So when I'm optimizing for throughput, I care a lot about the "overall" resource consumption of all the threads.
 
@Mysticial I could never understand this. If you have 2 sockets does that mean you have 2x the memory bandwidth? Its weird because I don't think you have 2 memory controllers (certainly not 2x the ram)
 
7:53 PM
So I'll go out of my way to avoid a large memcpy even if it's not a bottleneck in that portion of code if it will interfere with other threads.
 
I wish I learned to avoid this particular pitfall with c++11 <random> generators
 
@Mikhail Yes. 2 socket machines (except for the pre-Nehalem era) are NUMA and have their own memory channels.
 
@Mikhail each processor is assigned ram
(physical)
 
When you have NUMA, one thread cannot (easily) use all the bandwidth.
 
@ThePhD Eh nothing I did was complicated. Besides they're just bits and pieces/proofs of concept.
hopefully ill have some time to work more on it this weekend
 
7:56 PM
Not that I've tested it, but you could have one thread stream memory from both sockets simultaneously. And if the socket-socket interconnect is higher than the socket-memory bandwidth, then it might be possible to get the full bandwidth with just 1 thread.
 
@Borgleader You say that, but I struggled for 3 days to do what you did in an hour.
 
@Mysticial Its an even harder problem because you need to assign threads to the CPUs? For example optimal performance happens if you have 1 thread per CPU, but you will half the number if the system chooses to put 2 threads on CPU #1.
 
dammit. a simple memcpy benchmark how hard can it be
But TIL memcpy can do 9 bytes/s.
 
@StackedCrooked GPU prefix sums run 2x faster if you switch to float4 datatypes instead of float :-)
 
@Mikhail Yeah. I realize how bad the situation would be a few years back. So starting from around 2012, I started designing algorithms that would operate under the assumption that memory bandwidth would be extremely limited.
 
7:58 PM
num-threads: 1. elapsed_ns: 122364432. total throughput: 8.8 bytes/ns
num-threads: 2. elapsed_ns: 121376266. total throughput: 8.8 bytes/ns
num-threads: 3. elapsed_ns: 130442108. total throughput: 8.2 bytes/ns
num-threads: 4. elapsed_ns: 116405682. total throughput: 9.2 bytes/ns
num-threads: 5. elapsed_ns: 124815203. total throughput: 8.6 bytes/ns
num-threads: 6. elapsed_ns: 125926859. total throughput: 8.5 bytes/ns
 

« first day (1798 days earlier)      last day (3151 days later) »