NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
dpa_all_to_all_core.c File Reference
#include <stdlib.h>
#include <unistd.h>
#include <limits.h>
#include <math.h>
#include <time.h>
#include <doca_ctx.h>
#include <doca_dev.h>
#include <doca_log.h>
#include "dpa_all_to_all_core.h"
Include dependency graph for dpa_all_to_all_core.c:

Go to the source code of this file.

Macros

#define MAX_MPI_WAIT_TIME   (10) /* Maximum time to wait on MPI request */
 
#define SLEEP_IN_NANO_SEC   (100000000) /* Sleeping interval for completion polling */
 

Functions

 DOCA_LOG_REGISTER (A2A::Core)
 
static int calc_width (int n)
 
static void print_buff (const int *buff, size_t columns, size_t rows)
 
static int compute_random_int (void)
 
static doca_error_t mpi_request_wait_timeout (MPI_Request *req, size_t timeout)
 
bool dpa_device_exists_check (const char *device_name)
 
bool rdma_device_exists_check (const char *device_name)
 
static doca_error_t open_dpa_devices (const char *pf_device_name, const char *rdma_device_name, struct doca_dev **pf_doca_device, struct doca_dev **rdma_doca_device)
 
static doca_error_t create_dpa_context (struct a2a_resources *resources)
 
static doca_error_t create_mmap (struct doca_dev *doca_device, unsigned int mmap_permissions, void *memrange_addr, size_t memrange_len, struct doca_mmap **mmap, doca_dpa_dev_mmap_t *dpa_mmap_handle)
 
static doca_error_t create_doca_dpa_sync_event_from_export (struct doca_dpa *doca_dpa, struct doca_dev *doca_device, const uint8_t *remote_event_export_data, size_t remote_event_export_size, struct doca_sync_event_remote_net **remote_event, doca_dpa_dev_sync_event_remote_net_t *remote_event_dpa_handle)
 
static doca_error_t prepare_dpa_a2a_memory (struct a2a_resources *resources)
 
static doca_error_t connect_dpa_a2a_rdmas (struct a2a_resources *resources)
 
static doca_error_t create_rdma (struct doca_dpa *doca_dpa, struct doca_dev *doca_device, unsigned int rdma_caps, struct doca_dpa_completion *dpa_completion, struct doca_rdma **rdma)
 
static doca_error_t destroy_rdma (struct doca_rdma *rdma, struct doca_dev *doca_device)
 
static doca_error_t prepare_dpa_a2a_dpa_completions (struct a2a_resources *resources)
 
static doca_error_t prepare_dpa_a2a_rdmas (struct a2a_resources *resources)
 
static doca_error_t create_doca_dpa_completion_sync_event (struct doca_dpa *doca_dpa, struct doca_dev *doca_device, struct doca_sync_event **comp_event)
 
static doca_error_t create_doca_dpa_remote_net_sync_event (struct doca_dpa *doca_dpa, struct doca_sync_event **kernel_event)
 
static doca_error_t create_dpa_a2a_events (struct a2a_resources *resources)
 
doca_error_t dpa_a2a_init (struct a2a_resources *resources)
 
doca_error_t dpa_a2a_destroy (struct a2a_resources *resources)
 
doca_error_t dpa_a2a_req_finalize (struct dpa_a2a_request *req)
 
doca_error_t dpa_a2a_req_wait (struct dpa_a2a_request *req)
 
doca_error_t dpa_ialltoall (void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm, struct dpa_a2a_request *req)
 
doca_error_t dpa_alltoall (void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm)
 
doca_error_t dpa_a2a (int argc, char **argv, struct a2a_config *cfg)
 

Variables

struct doca_dpa_app * dpa_all2all_app
 
char pf_device1_name [MAX_IB_DEVICE_NAME_LEN]
 
char pf_device2_name [MAX_IB_DEVICE_NAME_LEN]
 
char rdma_device1_name [MAX_IB_DEVICE_NAME_LEN]
 
char rdma_device2_name [MAX_IB_DEVICE_NAME_LEN]
 
doca_dpa_func_t alltoall_kernel
 

Macro Definition Documentation

◆ MAX_MPI_WAIT_TIME

#define MAX_MPI_WAIT_TIME   (10) /* Maximum time to wait on MPI request */

Definition at line 38 of file dpa_all_to_all_core.c.

◆ SLEEP_IN_NANO_SEC

#define SLEEP_IN_NANO_SEC   (100000000) /* Sleeping interval for completion polling */

Definition at line 39 of file dpa_all_to_all_core.c.

Function Documentation

◆ calc_width()

static int calc_width ( int  n)
static

Definition at line 66 of file dpa_all_to_all_core.c.

◆ compute_random_int()

static int compute_random_int ( void  )
static

Definition at line 120 of file dpa_all_to_all_core.c.

◆ connect_dpa_a2a_rdmas()

static doca_error_t connect_dpa_a2a_rdmas ( struct a2a_resources resources)
static

Definition at line 984 of file dpa_all_to_all_core.c.

◆ create_doca_dpa_completion_sync_event()

static doca_error_t create_doca_dpa_completion_sync_event ( struct doca_dpa *  doca_dpa,
struct doca_dev *  doca_device,
struct doca_sync_event **  comp_event 
)
static

Definition at line 1356 of file dpa_all_to_all_core.c.

◆ create_doca_dpa_remote_net_sync_event()

static doca_error_t create_doca_dpa_remote_net_sync_event ( struct doca_dpa *  doca_dpa,
struct doca_sync_event **  kernel_event 
)
static

Definition at line 1404 of file dpa_all_to_all_core.c.

◆ create_doca_dpa_sync_event_from_export()

static doca_error_t create_doca_dpa_sync_event_from_export ( struct doca_dpa *  doca_dpa,
struct doca_dev *  doca_device,
const uint8_t *  remote_event_export_data,
size_t  remote_event_export_size,
struct doca_sync_event_remote_net **  remote_event,
doca_dpa_dev_sync_event_remote_net_t remote_event_dpa_handle 
)
static

Definition at line 513 of file dpa_all_to_all_core.c.

◆ create_dpa_a2a_events()

static doca_error_t create_dpa_a2a_events ( struct a2a_resources resources)
static

Definition at line 1452 of file dpa_all_to_all_core.c.

◆ create_dpa_context()

static doca_error_t create_dpa_context ( struct a2a_resources resources)
static

Definition at line 337 of file dpa_all_to_all_core.c.

◆ create_mmap()

static doca_error_t create_mmap ( struct doca_dev *  doca_device,
unsigned int  mmap_permissions,
void *  memrange_addr,
size_t  memrange_len,
struct doca_mmap **  mmap,
doca_dpa_dev_mmap_t dpa_mmap_handle 
)
static

Definition at line 438 of file dpa_all_to_all_core.c.

◆ create_rdma()

static doca_error_t create_rdma ( struct doca_dpa *  doca_dpa,
struct doca_dev *  doca_device,
unsigned int  rdma_caps,
struct doca_dpa_completion *  dpa_completion,
struct doca_rdma **  rdma 
)
static

Definition at line 1102 of file dpa_all_to_all_core.c.

◆ destroy_rdma()

static doca_error_t destroy_rdma ( struct doca_rdma *  rdma,
struct doca_dev *  doca_device 
)
static

Definition at line 1174 of file dpa_all_to_all_core.c.

◆ DOCA_LOG_REGISTER()

DOCA_LOG_REGISTER ( A2A::Core  )

◆ dpa_a2a()

doca_error_t dpa_a2a ( int  argc,
char **  argv,
struct a2a_config cfg 
)

Definition at line 2012 of file dpa_all_to_all_core.c.

◆ dpa_a2a_destroy()

doca_error_t dpa_a2a_destroy ( struct a2a_resources resources)

Definition at line 1692 of file dpa_all_to_all_core.c.

◆ dpa_a2a_init()

doca_error_t dpa_a2a_init ( struct a2a_resources resources)

Definition at line 1569 of file dpa_all_to_all_core.c.

◆ dpa_a2a_req_finalize()

doca_error_t dpa_a2a_req_finalize ( struct dpa_a2a_request req)

Definition at line 1834 of file dpa_all_to_all_core.c.

◆ dpa_a2a_req_wait()

doca_error_t dpa_a2a_req_wait ( struct dpa_a2a_request req)

Definition at line 1852 of file dpa_all_to_all_core.c.

◆ dpa_alltoall()

doca_error_t dpa_alltoall ( void *  sendbuf,
int  sendcount,
MPI_Datatype  sendtype,
void *  recvbuf,
int  recvcount,
MPI_Datatype  recvtype,
MPI_Comm  comm 
)

Definition at line 1974 of file dpa_all_to_all_core.c.

◆ dpa_device_exists_check()

bool dpa_device_exists_check ( const char *  device_name)

Definition at line 149 of file dpa_all_to_all_core.c.

◆ dpa_ialltoall()

doca_error_t dpa_ialltoall ( void *  sendbuf,
int  sendcount,
MPI_Datatype  sendtype,
void *  recvbuf,
int  recvcount,
MPI_Datatype  recvtype,
MPI_Comm  comm,
struct dpa_a2a_request req 
)

Definition at line 1893 of file dpa_all_to_all_core.c.

◆ mpi_request_wait_timeout()

static doca_error_t mpi_request_wait_timeout ( MPI_Request *  req,
size_t  timeout 
)
static

Definition at line 132 of file dpa_all_to_all_core.c.

◆ open_dpa_devices()

static doca_error_t open_dpa_devices ( const char *  pf_device_name,
const char *  rdma_device_name,
struct doca_dev **  pf_doca_device,
struct doca_dev **  rdma_doca_device 
)
static

Definition at line 244 of file dpa_all_to_all_core.c.

◆ prepare_dpa_a2a_dpa_completions()

static doca_error_t prepare_dpa_a2a_dpa_completions ( struct a2a_resources resources)
static

Definition at line 1197 of file dpa_all_to_all_core.c.

◆ prepare_dpa_a2a_memory()

static doca_error_t prepare_dpa_a2a_memory ( struct a2a_resources resources)
static

Definition at line 555 of file dpa_all_to_all_core.c.

◆ prepare_dpa_a2a_rdmas()

static doca_error_t prepare_dpa_a2a_rdmas ( struct a2a_resources resources)
static

Definition at line 1254 of file dpa_all_to_all_core.c.

◆ print_buff()

static void print_buff ( const int *  buff,
size_t  columns,
size_t  rows 
)
static

Definition at line 82 of file dpa_all_to_all_core.c.

◆ rdma_device_exists_check()

bool rdma_device_exists_check ( const char *  device_name)

Definition at line 190 of file dpa_all_to_all_core.c.

Variable Documentation

◆ alltoall_kernel

doca_dpa_func_t alltoall_kernel

Definition at line 56 of file dpa_all_to_all_core.c.

◆ dpa_all2all_app

struct doca_dpa_app* dpa_all2all_app
extern

◆ pf_device1_name

char pf_device1_name[MAX_IB_DEVICE_NAME_LEN]

Definition at line 50 of file dpa_all_to_all_core.c.

◆ pf_device2_name

char pf_device2_name[MAX_IB_DEVICE_NAME_LEN]

Definition at line 51 of file dpa_all_to_all_core.c.

◆ rdma_device1_name

char rdma_device1_name[MAX_IB_DEVICE_NAME_LEN]

Definition at line 52 of file dpa_all_to_all_core.c.

◆ rdma_device2_name

char rdma_device2_name[MAX_IB_DEVICE_NAME_LEN]

Definition at line 53 of file dpa_all_to_all_core.c.