topic Two parallel cblas_dgemm on XeonPhi 7210 in Software Archive
https://community.intel.com/t5/Software-Archive/Two-parallel-cblas-dgemm-on-XeonPhi-7210/m-p/1182642#M79727
<P>I intend to run two parallel cblas_dgemm instances, and used the following code snippet:</P>
<P> #pragma omp parallel num_threads(2)<BR />
{</P>
<P> if (omp_get_thread_num() == 0){<BR />
mkl_set_num_threads( NUM_OF_THREADS/2 );<BR />
cblas_dgemm(CblasRowMajor, CblasNoTrans, CblasNoTrans,m, n, p, 1, pA, p, pB, n, 0, pC, n);<BR />
} else{<BR />
mkl_set_num_threads( NUM_OF_THREADS/2 );<BR />
cblas_dgemm(CblasRowMajor, CblasNoTrans, CblasNoTrans,m, n, p, 1, pA, p, pB, n, 0, pD, n);<BR />
}<BR />
}</P>
<P>The time taken to do the above is compared with two serial instances of cblas_dgemm as follows:</P>
<P> cblas_dgemm(CblasRowMajor, CblasNoTrans, CblasNoTrans,m, n, p, 1, pA, p, pB, n, 0, pC, n);<BR />
cblas_dgemm(CblasRowMajor, CblasNoTrans, CblasNoTrans,m, n, p, 1, pA, p, pB, n, 0, pD, n);</P>
<P>each cblas_dgemm using a full NUM_OF_THREADS thread set.</P>
<P>On a XeonPhi, the time taken to do the parallel implementation is 0.272649 seconds, while the time taken to do the serial implementation is 0.164373 seconds. On a CPU the time taken to do the parallel version is about half the time taken to do the serial version. Any feedback is greatly appreciated. the code for the parallel and serial versions is attached.</P>
<P>Among the various setup, KMP_AFFINITY was "compact,1,0,granularity=fine", NUM_OF_THREADS was 32, matrix size was 100x100 for all matrices.</P>
<P> </P>Fri, 12 Jan 2018 12:35:27 GMTTBane2018-01-12T12:35:27ZTwo parallel cblas_dgemm on XeonPhi 7210
https://community.intel.com/t5/Software-Archive/Two-parallel-cblas-dgemm-on-XeonPhi-7210/m-p/1182642#M79727
<P>I intend to run two parallel cblas_dgemm instances, and used the following code snippet:</P>
<P> #pragma omp parallel num_threads(2)<BR />
{</P>
<P> if (omp_get_thread_num() == 0){<BR />
mkl_set_num_threads( NUM_OF_THREADS/2 );<BR />
cblas_dgemm(CblasRowMajor, CblasNoTrans, CblasNoTrans,m, n, p, 1, pA, p, pB, n, 0, pC, n);<BR />
} else{<BR />
mkl_set_num_threads( NUM_OF_THREADS/2 );<BR />
cblas_dgemm(CblasRowMajor, CblasNoTrans, CblasNoTrans,m, n, p, 1, pA, p, pB, n, 0, pD, n);<BR />
}<BR />
}</P>
<P>The time taken to do the above is compared with two serial instances of cblas_dgemm as follows:</P>
<P> cblas_dgemm(CblasRowMajor, CblasNoTrans, CblasNoTrans,m, n, p, 1, pA, p, pB, n, 0, pC, n);<BR />
cblas_dgemm(CblasRowMajor, CblasNoTrans, CblasNoTrans,m, n, p, 1, pA, p, pB, n, 0, pD, n);</P>
<P>each cblas_dgemm using a full NUM_OF_THREADS thread set.</P>
<P>On a XeonPhi, the time taken to do the parallel implementation is 0.272649 seconds, while the time taken to do the serial implementation is 0.164373 seconds. On a CPU the time taken to do the parallel version is about half the time taken to do the serial version. Any feedback is greatly appreciated. the code for the parallel and serial versions is attached.</P>
<P>Among the various setup, KMP_AFFINITY was "compact,1,0,granularity=fine", NUM_OF_THREADS was 32, matrix size was 100x100 for all matrices.</P>
<P> </P>Fri, 12 Jan 2018 12:35:27 GMThttps://community.intel.com/t5/Software-Archive/Two-parallel-cblas-dgemm-on-XeonPhi-7210/m-p/1182642#M79727TBane2018-01-12T12:35:27Z