openshmem-org / specification

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

Clarifications missing whether multiple threads can make init/finalize calls simultaneously #541

Open wrrobin opened 2 months ago

wrrobin commented 2 months ago

Problem Statement

With #512 , OpenSHMEM enables support for multiple init and finalize. However, it does not clarify whether these calls can be made from multiple threads simultaneously. In addition to the clarifications added for shmem_init and shmem_finalize, the following in Section 9.2 also needs to be adjusted properly.

SHMEM_THREAD_MULTIPLE
The OpenSHMEM program may be multithreaded and any thread may invoke the OpenSHMEM interfaces.

In the SHMEM_THREAD_FUNNELED, SHMEM_THREAD_SERIALIZED, and
SHMEM_THREAD_MULTIPLE thread levels, the shmem_init_thread and shmem_finalize calls must be
invoked by the same thread.

In the SHMEM_THREAD_MULTIPLE thread level, all OpenSHMEM calls are thread-safe. That is, any two
concurrently running threads may make OpenSHMEM calls.

Proposed Changes

Impact on Implementations

Impact on Users

References and Pull Requests