MPI:报告绑定

MPI:报告绑定,mpi,openmpi,Mpi,Openmpi,我正在使用-rankfile和-hostfile标志运行具有特定绑定的MPI程序。如何检查是否进行了正确的绑定(只是为了确保)?我尝试了--报告绑定标志。比如: mpirun --report-bindings -rankfile rank_file -hostfile host_file -n 16 ./$prog 但是,它没有提供任何输出。我使用的是OpenMPI版本1.5.4。我做错了什么?可能是您的标准错误,odls框架打印绑定信息的地方被重定向到了某个地方。它适用于我的Open MP

我正在使用
-rankfile
-hostfile
标志运行具有特定绑定的MPI程序。如何检查是否进行了正确的绑定(只是为了确保)?我尝试了
--报告绑定
标志。比如:

mpirun --report-bindings -rankfile rank_file -hostfile host_file -n 16 ./$prog

但是,它没有提供任何输出。我使用的是OpenMPI版本1.5.4。我做错了什么?

可能是您的标准错误,
odls
框架打印绑定信息的地方被重定向到了某个地方。它适用于我的Open MPI 1.5.3:

$ mpiexec --report-bindings -rankfile rank_file -hostfile host_file \
          -n 4 hostname
host
[host:18314] [[35226,0],0] odls:default:fork binding child [[35226,1],0] to slot_list 0
[host:18314] [[35226,0],0] odls:default:fork binding child [[35226,1],1] to slot_list 1
[host:18314] [[35226,0],0] odls:default:fork binding child [[35226,1],2] to slot_list 0
[host:18314] [[35226,0],0] odls:default:fork binding child [[35226,1],3] to slot_list 1
host
host
host
如果库由于任何原因未能报告绑定,您可以使用简单的脚本检查绑定是否实际发生:

#/垃圾箱/垃圾箱
cpuset=$(cat/proc/self/status | grepcpus |允许的| awk'{print$2;}')
echo“级别$OMPI\u COMM\u WORLD\u绑定到核心的级别$cpuset”
只需将其命名为
report\u bindings
,并通过
mpiexec
运行即可:

$ mpiexec --report-bindings -rankfile rank_file -hostfile host_file \
          -n 4 report_bindings
Rank 1 bound to core(s) 8
Rank 0 bound to core(s) 0
Rank 3 bound to core(s) 8
Rank 2 bound to core(s) 0

可能是您的标准错误,
odls
框架正在打印绑定信息,正在重定向到某个地方。它适用于我的Open MPI 1.5.3:

$ mpiexec --report-bindings -rankfile rank_file -hostfile host_file \
          -n 4 hostname
host
[host:18314] [[35226,0],0] odls:default:fork binding child [[35226,1],0] to slot_list 0
[host:18314] [[35226,0],0] odls:default:fork binding child [[35226,1],1] to slot_list 1
[host:18314] [[35226,0],0] odls:default:fork binding child [[35226,1],2] to slot_list 0
[host:18314] [[35226,0],0] odls:default:fork binding child [[35226,1],3] to slot_list 1
host
host
host
如果库由于任何原因未能报告绑定,您可以使用简单的脚本检查绑定是否实际发生:

#/垃圾箱/垃圾箱
cpuset=$(cat/proc/self/status | grepcpus |允许的| awk'{print$2;}')
echo“级别$OMPI\u COMM\u WORLD\u绑定到核心的级别$cpuset”
只需将其命名为
report\u bindings
,并通过
mpiexec
运行即可:

$ mpiexec --report-bindings -rankfile rank_file -hostfile host_file \
          -n 4 report_bindings
Rank 1 bound to core(s) 8
Rank 0 bound to core(s) 0
Rank 3 bound to core(s) 8
Rank 2 bound to core(s) 0

太好了,行得通。我不知道为什么--报表绑定标志没有提供信息。也许我有点不对劲。我倾向于在程序输出上有这样的问题。有时它只是开始不给我任何关于输出的信息,但是如果我在代码中添加另一条cout指令,一切都会正常工作。我应该补充一点,这不是因为刷新,因为函数被相应地调用了。老实说,我不知道。通常,OpenMPI的I/O重定向是非常健壮的。非常好。我不知道为什么--报表绑定标志没有提供信息。也许我有点不对劲。我倾向于在程序输出上有这样的问题。有时它只是开始不给我任何关于输出的信息,但是如果我在代码中添加另一条cout指令,一切都会正常工作。我应该补充一点,这不是因为刷新,因为函数被相应地调用了。老实说,我不知道。通常,OpenMPI的I/O重定向非常健壮。