Skip to content

Commit

Permalink
Merge branch 'mercury_profiling_interface' of https://github.com/srin…
Browse files Browse the repository at this point in the history
…i009/mercury into mercury_profiling_interface
  • Loading branch information
srini009 committed Oct 13, 2020
2 parents ace64be + a55bc1e commit d98a378
Showing 1 changed file with 10 additions and 21 deletions.
31 changes: 10 additions & 21 deletions src/na/na_ofi.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ static unsigned long const na_ofi_prov_flags[] = {NA_OFI_PROV_TYPES};

/* Number of retries when receiving FI_EINTR error */
#define NA_OFI_MAX_EINTR_RETRY (1000)
/* The magic number for na_ofi_op_id verification */
#define NA_OFI_OP_ID_MAGIC_1 (0x1928374655627384ULL)
#define NA_OFI_OP_ID_MAGIC_2 (0x8171615141312111ULL)

/* The predefined RMA KEY for MR_SCALABLE */
#define NA_OFI_RMA_KEY (0x0F1B0F1BULL)
Expand Down Expand Up @@ -1839,24 +1842,16 @@ na_ofi_domain_open(struct na_ofi_class *priv, enum na_ofi_prov_type prov_type,

#ifdef NA_OFI_HAS_EXT_GNI_H
if (na_ofi_domain->prov_type == NA_OFI_PROV_GNI) {
int32_t enable = 1;
# ifdef NA_OFI_GNI_HAS_UDREG
int enable = 1;
# ifdef NA_OFI_GNI_HAS_UDREG
char *other_reg_type = "udreg";
int32_t udreg_limit = 1024;

/* Enable use of udreg instead of internal MR cache */
ret = na_ofi_gni_set_domain_op_value(
na_ofi_domain, GNI_MR_CACHE, &other_reg_type);
NA_CHECK_NA_ERROR(
error, ret, "Could not set domain op value for GNI_MR_CACHE");

/* Experiments on Theta showed default value of 2048 too high if
* launching multiple clients on one node */
ret = na_ofi_gni_set_domain_op_value(
na_ofi_domain, GNI_MR_UDREG_REG_LIMIT, &udreg_limit);
ret = na_ofi_gni_set_domain_op_value(na_ofi_domain, GNI_MR_CACHE,
&other_reg_type);
NA_CHECK_NA_ERROR(error, ret,
"Could not set domain op value for GNI_MR_UDREG_REG_LIMIT");
# endif
"Could not set domain op value for GNI_MR_CACHE");
# endif

/* Enable lazy deregistration in MR cache */
ret = na_ofi_gni_set_domain_op_value(
Expand Down Expand Up @@ -4656,15 +4651,9 @@ na_ofi_progress(

if (wait_hdl) {
/* Wait in wait set if provider does not support wait on FDs */
int rc = 0, retry_cnt = 0;
do {
rc = fi_wait(wait_hdl, (int) (remaining * 1000.0));
} while (
rc == -FI_EINTR && retry_cnt++ < NA_OFI_MAX_EINTR_RETRY);

int rc = fi_wait(wait_hdl, (int) (remaining * 1000.0));
if (rc == -FI_ETIMEDOUT)
break;

NA_CHECK_ERROR(rc != 0, out, ret, NA_PROTOCOL_ERROR,
"fi_wait() failed, rc: %d (%s)", rc,
fi_strerror((int) -rc));
Expand Down

0 comments on commit d98a378

Please sign in to comment.