I can confirm this issue is already fixed in the 1.8 nightly.

-Nathan


________________________________________
From: users on behalf of Thibaud Kloczko
Sent: Friday, February 13, 2015 3:09:03 AM
To: Open MPI Users
Subject: [OMPI users] Weird behavior using MPI_Lock

Hi all,

I observed non-consistent behaviors for the lock functions when applied to 
windows either created using MPI_Win_create or using 
MPI_Win_allocate/MPI_Win_allocate_shared.

I am using openmpi 1.8.4. A sample of the code is joined to this mail.

1- Locking a window created using allocate functions.

As explained by Nathan Hjelm, the MPI_MODE_NOCHECK assert had a bug in its 
path, so I use 0 instead.

In my tests, each process use the lock functions as follows, first a 
lock/unlock for read then a lock/unlock for write, nothing is done between 
lock/unlock but it does not change the behavior:

-----
// Lock for read (local rank)
MPI_Win_lock(MPI_LOCK_SHARED, rank, 0, win_shared);
MPI_Win_unlock(rank, win_shared);

// Lock for write (local rank)
MPI_Win_lock(MPI_LOCK_EXCLUSIVE, rank, 0, win_shared);
MPI_Win_unlock(rank, win_shared);
-----

This works fine.

2- Locking a window created using MPI_Win_create.

In this case, the same code ...

-----
// Lock for read (local rank)
MPI_Win_lock(MPI_LOCK_SHARED, rank, 0, win);
MPI_Win_unlock(rank, win);

// Lock for write (local rank)
MPI_Win_lock(MPI_LOCK_EXCLUSIVE, rank, 0, win);
MPI_Win_unlock(rank, win);
-----

... freezes when entering the lock for write (it happens for all processes)

Further tests show that it works fine when:

- the MPI_MODE_NOCHECK assert is used
- the locks are applied to non-local rank
- the exclusive lock is done before the shared lock

In this last case, if I call a third lock with MPI_LOCK_EXCLUSIVE option, it 
works also.

Maybe, I misunderstand something :-/ !

Thanks for your help :-) !

Cheers,

Thibaud.

-------------------------------------------------
Ingénieur d'Expérimentation et de Développement
Inria CRISAM
2004, route des lucioles
06902 Sophia Antipolis
FRANCE
+33 4 92 38 50 03

Reply via email to