Skip to content

Commit 34c4a30

Browse files
author
Luke Robison
committed
coll/han: require smsc endpoint
This will allow HAN collectives to check for and use SMSC methods to direct-map peer memory during on-node communication. Signed-off-by: Luke Robison <lrbison@amazon.com>
1 parent 1fcd730 commit 34c4a30

File tree

3 files changed

+40
-0
lines changed

3 files changed

+40
-0
lines changed

ompi/mca/coll/han/coll_han.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
#include "mpi.h"
4343
#include "ompi/mca/mca.h"
4444
#include "opal/util/output.h"
45+
#include "opal/mca/smsc/smsc.h"
4546
#include "ompi/mca/coll/base/coll_base_functions.h"
4647
#include "coll_han_trigger.h"
4748
#include "ompi/mca/coll/han/coll_han_dynamic.h"
@@ -532,4 +533,20 @@ coll_han_utils_gcd(const uint64_t *numerators, const size_t size);
532533
int
533534
coll_han_utils_create_contiguous_datatype(size_t count, const ompi_datatype_t *oldType,
534535
ompi_datatype_t **newType);
536+
537+
static inline struct mca_smsc_endpoint_t *mca_coll_han_get_smsc_endpoint (struct ompi_proc_t *proc) {
538+
extern opal_mutex_t mca_coll_han_lock;
539+
if (NULL == proc->proc_endpoints[OMPI_PROC_ENDPOINT_TAG_SMSC]) {
540+
if (NULL == proc->proc_endpoints[OMPI_PROC_ENDPOINT_TAG_SMSC]) {
541+
OPAL_THREAD_LOCK(&mca_coll_han_lock);
542+
if (NULL == proc->proc_endpoints[OMPI_PROC_ENDPOINT_TAG_SMSC]) {
543+
proc->proc_endpoints[OMPI_PROC_ENDPOINT_TAG_SMSC] = mca_smsc->get_endpoint(&proc->super);
544+
}
545+
OPAL_THREAD_UNLOCK(&mca_coll_han_lock);
546+
}
547+
}
548+
549+
return (struct mca_smsc_endpoint_t *) proc->proc_endpoints[OMPI_PROC_ENDPOINT_TAG_SMSC];
550+
}
551+
535552
#endif /* MCA_COLL_HAN_EXPORT_H */

ompi/mca/coll/han/coll_han_component.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ ompi_coll_han_components ompi_coll_han_available_components[COMPONENTS_COUNT] =
4949
{ XHC, "xhc" }
5050
};
5151

52+
/*
53+
* Thread lock for han
54+
*/
55+
opal_mutex_t mca_coll_han_lock = OPAL_MUTEX_STATIC_INIT;
56+
5257
/*
5358
* Local functions
5459
*/

ompi/mca/coll/han/configure.m4

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# -*- autoconf -*-
2+
#
3+
# Copyright (c) 2022 Amazon.com, Inc. or its affiliates. All Rights reserved.
4+
# $COPYRIGHT$
5+
#
6+
# Additional copyrights may follow
7+
#
8+
# $HEADER$
9+
#
10+
11+
AC_DEFUN([MCA_ompi_coll_han_CONFIG],[
12+
AC_CONFIG_FILES([ompi/mca/coll/han/Makefile])
13+
$1
14+
])dnl
15+
16+
AC_DEFUN([MCA_ompi_coll_han_POST_CONFIG], [
17+
OMPI_REQUIRE_ENDPOINT_TAG([SMSC])
18+
])dnl

0 commit comments

Comments
 (0)