Function ucp_atomic_fetch_nb

Source
pub unsafe extern "C" fn ucp_atomic_fetch_nb(
    ep: ucp_ep_h,
    opcode: ucp_atomic_fetch_op_t,
    value: u64,
    result: *mut c_void,
    op_size: size_t,
    remote_addr: u64,
    rkey: ucp_rkey_h,
    cb: ucp_send_callback_t,
) -> ucs_status_ptr_t
Expand description

@ingroup UCP_COMM @brief Post an atomic fetch operation.

This routine will post an atomic fetch operation to remote memory. The remote value is described by the combination of the remote memory address @a remote_addr and the @ref ucp_rkey_h “remote memory handle” @a rkey. The routine is non-blocking and therefore returns immediately. However the actual atomic operation may be delayed. The atomic operation is not considered complete until the values in remote and local memory are completed. If the atomic operation completes immediately, the routine returns UCS_OK and the call-back routine @a cb is @b not invoked. If the operation is @b not completed immediately and no error is reported, then the UCP library will schedule invocation of the call-back routine @a cb upon completion of the atomic operation. In other words, the completion of an atomic operation can be signaled by the return code or execution of the call-back.

@note The user should not modify any part of the @a result after this operation is called, until the operation completes.

@param [in] ep UCP endpoint. @param [in] opcode One of @ref ucp_atomic_fetch_op_t. @param [in] value Source operand for atomic operation. In the case of CSWAP this is the conditional for the swap. For SWAP this is the value to be placed in remote memory. @param [inout] result Local memory address to store resulting fetch to. In the case of CSWAP the value in result will be swapped into the @a remote_addr if the condition is true. @param [in] op_size Size of value in bytes and pointer type for result @param [in] remote_addr Remote address to operate on. @param [in] rkey Remote key handle for the remote memory address. @param [in] cb Call-back function that is invoked whenever the send operation is completed. It is important to note that the call-back function is only invoked in a case when the operation cannot be completed in place.

@return NULL - The operation was completed immediately. @return UCS_PTR_IS_ERR(_ptr) - The operation failed. @return otherwise - Operation was scheduled and can be completed at any point in time. The request handle is returned to the application in order to track progress of the operation. The application is responsible for releasing the handle using @ref ucp_request_free “ucp_request_free()” routine.