From patchwork Thu Aug 11 00:41:58 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arlin Davis X-Patchwork-Id: 1055402 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p7B0fe5l016848 for ; Thu, 11 Aug 2011 00:42:04 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755483Ab1HKAmE (ORCPT ); Wed, 10 Aug 2011 20:42:04 -0400 Received: from mga14.intel.com ([143.182.124.37]:14831 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752290Ab1HKAmC convert rfc822-to-8bit (ORCPT ); Wed, 10 Aug 2011 20:42:02 -0400 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga102.ch.intel.com with ESMTP; 10 Aug 2011 17:42:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.67,353,1309762800"; d="scan'208";a="37259018" Received: from azsmsx601.amr.corp.intel.com ([10.2.121.193]) by azsmga001.ch.intel.com with ESMTP; 10 Aug 2011 17:42:02 -0700 Received: from azsmsx604.amr.corp.intel.com (10.2.161.34) by azsmsx601.amr.corp.intel.com (10.2.121.193) with Microsoft SMTP Server (TLS) id 8.2.255.0; Wed, 10 Aug 2011 17:42:01 -0700 Received: from fmsmsx102.amr.corp.intel.com (10.19.9.53) by azsmsx604.amr.corp.intel.com (10.2.161.34) with Microsoft SMTP Server (TLS) id 8.2.255.0; Wed, 10 Aug 2011 17:42:01 -0700 Received: from fmsmsx151.amr.corp.intel.com ([169.254.6.155]) by FMSMSX102.amr.corp.intel.com ([169.254.2.60]) with mapi id 14.01.0323.003; Wed, 10 Aug 2011 17:41:58 -0700 From: "Davis, Arlin R" To: linux-rdma , "ofw@lists.openfabrics.org" , "ewg@lists.openfabrics.org" Subject: [PATCH 4/10] DAPL v2.0: common: add collective call mappings via standard dapli_post_ext() Thread-Topic: [PATCH 4/10] DAPL v2.0: common: add collective call mappings via standard dapli_post_ext() Thread-Index: AcxXv3mDkVY0EfSUSEii5lw1ksPbaw== Date: Thu, 11 Aug 2011 00:41:58 +0000 Message-ID: <54347E5A035A054EAE9D05927FB467F916E42B40@FMSMSX151.amr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.22.254.138] MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 11 Aug 2011 00:42:04 +0000 (UTC) Signed-off-by: Arlin Davis --- dapl/openib_common/ib_extensions.c | 190 ++++++++++++++++++++++++++++++++++++ 1 files changed, 190 insertions(+), 0 deletions(-) diff --git a/dapl/openib_common/ib_extensions.c b/dapl/openib_common/ib_extensions.c index 3c418e1..c85323c 100644 --- a/dapl/openib_common/ib_extensions.c +++ b/dapl/openib_common/ib_extensions.c @@ -32,6 +32,10 @@ #include "dapl_cookie.h" #include +#ifdef DAT_IB_COLLECTIVES +#include "collectives/ib_collectives.h" +#endif + DAT_RETURN dapli_post_ext(IN DAT_EP_HANDLE ep_handle, IN DAT_UINT64 cmp_add, @@ -181,7 +185,193 @@ dapl_extensions(IN DAT_HANDLE dat_handle, break; } #endif /* DAPL_COUNTERS */ +#ifdef DAT_IB_COLLECTIVES + case DAT_IB_COLLECTIVE_CREATE_MEMBER_OP: + { + void *progress_func; + DAT_IB_COLLECTIVE_MEMBER *member_p; + DAT_COUNT *size_p; + + dapl_dbg_log(DAPL_DBG_TYPE_EXTENSION, + " COLLECTIVE_CREATE_MEMBER extension call\n"); + + progress_func = va_arg(args, void *); + member_p = va_arg(args, DAT_IB_COLLECTIVE_MEMBER *); + size_p = va_arg(args, DAT_COUNT *); + + return dapli_create_collective_member(dat_handle, + progress_func, + size_p, + member_p); + } + case DAT_IB_COLLECTIVE_FREE_MEMBER_OP: + { + DAT_IB_COLLECTIVE_MEMBER member; + + dapl_dbg_log(DAPL_DBG_TYPE_EXTENSION, + " COLLECTIVE_FREE_MEMBER extension call\n"); + + member = va_arg(args, DAT_IB_COLLECTIVE_MEMBER); + return dapli_free_collective_member(dat_handle, member); + } + case DAT_IB_COLLECTIVE_CREATE_GROUP_OP: + { + DAT_CONTEXT context; + DAT_IB_COLLECTIVE_MEMBER *members; + DAT_IB_COLLECTIVE_GROUP *grp; + DAT_IB_COLLECTIVE_RANK rank; + DAT_IB_COLLECTIVE_ID id; + DAT_PZ_HANDLE pd; + DAT_COUNT size; + + dapl_dbg_log(DAPL_DBG_TYPE_EXTENSION, + " DAT_IB_COLLECTIVE_CREATE_GROUP extension call\n"); + + members = va_arg(args, DAT_IB_COLLECTIVE_MEMBER *);/* array */ + size = va_arg(args, DAT_COUNT);/* member count */ + rank = va_arg(args, DAT_IB_COLLECTIVE_RANK);/* rank */ + id = va_arg(args, DAT_IB_COLLECTIVE_ID);/* group id */ + grp = va_arg(args, DAT_IB_COLLECTIVE_GROUP *);/* group info */ + pd = va_arg(args, DAT_PZ_HANDLE);/* prot domain */ + context = va_arg(args, DAT_CONTEXT); + + return dapli_create_collective_group(dat_handle, pd, members, + size, rank, id, grp, context); + } + case DAT_IB_COLLECTIVE_FREE_GROUP_OP: + { + dapl_dbg_log(DAPL_DBG_TYPE_EXTENSION, + " DAT_IB_COLLECTIVE_FREE_GROUP extension call\n"); + return dapli_free_collective_group(dat_handle); + } + case DAT_IB_COLLECTIVE_BARRIER_OP: + { + DAT_CONTEXT context; + + dapl_dbg_log(DAPL_DBG_TYPE_EXTENSION, + "Got DAT_IB_COLLECTIVE_BARRIER extension call\n"); + + context = va_arg(args, DAT_CONTEXT); + comp_flags = va_arg(args, DAT_COMPLETION_FLAGS); + + return dapli_collective_barrier(dat_handle, context, comp_flags); + } + case DAT_IB_COLLECTIVE_BROADCAST_OP: + { + DAT_CONTEXT context; + DAT_PVOID buf; + DAT_COUNT size; + DAT_IB_COLLECTIVE_RANK root; + + dapl_dbg_log(DAPL_DBG_TYPE_EXTENSION, + "Got DAT_IB_COLLECTIVE_BROADCAST extension call\n"); + + buf = va_arg(args, DAT_PVOID); + size = va_arg(args, DAT_COUNT); + root = va_arg(args, DAT_IB_COLLECTIVE_RANK); + context = va_arg(args, DAT_CONTEXT); + comp_flags = va_arg(args, DAT_COMPLETION_FLAGS); + + return dapli_collective_broadcast(dat_handle, buf, size, + root, context, comp_flags); + + } + case DAT_IB_COLLECTIVE_REDUCE_OP: + { + DAT_CONTEXT context; + DAT_IB_COLLECTIVE_RANK root; + DAT_PVOID sbuf, rbuf; + DAT_COUNT slen, rlen; + DAT_IB_COLLECTIVE_REDUCE_DATA_OP op; + DAT_IB_COLLECTIVE_DATA_TYPE type; + + dapl_dbg_log(DAPL_DBG_TYPE_EXTENSION, + "Got DAT_IB_COLLECTIVE_REDUCE extension call\n"); + + sbuf = va_arg(args, DAT_PVOID); + slen = va_arg(args, DAT_COUNT); + rbuf = va_arg(args, DAT_PVOID); + rlen = va_arg(args, DAT_COUNT); + op = va_arg(args, DAT_IB_COLLECTIVE_REDUCE_DATA_OP); + type = va_arg(args, DAT_IB_COLLECTIVE_DATA_TYPE); + root = va_arg(args, DAT_IB_COLLECTIVE_RANK); + context = va_arg(args, DAT_CONTEXT); + comp_flags = va_arg(args, DAT_COMPLETION_FLAGS); + + return dapli_collective_reduce(dat_handle, sbuf, slen, + rbuf, rlen, op, type, root, + context, comp_flags); + } + case DAT_IB_COLLECTIVE_ALLREDUCE_OP: + { + DAT_CONTEXT context; + DAT_PVOID sbuf, rbuf; + DAT_COUNT slen, rlen; + DAT_IB_COLLECTIVE_REDUCE_DATA_OP op; + DAT_IB_COLLECTIVE_DATA_TYPE type; + + dapl_dbg_log(DAPL_DBG_TYPE_EXTENSION, + "Got DAT_IB_COLLECTIVE_ALLREDUCE extension call\n"); + + sbuf = va_arg(args, DAT_PVOID); + slen = va_arg(args, DAT_COUNT); + rbuf = va_arg(args, DAT_PVOID); + rlen = va_arg(args, DAT_COUNT); + op = va_arg(args, DAT_IB_COLLECTIVE_REDUCE_DATA_OP); + type = va_arg(args, DAT_IB_COLLECTIVE_DATA_TYPE); + context = va_arg(args, DAT_CONTEXT); + comp_flags = va_arg(args, DAT_COMPLETION_FLAGS); + + return dapli_collective_allreduce(dat_handle, sbuf, slen, + rbuf, rlen, op, type, + context, comp_flags); + } + case DAT_IB_COLLECTIVE_ALLGATHER_OP: + { + DAT_CONTEXT context; + DAT_PVOID sbuf, rbuf; + DAT_COUNT slen, rlen; + + dapl_dbg_log(DAPL_DBG_TYPE_EXTENSION, + "Got DAT_IB_COLLECTIVE_ALLGATHER extension call\n"); + + sbuf = va_arg(args, DAT_PVOID); + slen = va_arg(args, DAT_COUNT); + rbuf = va_arg(args, DAT_PVOID); + rlen = va_arg(args, DAT_COUNT); + context = va_arg(args, DAT_CONTEXT); + comp_flags = va_arg(args, DAT_COMPLETION_FLAGS); + + return dapli_collective_allgather(dat_handle, sbuf, slen, + rbuf, rlen, context, + comp_flags); + } + case DAT_IB_COLLECTIVE_ALLGATHERV_OP: + { + DAT_CONTEXT context; + DAT_PVOID sbuf, rbuf; + DAT_COUNT slen; + DAT_COUNT *rlens; + DAT_COUNT *displs; + + dapl_dbg_log(DAPL_DBG_TYPE_EXTENSION, + "Got DAT_IB_COLLECTIVE_ALLGATHERV extension call\n"); + + sbuf = va_arg(args, DAT_PVOID); + slen = va_arg(args, DAT_COUNT); + rbuf = va_arg(args, DAT_PVOID); + rlens = va_arg(args, DAT_COUNT *); + displs = va_arg(args, DAT_COUNT *); + context = va_arg(args, DAT_CONTEXT); + comp_flags = va_arg(args, DAT_COMPLETION_FLAGS); + + return dapli_collective_allgatherv(dat_handle, sbuf, slen, + rbuf, rlens, displs, + context, comp_flags); + } + +#endif default: dapl_dbg_log(DAPL_DBG_TYPE_ERR, "unsupported extension(%d)\n", (int)ext_op);