查看openmpi手册中的以下摘录
--map-by <foo>
Map to the specified object, defaults to socket. Supported options
include slot, hwthread, core, L1cache, L2cache, L3cache, socket,
numa, board, node, sequential, distance, and ppr. Any object can
include modifiers by adding a : and any combination of PE=n (bind n
processing elements to each proc), SPAN (load balance the processes
across the allocation), OVERSUBSCRIBE (allow more processes on a node
than processing elements), and NOOVERSUBSCRIBE. This includes PPR,
where the pattern would be terminated …Run Code Online (Sandbox Code Playgroud) 我想准确地将我的 MPI 进程固定到(物理)内核列表。我参考了 mpirun --help 输出的以下几点:
-cpu-set|--cpu-set <arg0>
Comma-separated list of ranges specifying logical
cpus allocated to this job [default: none]
Run Code Online (Sandbox Code Playgroud)
...
-rf|--rankfile <arg0>
Provide a rankfile file
Run Code Online (Sandbox Code Playgroud)
我的处理器拓扑如下:
-------------------------------------------------------------
CPU type: Intel Core Bloomfield processor
*************************************************************
Hardware Thread Topology
*************************************************************
Sockets: 1
Cores per socket: 4
Threads per core: 2
-------------------------------------------------------------
HWThread Thread Core Socket
0 0 0 0
1 0 1 0
2 0 2 0
3 0 3 0
4 1 0 0
5 1 1 0 …Run Code Online (Sandbox Code Playgroud)