多线程MPI_Win_lock问题
使用MVAPICH2-1.9,被动单边通信语义,lock使用共享锁:
多线程执行以下语句,有Fatal error in MPI_Win_unlock错误。
lock(相同rank) get unlock
下面是单线程做的测试,可见针对相同rank时lock多线程可重入,但unlock时会出错。
文档上说是多线程可重入,估计是针对不同rank
2 lock 2 unlock
Fatal error in MPI_Win_unlock:
Wrong synchronization of RMA calls
2 lock no unlock
Fatal error in MPI_Win_free:
Wrong synchronization of RMA calls
2 lock 1 unlock
Fatal error in MPI_Win_free:
Wrong synchronization of RMA calls
no lock no unlock
Fatal error in MPI_Get:
Wrong synchronization of RMA calls
在我的应用中,仅需要对win做get,解决该问题方法为,get前获取所有rank的锁,free前unlock所有锁