Skip to content

Commit

Permalink
add backend checking
Browse files Browse the repository at this point in the history
  • Loading branch information
JiakunYan committed Nov 8, 2024
1 parent da6cc0c commit 40b7c4f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lci/backend/ibv/server_ibv.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,16 @@ void LCISI_event_polling_thread_fina(LCISI_server_t* server)

void LCISD_server_init(LCIS_server_t* s)
{
// Check configurations
if (LCI_MAX_SINGLE_MESSAGE_SIZE >= 2 << 31) {
// ibverbs' max message is 2GiB (or 2GB?)
LCI_MAX_SINGLE_MESSAGE_SIZE = 2 << 31 - 1;
LCI_Warn(
"Reduce LCI_MAX_SINGLE_MESSAGE_SIZE to %lu"
"as required by libibverbs max message size\n",
LCI_MAX_SINGLE_MESSAGE_SIZE);
}

LCISI_server_t* server = LCIU_malloc(sizeof(LCISI_server_t));
*s = (LCIS_server_t)server;

Expand Down
7 changes: 7 additions & 0 deletions lci/backend/ofi/server_ofi.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,13 @@ void LCISD_server_init(LCIS_server_t* s)
"inject_size (%lu) < sizeof(LCI_short_t) (%lu)!\n",
server->info->tx_attr->inject_size, sizeof(LCI_short_t));
fi_freeinfo(hints);
if (server->info->ep_attr->max_msg_size < LCI_MAX_SINGLE_MESSAGE_SIZE) {
LCI_MAX_SINGLE_MESSAGE_SIZE = server->info->ep_attr->max_msg_size;
LCI_Warn(
"Reduce LCI_MAX_SINGLE_MESSAGE_SIZE to %lu"
"as required by the libfabric max_msg_size attribute\n",
LCI_MAX_SINGLE_MESSAGE_SIZE);
}
if (strcmp(server->info->fabric_attr->prov_name, "cxi") == 0) {
LCI_Assert(LCI_USE_DREG == 0,
"The registration cache should be turned off "
Expand Down

0 comments on commit 40b7c4f

Please sign in to comment.