简体   繁体   中英

Which process goes to which cpu socket in MPI?

I am running a MPI program and in my hostfile I have only one node. The node has 2 scokets, 8 physical cores each and the hyperthreading is disabled.

mpiexec -n 8 -f /pathtohostfile/host_file_test./a.out

I am using likwid to measure energy consumed by my program.

Question:

  1. Are the above 8 process running on the same socket(to save energy) or processes can be randomly assigned to either socket?
  2. Not sure about it, but can a process context switch to another socket?
  3. In case process are randomly assigned, can I pin my process to a core/socket to measure the energy?

Since you have only one node, your 8 processes are all under control of the Linux scheduler, so, unless you use numactl or something to pin them down, the OS will place them for best load balancing. And it may decide to migrate them. Look into numactl and other "pinning" tools. hwloc may also do it for you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM