TL;DR: I'm doing some performance computing, and I've found that the ostensibly 'weaker' machine is outperforming the 'stronger' machine by orders of magnitude. Why?
I wrote some C code for a project. It involves 10,000 iterations of a lengthy process that generates pseudorandom data, and after each iteration, writes the data to a file. I used
#pragma omp parallel for to multi-thread the task.
I can run my program on two machines: let's call them s and d. Here are the relevant specs (please ask for any other specs that might matter):
- s: Linux Mint 15, Samsung 840 EVO SSD, 8gB RAM, quad-core Intel i3 CPU @ 2.40 gHZ
- d: Linux Mint 16, Intel SSD, 8gB RAM, eight-core AMD FX-8320 CPU @ 3.5 gHZ
Here's the big surprise: s completes the task an order of magnitude faster than d. I've run the program a few times on both machines, and s completes the task in about 3-4 minutes, whereas d takes anywhere from 12 to upwards of 30 minutes (I lost track of time). Both of them fully exhaust their cores (i.e. all cores at 100%) while computing. This phenomenon is even with auxiliary programs (Firefox, etc.) open on s, and nothing else running on d.
But the code is the same. The compiler flags are the same. Even the output is the same. I even removed the drives from both s and d, and swapped them and then ran the program again, just to test that it wasn't in some way Operating-System related. The result was that the phenomenon persisted: the quad-core 2.4 gHZ CPU vastly outperformed the eight-core 3.5 gHZ CPU.
This is, of course, really puzzling and totally counterintuitive. Can anyone tell me what's going on?