Skip to content

Commit

Permalink
Put CXI provider behind feature guard
Browse files Browse the repository at this point in the history
Without automatic CMake detection yet
  • Loading branch information
franzpoeschel committed Nov 30, 2023
1 parent 060440a commit b237e6b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
1 change: 1 addition & 0 deletions source/adios2/toolkit/sst/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ set(SST_CONFIG_OPTS
UCX
FI_GNI
CRAY_DRC
CRAY_CXI
NVStream
MPI
)
Expand Down
27 changes: 24 additions & 3 deletions source/adios2/toolkit/sst/dp/rdma_dp.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@
#include <rdma/fi_endpoint.h>
#include <rdma/fi_rma.h>

#ifdef SST_HAVE_CRAY_CXI
// Needs to be included before rdma/fi_cxi_ext.h
#include <stdbool.h>
#include <rdma/fi_cxi_ext.h>
#endif

#if defined(__has_feature)
#if __has_feature(thread_sanitizer)
Expand Down Expand Up @@ -74,7 +76,7 @@ int sst_fi_mr_reg(
{
int res = fi_mr_reg(domain, buf, len, acs, offset, requested_key, flags, mr,
context);
bool is_mr_endpoint = (mr_mode & FI_MR_ENDPOINT) != 0;
int is_mr_endpoint = (mr_mode & FI_MR_ENDPOINT) != 0;
if (!is_mr_endpoint)
{
return res;
Expand Down Expand Up @@ -140,7 +142,9 @@ struct fabric_state
struct fid_cq *cq_signal;
struct fid_av *av;
pthread_t listener;
#ifdef SST_HAVE_CRAY_CXI
struct cxi_auth_key *cxi_auth_key;
#endif
#ifdef SST_HAVE_CRAY_DRC
drc_info_handle_t drc_info;
uint32_t credential;
Expand Down Expand Up @@ -212,6 +216,7 @@ static void init_fabric(struct fabric_state *fabric, struct _SstParams *Params,
hints->ep_attr->type = FI_EP_RDM;

uint32_t fi_version;
#ifdef SST_HAVE_CRAY_CXI
if (fabric->cxi_auth_key)
{
fi_version = FI_VERSION(1, 11);
Expand Down Expand Up @@ -247,6 +252,13 @@ static void init_fabric(struct fabric_state *fabric, struct _SstParams *Params,
hints->domain_attr->control_progress = FI_PROGRESS_AUTO;
hints->domain_attr->data_progress = FI_PROGRESS_AUTO;
}
#else
fi_version = FI_VERSION(1, 5);

hints->domain_attr->mr_mode = FI_MR_BASIC;
hints->domain_attr->control_progress = FI_PROGRESS_AUTO;
hints->domain_attr->data_progress = FI_PROGRESS_AUTO;
#endif

/*
* ifname is passed as a function parameter of init_fabric() if
Expand Down Expand Up @@ -570,10 +582,12 @@ static void fini_fabric(struct fabric_state *fabric, CP_Services Svcs,
free(fabric->ctx);
}

#ifdef SST_HAVE_CRAY_CXI
if (fabric->cxi_auth_key)
{
free(fabric->cxi_auth_key);
}
#endif
#ifdef SST_HAVE_CRAY_DRC
if (Fabric->auth_key)
{
Expand Down Expand Up @@ -762,6 +776,7 @@ static TimestepList GetStep(Rdma_WS_Stream Stream, long Timestep)
return (Step);
}

#ifdef SST_HAVE_CRAY_CXI
int get_cxi_auth_key_from_env(CP_Services Svcs, void *CP_Stream,
struct _SstParams *Params,
struct cxi_auth_key *key,
Expand Down Expand Up @@ -942,6 +957,7 @@ int get_cxi_auth_key_from_writer(struct cxi_auth_key *key, attr_list WriterConta
key->vni = (uint16_t) vni;
return EXIT_SUCCESS;
}
#endif

static DP_RS_Stream RdmaInitReader(CP_Services Svcs, void *CP_Stream,
void **ReaderContactInfoPtr,
Expand Down Expand Up @@ -992,6 +1008,8 @@ static DP_RS_Stream RdmaInitReader(CP_Services Svcs, void *CP_Stream,
Stream->PreloadAvail = 0;
}

char *required_device = NULL;
#ifdef SST_HAVE_CRAY_CXI
struct
{
struct cxi_auth_key key;
Expand All @@ -1005,7 +1023,6 @@ static DP_RS_Stream RdmaInitReader(CP_Services Svcs, void *CP_Stream,
* instances (get this from the writer).
*/

char *required_device = NULL;
tagged_key.valid = get_cxi_auth_key_from_env(
Svcs, CP_Stream, Params, &tagged_key.key, &required_device);

Expand All @@ -1024,6 +1041,8 @@ static DP_RS_Stream RdmaInitReader(CP_Services Svcs, void *CP_Stream,
Svcs->verbose(CP_Stream, DPSummaryVerbose,
"Reader found no CXI auth key\n");
}
#endif


#ifdef SST_HAVE_CRAY_DRC
int attr_cred, try_left, rc;
Expand Down Expand Up @@ -1179,6 +1198,8 @@ static DP_WS_Stream RdmaInitWriter(CP_Services Svcs, void *CP_Stream,
Stream->Fabric = calloc(1, sizeof(struct fabric_state));
Fabric = Stream->Fabric;

char *required_device = NULL;
#ifdef SST_HAVE_CRAY_CXI
struct
{
struct cxi_auth_key key;
Expand All @@ -1191,7 +1212,6 @@ static DP_WS_Stream RdmaInitWriter(CP_Services Svcs, void *CP_Stream,
* The vni (virtual network ID) must be the same across all communicating
* instances (use the one seen by rank 0).
*/
char *required_device = NULL;
tagged_key.valid = get_cxi_auth_key_from_env(
Svcs, CP_Stream, Params, &tagged_key.key, &required_device);

Expand All @@ -1215,6 +1235,7 @@ static DP_WS_Stream RdmaInitWriter(CP_Services Svcs, void *CP_Stream,
Svcs->verbose(CP_Stream, DPSummaryVerbose,
"Writer found no CXI auth key");
}
#endif

#ifdef SST_HAVE_CRAY_DRC
int try_left, rc;
Expand Down

0 comments on commit b237e6b

Please sign in to comment.