Hi,
I tried running the following code on a Linux cluster with Intel MPI (Version 4.0 Update 3 Build 20110824) and slurm 2.2.7 on 2 nodes with 8 cores each (16 tasks).
Unfortunately, it hangs at the MPI_Win_unlock command during the 11th or 12th iteration. I have tried Intel compiler and gcc with no success.
#include
#include
#define USE_BARRIER 1
#define LOCAL_RANK 10
#define REMOTE_RANK 3
int main(int argc, char** argv)
{
int rank, error;
MPI_Win win;
double* value;
double local_value;
MPI_Init(&argc, &argv);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
error = MPI_Alloc_mem(sizeof(double), MPI_INFO_NULL, &value);
if (error != MPI_SUCCESS)
MPI_Abort(MPI_COMM_WORLD, error);
error = MPI_Win_create(value, sizeof(double), sizeof(double), MPI_INFO_NULL, MPI_COMM_WORLD, &win);
if (error != MPI_SUCCESS)
MPI_Abort(MPI_COMM_WORLD, error);
if (rank == LOCAL_RANK)
for (int i = 0; i < 25; i++) {
std::cout << "Iteration " << i << " in rank " << rank << std::endl;
error = MPI_Win_lock(MPI_LOCK_SHARED, REMOTE_RANK, 0, win);
if (error != MPI_SUCCESS)
MPI_Abort(MPI_COMM_WORLD, error);
error = MPI_Get(&local_value, 1, MPI_DOUBLE, REMOTE_RANK, 0, 1, MPI_DOUBLE, win);
if (error != MPI_SUCCESS)
MPI_Abort(MPI_COMM_WORLD, error);
error = MPI_Win_unlock(REMOTE_RANK, win);
if (error != MPI_SUCCESS)
MPI_Abort(MPI_COMM_WORLD, error);
}
#ifdef USE_BARRIER
MPI_Barrier(MPI_COMM_WORLD);
#endif
MPI_Win_free(&win);
MPI_Free_mem(value);
MPI_Finalize();
} Other MPI libraries work as expected, also other "configurations" work. E.g.:#define USE_BARRIER 0 #define LOCAL_RANK 10 #define REMOTE_RANK 3or
#define USE_BARRIER 1 #define LOCAL_RANK 2 #define REMOTE_RANK 3If you need more information, let me know.
Thanks for your help,
Sebastian



