47 if (
msgsize %
sizeof(
int) != 0) {
48 DOCA_LOG_ERR(
"Entered message size is not in multiplies of integer size (%lu)",
sizeof(
int));
66 char *devices_names = (
char *)param;
67 char *devices_names_list;
72 DOCA_LOG_ERR(
"Entered IB device name exceeding the maximum size of %d",
78 devices_names_list = strtok(devices_names,
",");
82 DOCA_LOG_ERR(
"Entered IB device name: %s doesn't exist or doesn't support DPA",
88 devices_names_list = strtok(
NULL,
",");
89 if (devices_names_list !=
NULL) {
92 DOCA_LOG_ERR(
"Entered IB device name: %s doesn't exist or doesn't support DPA",
97 devices_names_list = strtok(
NULL,
",");
98 if (devices_names_list !=
NULL) {
115 static doca_error_t rdma_devices_name_callback(
void *param,
void *config)
118 char *devices_names = (
char *)param;
119 char *devices_names_list;
124 DOCA_LOG_ERR(
"Entered IB device name exceeding the maximum size of %d",
130 devices_names_list = strtok(devices_names,
",");
134 DOCA_LOG_ERR(
"Entered IB device name: %s doesn't exist or doesn't support RDMA",
140 devices_names_list = strtok(
NULL,
",");
141 if (devices_names_list !=
NULL) {
144 DOCA_LOG_ERR(
"Entered IB device name: %s doesn't exist or doesn't support RDMA",
149 devices_names_list = strtok(
NULL,
",");
150 if (devices_names_list !=
NULL) {
168 struct doca_argp_param *msgsize_param;
169 struct doca_argp_param *pf_devices_param;
181 "The message size - the size of the sendbuf and recvbuf (in bytes). Must be in multiplies of integer size. Default is size of one integer times the number of processes.");
200 "PF devices names that supports DPA, separated by comma without spaces (max of two devices). If not provided then a random device will be chosen.");
210 struct doca_argp_param *rdma_devices_param;
221 "devices names that supports RDMA, separated by comma without spaces (max of two devices). If not provided then a random device will be chosen.");
278 int main(
int argc,
char **argv)
283 struct doca_log_backend *sdk_log;
284 int exit_status = EXIT_SUCCESS;
300 MPI_Init(&argc, &argv);
301 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
302 MPI_Comm_size(MPI_COMM_WORLD, &size);
318 MPI_Bcast(&
result,
sizeof(
result), MPI_BYTE, 0, MPI_COMM_WORLD);
320 exit_status = EXIT_FAILURE;
321 goto destroy_resources;
325 MPI_Bcast(&
cfg,
sizeof(
cfg), MPI_BYTE, 0, MPI_COMM_WORLD);
332 exit_status = EXIT_FAILURE;
static doca_error_t register_all_to_all_params(void)
static doca_error_t msgsize_callback(void *param, void *config)
int main(int argc, char **argv)
static doca_error_t pf_devices_name_callback(void *param, void *config)
static doca_error_t prepare_argp_parameters(int argc, char **argv, struct a2a_config *cfg)
bool rdma_device_exists_check(const char *device_name)
doca_error_t dpa_a2a(int argc, char **argv, struct a2a_config *cfg)
bool dpa_device_exists_check(const char *device_name)
#define MESSAGE_SIZE_DEFAULT_LEN
#define MAX_USER_IB_DEVICE_NAME_LEN
#define IB_DEVICE_DEFAULT_NAME
#define MAX_IB_DEVICE_NAME_LEN
DOCA_EXPERIMENTAL void doca_argp_param_set_description(struct doca_argp_param *param, const char *description)
Set the description of the program param, used during program usage.
DOCA_EXPERIMENTAL void doca_argp_param_set_long_name(struct doca_argp_param *param, const char *name)
Set the long name of the program param.
DOCA_EXPERIMENTAL doca_error_t doca_argp_start(int argc, char **argv)
Parse incoming arguments (cmd line/json).
DOCA_EXPERIMENTAL void doca_argp_param_set_arguments(struct doca_argp_param *param, const char *arguments)
Set the description of the expected arguments of the program param, used during program usage.
DOCA_EXPERIMENTAL doca_error_t doca_argp_init(const char *program_name, void *program_config)
Initialize the parser interface.
DOCA_EXPERIMENTAL void doca_argp_param_set_callback(struct doca_argp_param *param, doca_argp_param_cb_t callback)
Set the callback function of the program param.
DOCA_EXPERIMENTAL doca_error_t doca_argp_param_create(struct doca_argp_param **param)
Create new program param.
DOCA_EXPERIMENTAL void doca_argp_param_set_type(struct doca_argp_param *param, enum doca_argp_type type)
Set the type of the param arguments.
DOCA_EXPERIMENTAL void doca_argp_param_set_short_name(struct doca_argp_param *param, const char *name)
Set the short name of the program param.
DOCA_EXPERIMENTAL doca_error_t doca_argp_destroy(void)
ARG Parser destroy.
DOCA_EXPERIMENTAL doca_error_t doca_argp_register_param(struct doca_argp_param *input_param)
Register a program flag.
enum doca_error doca_error_t
DOCA API return codes.
DOCA_STABLE const char * doca_error_get_descr(doca_error_t error)
Returns the description string of an error code.
@ DOCA_ERROR_INVALID_VALUE
DOCA_EXPERIMENTAL doca_error_t doca_log_backend_create_standard(void)
Create default, non configurable backend for application messages.
#define DOCA_LOG_ERR(format,...)
Generates an ERROR application log message.
DOCA_EXPERIMENTAL doca_error_t doca_log_backend_create_with_file_sdk(FILE *fptr, struct doca_log_backend **backend)
Create a logging backend with a FILE* stream for SDK messages.
DOCA_EXPERIMENTAL doca_error_t doca_log_backend_set_sdk_level(struct doca_log_backend *backend, uint32_t level)
Set the log level limit for SDK logging backends.
const struct ip_frag_config * cfg
char pf_device2_name[MAX_IB_DEVICE_NAME_LEN]
char pf_device1_name[MAX_IB_DEVICE_NAME_LEN]
char rdma_device1_name[MAX_IB_DEVICE_NAME_LEN]
char rdma_device2_name[MAX_IB_DEVICE_NAME_LEN]