|
22 | 22 | * and Technology (RIST). All rights reserved. |
23 | 23 | * Copyright (c) 2014-2015 Intel, Inc. All rights reserved. |
24 | 24 | * Copyright (c) 2015 Mellanox Technologies. All rights reserved. |
| 25 | + * Copyright (c) 2017 IBM Corporation. All rights reserved. |
25 | 26 | * $COPYRIGHT$ |
26 | 27 | * |
27 | 28 | * Additional copyrights may follow |
@@ -86,7 +87,7 @@ static int ompi_comm_copy_topo (ompi_communicator_t *oldcomm, |
86 | 87 |
|
87 | 88 | /* idup with local group and info. the local group support is provided to support ompi_comm_set_nb */ |
88 | 89 | 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); |
90 | 91 |
|
91 | 92 |
|
92 | 93 | /**********************************************************************/ |
@@ -157,6 +158,7 @@ int ompi_comm_set_nb ( ompi_communicator_t **ncomm, |
157 | 158 |
|
158 | 159 | /* ompi_comm_allocate */ |
159 | 160 | newcomm = OBJ_NEW(ompi_communicator_t); |
| 161 | + newcomm->super.s_info = NULL; |
160 | 162 | /* fill in the inscribing hyper-cube dimensions */ |
161 | 163 | newcomm->c_cube_dim = opal_cube_dim(local_size); |
162 | 164 | newcomm->c_id_available = MPI_UNDEFINED; |
@@ -787,7 +789,7 @@ static int ompi_comm_split_verify (ompi_communicator_t *comm, int split_type, in |
787 | 789 | } |
788 | 790 |
|
789 | 791 | int ompi_comm_split_type (ompi_communicator_t *comm, int split_type, int key, |
790 | | - ompi_info_t *info, ompi_communicator_t **newcomm) |
| 792 | + opal_info_t *info, ompi_communicator_t **newcomm) |
791 | 793 | { |
792 | 794 | bool need_split = false, no_reorder = false, no_undefined = false; |
793 | 795 | ompi_communicator_t *newcomp = MPI_COMM_NULL; |
@@ -917,6 +919,12 @@ int ompi_comm_split_type (ompi_communicator_t *comm, int split_type, int key, |
917 | 919 | break; |
918 | 920 | } |
919 | 921 |
|
| 922 | + // Copy info if there is one. |
| 923 | + newcomp->super.s_info = OBJ_NEW(opal_info_t); |
| 924 | + if (info) { |
| 925 | + opal_info_dup(info, &(newcomp->super.s_info)); |
| 926 | + } |
| 927 | + |
920 | 928 | /* Activate the communicator and init coll-component */ |
921 | 929 | rc = ompi_comm_activate (&newcomp, comm, NULL, NULL, NULL, false, mode); |
922 | 930 | if (OPAL_UNLIKELY(OMPI_SUCCESS != rc)) { |
@@ -972,7 +980,7 @@ int ompi_comm_dup ( ompi_communicator_t * comm, ompi_communicator_t **newcomm ) |
972 | 980 | /**********************************************************************/ |
973 | 981 | /**********************************************************************/ |
974 | 982 | /**********************************************************************/ |
975 | | -int ompi_comm_dup_with_info ( ompi_communicator_t * comm, ompi_info_t *info, ompi_communicator_t **newcomm ) |
| 983 | +int ompi_comm_dup_with_info ( ompi_communicator_t * comm, opal_info_t *info, ompi_communicator_t **newcomm ) |
976 | 984 | { |
977 | 985 | ompi_communicator_t *newcomp = NULL; |
978 | 986 | ompi_group_t *remote_group = NULL; |
@@ -1014,6 +1022,12 @@ int ompi_comm_dup_with_info ( ompi_communicator_t * comm, ompi_info_t *info, omp |
1014 | 1022 | snprintf(newcomp->c_name, MPI_MAX_OBJECT_NAME, "MPI COMMUNICATOR %d DUP FROM %d", |
1015 | 1023 | newcomp->c_contextid, comm->c_contextid ); |
1016 | 1024 |
|
| 1025 | + // Copy info if there is one. |
| 1026 | + newcomp->super.s_info = OBJ_NEW(opal_info_t); |
| 1027 | + if (info) { |
| 1028 | + opal_info_dup(info, &(newcomp->super.s_info)); |
| 1029 | + } |
| 1030 | + |
1017 | 1031 | /* activate communicator and init coll-module */ |
1018 | 1032 | rc = ompi_comm_activate (&newcomp, comm, NULL, NULL, NULL, false, mode); |
1019 | 1033 | if ( OMPI_SUCCESS != rc ) { |
@@ -1042,14 +1056,14 @@ int ompi_comm_idup (ompi_communicator_t *comm, ompi_communicator_t **newcomm, om |
1042 | 1056 | return ompi_comm_idup_with_info (comm, NULL, newcomm, req); |
1043 | 1057 | } |
1044 | 1058 |
|
1045 | | -int ompi_comm_idup_with_info (ompi_communicator_t *comm, ompi_info_t *info, ompi_communicator_t **newcomm, ompi_request_t **req) |
| 1059 | +int ompi_comm_idup_with_info (ompi_communicator_t *comm, opal_info_t *info, ompi_communicator_t **newcomm, ompi_request_t **req) |
1046 | 1060 | { |
1047 | 1061 | return ompi_comm_idup_internal (comm, comm->c_local_group, comm->c_remote_group, info, newcomm, req); |
1048 | 1062 | } |
1049 | 1063 |
|
1050 | 1064 | /* NTH: we need a way to idup with a smaller local group so this function takes a local group */ |
1051 | 1065 | 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) |
| 1066 | + opal_info_t *info, ompi_communicator_t **newcomm, ompi_request_t **req) |
1053 | 1067 | { |
1054 | 1068 | ompi_comm_idup_with_info_context_t *context; |
1055 | 1069 | ompi_comm_request_t *request; |
@@ -1094,6 +1108,15 @@ static int ompi_comm_idup_internal (ompi_communicator_t *comm, ompi_group_t *gro |
1094 | 1108 | return rc; |
1095 | 1109 | } |
1096 | 1110 |
|
| 1111 | + // Copy info if there is one. |
| 1112 | + { |
| 1113 | + ompi_communicator_t *newcomp = context->newcomp; |
| 1114 | + newcomp->super.s_info = OBJ_NEW(opal_info_t); |
| 1115 | + if (info) { |
| 1116 | + opal_info_dup(info, &(newcomp->super.s_info)); |
| 1117 | + } |
| 1118 | + } |
| 1119 | + |
1097 | 1120 | ompi_comm_request_schedule_append (request, ompi_comm_idup_getcid, subreq, subreq[0] ? 1 : 0); |
1098 | 1121 |
|
1099 | 1122 | /* assign the newcomm now */ |
@@ -1471,6 +1494,10 @@ int ompi_comm_free( ompi_communicator_t **comm ) |
1471 | 1494 | ompi_mpi_comm_parent = &ompi_mpi_comm_null.comm; |
1472 | 1495 | } |
1473 | 1496 |
|
| 1497 | + if (NULL != ((*comm)->super.s_info)) { |
| 1498 | + OBJ_RELEASE((*comm)->super.s_info); |
| 1499 | + } |
| 1500 | + |
1474 | 1501 | /* Release the communicator */ |
1475 | 1502 | if ( OMPI_COMM_IS_DYNAMIC (*comm) ) { |
1476 | 1503 | ompi_comm_num_dyncomm --; |
|
0 commit comments