diff --git a/lci/backend/ibv/server_ibv.c b/lci/backend/ibv/server_ibv.c index bbac265f..edf33680 100644 --- a/lci/backend/ibv/server_ibv.c +++ b/lci/backend/ibv/server_ibv.c @@ -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; diff --git a/lci/backend/ofi/server_ofi.c b/lci/backend/ofi/server_ofi.c index ff89b093..eb7dfa89 100644 --- a/lci/backend/ofi/server_ofi.c +++ b/lci/backend/ofi/server_ofi.c @@ -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 "