Microsoft MPI无法运行 [英] Microsoft MPI doesn't run

查看:1104
本文介绍了Microsoft MPI无法运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试Microsoft的MPI实现.我从这里安装了CCP sdk:

I'm trying out Microsoft's implementation of MPI. I installed the CCP sdk from here:

http://www.microsoft.com/zh-CN -us/download/details.aspx?id = 239

然后在我的项目设置中,添加了include文件夹,lib文件夹并提到了msmpi.lib.

And then in my project settings I added the include folder, the lib folder and mentioned msmpi.lib.

其余设置保持不变,我构建了程序,然后在命令提示符下继续运行该程序,但是启动它后没有任何反应.

With the remaining settings as-is, I build the program and then in the command prompt I proceed to run the program, but nothing happens after I start it up.

这是代码(应该显示每个线程的ID号):

Here's the code (It's supposed to display the id numbers for each thread):

#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();
}

一旦我运行mpiexec.exe(命令在注释中),该程序什么也不做,直到我按Ctrl-C为止.有人知道我在做什么错吗?生成程序时没有错误,而且如果我从Visual Studio中运行它,就好像只有一个进程在启动一样.

As soon as I run mpiexec.exe (the commands are in the comments) the program just does nothing, until I press Ctrl-C. Does anyone know what I'm doing wrong? There are no errors when I build the program, and if I run it from visual studio, it acts as if there was only one process started up.

推荐答案

我根本没有发现SDK有用,这是我在VS 2010(VC10)中启用MPI群集调试的步骤:

I didn't find SDK useful at all, here are my steps to enable MPI cluster debugging in VS 2010 (VC10):

步骤1.安装MS-MPI: http://www.microsoft.com/en-us/download/details.aspx?id=36045 (仅x64),这会创建

step 1. Install MS-MPI: http://www.microsoft.com/en-us/download/details.aspx?id=36045 (x64 only), this creates

C:\Program Files\Microsoft HPC Pack 2012\Inc
C:\Program Files\Microsoft HPC Pack 2012\Lib\amd64
C:\Program Files\Microsoft HPC Pack 2012\Lib\i386

第2步.下载示例: http ://msdn.microsoft.com/zh-cn/library/ee441265(v = vs.100).aspx#BKMK_debugMany

第3步.调试设置:右键单击启动项目">属性">调试"

step 3. Debugging setting: Right click on the Startup Project > Properties > Debugging

Debugger to launch, change "Local Windows Debugger" to "MPI Cluster Debugger"
Run Environment, change "localhost/1" to "localhost/4"

右键单击Visudal Studio工具栏区域以检查调试位置",现在您可以在调试位置"工具栏中切换进程"及其线程",玩得开心!

Right click on Visudal Studio Toolbar area to check "Debug Location", now you can switch Process and its Threads in the Debug Location toolbar, have fun!

这篇关于Microsoft MPI无法运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆