0
我有最簡單的代碼的 「Hello world」意外返回消息: 「鬧鐘」
#include <stdio.h> /* printf and BUFSIZ defined there */
#include <stdlib.h> /* exit defined there */
#include <mpi.h> /* all MPI-2 functions defined there */
int main(argc, argv)
int argc;
char *argv[];
{
int rank, size, length;
char name[BUFSIZ];
MPI_Init(&argc, &argv);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Comm_size(MPI_COMM_WORLD, &size);
MPI_Get_processor_name(name, &length);
printf("%s: hello world from process %d of %d\n", name, rank, size);
MPI_Finalize();
exit(0);
}
我編這
mpicc -o hello hello.c
,並試圖用4個進程
運行mpirun -np 4 hello
它返回;
[email protected]:~/MpiProgrammes$ mpicc -o hello Hello.c
[email protected]:~/MpiProgrammes$ mpirun -np 4 hello
Alarm clock
[email protected]:~/MpiProgrammes$
它可能是什麼?
哪個平臺和MPI實現您使用,包括版本? – msw 2010-10-02 16:01:24
在mpirun-ing之前你有lamboo(啓動lam mpi守護進程)嗎?例如lamboot; mpirun -np 4 hello; lamhalt? – 2010-10-02 16:24:56