下面这个小程序hello已经在VC6.0编译通过了,
如何用mpich进行多机模拟,显示结果?我的mpich是mpich.nt.1.2.5版本
我试过用MPIRun,将“application”设为hello.exe的路径
“number of ”设为4,即模拟在4台计算机上并行运行程序,可单击“run”以后,为什么output栏中没有任何显示结果?
是mpich的环境设置有问题,还是其它原因?
麻烦各位高手指点,万分感谢:)
#include <mpi.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <conio.h>
#pragma comment (lib, "mpichd.lib")
void main(int argc,char *argv[])
{
int myid, numprocs;
int namelen;
char processor_name[MPI_MAX_PROCESSOR_NAME];
MPI_Init(&argc,&argv);
MPI_Comm_rank(MPI_COMM_WORLD,&myid);
MPI_Comm_size(MPI_COMM_WORLD,&numprocs);
MPI_Get_processor_name(processor_name,&namelen);
fprintf(stderr,"Hello World! Process %d of %d on %s/n",
myid, numprocs, processor_name);
MPI_Finalize();
}