Use Barrier operations to resolve order-of-write-access memory model issues. Barrier operations also provide remote memory access error detection.
The barrier mechanism is made up of the following operations:
Initialization
Open
Close
Order
The open and close operations define a span-of-time interval for error detection and ordering. The initialization operation enables barrier creation for each imported segment, as well as barrier type specification. The only barrier type currently supported has a span-of-time scope per segment. Use a type argument value of RSM_BAR_DEFAULT.
Successfully performing a close operation guarantees the successful completion of covered access operations, which take place between the barrier open and the barrier close. After a barrier open operation, failures of individual data access operations, both reads and writes, are not reported until the barrier close operation.
To impose a specific order of write completion within a barrier's scope, use an explicit barrier-order operation. A write operation that is issued before the barrier-order operation finishes before operations that are issued after the barrier-order operation. Write operations within a given barrier scope are ordered with respect to another barrier scope.
int rsm_memseg_import_init_barrier(rsm_memseg_import_handle_t im_memseg, rsm_barrier_type_t type, rsmapi_barrier_t *barrier);At present, RSM_BAR_DEFAULT is the only supported type.
Return Values: Returns 0 if successful. Returns an error value otherwise.
Invalid segment handle
Invalid barrier pointer
Insufficient memory
Return Values: Returns 0 if successful. Returns an error value otherwise.
Invalid segment handle
Invalid barrier pointer
This function closes the barrier and flushes all store buffers. This call assumes that the calling process will retry all remote memory operations since the last rsm_memseg_import_open_barrier call if the call to rsm_memseg_import_close_barrier() fails.
Return Values: Returns 0 if successful. Returns an error value otherwise.
Invalid segment handle
Invalid barrier pointer
Barrier not initialized
Barrier not opened
Memory access error
Connection aborted
This function flushes all store buffers.
Return Values: Returns 0 if successful. Returns an error value otherwise.
Invalid segment handle
Invalid barrier pointer
Barrier not initialized
Barrier not opened
Memory access error
Connection aborted
This function deallocates all barrier resources.
Return Values: Returns 0 if successful. Returns an error value otherwise.
Invalid segment handle
Invalid barrier pointer
This function supports the optional explicit barrier scoping that is available in the put routines. The two valid barrier modes are RSM_BARRIER_MODE_EXPLICIT and RSM_BARRIER_MODE_IMPLICIT. The default value of the barrier mode is RSM_BARRIER_MODE_IMPLICIT. While in implicit mode, an implicit barrier open and barrier close is applied to each put operation. Before setting the barrier mode value to RSM_BARRIER_MODE_EXPLICIT, use the rsm_memseg_import_init_barrier routine to initialize a barrier for the imported segment im_memseg.
Return Values: Returns 0 if successful. Returns an error value otherwise.
Invalid segment handle
This function obtains the current mode value for barrier scoping in the put routines.
Return Values: Returns 0 if successful. Returns an error value otherwise.
Invalid segment handle.