Skip to content

Commit 771ac61

Browse files
authored
Merge branch 'main' into main
2 parents 8ccb15c + a6d5b36 commit 771ac61

23 files changed

+719
-161
lines changed

docs/Makefile.am

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,14 @@ ALL_MAN_BUILT = \
881881
# built HTML and man docs into a separate location that is included in
882882
# the tarball. This gives users a fully copy of the docs included in
883883
# distribution tarballs.
884-
html: $(ALL_MAN_BUILT)
884+
#
885+
# Note: we name this "html-local" because otherwise Automake issues a
886+
# warning about us overriding its default "html" target. In our
887+
# particular use case, the rules generated if we name this target
888+
# "html-local" instead of "html" are effectively equivalent to when we
889+
# name this target "html", so we might as well avoid the Automake
890+
# warning.
891+
html-local: $(ALL_MAN_BUILT)
885892
$(OMPI_V_COPYALL) rm -rf html; cp -rp $(OUTDIR)/html .
886893

887894
man: $(ALL_MAN_BUILT)

docs/conf.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ def read_version_file(path):
3737
if not os.path.exists(path):
3838
print(f"ERROR: Unable to find file {path}")
3939
exit(1)
40-
40+
4141
with open(path) as fp:
4242
version_lines = fp.readlines()
43-
43+
4444
data = dict()
4545
for line in version_lines:
4646
if '#' in line:
@@ -129,6 +129,15 @@ def get_tarball_version(path, expr):
129129
if key in os.environ and os.environ[key] == 'True':
130130
print("OMPI: found ReadTheDocs build environment")
131131

132+
# Tell Jinja2 templates the build is running on Read the Docs
133+
if "html_context" not in globals():
134+
html_context = {}
135+
html_context["READTHEDOCS"] = True
136+
137+
# Define the canonical URL if you are using a custom domain on
138+
# Read the Docs
139+
html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "")
140+
132141
rtd_v = os.environ['READTHEDOCS_VERSION']
133142
if os.environ['READTHEDOCS_VERSION_TYPE'] == 'external':
134143
# Make "release" be shorter than the full "ompi_ver" value.

ompi/communicator/communicator.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
* Copyright (c) 2018-2024 Triad National Security, LLC. All rights
2626
* reserved.
2727
* Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved.
28+
* Copyright (c) 2024 NVIDIA Corporation. All rights reserved.
2829
* $COPYRIGHT$
2930
*
3031
* Additional copyrights may follow
@@ -613,11 +614,6 @@ static inline struct ompi_proc_t* ompi_comm_peer_lookup (const ompi_communicator
613614
return ompi_group_peer_lookup(comm->c_remote_group,peer_id);
614615
}
615616

616-
static inline bool ompi_comm_instances_same(const ompi_communicator_t *comm1, const ompi_communicator_t *comm2)
617-
{
618-
return comm1->instance == comm2->instance;
619-
}
620-
621617
#if OPAL_ENABLE_FT_MPI
622618
/*
623619
* Support for MPI_ANY_SOURCE point-to-point operations

ompi/mca/coll/han/Makefile.am

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Copyright (c) 2018-2020 The University of Tennessee and The University
33
# of Tennessee Research Foundation. All rights
44
# reserved.
5-
# Copyright (c) 2022 Amazon.com, Inc. or its affiliates. All Rights reserved.
5+
# Copyright (c) 2024 Amazon.com, Inc. or its affiliates. All Rights reserved.
66
# Copyright (c) 2022 BULL S.A.S. All rights reserved.
77
# $COPYRIGHT$
88
#
@@ -15,6 +15,7 @@ sources = \
1515
coll_han.h \
1616
coll_han_trigger.h \
1717
coll_han_algorithms.h \
18+
coll_han_alltoall.c \
1819
coll_han_dynamic.h \
1920
coll_han_dynamic_file.h \
2021
coll_han_barrier.c \

ompi/mca/coll/han/coll_han.h

Lines changed: 34 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"
@@ -197,6 +198,7 @@ typedef struct mca_coll_han_op_module_name_t {
197198
mca_coll_han_op_up_low_module_name_t gatherv;
198199
mca_coll_han_op_up_low_module_name_t scatter;
199200
mca_coll_han_op_up_low_module_name_t scatterv;
201+
mca_coll_han_op_up_low_module_name_t alltoall;
200202
} mca_coll_han_op_module_name_t;
201203

202204
/**
@@ -252,6 +254,13 @@ typedef struct mca_coll_han_component_t {
252254
uint32_t han_scatterv_up_module;
253255
/* low level module for scatterv */
254256
uint32_t han_scatterv_low_module;
257+
258+
/* low level module for alltoall */
259+
uint32_t han_alltoall_low_module;
260+
/* alltoall: parallel stages */
261+
int32_t han_alltoall_pstages;
262+
263+
255264
/* name of the modules */
256265
mca_coll_han_op_module_name_t han_op_module_name;
257266
/* whether we need reproducible results
@@ -287,6 +296,7 @@ typedef struct mca_coll_han_single_collective_fallback_s
287296
{
288297
union
289298
{
299+
mca_coll_base_module_alltoall_fn_t alltoall;
290300
mca_coll_base_module_allgather_fn_t allgather;
291301
mca_coll_base_module_allgatherv_fn_t allgatherv;
292302
mca_coll_base_module_allreduce_fn_t allreduce;
@@ -308,6 +318,7 @@ typedef struct mca_coll_han_single_collective_fallback_s
308318
*/
309319
typedef struct mca_coll_han_collectives_fallback_s
310320
{
321+
mca_coll_han_single_collective_fallback_t alltoall;
311322
mca_coll_han_single_collective_fallback_t allgather;
312323
mca_coll_han_single_collective_fallback_t allgatherv;
313324
mca_coll_han_single_collective_fallback_t allreduce;
@@ -370,6 +381,9 @@ OBJ_CLASS_DECLARATION(mca_coll_han_module_t);
370381
* Some defines to stick to the naming used in the other components in terms of
371382
* fallback routines
372383
*/
384+
#define previous_alltoall fallback.alltoall.alltoall
385+
#define previous_alltoall_module fallback.alltoall.module
386+
373387
#define previous_allgather fallback.allgather.allgather
374388
#define previous_allgather_module fallback.allgather.module
375389

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

@@ -485,6 +500,9 @@ mca_coll_han_get_all_coll_modules(struct ompi_communicator_t *comm,
485500
mca_coll_han_module_t *han_module);
486501

487502
int
503+
mca_coll_han_alltoall_intra_dynamic(ALLTOALL_BASE_ARGS,
504+
mca_coll_base_module_t *module);
505+
int
488506
mca_coll_han_allgather_intra_dynamic(ALLGATHER_BASE_ARGS,
489507
mca_coll_base_module_t *module);
490508
int
@@ -532,4 +550,20 @@ coll_han_utils_gcd(const uint64_t *numerators, const size_t size);
532550
int
533551
coll_han_utils_create_contiguous_datatype(size_t count, const ompi_datatype_t *oldType,
534552
ompi_datatype_t **newType);
553+
554+
static inline struct mca_smsc_endpoint_t *mca_coll_han_get_smsc_endpoint (struct ompi_proc_t *proc) {
555+
extern opal_mutex_t mca_coll_han_lock;
556+
if (NULL == proc->proc_endpoints[OMPI_PROC_ENDPOINT_TAG_SMSC]) {
557+
if (NULL == proc->proc_endpoints[OMPI_PROC_ENDPOINT_TAG_SMSC]) {
558+
OPAL_THREAD_LOCK(&mca_coll_han_lock);
559+
if (NULL == proc->proc_endpoints[OMPI_PROC_ENDPOINT_TAG_SMSC]) {
560+
proc->proc_endpoints[OMPI_PROC_ENDPOINT_TAG_SMSC] = mca_smsc->get_endpoint(&proc->super);
561+
}
562+
OPAL_THREAD_UNLOCK(&mca_coll_han_lock);
563+
}
564+
}
565+
566+
return (struct mca_smsc_endpoint_t *) proc->proc_endpoints[OMPI_PROC_ENDPOINT_TAG_SMSC];
567+
}
568+
535569
#endif /* MCA_COLL_HAN_EXPORT_H */

ompi/mca/coll/han/coll_han_algorithms.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
22
/*
33
* Copyright (c) 2020-2022 Bull S.A.S. All rights reserved.
4+
* Copyright (c) 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
45
*
56
* $COPYRIGHT$
67
*
@@ -77,6 +78,10 @@ mca_coll_han_algorithm_value_t* mca_coll_han_available_algorithms[COLLCOUNT] =
7778
{"simple", (fnptr_t)&mca_coll_han_allgather_intra_simple}, // 2-level
7879
{ 0 }
7980
},
81+
[ALLTOALL] = (mca_coll_han_algorithm_value_t[]){
82+
{"smsc", (fnptr_t)&mca_coll_han_alltoall_using_smsc}, // 2-level
83+
{ 0 }
84+
},
8085
};
8186

8287
int

ompi/mca/coll/han/coll_han_algorithms.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
22
/*
33
* Copyright (c) 2020-2022 Bull S.A.S. All rights reserved.
4+
* Copyright (c) 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
45
*
56
* $COPYRIGHT$
67
*
@@ -208,4 +209,10 @@ mca_coll_han_allgather_intra_simple(const void *sbuf, size_t scount,
208209
struct ompi_communicator_t *comm,
209210
mca_coll_base_module_t *module);
210211

212+
/* Alltoall */
213+
int
214+
mca_coll_han_alltoall_using_smsc(ALLTOALL_BASE_ARGS,
215+
mca_coll_base_module_t *module);
216+
217+
211218
#endif

0 commit comments

Comments
 (0)