根据我的小知识mpirun,mpiexec两者都是发射器.谁能告诉mpiexec和之间的确切区别mpirun?
我正在尝试使用D编程语言的MPI.D完全支持C ABI,可以链接并调用任何C代码.我已经完成了显而易见的事情并将MPI标题翻译为D.然后我将测试程序从维基百科翻译成D.我使用以下命令编译它:
dmd test.d -L-lmpistubs
它在我刚运行时起作用./test,并打印:
0: We have 1 processors
但是,当我跑步时mpiexec -n 8 test,它什么都不打印.我的理解是MPI可执行文件需要一堆奇怪的链接选项,这就是mpicc存在自动化过程的工具的原因.但是,如果我在D中尝试使用MPI,这对我没有帮助.我认为这是因为我没有使用正确的链接器选项.有人可以告诉我mpicc,我可以做什么以及如何让DMD做同样的事情?
编辑:我找到了答案mpicc -showme.这显示了mpicc转发的命令gcc.但是,我也意识到我做错了头文件翻译.下一个问题: 如何做对.
我在虚拟机上运行python Hello World mpi4py代码时遇到问题.
hello.py代码是:
#!/usr/bin/python
#hello.py
from mpi4py import MPI
comm = MPI.COMM_WORLD
size = comm.Get_size()
rank = comm.Get_rank()
print "hello world from process ", rank,"of", size
Run Code Online (Sandbox Code Playgroud)
我试图用mpiexec和mpirun来运行它,但运行不好.输出:
$ mpirun -c 4 python hello.py
hello world from process 0 of 1
hello world from process 0 of 1
hello world from process 0 of 1
hello world from process 0 of 1
Run Code Online (Sandbox Code Playgroud)
从mpiexec:
$ mpiexec -n 4 python hello.py
hello world from process 0 of 1
hello world from …Run Code Online (Sandbox Code Playgroud) 我是 MPI 世界的新手,有一个问题让我非常恼火。-n 和 -np 之间的真正区别是什么?
我正在尝试微软的MPI实现.我从这里安装了CCP sdk:
http://www.microsoft.com/en-us/download/details.aspx?id=239
然后在我的项目设置中添加了include文件夹,lib文件夹并提到了msmpi.lib.
使用剩余的设置,我构建程序,然后在命令提示符下继续运行程序,但在启动后没有任何反应.
这是代码(它应该显示每个线程的id号):
#include "stdafx.h"
#include "mpi.h"
#include <stdio.h>
//Commands in cmd prompt
//cd "C:\Program Files\Microsoft Compute Cluster Pack\Bin"
//mpiexec.exe -n 2 "C:\Users\MyNameHere\Documents\Visual Studio 2012\Projects\tspMpi\Debug\tspMpi.exe"
int main(int argc, char* argv[])
{
int nTasks = 0, rank = 0;
MPI_Init(&argc,&argv);
MPI_Comm_size(MPI_COMM_WORLD,&nTasks);
MPI_Comm_rank(MPI_COMM_WORLD,&rank);
printf ("Number of threads = %d, My rank = %d\n", nTasks, rank);
return 0;
MPI_Finalize();
}
Run Code Online (Sandbox Code Playgroud)
一旦我运行mpiexec.exe(命令在注释中),程序就什么都不做,直到我按下Ctrl-C.有谁知道我做错了什么?构建程序时没有错误,如果我从visual studio运行它,就好像只启动了一个进程.
我对以下3个命令中的每一个都得到了相同的错误.是来自ifconfig的我的ip地址.什么是错误的任何想法?昨晚工作得很好.
mpiexec -f machinefile -n <number> hostname
mpiexec -f machinefile –n 1 hostname
mpiexec -f machinefile -n 2 ~/mpich_build/examples/cpi
--------------------------------------------------------------------------
mpiexec was unable to launch the specified application as it could not find an executable:
Executable: -f
Node: raspberrypi
while attempting to start process rank 0.
--------------------------------------------------------------------------
Run Code Online (Sandbox Code Playgroud)
我正在按照http://www.southampton.ac.uk/~sjc/raspberrypi/pi_supercomputer_southampton.htm的教程进行操作