Question on non-blocking nature of few interfaces?

7 views
Skip to first unread message

Sri Raj Paul

unread,
Jun 5, 2020, 9:06:36 PM6/5/20
to upc-users
Hello,

I had some questions regarding non blocking nature of a few calls.

Given a distributed array A.

Is  'int tmp = A[n] ' a blocking version? and

is  'upc_memget_nbi(&tmp, A+n, sizeof(int))' its non-blocking equivalent?

Is 'upc_atomic_relaxed(upc_atomic_domain, NULL, UPC_ADD,  A+n, &one, NULL)' a non blocking call? I assume they are, because the equivalents in OpenSHMEM ( shmem_int64_atomic_add) and MPI2-RMA (MPI_Accumulate) seems to be non-blocking.

Thank you
Sriraj

Paul Hargrove

unread,
Jun 6, 2020, 4:20:16 PM6/6/20
to Sri Raj Paul, upc-users
Sriraj,

1. `int tmp = A[n]`
The UPC language specification does not specify if this is blocking or non-blocking. Note that unlike OpenSHMEM and MPI, UPC is a language with a dedicated compiler that may or may not optimize communication operations. The UPC memory model constrains when the implied communication may take place with respect to other operations.
Those constraints will depend on whether `A` was declared with the `strict` or `relaxed` qualifier, or the default in effect if neither was used.
With respect to the Berkeley UPC translator with default (non-experimental) optimizations: this will be performed as a blocking operation.

2. `upc_memget_nbi(&tmp, A+n, sizeof(int))`
This expresses an explicitly non-blocking transfer that is outside the normal constraints of the memory model.
It is only required to be completed by the corresponding synchronization call.
However, it is permitted for the implementation to be synchronous.
With respect to Berkeley UPC specifically: this is semantically always a non-blocking operation, although notably it might be synchronously performed via shared memory when that’s possible (this generally means affinity to the caller or to another thread on the same compute node).

3. `upc_atomic_relaxed(upc_atomic_domain, NULL, UPC_ADD,  A+n, &one, NULL)`
Again, the UPC library specification does not specify this as a blocking or non-blocking operation.
Like the assignment (first example) the operation is ordered according to the UPC memory model.
Unlike the assignment, whether this is either a `strict` or `relaxed` reference is given in the name of the function, rather than by the type system.
With respect to Berkeley UPC translator: this will be performed as a blocking operation.

-Paul

--
You received this message because you are subscribed to the Google Groups "upc-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to upc-users+...@lbl.gov.
To view this discussion on the web visit https://groups.google.com/a/lbl.gov/d/msgid/upc-users/2974976f-65a7-40dd-bf75-de49eb9c0b14o%40lbl.gov.


--
Paul H. Hargrove <PHHar...@lbl.gov>
Computer Languages & Systems Software (CLaSS) Group
Computer Science Department
Lawrence Berkeley National Laboratory

Sri Raj Paul

unread,
Jun 7, 2020, 1:34:19 AM6/7/20
to upc-users, srira...@gmail.com
Paul, Thank you for the detailed explanation.
Sriraj
To unsubscribe from this group and stop receiving emails from it, send an email to upc-...@lbl.gov.
Reply all
Reply to author
Forward
0 new messages