Processors
Intel® Processors, Tools, and Utilities
14510 Discussions

Multithreading issues seen on dual chip machine with 2x E5-2650V3 processor

idata
Employee
1,213 Views

I see a multithreading issue on a dual chip machine with E5-2650V3 processors for the code below. This is associated with the malloc/free calls in the code below (also tried new / delete, creating std::vectors, using Windows HeapAlloc). Intel Vtune amplifier shows many cache misses for the code. The issue only occurs when the code is run after calling some other GUI related code and only on the specified machine type. Note that no other event loops or anything else is run by the previously called code when running the code below. It doesn't occur on a similar machine with two E5-2665 processors, where zero cache misses are reported. Question is whether this is a OS related issue (in this case Windows 7), or an issue with the GUI system (Qt 5.6.1). But if this is the case, why would it also be processor specific.

std::vector> futures;

for (auto iii = 0; iii != 40; iii++) {

futures.push_back(std::async([]() {

for (auto i = 0; i != 100000 / 40; i++) {

const int size = 10;

for (auto k = 0; k != size * size; k++) {

double* matrix1 = (double*)malloc(100 * sizeof(double));

double* matrix2 = (double*)malloc(100 * sizeof(double));

double* matrix3 = (double*)malloc(100 * sizeof(double));

for (auto i = 0; i != size; i++) {

for (auto j = 0; j != size; j++) {

matrix1[i * size + j] = std::rand() / RAND_MAX;

matrix2[i * size + j] = std::rand() / RAND_MAX;

}

}

double sum = 0;

for (auto i = 0; i != size; i++) {

for (auto j = 0; j != size; j++) {

for (auto k = 0; k != size; k++) {

sum += matrix1[i * size + k] * matrix2[k * size + j];

}

matrix3[i * size + j] = sum;

sum = 0;

}

}

free(matrix1);

free(matrix2);

free(matrix3);

}

}

}));

}

for (auto& entry : futures)

entry.wait();

1 Reply
idata
Employee
390 Views

Thank your for taking the time to send this information to our community.

 

 

I have been trying to get information about this matter through the processor area, I regret to inform you that I was unable to find a report about it from my side.

 

 

I checked some documentation about the support for your Intel product and I see that the Intel® Vtune has a community area for issues like this. Please try contacting the Intel® Vtune forums for more information: https://software.intel.com/en-us/forums/intel-vtune-amplifier-xe https://software.intel.com/en-us/intel-vtune-amplifier-xe-support

 

 

 

Allan.
0 Kudos
Reply