Skip to content

Commit 5dcaa3f

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 ef24f71 commit 5dcaa3f

File tree

97 files changed

+2228
-1104
lines changed

Some content is hidden

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

97 files changed

+2228
-1104
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

+5-5
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ static int ompi_comm_copy_topo (ompi_communicator_t *oldcomm,
8686

8787
/* idup with local group and info. the local group support is provided to support ompi_comm_set_nb */
8888
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);
89+
opal_info_t *info, ompi_communicator_t **newcomm, ompi_request_t **req);
9090

9191

9292
/**********************************************************************/
@@ -787,7 +787,7 @@ static int ompi_comm_split_type_get_part (ompi_group_t *group, int *results, int
787787
int
788788
ompi_comm_split_type(ompi_communicator_t *comm,
789789
int split_type, int key,
790-
ompi_info_t *info,
790+
opal_info_t *info,
791791
ompi_communicator_t** newcomm)
792792
{
793793
int myinfo[2];
@@ -998,7 +998,7 @@ int ompi_comm_dup ( ompi_communicator_t * comm, ompi_communicator_t **newcomm )
998998
/**********************************************************************/
999999
/**********************************************************************/
10001000
/**********************************************************************/
1001-
int ompi_comm_dup_with_info ( ompi_communicator_t * comm, ompi_info_t *info, ompi_communicator_t **newcomm )
1001+
int ompi_comm_dup_with_info ( ompi_communicator_t * comm, opal_info_t *info, ompi_communicator_t **newcomm )
10021002
{
10031003
ompi_communicator_t *newcomp = NULL;
10041004
ompi_group_t *remote_group = NULL;
@@ -1076,14 +1076,14 @@ int ompi_comm_idup (ompi_communicator_t *comm, ompi_communicator_t **newcomm, om
10761076
return ompi_comm_idup_with_info (comm, NULL, newcomm, req);
10771077
}
10781078

1079-
int ompi_comm_idup_with_info (ompi_communicator_t *comm, ompi_info_t *info, ompi_communicator_t **newcomm, ompi_request_t **req)
1079+
int ompi_comm_idup_with_info (ompi_communicator_t *comm, opal_info_t *info, ompi_communicator_t **newcomm, ompi_request_t **req)
10801080
{
10811081
return ompi_comm_idup_internal (comm, comm->c_local_group, comm->c_remote_group, info, newcomm, req);
10821082
}
10831083

10841084
/* NTH: we need a way to idup with a smaller local group so this function takes a local group */
10851085
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)
1086+
opal_info_t *info, ompi_communicator_t **newcomm, ompi_request_t **req)
10871087
{
10881088
struct ompi_comm_idup_with_info_context *context;
10891089
ompi_comm_request_t *request;

ompi/communicator/comm_init.c

+5-4
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include <stdio.h>
3434

3535
#include "opal/util/bit_ops.h"
36+
#include "opal/util/info_subscriber.h"
3637
#include "ompi/constants.h"
3738
#include "ompi/mca/pml/pml.h"
3839
#include "ompi/mca/coll/base/base.h"
@@ -52,9 +53,9 @@
5253
opal_pointer_array_t ompi_mpi_communicators = {{0}};
5354
opal_pointer_array_t ompi_comm_f_to_c_table = {{0}};
5455

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}}};
56+
ompi_predefined_communicator_t ompi_mpi_comm_world = {{{{0}}}};
57+
ompi_predefined_communicator_t ompi_mpi_comm_self = {{{{0}}}};
58+
ompi_predefined_communicator_t ompi_mpi_comm_null = {{{{0}}}};
5859
ompi_communicator_t *ompi_mpi_comm_parent = NULL;
5960

6061
ompi_predefined_communicator_t *ompi_mpi_comm_world_addr =
@@ -67,7 +68,7 @@ ompi_predefined_communicator_t *ompi_mpi_comm_null_addr =
6768
static void ompi_comm_construct(ompi_communicator_t* comm);
6869
static void ompi_comm_destruct(ompi_communicator_t* comm);
6970

70-
OBJ_CLASS_INSTANCE(ompi_communicator_t, opal_object_t,
71+
OBJ_CLASS_INSTANCE(ompi_communicator_t, opal_infosubscriber_t,
7172
ompi_comm_construct,
7273
ompi_comm_destruct);
7374

ompi/communicator/communicator.h

+6-4
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232

3333
#include "ompi_config.h"
3434
#include "opal/class/opal_object.h"
35+
#include "opal/class/opal_hash_table.h"
36+
#include "opal/util/info_subscriber.h"
3537
#include "ompi/errhandler/errhandler.h"
3638
#include "opal/threads/mutex.h"
3739
#include "ompi/communicator/comm_request.h"
@@ -115,7 +117,7 @@ OMPI_DECLSPEC extern opal_pointer_array_t ompi_mpi_communicators;
115117
OMPI_DECLSPEC extern opal_pointer_array_t ompi_comm_f_to_c_table;
116118

117119
struct ompi_communicator_t {
118-
opal_object_t c_base;
120+
opal_infosubscriber_t super;
119121
opal_mutex_t c_lock; /* mutex for name and potentially
120122
attributes */
121123
char c_name[MPI_MAX_OBJECT_NAME];
@@ -420,7 +422,7 @@ OMPI_DECLSPEC int ompi_comm_split (ompi_communicator_t *comm, int color, int key
420422
*/
421423
OMPI_DECLSPEC int ompi_comm_split_type(ompi_communicator_t *comm,
422424
int split_type, int key,
423-
struct ompi_info_t *info,
425+
struct opal_info_t *info,
424426
ompi_communicator_t** newcomm);
425427

426428
/**
@@ -451,7 +453,7 @@ OMPI_DECLSPEC int ompi_comm_idup (ompi_communicator_t *comm, ompi_communicator_t
451453
* @param comm: input communicator
452454
* @param newcomm: the new communicator or MPI_COMM_NULL if any error is detected.
453455
*/
454-
OMPI_DECLSPEC int ompi_comm_dup_with_info (ompi_communicator_t *comm, ompi_info_t *info, ompi_communicator_t **newcomm);
456+
OMPI_DECLSPEC int ompi_comm_dup_with_info (ompi_communicator_t *comm, opal_info_t *info, ompi_communicator_t **newcomm);
455457

456458
/**
457459
* dup a communicator (non-blocking) with info.
@@ -461,7 +463,7 @@ OMPI_DECLSPEC int ompi_comm_dup_with_info (ompi_communicator_t *comm, ompi_info_
461463
* @param comm: input communicator
462464
* @param newcomm: the new communicator or MPI_COMM_NULL if any error is detected.
463465
*/
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);
466+
OMPI_DECLSPEC int ompi_comm_idup_with_info (ompi_communicator_t *comm, opal_info_t *info, ompi_communicator_t **newcomm, ompi_request_t **req);
465467

466468
/**
467469
* compare two communicators.

ompi/debuggers/ompi_mpihandles_dll.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ int mpidbg_init_per_image(mqs_image *image, const mqs_image_callbacks *icb,
234234
mqs_find_type(image, "ompi_file_t", mqs_lang_c);
235235
handle_types->hi_c_group = i_info->ompi_group_t.type;
236236
handle_types->hi_c_info =
237-
mqs_find_type(image, "ompi_info_t", mqs_lang_c);
237+
mqs_find_type(image, "opal_info_t", mqs_lang_c);
238238
/* JMS: "MPI_Offset" is a typedef (see comment about MPI_Aint above) */
239239
handle_types->hi_c_offset =
240240
mqs_find_type(image, "MPI_Offset", mqs_lang_c);

ompi/debuggers/predefined_gap_test.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ int main(int argc, char **argv) {
4545
ompi_request_t test_req;
4646
ompi_op_t test_op;
4747
ompi_win_t test_win;
48-
ompi_info_t test_info;
48+
opal_info_t test_info;
4949
ompi_file_t test_file;
5050
size_t exp_offset, offset;
5151

@@ -134,7 +134,7 @@ int main(int argc, char **argv) {
134134
/* Test Predefined info sizes */
135135
printf("=============================================\n");
136136
printf("ompi_predefined_info_t = %lu bytes\n", sizeof(ompi_predefined_info_t));
137-
printf("ompi_info_t = %lu bytes\n", sizeof(ompi_info_t));
137+
printf("opal_info_t = %lu bytes\n", sizeof(opal_info_t));
138138
GAP_CHECK("super", test_info, super, super, 0);
139139
GAP_CHECK("i_f_to_c_index", test_info, i_f_to_c_index, super, 1);
140140
GAP_CHECK("i_lock", test_info, i_lock, i_f_to_c_index, 1);

ompi/dpm/dpm.c

+21-21
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@ int ompi_dpm_spawn(int count, const char *array_of_commands[],
722722
if ( array_of_info != NULL && array_of_info[i] != MPI_INFO_NULL ) {
723723

724724
/* check for personality - this is a job-level key */
725-
ompi_info_get (array_of_info[i], "personality", sizeof(host) - 1, host, &flag);
725+
opal_info_get (array_of_info[i], "personality", sizeof(host) - 1, host, &flag);
726726
if ( flag ) {
727727
personality = true;
728728
info = OBJ_NEW(opal_value_t);
@@ -732,7 +732,7 @@ int ompi_dpm_spawn(int count, const char *array_of_commands[],
732732
}
733733

734734
/* check for 'host' */
735-
ompi_info_get (array_of_info[i], "host", sizeof(host) - 1, host, &flag);
735+
opal_info_get (array_of_info[i], "host", sizeof(host) - 1, host, &flag);
736736
if ( flag ) {
737737
info = OBJ_NEW(opal_value_t);
738738
info->key = strdup(OPAL_PMIX_HOST);
@@ -741,7 +741,7 @@ int ompi_dpm_spawn(int count, const char *array_of_commands[],
741741
}
742742

743743
/* check for 'hostfile' */
744-
ompi_info_get (array_of_info[i], "hostfile", sizeof(host) - 1, host, &flag);
744+
opal_info_get (array_of_info[i], "hostfile", sizeof(host) - 1, host, &flag);
745745
if ( flag ) {
746746
info = OBJ_NEW(opal_value_t);
747747
info->key = strdup(OPAL_PMIX_HOSTFILE);
@@ -750,7 +750,7 @@ int ompi_dpm_spawn(int count, const char *array_of_commands[],
750750
}
751751

752752
/* check for 'add-hostfile' */
753-
ompi_info_get (array_of_info[i], "add-hostfile", sizeof(host) - 1, host, &flag);
753+
opal_info_get (array_of_info[i], "add-hostfile", sizeof(host) - 1, host, &flag);
754754
if ( flag ) {
755755
info = OBJ_NEW(opal_value_t);
756756
info->key = strdup(OPAL_PMIX_ADD_HOSTFILE);
@@ -759,7 +759,7 @@ int ompi_dpm_spawn(int count, const char *array_of_commands[],
759759
}
760760

761761
/* check for 'add-host' */
762-
ompi_info_get (array_of_info[i], "add-host", sizeof(host) - 1, host, &flag);
762+
opal_info_get (array_of_info[i], "add-host", sizeof(host) - 1, host, &flag);
763763
if ( flag ) {
764764
info = OBJ_NEW(opal_value_t);
765765
info->key = strdup(OPAL_PMIX_ADD_HOST);
@@ -768,7 +768,7 @@ int ompi_dpm_spawn(int count, const char *array_of_commands[],
768768
}
769769

770770
/* check for env */
771-
ompi_info_get (array_of_info[i], "env", sizeof(host)-1, host, &flag);
771+
opal_info_get (array_of_info[i], "env", sizeof(host)-1, host, &flag);
772772
if ( flag ) {
773773
envars = opal_argv_split(host, '\n');
774774
for (j=0; NULL != envars[j]; j++) {
@@ -784,7 +784,7 @@ int ompi_dpm_spawn(int count, const char *array_of_commands[],
784784
*
785785
* This is a job-level key
786786
*/
787-
ompi_info_get (array_of_info[i], "ompi_prefix", sizeof(prefix) - 1, prefix, &flag);
787+
opal_info_get (array_of_info[i], "ompi_prefix", sizeof(prefix) - 1, prefix, &flag);
788788
if ( flag ) {
789789
info = OBJ_NEW(opal_value_t);
790790
info->key = strdup(OPAL_PMIX_PREFIX);
@@ -793,7 +793,7 @@ int ompi_dpm_spawn(int count, const char *array_of_commands[],
793793
}
794794

795795
/* check for 'wdir' */
796-
ompi_info_get (array_of_info[i], "wdir", sizeof(cwd) - 1, cwd, &flag);
796+
opal_info_get (array_of_info[i], "wdir", sizeof(cwd) - 1, cwd, &flag);
797797
if ( flag ) {
798798
info = OBJ_NEW(opal_value_t);
799799
info->key = strdup(OPAL_PMIX_WDIR);
@@ -803,7 +803,7 @@ int ompi_dpm_spawn(int count, const char *array_of_commands[],
803803
}
804804

805805
/* check for 'mapper' - a job-level key */
806-
ompi_info_get(array_of_info[i], "mapper", sizeof(mapper) - 1, mapper, &flag);
806+
opal_info_get(array_of_info[i], "mapper", sizeof(mapper) - 1, mapper, &flag);
807807
if ( flag ) {
808808
info = OBJ_NEW(opal_value_t);
809809
info->key = strdup(OPAL_PMIX_MAPPER);
@@ -812,7 +812,7 @@ int ompi_dpm_spawn(int count, const char *array_of_commands[],
812812
}
813813

814814
/* check for 'display_map' - a job-level key */
815-
ompi_info_get_bool(array_of_info[i], "display_map", &local_spawn, &flag);
815+
opal_info_get_bool(array_of_info[i], "display_map", &local_spawn, &flag);
816816
if ( flag ) {
817817
info = OBJ_NEW(opal_value_t);
818818
info->key = strdup(OPAL_PMIX_DISPLAY_MAP);
@@ -821,22 +821,22 @@ int ompi_dpm_spawn(int count, const char *array_of_commands[],
821821
}
822822

823823
/* check for 'npernode' and 'ppr' - job-level key */
824-
ompi_info_get (array_of_info[i], "npernode", sizeof(slot_list) - 1, slot_list, &flag);
824+
opal_info_get (array_of_info[i], "npernode", sizeof(slot_list) - 1, slot_list, &flag);
825825
if ( flag ) {
826826
info = OBJ_NEW(opal_value_t);
827827
info->key = strdup(OPAL_PMIX_PPR);
828828
info->type = OPAL_STRING;
829829
(void)asprintf(&(info->data.string), "%s:n", slot_list);
830830
opal_list_append(&job_info, &info->super);
831831
}
832-
ompi_info_get (array_of_info[i], "pernode", sizeof(slot_list) - 1, slot_list, &flag);
832+
opal_info_get (array_of_info[i], "pernode", sizeof(slot_list) - 1, slot_list, &flag);
833833
if ( flag ) {
834834
info = OBJ_NEW(opal_value_t);
835835
info->key = strdup(OPAL_PMIX_PPR);
836836
opal_value_load(info, "1:n", OPAL_STRING);
837837
opal_list_append(&job_info, &info->super);
838838
}
839-
ompi_info_get (array_of_info[i], "ppr", sizeof(slot_list) - 1, slot_list, &flag);
839+
opal_info_get (array_of_info[i], "ppr", sizeof(slot_list) - 1, slot_list, &flag);
840840
if ( flag ) {
841841
info = OBJ_NEW(opal_value_t);
842842
info->key = strdup(OPAL_PMIX_PPR);
@@ -845,7 +845,7 @@ int ompi_dpm_spawn(int count, const char *array_of_commands[],
845845
}
846846

847847
/* check for 'map_by' - job-level key */
848-
ompi_info_get(array_of_info[i], "map_by", sizeof(slot_list) - 1, slot_list, &flag);
848+
opal_info_get(array_of_info[i], "map_by", sizeof(slot_list) - 1, slot_list, &flag);
849849
if ( flag ) {
850850
info = OBJ_NEW(opal_value_t);
851851
info->key = strdup(OPAL_PMIX_MAPBY);
@@ -854,7 +854,7 @@ int ompi_dpm_spawn(int count, const char *array_of_commands[],
854854
}
855855

856856
/* check for 'rank_by' - job-level key */
857-
ompi_info_get(array_of_info[i], "rank_by", sizeof(slot_list) - 1, slot_list, &flag);
857+
opal_info_get(array_of_info[i], "rank_by", sizeof(slot_list) - 1, slot_list, &flag);
858858
if ( flag ) {
859859
info = OBJ_NEW(opal_value_t);
860860
info->key = strdup(OPAL_PMIX_RANKBY);
@@ -863,7 +863,7 @@ int ompi_dpm_spawn(int count, const char *array_of_commands[],
863863
}
864864

865865
/* check for 'bind_to' - job-level key */
866-
ompi_info_get(array_of_info[i], "bind_to", sizeof(slot_list) - 1, slot_list, &flag);
866+
opal_info_get(array_of_info[i], "bind_to", sizeof(slot_list) - 1, slot_list, &flag);
867867
if ( flag ) {
868868
info = OBJ_NEW(opal_value_t);
869869
info->key = strdup(OPAL_PMIX_BINDTO);
@@ -872,7 +872,7 @@ int ompi_dpm_spawn(int count, const char *array_of_commands[],
872872
}
873873

874874
/* check for 'preload_binary' - job-level key */
875-
ompi_info_get_bool(array_of_info[i], "ompi_preload_binary", &local_spawn, &flag);
875+
opal_info_get_bool(array_of_info[i], "ompi_preload_binary", &local_spawn, &flag);
876876
if ( flag ) {
877877
info = OBJ_NEW(opal_value_t);
878878
info->key = strdup(OPAL_PMIX_PRELOAD_BIN);
@@ -881,7 +881,7 @@ int ompi_dpm_spawn(int count, const char *array_of_commands[],
881881
}
882882

883883
/* check for 'preload_files' - job-level key */
884-
ompi_info_get (array_of_info[i], "ompi_preload_files", sizeof(cwd) - 1, cwd, &flag);
884+
opal_info_get (array_of_info[i], "ompi_preload_files", sizeof(cwd) - 1, cwd, &flag);
885885
if ( flag ) {
886886
info = OBJ_NEW(opal_value_t);
887887
info->key = strdup(OPAL_PMIX_PRELOAD_FILES);
@@ -892,7 +892,7 @@ int ompi_dpm_spawn(int count, const char *array_of_commands[],
892892
/* see if this is a non-mpi job - if so, then set the flag so ORTE
893893
* knows what to do - job-level key
894894
*/
895-
ompi_info_get_bool(array_of_info[i], "ompi_non_mpi", &non_mpi, &flag);
895+
opal_info_get_bool(array_of_info[i], "ompi_non_mpi", &non_mpi, &flag);
896896
if (flag && non_mpi) {
897897
info = OBJ_NEW(opal_value_t);
898898
info->key = strdup(OPAL_PMIX_NON_PMI);
@@ -901,15 +901,15 @@ int ompi_dpm_spawn(int count, const char *array_of_commands[],
901901
}
902902

903903
/* see if this is an MCA param that the user wants applied to the child job */
904-
ompi_info_get (array_of_info[i], "ompi_param", sizeof(params) - 1, params, &flag);
904+
opal_info_get (array_of_info[i], "ompi_param", sizeof(params) - 1, params, &flag);
905905
if ( flag ) {
906906
opal_argv_append_unique_nosize(&app->env, params, true);
907907
}
908908

909909
/* see if user specified what to do with stdin - defaults to
910910
* not forwarding stdin to child processes - job-level key
911911
*/
912-
ompi_info_get (array_of_info[i], "ompi_stdin_target", sizeof(stdin_target) - 1, stdin_target, &flag);
912+
opal_info_get (array_of_info[i], "ompi_stdin_target", sizeof(stdin_target) - 1, stdin_target, &flag);
913913
if ( flag ) {
914914
if (0 == strcmp(stdin_target, "all")) {
915915
ui32 = ORTE_VPID_WILDCARD;

0 commit comments

Comments
 (0)