White RoomNEW

Whoever Touches It First

A dual-socket Linux box, 24 cores per socket. This loop runs at half the memory bandwidth the machine can do, and perf attributes most of the traffic to the inter-socket link when threads on socket 1 run.

double *a = malloc(N * sizeof(double));   /* N = 2e9 */
memset(a, 0, N * sizeof(double));         /* main thread, before the parallel region */

#pragma omp parallel for
for (long i = 0; i < N; i++)
    a[i] = a[i] * 2.0 + 1.0;

What put the data in the wrong place?