openshmem-org / specification

OpenSHMEM Application Programming Interface
http://www.openshmem.org
51 stars 41 forks source link

Add Signal API #382

Closed jdinan closed 1 year ago

jdinan commented 4 years ago

Issue

Signaling is used for point-to-point synchronization. With OpenSHMEM 1.5 we removed support for shmem_p as a signal operation.

Current replacements for shmem_p are shmem_set (or another AMO) or zero-length shmem_put_signal. Atomic set must be atomic with respect to all other AMOs; signals can provide better performance (only require single-copy atomicity).

Put-with-signal can be used for only transmitting a signal update, but for this usage model the API is not very clean and there are additional overheads (arguments, branches, etc.) compared with a simple signal operation.

Proposed Solution

Add a signal operation:

void shmem_signal(uint64_t *sig_addr, uint64_t signal, int sig_op, int pe);

nspark commented 2 years ago

I'm going to take this one. I think this is a feature we need for 1.6.

naveen-rn commented 2 years ago

I would assume there is no new implicit ordering guarantees introduced with this proposal. This is simply a special case PWS with 0-size payload. If this is the intended semantics - I think this proposal is implementable.

Also, it would be better to introduce shmem_signal_set and shmem_signal_add as separate APIs.

jdinan commented 2 years ago

I think Naveen is saying that signals don't automatically provide ordering; users need to call shmem_fence. And I fully agree with this.