Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
mshanthagit authored Jul 19, 2024
2 parents 8ccb15c + a6d5b36 commit 771ac61
Show file tree
Hide file tree
Showing 23 changed files with 719 additions and 161 deletions.
9 changes: 8 additions & 1 deletion docs/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,14 @@ ALL_MAN_BUILT = \
# built HTML and man docs into a separate location that is included in
# the tarball. This gives users a fully copy of the docs included in
# distribution tarballs.
html: $(ALL_MAN_BUILT)
#
# Note: we name this "html-local" because otherwise Automake issues a
# warning about us overriding its default "html" target. In our
# particular use case, the rules generated if we name this target
# "html-local" instead of "html" are effectively equivalent to when we
# name this target "html", so we might as well avoid the Automake
# warning.
html-local: $(ALL_MAN_BUILT)
$(OMPI_V_COPYALL) rm -rf html; cp -rp $(OUTDIR)/html .

man: $(ALL_MAN_BUILT)
Expand Down
13 changes: 11 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ def read_version_file(path):
if not os.path.exists(path):
print(f"ERROR: Unable to find file {path}")
exit(1)

with open(path) as fp:
version_lines = fp.readlines()

data = dict()
for line in version_lines:
if '#' in line:
Expand Down Expand Up @@ -129,6 +129,15 @@ def get_tarball_version(path, expr):
if key in os.environ and os.environ[key] == 'True':
print("OMPI: found ReadTheDocs build environment")

# Tell Jinja2 templates the build is running on Read the Docs
if "html_context" not in globals():
html_context = {}
html_context["READTHEDOCS"] = True

# Define the canonical URL if you are using a custom domain on
# Read the Docs
html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "")

rtd_v = os.environ['READTHEDOCS_VERSION']
if os.environ['READTHEDOCS_VERSION_TYPE'] == 'external':
# Make "release" be shorter than the full "ompi_ver" value.
Expand Down
6 changes: 1 addition & 5 deletions ompi/communicator/communicator.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
* Copyright (c) 2018-2024 Triad National Security, LLC. All rights
* reserved.
* Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved.
* Copyright (c) 2024 NVIDIA Corporation. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -613,11 +614,6 @@ static inline struct ompi_proc_t* ompi_comm_peer_lookup (const ompi_communicator
return ompi_group_peer_lookup(comm->c_remote_group,peer_id);
}

static inline bool ompi_comm_instances_same(const ompi_communicator_t *comm1, const ompi_communicator_t *comm2)
{
return comm1->instance == comm2->instance;
}

#if OPAL_ENABLE_FT_MPI
/*
* Support for MPI_ANY_SOURCE point-to-point operations
Expand Down
3 changes: 2 additions & 1 deletion ompi/mca/coll/han/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright (c) 2018-2020 The University of Tennessee and The University
# of Tennessee Research Foundation. All rights
# reserved.
# Copyright (c) 2022 Amazon.com, Inc. or its affiliates. All Rights reserved.
# Copyright (c) 2024 Amazon.com, Inc. or its affiliates. All Rights reserved.
# Copyright (c) 2022 BULL S.A.S. All rights reserved.
# $COPYRIGHT$
#
Expand All @@ -15,6 +15,7 @@ sources = \
coll_han.h \
coll_han_trigger.h \
coll_han_algorithms.h \
coll_han_alltoall.c \
coll_han_dynamic.h \
coll_han_dynamic_file.h \
coll_han_barrier.c \
Expand Down
34 changes: 34 additions & 0 deletions ompi/mca/coll/han/coll_han.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#include "mpi.h"
#include "ompi/mca/mca.h"
#include "opal/util/output.h"
#include "opal/mca/smsc/smsc.h"
#include "ompi/mca/coll/base/coll_base_functions.h"
#include "coll_han_trigger.h"
#include "ompi/mca/coll/han/coll_han_dynamic.h"
Expand Down Expand Up @@ -197,6 +198,7 @@ typedef struct mca_coll_han_op_module_name_t {
mca_coll_han_op_up_low_module_name_t gatherv;
mca_coll_han_op_up_low_module_name_t scatter;
mca_coll_han_op_up_low_module_name_t scatterv;
mca_coll_han_op_up_low_module_name_t alltoall;
} mca_coll_han_op_module_name_t;

/**
Expand Down Expand Up @@ -252,6 +254,13 @@ typedef struct mca_coll_han_component_t {
uint32_t han_scatterv_up_module;
/* low level module for scatterv */
uint32_t han_scatterv_low_module;

/* low level module for alltoall */
uint32_t han_alltoall_low_module;
/* alltoall: parallel stages */
int32_t han_alltoall_pstages;


/* name of the modules */
mca_coll_han_op_module_name_t han_op_module_name;
/* whether we need reproducible results
Expand Down Expand Up @@ -287,6 +296,7 @@ typedef struct mca_coll_han_single_collective_fallback_s
{
union
{
mca_coll_base_module_alltoall_fn_t alltoall;
mca_coll_base_module_allgather_fn_t allgather;
mca_coll_base_module_allgatherv_fn_t allgatherv;
mca_coll_base_module_allreduce_fn_t allreduce;
Expand All @@ -308,6 +318,7 @@ typedef struct mca_coll_han_single_collective_fallback_s
*/
typedef struct mca_coll_han_collectives_fallback_s
{
mca_coll_han_single_collective_fallback_t alltoall;
mca_coll_han_single_collective_fallback_t allgather;
mca_coll_han_single_collective_fallback_t allgatherv;
mca_coll_han_single_collective_fallback_t allreduce;
Expand Down Expand Up @@ -370,6 +381,9 @@ OBJ_CLASS_DECLARATION(mca_coll_han_module_t);
* Some defines to stick to the naming used in the other components in terms of
* fallback routines
*/
#define previous_alltoall fallback.alltoall.alltoall
#define previous_alltoall_module fallback.alltoall.module

#define previous_allgather fallback.allgather.allgather
#define previous_allgather_module fallback.allgather.module

Expand Down Expand Up @@ -425,6 +439,7 @@ OBJ_CLASS_DECLARATION(mca_coll_han_module_t);
HAN_UNINSTALL_COLL_API(COMM, HANM, allreduce); \
HAN_UNINSTALL_COLL_API(COMM, HANM, allgather); \
HAN_UNINSTALL_COLL_API(COMM, HANM, allgatherv); \
HAN_UNINSTALL_COLL_API(COMM, HANM, alltoall); \
han_module->enabled = false; /* entire module set to pass-through from now on */ \
} while(0)

Expand Down Expand Up @@ -485,6 +500,9 @@ mca_coll_han_get_all_coll_modules(struct ompi_communicator_t *comm,
mca_coll_han_module_t *han_module);

int
mca_coll_han_alltoall_intra_dynamic(ALLTOALL_BASE_ARGS,
mca_coll_base_module_t *module);
int
mca_coll_han_allgather_intra_dynamic(ALLGATHER_BASE_ARGS,
mca_coll_base_module_t *module);
int
Expand Down Expand Up @@ -532,4 +550,20 @@ coll_han_utils_gcd(const uint64_t *numerators, const size_t size);
int
coll_han_utils_create_contiguous_datatype(size_t count, const ompi_datatype_t *oldType,
ompi_datatype_t **newType);

static inline struct mca_smsc_endpoint_t *mca_coll_han_get_smsc_endpoint (struct ompi_proc_t *proc) {
extern opal_mutex_t mca_coll_han_lock;
if (NULL == proc->proc_endpoints[OMPI_PROC_ENDPOINT_TAG_SMSC]) {
if (NULL == proc->proc_endpoints[OMPI_PROC_ENDPOINT_TAG_SMSC]) {
OPAL_THREAD_LOCK(&mca_coll_han_lock);
if (NULL == proc->proc_endpoints[OMPI_PROC_ENDPOINT_TAG_SMSC]) {
proc->proc_endpoints[OMPI_PROC_ENDPOINT_TAG_SMSC] = mca_smsc->get_endpoint(&proc->super);
}
OPAL_THREAD_UNLOCK(&mca_coll_han_lock);
}
}

return (struct mca_smsc_endpoint_t *) proc->proc_endpoints[OMPI_PROC_ENDPOINT_TAG_SMSC];
}

#endif /* MCA_COLL_HAN_EXPORT_H */
5 changes: 5 additions & 0 deletions ompi/mca/coll/han/coll_han_algorithms.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2020-2022 Bull S.A.S. All rights reserved.
* Copyright (c) 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* $COPYRIGHT$
*
Expand Down Expand Up @@ -77,6 +78,10 @@ mca_coll_han_algorithm_value_t* mca_coll_han_available_algorithms[COLLCOUNT] =
{"simple", (fnptr_t)&mca_coll_han_allgather_intra_simple}, // 2-level
{ 0 }
},
[ALLTOALL] = (mca_coll_han_algorithm_value_t[]){
{"smsc", (fnptr_t)&mca_coll_han_alltoall_using_smsc}, // 2-level
{ 0 }
},
};

int
Expand Down
7 changes: 7 additions & 0 deletions ompi/mca/coll/han/coll_han_algorithms.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2020-2022 Bull S.A.S. All rights reserved.
* Copyright (c) 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* $COPYRIGHT$
*
Expand Down Expand Up @@ -208,4 +209,10 @@ mca_coll_han_allgather_intra_simple(const void *sbuf, size_t scount,
struct ompi_communicator_t *comm,
mca_coll_base_module_t *module);

/* Alltoall */
int
mca_coll_han_alltoall_using_smsc(ALLTOALL_BASE_ARGS,
mca_coll_base_module_t *module);


#endif
Loading

0 comments on commit 771ac61

Please sign in to comment.