MPI hangs on MPI_Send for large messages

The details of the Cube class aren’t relevant here: consider a simpler version #include <mpi.h> #include <cstdlib> using namespace std; int main(int argc, char *argv[]) { int size, rank; const int root = 0; int datasize = atoi(argv[1]); MPI_Init(&argc, &argv); MPI_Comm_size(MPI_COMM_WORLD, &size); MPI_Comm_rank(MPI_COMM_WORLD, &rank); if (rank != root) { int nodeDest = rank + 1; … Read more

Probe seems to consume the CPU

Yes; most MPI implementations, for the sake of performance, busy-wait on blocking operations. The assumption is that the MPI job is the only thing going on that we care about on the processor, and if the task is blocked waiting for communications, the best thing to do is to continually poll for that communication to … Read more

MPI_Rank return same process number for all process

Make sure that both mpicc and mpirun come from the same MPI implementation. When mpirun fails to provide the necessary universe information to the launched processes, with the most common reason for that being that the executable was build against a different MPI implementation (or even a different version of the same implementation), MPI_Init() falls … Read more