Skip to content

Commit fb6c2dd

Browse files
dsoltmarkalle
authored andcommitted
Major structural changes to data types: .super infosubscriber
ompi_communicator_t, ompi_win_t, ompi_file_t all have a super class of type opal_infosubscriber_t instead of a base/super type of opal_object_t (in previous code comm used c_base, but file used super). It may be a bit bold to say that being a subscriber of MPI_Info is the foundational piece that ties these three things together, but if you object, then I would prefer to turn infosubscriber into a more general name that encompasses other common features rather than create a different super class. The key here is that we want to be able to pass comm, win and file objects as if they were opal_infosubscriber_t, so that one routine can heandle all 3 types of objects being passed to it. MPI_INFO_NULL is still an ompi_predefined_info_t type since an MPI_Info is part of ompi but the internal details of the underlying information concept is part of opal. An ompi_info_t type still exists for exposure to the user, but it is simply a wrapper for the opal object. Routines such as ompi_info_dup, etc have all been moved to opal_info_dup and related to the opal directory. Fortran to C translation tables are only used for MPI_Info that is exposed to the application and are therefore part of the ompi_info_t and not the opal_info_t The data structure changes are primarily in the following files: communicator/communicator.h ompi/info/info.h ompi/win/win.h ompi/file/file.h The following new files were created: opal/util/info.h opal/util/info.c opal/util/info_subscriber.h opal/util/info_subscriber.c This infosubscriber concept is that communicators, files and windows can have subscribers that subscribe to any changes in the info associated with the comm/file/window. When xxx_set_info is called, the new info is presented to each subscriber who can modify the info in any way they want. The new value is presented to the next subscriber and so on until all subscribers have had a chance to modify the value. Therefore, the order of subscribers can make a difference but we hope that there is generally only one subscriber that cares or modifies any given key/value pair. The final info is then stored and returned by a call to xxx_get_info. The new model can be seen in the following files: ompi/mpi/c/comm_get_info.c ompi/mpi/c/comm_set_info.c ompi/mpi/c/file_get_info.c ompi/mpi/c/file_set_info.c ompi/mpi/c/win_get_info.c ompi/mpi/c/win_set_info.c The current subscribers where changed as follows: mca/io/ompio/io_ompio_file_open.c mca/io/ompio/io_ompio_module.c mca/osc/rmda/osc_rdma_component.c (This one actually subscribes to "no_locks") mca/osc/sm/osc_sm_component.c (This one actually subscribes to "blocking_fence" and "alloc_shared_contig") Signed-off-by: Mark Allen <[email protected]> Conflicts: AUTHORS ompi/communicator/comm.c ompi/debuggers/ompi_mpihandles_dll.c ompi/file/file.c ompi/file/file.h ompi/info/info.c ompi/mca/io/ompio/io_ompio.h ompi/mca/io/ompio/io_ompio_file_open.c ompi/mca/io/ompio/io_ompio_file_set_view.c ompi/mca/osc/pt2pt/osc_pt2pt.h ompi/mca/sharedfp/addproc/sharedfp_addproc.h ompi/mca/sharedfp/addproc/sharedfp_addproc_file_open.c ompi/mca/topo/treematch/topo_treematch_dist_graph_create.c ompi/mpi/c/lookup_name.c ompi/mpi/c/publish_name.c ompi/mpi/c/unpublish_name.c opal/mca/mpool/base/mpool_base_alloc.c opal/util/Makefile.am
1 parent 17a34b4 commit fb6c2dd

File tree

100 files changed

+1686
-1116
lines changed

Some content is hidden

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

100 files changed

+1686
-1116
lines changed

AUTHORS

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ Github.com pull request). Note that these email addresses are not
88
guaranteed to be current; they are simply a unique indicator of the
99
individual who committed them.
1010

11-
-----
1211

1312
Abhishek Joshi, Broadcom
1413
@@ -85,6 +84,8 @@ Dave Goodell, Cisco
8584
8685
David Daniel, Los Alamos National Laboratory
8786
87+
David Solt, IBM
88+
8889
Denis Dimick, Los Alamos National Laboratory
8990
9091
Devendar Bureddy, Mellanox

ompi/communicator/comm.c

+6-5
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
* and Technology (RIST). All rights reserved.
2323
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
2424
* Copyright (c) 2015 Mellanox Technologies. All rights reserved.
25+
* Copyright (c) 2016 IBM Corp. All rights reserved.
2526
* $COPYRIGHT$
2627
*
2728
* Additional copyrights may follow
@@ -86,7 +87,7 @@ static int ompi_comm_copy_topo (ompi_communicator_t *oldcomm,
8687

8788
/* idup with local group and info. the local group support is provided to support ompi_comm_set_nb */
8889
static int ompi_comm_idup_internal (ompi_communicator_t *comm, ompi_group_t *group, ompi_group_t *remote_group,
89-
ompi_info_t *info, ompi_communicator_t **newcomm, ompi_request_t **req);
90+
opal_info_t *info, ompi_communicator_t **newcomm, ompi_request_t **req);
9091

9192

9293
/**********************************************************************/
@@ -787,7 +788,7 @@ static int ompi_comm_split_verify (ompi_communicator_t *comm, int split_type, in
787788
}
788789

789790
int ompi_comm_split_type (ompi_communicator_t *comm, int split_type, int key,
790-
ompi_info_t *info, ompi_communicator_t **newcomm)
791+
opal_info_t *info, ompi_communicator_t **newcomm)
791792
{
792793
bool need_split = false, no_reorder = false, no_undefined = false;
793794
ompi_communicator_t *newcomp = MPI_COMM_NULL;
@@ -972,7 +973,7 @@ int ompi_comm_dup ( ompi_communicator_t * comm, ompi_communicator_t **newcomm )
972973
/**********************************************************************/
973974
/**********************************************************************/
974975
/**********************************************************************/
975-
int ompi_comm_dup_with_info ( ompi_communicator_t * comm, ompi_info_t *info, ompi_communicator_t **newcomm )
976+
int ompi_comm_dup_with_info ( ompi_communicator_t * comm, opal_info_t *info, ompi_communicator_t **newcomm )
976977
{
977978
ompi_communicator_t *newcomp = NULL;
978979
ompi_group_t *remote_group = NULL;
@@ -1042,14 +1043,14 @@ int ompi_comm_idup (ompi_communicator_t *comm, ompi_communicator_t **newcomm, om
10421043
return ompi_comm_idup_with_info (comm, NULL, newcomm, req);
10431044
}
10441045

1045-
int ompi_comm_idup_with_info (ompi_communicator_t *comm, ompi_info_t *info, ompi_communicator_t **newcomm, ompi_request_t **req)
1046+
int ompi_comm_idup_with_info (ompi_communicator_t *comm, opal_info_t *info, ompi_communicator_t **newcomm, ompi_request_t **req)
10461047
{
10471048
return ompi_comm_idup_internal (comm, comm->c_local_group, comm->c_remote_group, info, newcomm, req);
10481049
}
10491050

10501051
/* NTH: we need a way to idup with a smaller local group so this function takes a local group */
10511052
static int ompi_comm_idup_internal (ompi_communicator_t *comm, ompi_group_t *group, ompi_group_t *remote_group,
1052-
ompi_info_t *info, ompi_communicator_t **newcomm, ompi_request_t **req)
1053+
opal_info_t *info, ompi_communicator_t **newcomm, ompi_request_t **req)
10531054
{
10541055
ompi_comm_idup_with_info_context_t *context;
10551056
ompi_comm_request_t *request;

ompi/communicator/comm_init.c

+6-4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
* Copyright (c) 2015 Research Organization for Information Science
2222
* and Technology (RIST). All rights reserved.
2323
* Copyright (c) 2015 Intel, Inc. All rights reserved.
24+
* Copyright (c) 2016 IBM Corp. All rights reserved.
2425
* $COPYRIGHT$
2526
*
2627
* Additional copyrights may follow
@@ -33,6 +34,7 @@
3334
#include <stdio.h>
3435

3536
#include "opal/util/bit_ops.h"
37+
#include "opal/util/info_subscriber.h"
3638
#include "ompi/constants.h"
3739
#include "ompi/mca/pml/pml.h"
3840
#include "ompi/mca/coll/base/base.h"
@@ -52,9 +54,9 @@
5254
opal_pointer_array_t ompi_mpi_communicators = {{0}};
5355
opal_pointer_array_t ompi_comm_f_to_c_table = {{0}};
5456

55-
ompi_predefined_communicator_t ompi_mpi_comm_world = {{{0}}};
56-
ompi_predefined_communicator_t ompi_mpi_comm_self = {{{0}}};
57-
ompi_predefined_communicator_t ompi_mpi_comm_null = {{{0}}};
57+
ompi_predefined_communicator_t ompi_mpi_comm_world = {{{{0}}}};
58+
ompi_predefined_communicator_t ompi_mpi_comm_self = {{{{0}}}};
59+
ompi_predefined_communicator_t ompi_mpi_comm_null = {{{{0}}}};
5860
ompi_communicator_t *ompi_mpi_comm_parent = NULL;
5961

6062
ompi_predefined_communicator_t *ompi_mpi_comm_world_addr =
@@ -67,7 +69,7 @@ ompi_predefined_communicator_t *ompi_mpi_comm_null_addr =
6769
static void ompi_comm_construct(ompi_communicator_t* comm);
6870
static void ompi_comm_destruct(ompi_communicator_t* comm);
6971

70-
OBJ_CLASS_INSTANCE(ompi_communicator_t, opal_object_t,
72+
OBJ_CLASS_INSTANCE(ompi_communicator_t, opal_infosubscriber_t,
7173
ompi_comm_construct,
7274
ompi_comm_destruct);
7375

ompi/communicator/communicator.h

+6-4
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333

3434
#include "ompi_config.h"
3535
#include "opal/class/opal_object.h"
36+
#include "opal/class/opal_hash_table.h"
37+
#include "opal/util/info_subscriber.h"
3638
#include "ompi/errhandler/errhandler.h"
3739
#include "opal/threads/mutex.h"
3840
#include "ompi/communicator/comm_request.h"
@@ -116,7 +118,7 @@ OMPI_DECLSPEC extern opal_pointer_array_t ompi_mpi_communicators;
116118
OMPI_DECLSPEC extern opal_pointer_array_t ompi_comm_f_to_c_table;
117119

118120
struct ompi_communicator_t {
119-
opal_object_t c_base;
121+
opal_infosubscriber_t super;
120122
opal_mutex_t c_lock; /* mutex for name and potentially
121123
attributes */
122124
char c_name[MPI_MAX_OBJECT_NAME];
@@ -442,7 +444,7 @@ OMPI_DECLSPEC int ompi_comm_split (ompi_communicator_t *comm, int color, int key
442444
*/
443445
OMPI_DECLSPEC int ompi_comm_split_type(ompi_communicator_t *comm,
444446
int split_type, int key,
445-
struct ompi_info_t *info,
447+
struct opal_info_t *info,
446448
ompi_communicator_t** newcomm);
447449

448450
/**
@@ -473,7 +475,7 @@ OMPI_DECLSPEC int ompi_comm_idup (ompi_communicator_t *comm, ompi_communicator_t
473475
* @param comm: input communicator
474476
* @param newcomm: the new communicator or MPI_COMM_NULL if any error is detected.
475477
*/
476-
OMPI_DECLSPEC int ompi_comm_dup_with_info (ompi_communicator_t *comm, ompi_info_t *info, ompi_communicator_t **newcomm);
478+
OMPI_DECLSPEC int ompi_comm_dup_with_info (ompi_communicator_t *comm, opal_info_t *info, ompi_communicator_t **newcomm);
477479

478480
/**
479481
* dup a communicator (non-blocking) with info.
@@ -483,7 +485,7 @@ OMPI_DECLSPEC int ompi_comm_dup_with_info (ompi_communicator_t *comm, ompi_info_
483485
* @param comm: input communicator
484486
* @param newcomm: the new communicator or MPI_COMM_NULL if any error is detected.
485487
*/
486-
OMPI_DECLSPEC int ompi_comm_idup_with_info (ompi_communicator_t *comm, ompi_info_t *info, ompi_communicator_t **newcomm, ompi_request_t **req);
488+
OMPI_DECLSPEC int ompi_comm_idup_with_info (ompi_communicator_t *comm, opal_info_t *info, ompi_communicator_t **newcomm, ompi_request_t **req);
487489

488490
/**
489491
* compare two communicators.

ompi/debuggers/ompi_mpihandles_dll.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* Copyright (c) 2012-2013 Inria. All rights reserved.
88
* Copyright (c) 2016 Research Organization for Information Science
99
* and Technology (RIST). All rights reserved.
10+
* Copyright (c) 2017 IBM Corp. All rights reserved.
1011
* $COPYRIGHT$
1112
*
1213
* Additional copyrights may follow
@@ -237,7 +238,7 @@ int mpidbg_init_per_image(mqs_image *image, const mqs_image_callbacks *icb,
237238
mqs_find_type(image, "ompi_file_t", mqs_lang_c);
238239
handle_types->hi_c_group = i_info->ompi_group_t.type;
239240
handle_types->hi_c_info =
240-
mqs_find_type(image, "ompi_info_t", mqs_lang_c);
241+
mqs_find_type(image, "opal_info_t", mqs_lang_c);
241242
/* JMS: "MPI_Offset" is a typedef (see comment about MPI_Aint above) */
242243
handle_types->hi_c_offset =
243244
mqs_find_type(image, "MPI_Offset", mqs_lang_c);

ompi/debuggers/predefined_gap_test.c

+7-8
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* of Tennessee Research Foundation. All rights
66
* reserved.
77
* Copyright (c) 2012-2013 Inria. All rights reserved.
8+
* Copyright (c) 2016 IBM Corp. All rights reserved.
89
* $COPYRIGHT$
910
*
1011
* Additional copyrights may follow
@@ -52,8 +53,8 @@ int main(int argc, char **argv) {
5253
/* Test Predefined communicator sizes */
5354
printf("ompi_predefined_communicator_t = %lu bytes\n", sizeof(ompi_predefined_communicator_t));
5455
printf("ompi_communicator_t = %lu bytes\n", sizeof(ompi_communicator_t));
55-
GAP_CHECK("c_base", test_comm, c_base, c_base, 0);
56-
GAP_CHECK("c_lock", test_comm, c_lock, c_base, 1);
56+
GAP_CHECK("c_base", test_comm, super, super, 0);
57+
GAP_CHECK("c_lock", test_comm, c_lock, super, 1);
5758
GAP_CHECK("c_name", test_comm, c_name, c_lock, 1);
5859
GAP_CHECK("c_contextid", test_comm, c_contextid, c_name, 1);
5960
GAP_CHECK("c_my_rank", test_comm, c_my_rank, c_contextid, 1);
@@ -120,8 +121,8 @@ int main(int argc, char **argv) {
120121
printf("=============================================\n");
121122
printf("ompi_predefined_win_t = %lu bytes\n", sizeof(ompi_predefined_win_t));
122123
printf("ompi_win_t = %lu bytes\n", sizeof(ompi_win_t));
123-
GAP_CHECK("w_base", test_win, w_base, w_base, 0);
124-
GAP_CHECK("w_lock", test_win, w_lock, w_base, 1);
124+
GAP_CHECK("super", test_win, super, super, 0);
125+
GAP_CHECK("w_lock", test_win, w_lock, super, 1);
125126
GAP_CHECK("w_name", test_win, w_name, w_lock, 1);
126127
GAP_CHECK("w_group", test_win, w_group, w_name, 1);
127128
GAP_CHECK("w_flags", test_win, w_flags, w_group, 1);
@@ -137,8 +138,7 @@ int main(int argc, char **argv) {
137138
printf("ompi_info_t = %lu bytes\n", sizeof(ompi_info_t));
138139
GAP_CHECK("super", test_info, super, super, 0);
139140
GAP_CHECK("i_f_to_c_index", test_info, i_f_to_c_index, super, 1);
140-
GAP_CHECK("i_lock", test_info, i_lock, i_f_to_c_index, 1);
141-
GAP_CHECK("i_freed", test_info, i_freed, i_lock, 1);
141+
GAP_CHECK("i_freed", test_info, i_freed, i_f_to_c_index, 1);
142142

143143
/* Test Predefined file sizes */
144144
printf("=============================================\n");
@@ -148,8 +148,7 @@ int main(int argc, char **argv) {
148148
GAP_CHECK("f_comm", test_file, f_comm, super, 1);
149149
GAP_CHECK("f_filename", test_file, f_filename, f_comm, 1);
150150
GAP_CHECK("f_amode", test_file, f_amode, f_filename, 1);
151-
GAP_CHECK("f_info", test_file, f_info, f_amode, 1);
152-
GAP_CHECK("f_flags", test_file, f_flags, f_info, 1);
151+
GAP_CHECK("f_flags", test_file, f_flags, f_amode, 1);
153152
GAP_CHECK("f_f_to_c_index", test_file, f_f_to_c_index, f_flags, 1);
154153
GAP_CHECK("error_handler", test_file, error_handler, f_f_to_c_index, 1);
155154
GAP_CHECK("errhandler_type", test_file, errhandler_type, error_handler, 1);

0 commit comments

Comments
 (0)