C API Documentation

client.h

Defines

WARABI_CLIENT_NULL
WARABI_TARGET_HANDLE_NULL
WARABI_ASYNC_REQUEST_NULL
WARABI_ASYNC_REQUEST_IGNORE

Typedefs

typedef struct warabi_client *warabi_client_t
typedef struct warabi_target_handle *warabi_target_handle_t
typedef struct warabi_async_request *warabi_async_request_t
typedef struct warabi_region warabi_region_t

Functions

warabi_err_t warabi_client_create(margo_instance_id mid, warabi_client_t *client)

Create a client.

Parameters
  • mid[in] margo instance id.

  • client[out] Resulting client.

warabi_err_t warabi_client_free(warabi_client_t client)

Free the client handle.

warabi_err_t warabi_client_make_target_handle(warabi_client_t client, const char *address, uint16_t provider_id, warabi_target_handle_t *th)

Creates a handle to a remote target.

Parameters
  • client[in] Client.

  • address[in] Address of the provider holding the target.

  • provider_id[in] Provider id.

  • th[out] Target handle.

warabi_err_t warabi_target_handle_free(warabi_target_handle_t th)

Free the target handle.

char *warabi_client_get_config(warabi_client_t client)

Returns the internal configuration of the client as a JSON-formatted string, or NULL if the client is invalid.

It is the caller’s responsibility to free the returned string.

Parameters

client – Client.

warabi_err_t warabi_create(warabi_target_handle_t th, size_t size, warabi_region_t *region, warabi_async_request_t *req)

Create a region.

Parameters
  • th[in] Target handle.

  • size[in] Size of the region.

  • region[out] Resulting region ID.

  • req[out] Optional asynchronous request.

Returns

warabi_err_t handle.

warabi_err_t warabi_write(warabi_target_handle_t th, warabi_region_t region, size_t regionOffset, const char *data, size_t size, bool persist, warabi_async_request_t *req)

Write data into a region.

Parameters
  • th[in] Target handle.

  • region[in] Region to write to.

  • regionOffset[in] Offset to write from in the region.

  • data[in] Data to write.

  • size[in] Size of the data.

  • persist[in] Whether to persist the data.

  • req[out] Optional asynchronous request.

Returns

warabi_err_t handle.

warabi_err_t warabi_write_multi(warabi_target_handle_t th, warabi_region_t region, size_t count, const size_t *regionOffsets, const size_t *regionSizes, const char *data, bool persist, warabi_async_request_t *req)

Same as warabi_write but accesses non-contiguous segments inside a region.

warabi_err_t warabi_write_bulk(warabi_target_handle_t th, warabi_region_t region, size_t regionOffset, hg_bulk_t bulk, const char *address, size_t bulkOffset, size_t size, bool persist, warabi_async_request_t *req)

Same as warabi_write but the data is coming from an hg_bulk_t handle at a specified bulkOffset.

Note: this function can be used to write from a non-contiguous local memory since hg_bulk_t can represent non-contiguous memory.

warabi_err_t warabi_write_multi_bulk(warabi_target_handle_t th, warabi_region_t region, size_t count, const size_t *regionOffsets, const size_t *regionSizes, hg_bulk_t bulk, const char *address, size_t bulkOffset, bool persist, warabi_async_request_t *req)

Same as warabi_write_multi but the data is coming from an hg_bulk_t handle at a specified bulkOffset.

Note: this function can be used to write from a non-contiguous local memory since hg_bulk_t can represent non-contiguous memory.

warabi_err_t warabi_persist(warabi_target_handle_t th, warabi_region_t region, size_t regionOffset, size_t size, warabi_async_request_t *req)

Persist the content of a region from a given offset.

Parameters
  • th[in] Target handle.

  • region[in] Region from which to persist data.

  • regionOffset[in] Offset from which to persist data.

  • size[in] Size to persist.

  • req[out] Optional asynchronous request.

Returns

warabi_err_t handle.

warabi_err_t warabi_persist_multi(warabi_target_handle_t th, warabi_region_t region, size_t count, const size_t *regionOffsets, const size_t *regionSizes, warabi_async_request_t *req)

Same as warabi_persist but allows persisting multiple non-contiguous segments of the underlying region.

warabi_err_t warabi_create_write(warabi_target_handle_t th, const char *data, size_t size, bool persist, warabi_region_t *region, warabi_async_request_t *req)

Combined create + write operation.

warabi_err_t warabi_create_write_bulk(warabi_target_handle_t th, hg_bulk_t bulk, const char *address, size_t bulkOffset, size_t size, bool persist, warabi_region_t *region, warabi_async_request_t *req)

Combined create + write operation with data coming from a bulk handle.

warabi_err_t warabi_read(warabi_target_handle_t th, warabi_region_t region, size_t regionOffset, char *data, size_t size, warabi_async_request_t *req)

Read a region from a given offset.

Parameters
  • th[in] Target handle.

  • region[in] Region to read from.

  • regionOffset[in] Offset from which to read in the region.

  • data[out] Buffer in which to place the data read.

  • size[in] Size to read.

  • req[out] Optional asynchronous request.

Returns

warabi_err_t handle.

warabi_err_t warabi_read_multi(warabi_target_handle_t th, warabi_region_t region, size_t count, const size_t *regionOffsets, const size_t *regionSizes, char *data, warabi_async_request_t *req)

Same as warabi_read but allows reading non-contiguous segments from a region.

warabi_err_t warabi_read_bulk(warabi_target_handle_t th, warabi_region_t region, size_t regionOffset, const char *address, hg_bulk_t bulk, size_t bulkOffset, size_t size, warabi_async_request_t *req)

Same as warabi_read but will push the data to a provided hg_bulk_t handle.

warabi_err_t warabi_read_multi_bulk(warabi_target_handle_t th, warabi_region_t region, size_t count, const size_t *regionOffsets, const size_t *regionSizes, const char *address, hg_bulk_t bulk, size_t bulkOffset, warabi_async_request_t *req)

Same as warabi_read_multi but will push the data to a provided hg_bulk_t handle.

warabi_err_t warabi_erase(warabi_target_handle_t th, warabi_region_t region, warabi_async_request_t *req)

Erase a region.

Parameters
  • th[in] Target handle.

  • region[in] Region to erase.

  • req[out] Optional asynchronous request.

Returns

warabi_err_t handle.

warabi_err_t warabi_wait(warabi_async_request_t req)

Wait on an asynchronous request. This will also free the underlying handle request handle.

Parameters

req – Request to wait on.

Returns

warabi_err_t handle.

warabi_err_t warabi_test(warabi_async_request_t req, bool *flag)

Test without blocking whether the asynchronous request has completed. Note that even if the test returns true, the caller still needs to call warabi_wait.

Parameters
  • req[in] Request to test.

  • flag[out] Whether the request completed.

Returns

warabi_err_t handle.

warabi_err_t warabi_set_eager_write_threshold(warabi_target_handle_t th, size_t size)

Set the thresdhold for using RPC messages instead of RDMA for write operations on this target handle.

Parameters
  • th – Target handle.

  • size – Threshold.

Returns

warabi_err_t handle.

warabi_err_t warabi_set_eager_read_threshold(warabi_target_handle_t th, size_t size)

Set the thresdhold for using RPC messages instead of RDMA for read operations on this target handle.

Parameters
  • th – Target handle.

  • size – Threshold.

Returns

warabi_err_t handle.

struct warabi_region

Public Members

uint8_t opaque[16]

error.h

Defines

WARABI_SUCCESS

Typedefs

typedef struct warabi_err *warabi_err_t

Functions

const char *warabi_err_message(warabi_err_t err)

Return the error message associated with the error handle.

void warabi_err_free(warabi_err_t err)

Free the error handle.

server.h

Defines

WARABI_PROVIDER_IGNORE

Typedefs

typedef struct remi_client *remi_client_t
typedef struct remi_provider *remi_provider_t
typedef struct warabi_provider *warabi_provider_t

Functions

warabi_err_t warabi_provider_register(warabi_provider_t *provider, margo_instance_id mid, uint16_t provider_id, const char *config, struct warabi_provider_init_args *args)

Register a Warabi provider.

Parameters
  • provider[out] Provider.

  • mid[in] Margo instance id.

  • provider_id[in] Provider id.

  • args[in] Optional extra arguments.

Returns

warabi_err_t handle.

warabi_err_t warabi_provider_deregister(warabi_provider_t provider)

Deregister the provider.

char *warabi_provider_get_config(warabi_provider_t provider)

Get the provider configuration. The caller is responsible for freeing the returned string.

warabi_err_t warabi_provider_migrate(warabi_provider_t provider, const char *dest_addr, uint16_t dest_provider_id, const char *migration_config)

Request that the provider migrate its target to another provider.

Parameters
  • provider – Provider whose target to migrate.

  • dest_addr – Destination address.

  • dest_provider_id – Destination provider ID.

  • migration_config – Migration config.

Returns

warabi_err_t handle.

struct warabi_provider_init_args

Public Members

ABT_pool pool
remi_client_t remi_cl
remi_provider_t remi_pr