53 #define PING_TAG 0x1234
54 #define PONG_TAG 0x5678
55 #define RECV_MAX_LEN 100
56 #define PING_RECV_CTX 0xdead
57 #define PONG_RECV_CTX 0xbeef
72 MPI_Comm comm = (MPI_Comm)(
uintptr_t)coll_info;
74 request = calloc(1,
sizeof(*request));
78 MPI_Iallgather(sbuf, msglen, MPI_BYTE, rbuf, msglen, MPI_BYTE, comm, request);
93 MPI_Request *request = (MPI_Request *)req;
95 MPI_Test(request, &is_done, MPI_STATUS_IGNORE);
166 res->
count = buf_len;
204 bool is_client =
false;
209 int msg_len = strlen(msg) + 1;
210 int dest = (my_rank + 1) % size;
214 recv_res = calloc(1,
sizeof(*recv_res));
215 if (recv_res ==
NULL)
218 send_res = calloc(1,
sizeof(*send_res));
219 if (send_res ==
NULL) {
224 recv_data.
ptr = recv_res;
225 send_data.
ptr = send_res;
282 }
while (ret == 0 || send_res->
type == 0);
285 send_res->
status != UCS_OK) {
296 }
while (ret == 0 || recv_res->
type == 0);
328 }
while (ret == 0 || send_res->
type == 0);
331 send_res->
status != UCS_OK) {
344 }
while (ret == 0 || recv_res->
type == 0);
376 size_t i, plugins_count = 0;
377 char *plugin_name =
"worker_sandbox";
379 struct doca_dev *dev;
383 struct doca_urom_domain *
domain;
384 struct doca_urom_worker *worker;
385 struct doca_urom_service *service;
386 uint64_t worker_id = (uint64_t)rank;
391 .coll_info = (
void *)(
uintptr_t)MPI_COMM_WORLD,
392 .n_oob_indexes = size,
416 for (i = 0; i < plugins_count; i++) {
418 sandbox_info = &plugins[i];
423 if (sandbox_info ==
NULL) {
437 for (idx = 0; idx < 8; idx++) {
467 MPI_Abort(MPI_COMM_WORLD, 1);
doca_error_t open_doca_device_with_ibdev_name(const uint8_t *value, size_t val_size, tasks_check func, struct doca_dev **retval)
if(bitoffset % 64+bitlength > 64) result|
static enum doca_flow_pipe_domain domain
static struct doca_pe * pe
DOCA_STABLE doca_error_t doca_ctx_get_state(const struct doca_ctx *ctx, enum doca_ctx_states *state)
Get context state.
DOCA_STABLE doca_error_t doca_ctx_stop(struct doca_ctx *ctx)
Stops the context allowing reconfiguration.
doca_ctx_states
This enum defines the states of a context.
@ DOCA_CTX_STATE_STARTING
DOCA_STABLE doca_error_t doca_dev_close(struct doca_dev *dev)
Destroy allocated local device instance.
#define DOCA_ERROR_PROPAGATE(r, t)
Save the first encountered doca_error_t.
enum doca_error doca_error_t
DOCA API return codes.
@ DOCA_ERROR_INVALID_VALUE
#define DOCA_LOG_ERR(format,...)
Generates an ERROR application log message.
#define DOCA_LOG_INFO(format,...)
Generates an INFO application log message.
DOCA_STABLE doca_error_t doca_pe_destroy(struct doca_pe *pe)
Destroy doca progress engine.
DOCA_STABLE uint8_t doca_pe_progress(struct doca_pe *pe)
Run the progress engine.
DOCA_STABLE doca_error_t doca_pe_create(struct doca_pe **pe)
Creates DOCA progress engine.
DOCA_EXPERIMENTAL struct doca_ctx * doca_urom_domain_as_ctx(struct doca_urom_domain *domain_ctx)
DOCA_EXPERIMENTAL doca_error_t doca_urom_domain_destroy(struct doca_urom_domain *domain_ctx)
ucs_cpu_set_t doca_cpu_set_t
DOCA CPU set structure.
DOCA_EXPERIMENTAL doca_error_t doca_urom_service_get_plugins_list(struct doca_urom_service *service_ctx, const struct doca_urom_service_plugin_info **plugins, size_t *plugins_count)
This method gets the list of supported plugins on service's DPU side.
DOCA_EXPERIMENTAL doca_error_t doca_urom_service_get_cpuset(struct doca_urom_service *service_ctx, doca_cpu_set_t *cpuset)
Get the allowed CPU set for the service.
DOCA_EXPERIMENTAL struct doca_ctx * doca_urom_service_as_ctx(struct doca_urom_service *service_ctx)
Convert service_ctx instance into a generalized context for use with DOCA core objects.
DOCA_EXPERIMENTAL doca_error_t doca_urom_service_destroy(struct doca_urom_service *service_ctx)
This method destroys a UROM Service context.
#define doca_cpu_is_set(_cpu, _cpusetp)
Check if specific bit in DOCA CPU is set.
DOCA_EXPERIMENTAL doca_error_t doca_urom_worker_destroy(struct doca_urom_worker *worker_ctx)
This method destroys a UROM Worker context.
DOCA_EXPERIMENTAL struct doca_ctx * doca_urom_worker_as_ctx(struct doca_urom_worker *worker_ctx)
__UINTPTR_TYPE__ uintptr_t
Out-of-band communication descriptor for Domain creation.
doca_urom_domain_allgather_cb_t allgather
char plugin_name[DOCA_UROM_PLUGIN_NAME_MAX_LEN]
char buffer[RECV_MAX_LEN]
Convenience type for representing opaque data.
doca_error_t start_urom_service(struct doca_pe *pe, struct doca_dev *dev, uint64_t nb_workers, struct doca_urom_service **service)
doca_error_t start_urom_worker(struct doca_pe *pe, struct doca_urom_service *service, uint64_t worker_id, uint32_t *gid, uint64_t nb_tasks, doca_cpu_set_t *cpuset, char **env, size_t env_count, uint64_t plugins, struct doca_urom_worker **worker)
doca_error_t start_urom_domain(struct doca_pe *pe, struct doca_urom_domain_oob_coll *oob, uint64_t *worker_ids, struct doca_urom_worker **workers, size_t nb_workers, struct urom_domain_buffer_attrs *buffers, size_t nb_buffers, struct doca_urom_domain **domain)
static void recv_finished_cb(doca_error_t result, union doca_data cookie, union doca_data context, void *buffer, uint64_t buf_len, uint64_t sender_tag, ucs_status_t status)
doca_error_t urom_ping_pong(const char *message, const char *device_name, uint32_t rank, uint32_t size)
static void send_finished_cb(doca_error_t result, union doca_data cookie, union doca_data context, ucs_status_t status)
static doca_error_t oob_allgather_free(void *req)
doca_error_t ping_pong(struct doca_pe *pe, struct doca_urom_worker *worker, const char *msg, int my_rank, int size)
static doca_error_t oob_allgather(void *sbuf, void *rbuf, size_t msglen, void *coll_info, void **req)
DOCA_LOG_REGISTER(UROM_PING_PONG::SAMPLE)
static doca_error_t oob_allgather_test(void *req)
doca_error_t urom_sandbox_tag_task_send(struct doca_urom_worker *worker_ctx, union doca_data cookie, union doca_data context, uint64_t dest, uint64_t buffer, uint64_t count, uint64_t tag, uint64_t memh_id, urom_sandbox_send_finished cb)
doca_error_t urom_sandbox_init(uint64_t plugin_id, uint64_t version)
doca_error_t urom_sandbox_tag_task_recv(struct doca_urom_worker *worker_ctx, union doca_data cookie, union doca_data context, uint64_t buffer, uint64_t count, uint64_t tag, uint64_t tag_mask, uint64_t memh_id, urom_sandbox_recv_finished cb)