Skip to content

Commit 35137a8

Browse files
committed
Major structural changes to data types:
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")
1 parent 243d973 commit 35137a8

File tree

96 files changed

+1685
-1111
lines changed

Some content is hidden

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

96 files changed

+1685
-1111
lines changed

AUTHORS

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ [email protected] Denis Dimick LANL
3636
[email protected] Dave Goodell Cisco
3737
[email protected] Donald Kerr Sun, Oracle
3838
[email protected] Doron Shoham Mellanox
39+
[email protected] David Solt IBM
3940
[email protected] Ethan Mallove Sun, Oracle
4041
[email protected] Eugene Loh Sun, Oracle
4142
[email protected] Edgar Gabriel HLRS, UH, UTK

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_type_get_part (ompi_group_t *group, int *results, int
787788
int
788789
ompi_comm_split_type(ompi_communicator_t *comm,
789790
int split_type, int key,
790-
ompi_info_t *info,
791+
opal_info_t *info,
791792
ompi_communicator_t** newcomm)
792793
{
793794
int myinfo[2];
@@ -998,7 +999,7 @@ int ompi_comm_dup ( ompi_communicator_t * comm, ompi_communicator_t **newcomm )
998999
/**********************************************************************/
9991000
/**********************************************************************/
10001001
/**********************************************************************/
1001-
int ompi_comm_dup_with_info ( ompi_communicator_t * comm, ompi_info_t *info, ompi_communicator_t **newcomm )
1002+
int ompi_comm_dup_with_info ( ompi_communicator_t * comm, opal_info_t *info, ompi_communicator_t **newcomm )
10021003
{
10031004
ompi_communicator_t *newcomp = NULL;
10041005
ompi_group_t *remote_group = NULL;
@@ -1076,14 +1077,14 @@ int ompi_comm_idup (ompi_communicator_t *comm, ompi_communicator_t **newcomm, om
10761077
return ompi_comm_idup_with_info (comm, NULL, newcomm, req);
10771078
}
10781079

1079-
int ompi_comm_idup_with_info (ompi_communicator_t *comm, ompi_info_t *info, ompi_communicator_t **newcomm, ompi_request_t **req)
1080+
int ompi_comm_idup_with_info (ompi_communicator_t *comm, opal_info_t *info, ompi_communicator_t **newcomm, ompi_request_t **req)
10801081
{
10811082
return ompi_comm_idup_internal (comm, comm->c_local_group, comm->c_remote_group, info, newcomm, req);
10821083
}
10831084

10841085
/* NTH: we need a way to idup with a smaller local group so this function takes a local group */
10851086
static int ompi_comm_idup_internal (ompi_communicator_t *comm, ompi_group_t *group, ompi_group_t *remote_group,
1086-
ompi_info_t *info, ompi_communicator_t **newcomm, ompi_request_t **req)
1087+
opal_info_t *info, ompi_communicator_t **newcomm, ompi_request_t **req)
10871088
{
10881089
struct ompi_comm_idup_with_info_context *context;
10891090
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

+7-4
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
2121
* Copyright (c) 2015 Research Organization for Information Science
2222
* and Technology (RIST). All rights reserved.
23+
* Copyright (c) 2016 IBM Corp. All rights reserved.
2324
* $COPYRIGHT$
2425
*
2526
* Additional copyrights may follow
@@ -32,6 +33,8 @@
3233

3334
#include "ompi_config.h"
3435
#include "opal/class/opal_object.h"
36+
#include "opal/class/opal_hash_table.h"
37+
#include "opal/util/info_subscriber.h"
3538
#include "ompi/errhandler/errhandler.h"
3639
#include "opal/threads/mutex.h"
3740
#include "ompi/communicator/comm_request.h"
@@ -115,7 +118,7 @@ OMPI_DECLSPEC extern opal_pointer_array_t ompi_mpi_communicators;
115118
OMPI_DECLSPEC extern opal_pointer_array_t ompi_comm_f_to_c_table;
116119

117120
struct ompi_communicator_t {
118-
opal_object_t c_base;
121+
opal_infosubscriber_t super;
119122
opal_mutex_t c_lock; /* mutex for name and potentially
120123
attributes */
121124
char c_name[MPI_MAX_OBJECT_NAME];
@@ -420,7 +423,7 @@ OMPI_DECLSPEC int ompi_comm_split (ompi_communicator_t *comm, int color, int key
420423
*/
421424
OMPI_DECLSPEC int ompi_comm_split_type(ompi_communicator_t *comm,
422425
int split_type, int key,
423-
struct ompi_info_t *info,
426+
struct opal_info_t *info,
424427
ompi_communicator_t** newcomm);
425428

426429
/**
@@ -451,7 +454,7 @@ OMPI_DECLSPEC int ompi_comm_idup (ompi_communicator_t *comm, ompi_communicator_t
451454
* @param comm: input communicator
452455
* @param newcomm: the new communicator or MPI_COMM_NULL if any error is detected.
453456
*/
454-
OMPI_DECLSPEC int ompi_comm_dup_with_info (ompi_communicator_t *comm, ompi_info_t *info, ompi_communicator_t **newcomm);
457+
OMPI_DECLSPEC int ompi_comm_dup_with_info (ompi_communicator_t *comm, opal_info_t *info, ompi_communicator_t **newcomm);
455458

456459
/**
457460
* dup a communicator (non-blocking) with info.
@@ -461,7 +464,7 @@ OMPI_DECLSPEC int ompi_comm_dup_with_info (ompi_communicator_t *comm, ompi_info_
461464
* @param comm: input communicator
462465
* @param newcomm: the new communicator or MPI_COMM_NULL if any error is detected.
463466
*/
464-
OMPI_DECLSPEC int ompi_comm_idup_with_info (ompi_communicator_t *comm, ompi_info_t *info, ompi_communicator_t **newcomm, ompi_request_t **req);
467+
OMPI_DECLSPEC int ompi_comm_idup_with_info (ompi_communicator_t *comm, opal_info_t *info, ompi_communicator_t **newcomm, ompi_request_t **req);
465468

466469
/**
467470
* compare two communicators.

ompi/debuggers/ompi_mpihandles_dll.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* reserved.
66
* Copyright (c) 2008 Sun Microsystems, Inc. All rights 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
@@ -234,7 +235,7 @@ int mpidbg_init_per_image(mqs_image *image, const mqs_image_callbacks *icb,
234235
mqs_find_type(image, "ompi_file_t", mqs_lang_c);
235236
handle_types->hi_c_group = i_info->ompi_group_t.type;
236237
handle_types->hi_c_info =
237-
mqs_find_type(image, "ompi_info_t", mqs_lang_c);
238+
mqs_find_type(image, "opal_info_t", mqs_lang_c);
238239
/* JMS: "MPI_Offset" is a typedef (see comment about MPI_Aint above) */
239240
handle_types->hi_c_offset =
240241
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)