Intel® Moderncode for Parallel Architectures
Support for developing parallel programming applications on Intel® Architecture.

mesuring cost of communication between threads

karimfath
Beginner
340 Views

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
Honored Contributor III
340 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

0 Kudos
TimP
Honored Contributor III
340 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.

0 Kudos
Reply