AnsweredAssumed Answered

CPU affinity persists in main thread

Question asked by sgaure on Jun 12, 2014

I have a problem with ACML's cpu affinity on linux.  Both version 5 and 6 beta.

My main thread looks schematically like this:



<call dgemm>

<main work, may take hours: N x pthread_create, no acml>

<wait for threads>

<collect data>



The problem is that the first call to dgemm sets the main thread's affinity mask to a single cpu, which causes all the N subsequent manually started threads to have affinity to the same cpu.


The obvious workaround is to pick up the affinity mask prior to calling acml, and reset it to that value prior to calling pthread_create, but I would very much like to see acml doing this for me, at least optionally. This is an acml-specific issue and may not be present if the user chooses to link with some other blas.