HixlCSServerRegMem

Function Description

Registers the shared memory by the server for the client to access.

Prototype

HixlStatus HixlCSServerRegMem(HixlServerHandle server_handle,
                              const char *mem_tag,
                              const CommMem *mem,
                              MemHandle *mem_handle);

Parameters

Parameter

Input/Output

Description

server_handle

Input

Handle to a server instance.

mem_tag

Input

Memory tag string, which is used to identify the memory. Optional. The value can be NULL.

mem

Input

It points to CommMem and describes the memory location and size. For details about the definition, see https://gitcode.com/cann/hcomm/blob/master/include/hcomm_res_defs.h).

mem_handle

Output

Memory handle, which is used for subsequent deregistration.

Returns

  • HIXL_SUCCESS: Registration success.
  • HIXL_PARAM_INVALID: Incorrect parameter.
  • Other values: Failure.

Constraints

  • Before the client calls HixlCSClientConnect to establish a link with the local end, register all local memories.
  • If you use the host RoCE NIC, the memory allocated by aclrtMallocHost cannot be registered. Use the malloc method instead.
  • Allocate device memory using aclrtMalloc for registration.