From 1be185ed8791f258c8d6df9e110c3a9262969de4 Mon Sep 17 00:00:00 2001 From: Yohann Burette Date: Fri, 24 Apr 2015 15:55:21 -0700 Subject: [PATCH] mtl/ofi: Remove use of MR. --- ompi/mca/mtl/ofi/mtl_ofi.h | 13 ++++------- ompi/mca/mtl/ofi/mtl_ofi_component.c | 34 +++------------------------- ompi/mca/mtl/ofi/mtl_ofi_types.h | 3 --- 3 files changed, 7 insertions(+), 43 deletions(-) diff --git a/ompi/mca/mtl/ofi/mtl_ofi.h b/ompi/mca/mtl/ofi/mtl_ofi.h index b54cad0218..a239681496 100644 --- a/ompi/mca/mtl/ofi/mtl_ofi.h +++ b/ompi/mca/mtl/ofi/mtl_ofi.h @@ -128,11 +128,6 @@ ompi_mtl_ofi_finalize(struct mca_mtl_base_module_t *mtl) "fi_close failed: %s", strerror(errno)); abort(); } - if (fi_close((fid_t)ompi_mtl_ofi.mr)) { - opal_output(ompi_mtl_base_framework.framework_output, - "fi_close failed: %s", strerror(errno)); - abort(); - } if (fi_close((fid_t)ompi_mtl_ofi.cq)) { opal_output(ompi_mtl_base_framework.framework_output, "fi_close failed: %s", strerror(errno)); @@ -287,7 +282,7 @@ ompi_mtl_ofi_send_start(struct mca_mtl_base_module_t *mtl, ret_length = fi_trecv(ompi_mtl_ofi.ep, NULL, 0, - ompi_mtl_ofi.mr, + NULL, endpoint->peer_fiaddr, match_bits | MTL_OFI_SYNC_SEND_ACK, 0, /* Exact match, no ignore bits */ @@ -323,7 +318,7 @@ ompi_mtl_ofi_send_start(struct mca_mtl_base_module_t *mtl, ret_length = fi_tsend(ompi_mtl_ofi.ep, start, length, - ompi_mtl_ofi.mr, + NULL, endpoint->peer_fiaddr, match_bits, (void *) &ofi_req->ctx); @@ -498,7 +493,7 @@ ompi_mtl_ofi_recv_callback(struct fi_cq_tagged_entry *wc, ret_length = fi_tsend(ompi_mtl_ofi.ep, NULL, 0, - ompi_mtl_ofi.mr, + NULL, ofi_req->remote_addr, wc->tag | MTL_OFI_SYNC_SEND_ACK, (void *) &ofi_req->ctx); @@ -591,7 +586,7 @@ ompi_mtl_ofi_irecv(struct mca_mtl_base_module_t *mtl, ret_length = fi_trecv(ompi_mtl_ofi.ep, start, length, - ompi_mtl_ofi.mr, + NULL, remote_addr, match_bits, mask_bits, diff --git a/ompi/mca/mtl/ofi/mtl_ofi_component.c b/ompi/mca/mtl/ofi/mtl_ofi_component.c index 712c1be13c..05f5e0208c 100644 --- a/ompi/mca/mtl/ofi/mtl_ofi_component.c +++ b/ompi/mca/mtl/ofi/mtl_ofi_component.c @@ -91,7 +91,6 @@ ompi_mtl_ofi_component_open(void) ompi_mtl_ofi.domain = NULL; ompi_mtl_ofi.av = NULL; ompi_mtl_ofi.cq = NULL; - ompi_mtl_ofi.mr = NULL; ompi_mtl_ofi.ep = NULL; return OMPI_SUCCESS; @@ -130,11 +129,8 @@ ompi_mtl_ofi_component_init(bool enable_progress_threads, * mode: Select capabilities MTL is prepared to support. * In this case, MTL will pass in context into communication calls * ep_type: reliable datagram operation - * caps: Capabilities required from the provider. The bits specified - * implement MPI semantics. - * Tagged is used to support tag matching. - * We expect to register all memory up front for use with this - * endpoint, so the MTL requires dynamic memory regions + * caps: Capabilities required from the provider. + * Tag matching is specified to implement MPI semantics. */ hints = fi_allocinfo(); if (!hints) { @@ -146,7 +142,6 @@ ompi_mtl_ofi_component_init(bool enable_progress_threads, hints->mode = FI_CONTEXT; hints->ep_attr->type = FI_EP_RDM; /* Reliable datagram */ hints->caps = FI_TAGGED; /* Tag matching interface */ - hints->caps |= FI_DYNAMIC_MR; /* Global dynamic mem region */ /** * Refine filter for additional capabilities @@ -275,27 +270,7 @@ ompi_mtl_ofi_component_init(bool enable_progress_threads, __FILE__, __LINE__, fi_strerror(-ret)); goto error; } - - /** - * All OFI communication routines require at least one MR. - * This MTL only needs a single MR. - */ - ret = fi_mr_reg(ompi_mtl_ofi.domain, /* In: Domain object */ - 0, /* In: Lower memory address */ - UINTPTR_MAX, /* In: Upper memory address */ - FI_SEND | FI_RECV, /* In: Expose MR for read/write */ - 0ULL, /* In: base MR offset */ - 0ULL, /* In: requested key */ - 0ULL, /* In: No flags */ - &ompi_mtl_ofi.mr, /* Out: memregion object */ - NULL); /* Context: memregion events */ - if (0 != ret) { - opal_output_verbose(1, ompi_mtl_base_framework.framework_output, - "%s:%d: fi_mr_reg failed: %s\n", - __FILE__, __LINE__, fi_strerror(-ret)); - goto error; - } - + /** * Bind the CQ and AV to the endpoint object. */ @@ -394,9 +369,6 @@ error: if (ompi_mtl_ofi.cq) { (void) fi_close((fid_t)ompi_mtl_ofi.cq); } - if (ompi_mtl_ofi.mr) { - (void) fi_close((fid_t)ompi_mtl_ofi.mr); - } if (ompi_mtl_ofi.ep) { (void) fi_close((fid_t)ompi_mtl_ofi.ep); } diff --git a/ompi/mca/mtl/ofi/mtl_ofi_types.h b/ompi/mca/mtl/ofi/mtl_ofi_types.h index 4855fbcdfd..9a753a5210 100644 --- a/ompi/mca/mtl/ofi/mtl_ofi_types.h +++ b/ompi/mca/mtl/ofi/mtl_ofi_types.h @@ -43,9 +43,6 @@ typedef struct mca_mtl_ofi_module_t { /** Completion queue handle */ struct fid_cq *cq; - /** Memory region handle */ - struct fid_mr *mr; - /** Endpoint to communicate on */ struct fid_ep *ep;