| <html>
|
| <head>
|
| <title>shmem_longlong_swap</title>
|
| </head>
|
| <h2 id="top">shmem_longlong_swap</h2>
|
| <h4>Purpose</h4>
|
|
|
|
|
| <p>Performs an atomic swap operation to a symmetric data object.
|
| </p>
|
|
|
| <h4>C syntax</h4>
|
|
|
| <pre>
|
| #include <shmem.h>
|
|
|
| long long shmem_longlong_swap(long long *target, long long value, int pe);
|
|
|
| </pre>
|
|
|
| <h4>Parameters</h4>
|
|
|
|
|
| <dl>
|
| <dt class="bold">INPUT</dt>
|
| <dd>
|
|
|
| </dd>
|
| <dt class="bold ">target</dt>
|
| <dd>The pointer to the remotely accessible data object to be updated on
|
| the remote PE.
|
| </dd>
|
| <dt class="bold ">value</dt>
|
| <dd>The pointer to the remotely accessible data object to be updated on
|
| the remote PE.
|
| </dd>
|
| <dt class="bold ">pe</dt>
|
| <dd>An integer indicating the PE number on which target is to be
|
| updated.
|
| </dd>
|
| </dl>
|
|
|
| <h4>Description</h4>
|
|
|
| <div class="ledi">
|
| <p>This function performs atomic swap operations</p>
|
| <p>The shmem_longlong_swap function writes the long long value in to the variable pointed by
|
| target on processing element pe and returns the previous contents of target as an
|
| atomic operation.</p>
|
| <p>The atomic accessing of the shared variable is guaranteed only when that variable is updated solely using IBM openshmem functions.</p>
|
|
|
| <h4>Return values</h4>
|
| <p>This function returns the contents that had been at the target address on the remote
|
| PE prior to the swap is returned.</p>
|
|
|
|
|
| <h4>IBM NOTES</h4>
|
| <div class="ledi">
|
| <dl>
|
| <p>To utilize the hardware atomic operations support of the PERCS system, the variables of these operations should be aligned with their natural byte alignments. For example, an int variable should be 4-byte aligned; a long long variable should be 8-byte aligned. If the participating variables are not aligned, the operation is done in software with sub-optimal performance</p>
|
| </dd>
|
| </dl>
|
| <h4>C examples</h4>
|
| <pre>
|
| </pre>
|
|
|
| <h4>Related information</h4>
|
|
|
| <p>Subroutines: shmem_put
|
| </p>
|
| <hr><a href="apiIndex.html">OpenSHMEM API Index</a> |
| </html> |