GlobalArrays / ga

Partitioned Global Address Space (PGAS) library for distributed arrays
http://hpc.pnl.gov/globalarrays/
Other
97 stars 38 forks source link

Question on how to use ga_lock. #212

Closed jsboer closed 1 month ago

jsboer commented 3 years ago

I am new to GA. The manual say any process attempt to lock a mutex which has already been locked will be a fatal error, and the process locking mutex will enter the critical section.

My question is, how to prevent other processes lock the locked mutex, for there is no API consult the status of lock. And if more than one process try to lock the mutex, the program will stop for the fatal error. So what is the right way to use lock and mutex? I still can not figure out it after seeing the example in manual, is there any example in more detail?

Thank you!

bjpalmer commented 1 month ago

Sorry, this fell through the cracks but if you are still interested in this issue, here goes. The mutexes were created at the start of the GA project and may have seemed like a useful thing at the time, but as far as I know nobody (or almost nobody) has ever used them. At this point, none of the people that created the mutexes are still around so it is hard to see what the original intent was. I think it may have been to implement operations that are currently handled by the accumulate functions but since these functions are already provided, it is not necessary to use mutexes.