Community
cancel
Showing results for 
Search instead for 
Did you mean: 
karimfath
Beginner
33 Views

mesuring cost of communication between threads

hello

i want to mesure the number of processor cycle used in communication between two threads in openmp program .

my program consist of thread 0 write a matrix 1000*1000 and thread 1 read the matrix

-we used rdtsc() to count the number of cycle but i m not sure that thread 0 is runing on core 1 and thread 1 is runing on core 2 .

i want a function that help me to place thread 0 in core 1 and thread 1 in core 2

thanks

0 Kudos
2 Replies
jimdempseyatthecove
Black Belt
33 Views

Quoting - karimfath

hello

i want to mesure the number of processor cycle used in communication between two threads in openmp program .

my program consist of thread 0 write a matrix 1000*1000 and thread 1 read the matrix

-we used rdtsc() to count the number of cycle but i m not sure that thread 0 is runing on core 1 and thread 1 is runing on core 2 .

i want a function that help me to place thread 0 in core 1 and thread 1 in core 2

thanks


Karimfath,

You can lock each thread to run on a specific processor or group of processors. The technique may vary depending on your operating system and tools. Using Microsoft Visual Studio Use SetThreadAffinityMask to specify a bit mask of processors on which the thread is restricted to running on. See documentation for how to make the call.

Jim Dempsey

TimP
Black Belt
33 Views

Quoting - karimfath

hello

i want to mesure the number of processor cycle used in communication between two threads in openmp program .

my program consist of thread 0 write a matrix 1000*1000 and thread 1 read the matrix

-we used rdtsc() to count the number of cycle but i m not sure that thread 0 is runing on core 1 and thread 1 is runing on core 2 .

i want a function that help me to place thread 0 in core 1 and thread 1 in core 2

thanks

Intel OpenMP supports both (either) the KMP_AFFINITY or GOMP_CPU_AFFINITY environment variables.

Reply