Skip to content

Commit fadd3be

Browse files
committed
Added an initial implementation of partitioned communication.
Signed-off-by: Matthew Dosanjh <[email protected]>
1 parent 1da3f93 commit fadd3be

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+4189
-3
lines changed

.mailmap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,5 @@ Anandhi S Jayakumar <[email protected]>
113113
Mohan Gandhi <[email protected]>
114114

115115
Harumi Kuno <[email protected]>
116+
117+
Matthew G. F. Dosanjh <[email protected]>

ompi/include/mpi.h.in

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Copyright (c) 2007-2020 Cisco Systems, Inc. All rights reserved
1313
* Copyright (c) 2008-2009 Sun Microsystems, Inc. All rights reserved.
1414
* Copyright (c) 2009-2012 Oak Rigde National Laboratory. All rights reserved.
15-
* Copyright (c) 2011 Sandia National Laboratories. All rights reserved.
15+
* Copyright (c) 2011-2020 Sandia National Laboratories. All rights reserved.
1616
* Copyright (c) 2012-2018 Los Alamos National Security, LLC. All rights
1717
* reserved.
1818
* Copyright (c) 2011-2013 INRIA. All rights reserved.
@@ -1645,6 +1645,17 @@ OMPI_DECLSPEC int MPI_Isend(const void *buf, int count, MPI_Datatype datatype,
16451645
int tag, MPI_Comm comm, MPI_Request *request);
16461646
OMPI_DECLSPEC int MPI_Issend(const void *buf, int count, MPI_Datatype datatype, int dest,
16471647
int tag, MPI_Comm comm, MPI_Request *request);
1648+
OMPI_DECLSPEC int MPI_Precv_init(const void* buf, int partitions, MPI_Count count,
1649+
MPI_Datatype datatype, int source, int tag, MPI_Comm comm,
1650+
MPI_Request *request);
1651+
OMPI_DECLSPEC int MPI_Psend_init(const void* buf, int partitions, MPI_Count count,
1652+
MPI_Datatype datatype, int dest, int tag, MPI_Comm comm,
1653+
MPI_Request *request);
1654+
OMPI_DECLSPEC int MPI_Pready(int partitions, MPI_Request request);
1655+
OMPI_DECLSPEC int MPI_Pready_range(int partition_low, int partition_high,
1656+
MPI_Request request);
1657+
OMPI_DECLSPEC int MPI_Pready_list(int length, int partition_list[], MPI_Request request);
1658+
OMPI_DECLSPEC int MPI_Parrived(MPI_Request request, MPI_Count partition, int *flag);
16481659
OMPI_DECLSPEC int MPI_Is_thread_main(int *flag);
16491660
OMPI_DECLSPEC int MPI_Lookup_name(const char *service_name, MPI_Info info, char *port_name);
16501661
OMPI_DECLSPEC MPI_Fint MPI_Message_c2f(MPI_Message message);
@@ -2310,6 +2321,17 @@ OMPI_DECLSPEC int PMPI_Isend(const void *buf, int count, MPI_Datatype datatype,
23102321
int tag, MPI_Comm comm, MPI_Request *request);
23112322
OMPI_DECLSPEC int PMPI_Issend(const void *buf, int count, MPI_Datatype datatype, int dest,
23122323
int tag, MPI_Comm comm, MPI_Request *request);
2324+
OMPI_DECLSPEC int PMPI_Precv_init(const void* buf, int partitions, MPI_Count count,
2325+
MPI_Datatype datatype, int source, int tag, MPI_Comm comm,
2326+
MPI_Request *request);
2327+
OMPI_DECLSPEC int PMPI_Psend_init(const void* buf, int partitions, MPI_Count count,
2328+
MPI_Datatype datatype, int dest, int tag, MPI_Comm comm,
2329+
MPI_Request *request);
2330+
OMPI_DECLSPEC int PMPI_Pready(int partitions, MPI_Request request);
2331+
OMPI_DECLSPEC int PMPI_Pready_range(int partition_low, int partition_high,
2332+
MPI_Request request);
2333+
OMPI_DECLSPEC int PMPI_Pready_list(int length, int partition_list[], MPI_Request request);
2334+
OMPI_DECLSPEC int PMPI_Parrived(MPI_Request request, MPI_Count partition, int *flag);
23132335
OMPI_DECLSPEC int PMPI_Is_thread_main(int *flag);
23142336
OMPI_DECLSPEC int PMPI_Lookup_name(const char *service_name, MPI_Info info, char *port_name);
23152337
OMPI_DECLSPEC MPI_Fint PMPI_Message_c2f(MPI_Message message);

ompi/mca/part/Makefile.am

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#
2+
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
3+
# University Research and Technology
4+
# Corporation. All rights reserved.
5+
# Copyright (c) 2004-2005 The University of Tennessee and The University
6+
# of Tennessee Research Foundation. All rights
7+
# reserved.
8+
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
9+
# University of Stuttgart. All rights reserved.
10+
# Copyright (c) 2004-2005 The Regents of the University of California.
11+
# All rights reserved.
12+
# Copyright (c) 2010-2015 Cisco Systems, Inc. All rights reserved.
13+
# Copyright (c) 2020 Sandia National Laboratories. All rights reserved.
14+
# $COPYRIGHT$
15+
#
16+
# Additional copyrights may follow
17+
#
18+
# $HEADER$
19+
#
20+
21+
# main library setup
22+
noinst_LTLIBRARIES = libmca_part.la
23+
libmca_part_la_SOURCES =
24+
25+
# local files
26+
headers = part.h
27+
libmca_part_la_SOURCES += $(headers) $(nodist_headers)
28+
29+
# Conditionally install the header files
30+
if WANT_INSTALL_HEADERS
31+
ompidir = $(ompiincludedir)/$(subdir)
32+
nobase_ompi_HEADERS = $(headers)
33+
nobase_nodist_ompi_HEADERS = $(nodist_headers)
34+
endif
35+
36+
include base/Makefile.am
37+
38+
distclean-local:
39+
rm -f base/static-components.h

ompi/mca/part/base/Makefile.am

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#
2+
# Copyright (c) 2020 Sandia National Laboratories. All rights reserved.
3+
# $COPYRIGHT$
4+
#
5+
# Additional copyrights may follow
6+
#
7+
# $HEADER$
8+
#
9+
10+
headers += \
11+
base/base.h \
12+
base/part_base_prequest.h \
13+
base/part_base_precvreq.h \
14+
base/part_base_psendreq.h
15+
16+
libmca_part_la_SOURCES += \
17+
base/part_base_frame.c \
18+
base/part_base_precvreq.c \
19+
base/part_base_prequest.c \
20+
base/part_base_select.c \
21+
base/part_base_psendreq.c

ompi/mca/part/base/base.h

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
/* -*- Mode: C; c-basic-offset:4 ; -*- */
2+
/*
3+
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
4+
* University Research and Technology
5+
* Corporation. All rights reserved.
6+
* Copyright (c) 2004-2007 The University of Tennessee and The University
7+
* of Tennessee Research Foundation. All rights
8+
* reserved.
9+
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
10+
* University of Stuttgart. All rights reserved.
11+
* Copyright (c) 2004-2005 The Regents of the University of California.
12+
* All rights reserved.
13+
* Copyright (c) 2013 Los Alamos National Security, LLC. All rights reserved.
14+
* Copyright (c) 2020 Sandia National Laboratories. All rights reserved.
15+
* $COPYRIGHT$
16+
*
17+
* Additional copyrights may follow
18+
*
19+
* $HEADER$
20+
*/
21+
22+
#ifndef MCA_PART_BASE_H
23+
#define MCA_PART_BASE_H
24+
25+
#include "ompi_config.h"
26+
27+
#include "ompi/mca/mca.h"
28+
#include "opal/mca/base/mca_base_framework.h"
29+
#include "opal/class/opal_list.h"
30+
#include "opal/class/opal_pointer_array.h"
31+
32+
#include "ompi/mca/part/part.h"
33+
34+
/*
35+
* Global functions for PART
36+
*/
37+
38+
BEGIN_C_DECLS
39+
40+
/*
41+
* This is the base priority for a PART wrapper component
42+
* If there exists more than one then it is undefined
43+
* which one is picked.
44+
*/
45+
#define PART_SELECT_WRAPPER_PRIORITY -128
46+
47+
/*
48+
* MCA framework
49+
*/
50+
OMPI_DECLSPEC extern mca_base_framework_t ompi_part_base_framework;
51+
52+
/*
53+
* Select an available component.
54+
*/
55+
OMPI_DECLSPEC int mca_part_base_select(bool enable_progress_threads,
56+
bool enable_mpi_threads);
57+
58+
OMPI_DECLSPEC int mca_part_base_progress(void);
59+
60+
OMPI_DECLSPEC int mca_part_base_finalize(void);
61+
62+
/*
63+
* Globals
64+
*/
65+
OMPI_DECLSPEC extern mca_part_base_component_t mca_part_base_selected_component;
66+
OMPI_DECLSPEC extern mca_part_base_module_t mca_part;
67+
OMPI_DECLSPEC extern opal_pointer_array_t mca_part_base_part;
68+
69+
END_C_DECLS
70+
71+
#endif /* MCA_PART_BASE_H */

ompi/mca/part/base/part_base_frame.c

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
2+
/*
3+
* Copyright (c) 2004-2010 The Trustees of Indiana University and Indiana
4+
* University Research and Technology
5+
* Corporation. All rights reserved.
6+
* Copyright (c) 2004-2007 The University of Tennessee and The University
7+
* of Tennessee Research Foundation. All rights
8+
* reserved.
9+
* Copyright (c) 2004-2007 High Performance Computing Center Stuttgart,
10+
* University of Stuttgart. All rights reserved.
11+
* Copyright (c) 2004-2005 The Regents of the University of California.
12+
* All rights reserved.
13+
* Copyright (c) 2009 Cisco Systems, Inc. All rights reserved.
14+
* Copyright (c) 2013-2015 Los Alamos National Security, LLC. All rights
15+
* reserved.
16+
* Copyright (c) 2015 Research Organization for Information Science
17+
* and Technology (RIST). All rights reserved.
18+
* Copyright (c) 2018 IBM Corporation. All rights reserved.
19+
* Copyright (c) 2020 Intel, Inc. All rights reserved.
20+
* Copyright (c) 2020 Sandia National Laboratories. All rights reserved.
21+
* $COPYRIGHT$
22+
*
23+
* Additional copyrights may follow
24+
*
25+
* $HEADER$
26+
*/
27+
28+
29+
#include "ompi_config.h"
30+
#include <stdio.h>
31+
32+
#include <string.h>
33+
#ifdef HAVE_UNISTD_H
34+
#include <unistd.h>
35+
#endif /* HAVE_UNIST_H */
36+
#include "ompi/mca/mca.h"
37+
#include "opal/util/output.h"
38+
#include "opal/mca/base/base.h"
39+
40+
41+
#include "ompi/constants.h"
42+
#include "ompi/mca/part/part.h"
43+
#include "ompi/mca/part/base/base.h"
44+
#include "ompi/mca/part/base/part_base_prequest.h"
45+
46+
/*
47+
* The following file was created by configure. It contains extern
48+
* statements and the definition of an array of pointers to each
49+
* component's public mca_base_component_t struct.
50+
*/
51+
52+
#include "ompi/mca/part/base/static-components.h"
53+
54+
/*
55+
* This function allows modules to not declare a progress function,
56+
* by defaulting to doing nothing.
57+
*/
58+
int mca_part_base_progress(void)
59+
{
60+
return OMPI_SUCCESS;
61+
}
62+
63+
#define xstringify(part) #part
64+
#define stringify(part) xstringify(part)
65+
66+
/*
67+
* Global variables
68+
*/
69+
mca_part_base_module_t mca_part = {
70+
.part_progress = mca_part_base_progress /* part_progress */
71+
};
72+
73+
mca_part_base_component_t mca_part_base_selected_component = {{0}};
74+
opal_pointer_array_t mca_part_base_part = {{0}};
75+
76+
static int mca_part_base_register(mca_base_register_flag_t flags)
77+
{
78+
return OMPI_SUCCESS;
79+
}
80+
81+
int mca_part_base_finalize(void) {
82+
if (NULL != mca_part_base_selected_component.partm_finalize) {
83+
return mca_part_base_selected_component.partm_finalize();
84+
}
85+
return OMPI_SUCCESS;
86+
}
87+
88+
89+
static int mca_part_base_close(void)
90+
{
91+
int i, j;
92+
93+
/* unregister the progress function */
94+
if( NULL != mca_part.part_progress ) {
95+
opal_progress_unregister(mca_part.part_progress);
96+
}
97+
98+
/* reset the progress function to do nothing */
99+
mca_part.part_progress = mca_part_base_progress;
100+
101+
/* Free all the strings in the array of components */
102+
j = opal_pointer_array_get_size(&mca_part_base_part);
103+
for (i = 0; i < j; ++i) {
104+
char *str;
105+
str = (char*) opal_pointer_array_get_item(&mca_part_base_part, i);
106+
free(str);
107+
}
108+
OBJ_DESTRUCT(&mca_part_base_part);
109+
110+
OBJ_DESTRUCT(&mca_part_base_psend_requests);
111+
OBJ_DESTRUCT(&mca_part_base_precv_requests);
112+
113+
/* Close all remaining available components */
114+
return mca_base_framework_components_close(&ompi_part_base_framework, NULL);
115+
}
116+
117+
/**
118+
* Function for finding and opening either all MCA components, or the one
119+
* that was specifically requested via a MCA parameter.
120+
*/
121+
static int mca_part_base_open(mca_base_open_flag_t flags)
122+
{
123+
OBJ_CONSTRUCT(&mca_part_base_part, opal_pointer_array_t);
124+
125+
126+
OBJ_CONSTRUCT(&mca_part_base_psend_requests, opal_free_list_t);
127+
OBJ_CONSTRUCT(&mca_part_base_precv_requests, opal_free_list_t);
128+
/* Open up all available components */
129+
130+
if (OPAL_SUCCESS !=
131+
mca_base_framework_components_open(&ompi_part_base_framework, flags)) {
132+
return OMPI_ERROR;
133+
}
134+
135+
/* Set a sentinel in case we don't select any components (e.g.,
136+
ompi_info) */
137+
138+
mca_part_base_selected_component.partm_finalize = NULL;
139+
140+
/* Currently this uses a default with no selection criteria as there is only 1 module. */
141+
opal_pointer_array_add(&mca_part_base_part, strdup("persist"));
142+
143+
return OMPI_SUCCESS;
144+
}
145+
146+
MCA_BASE_FRAMEWORK_DECLARE(ompi, part, "OMPI PART", mca_part_base_register,
147+
mca_part_base_open, mca_part_base_close,
148+
mca_part_base_static_components, 0);
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
3+
* University Research and Technology
4+
* Corporation. All rights reserved.
5+
* Copyright (c) 2004-2007 The University of Tennessee and The University
6+
* of Tennessee Research Foundation. All rights
7+
* reserved.
8+
* Copyright (c) 2004-2007 High Performance Computing Center Stuttgart,
9+
* University of Stuttgart. All rights reserved.
10+
* Copyright (c) 2004-2005 The Regents of the University of California.
11+
* All rights reserved.
12+
* Copyright (c) 2020 Sandia National Laboratories. All rights reserved.
13+
* $COPYRIGHT$
14+
*
15+
* Additional copyrights may follow
16+
*
17+
* $HEADER$
18+
*/
19+
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
20+
21+
#include "ompi_config.h"
22+
#include "ompi/types.h"
23+
#include "ompi/mca/part/part.h"
24+
#include "ompi/mca/part/base/part_base_precvreq.h"
25+
26+
27+
static void mca_part_base_precv_request_construct(mca_part_base_precv_request_t* request)
28+
{
29+
OBJ_CONSTRUCT(&request->req_base.req_convertor, opal_convertor_t);
30+
}
31+
32+
33+
/* For each request the convertor get cleaned after each message
34+
* (in the base _FINI macro). Therefore, as the convertor is a static object
35+
* we don't have to call OBJ_DESTRUCT here.
36+
*/
37+
38+
OBJ_CLASS_INSTANCE(
39+
mca_part_base_precv_request_t,
40+
mca_part_base_prequest_t,
41+
mca_part_base_precv_request_construct,
42+
0
43+
);
44+
45+

0 commit comments

Comments
 (0)