MPI_Comm_size(comm, &size);
MPI_Comm_rank(comm, &rank);
通信域MPI_COMM_WORLD中的进程数量size总是为1。
解决:
1.在exe目录下执行cmd命令行。
2.输入mpiexec -n 4 ConsoleApplication2.exe,其中,4为进程数,ConsoleApplication2.exe为exe名。
可以看到,开启了四个进程,即size=4.
MPI_Comm_size(comm, &size);
MPI_Comm_rank(comm, &rank);
通信域MPI_COMM_WORLD中的进程数量size总是为1。
解决:
1.在exe目录下执行cmd命令行。
2.输入mpiexec -n 4 ConsoleApplication2.exe,其中,4为进程数,ConsoleApplication2.exe为exe名。
可以看到,开启了四个进程,即size=4.