Skip to content

Commit

Permalink
core/fabric -collective ofload provider set via environemnt variable …
Browse files Browse the repository at this point in the history
…FI_OFFLOAD_COLL_PROVIDER

Signed-off-by: Tomasz Gromadzki <[email protected]>
  • Loading branch information
grom72 committed Nov 29, 2022
1 parent e205260 commit 748c3a3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
4 changes: 1 addition & 3 deletions prov/coll/src/coll_cq.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ int coll_cq_init(struct fid_domain *domain,
coll_domain = container_of(domain, struct coll_domain, util_domain.domain_fid.fid);
provider = coll_domain->util_domain.fabric->prov;


if (!attr || !(attr->flags & FI_PEER)) {
FI_WARN(provider, FI_LOG_CORE, "FI_PEER flag required\n");
return -EINVAL;
Expand All @@ -103,8 +102,7 @@ int coll_cq_init(struct fid_domain *domain,

cq->peer_cq = peer_context->cq;

ret = ofi_cq_init(provider, domain, attr, &cq->util_cq, &ofi_cq_progress,
context);
ret = ofi_cq_init(provider, domain, attr, &cq->util_cq, progress, context);
if (ret)
goto err;

Expand Down
16 changes: 8 additions & 8 deletions prov/rxm/src/rxm_fabric.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,20 +128,20 @@ static int rxm_fabric_init_offload_coll(struct rxm_fabric *fabric)
*/
struct fi_info *hints, *offload_coll_info;
struct fid_fabric *offload_coll_fabric;
char *offload_coll_name;
int ret;

fi_param_get_str(NULL, "offload_coll_provider", &offload_coll_name);

if (!strlen(offload_coll_name)) {
return 0;
}

hints = fi_allocinfo();
if (!hints)
return -FI_ENOMEM;

hints->fabric_attr->prov_name = strdup(OFI_OFFLOAD_PREFIX "sharp"); // XXX to be fixed
// provider is discovered
// by feature
if (!hints->fabric_attr->prov_name) {
fi_freeinfo(hints);
return -FI_ENOMEM;
}

hints->fabric_attr->prov_name = strdup(offload_coll_name);
hints->mode = FI_PEER_TRANSFER;
ret = fi_getinfo(OFI_VERSION_LATEST, NULL, NULL, OFI_OFFLOAD_PROV_ONLY,
hints, &offload_coll_info);
Expand Down
7 changes: 7 additions & 0 deletions src/fabric.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Copyright (c) 2006-2016 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2013-2017 Intel Corp., Inc. All rights reserved.
* (C) Copyright 2020 Hewlett Packard Enterprise Development LP
* Copyright (c) 2022 Intel Corporation. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
Expand Down Expand Up @@ -662,6 +663,8 @@ static void ofi_find_prov_libs(void)

if (ofi_has_util_prefix(prov->prov_name)) {
short_prov_name = prov->prov_name + strlen(OFI_UTIL_PREFIX);
} else if (ofi_has_offload_prefix(prov->prov_name)) {
short_prov_name = prov->prov_name + strlen(OFI_OFFLOAD_PREFIX);
} else {
short_prov_name = prov->prov_name;
}
Expand Down Expand Up @@ -834,6 +837,10 @@ void fi_ini(void)
"(default: false)");
fi_param_get_bool(NULL, "av_remove_cleanup", &ofi_av_remove_cleanup);

fi_param_define(NULL, "offload_coll_provider", FI_PARAM_STRING,
"The name of colective offload provider (default: empty - no provider)");


ofi_load_dl_prov();

ofi_register_provider(PSM3_INIT, NULL);
Expand Down

0 comments on commit 748c3a3

Please sign in to comment.