@@ -358,13 +358,7 @@ int ompi_comm_create ( ompi_communicator_t *comm, ompi_group_t *group,
358
358
}
359
359
360
360
/* Determine context id. It is identical to f_2_c_handle */
361
- rc = ompi_comm_nextcid ( newcomp , /* new communicator */
362
- comm , /* old comm */
363
- NULL , /* bridge comm */
364
- NULL , /* local leader */
365
- NULL , /* remote_leader */
366
- mode , /* mode */
367
- -1 ); /* send first */
361
+ rc = ompi_comm_nextcid (newcomp , comm , NULL , NULL , NULL , false, mode );
368
362
if ( OMPI_SUCCESS != rc ) {
369
363
goto exit ;
370
364
}
@@ -374,13 +368,7 @@ int ompi_comm_create ( ompi_communicator_t *comm, ompi_group_t *group,
374
368
newcomp -> c_contextid , comm -> c_contextid );
375
369
376
370
/* Activate the communicator and init coll-component */
377
- rc = ompi_comm_activate ( & newcomp , /* new communicator */
378
- comm ,
379
- NULL ,
380
- NULL ,
381
- NULL ,
382
- mode ,
383
- -1 );
371
+ rc = ompi_comm_activate (& newcomp , comm , NULL , NULL , NULL , false, mode );
384
372
if ( OMPI_SUCCESS != rc ) {
385
373
goto exit ;
386
374
}
@@ -609,13 +597,7 @@ int ompi_comm_split( ompi_communicator_t* comm, int color, int key,
609
597
}
610
598
611
599
/* Determine context id. It is identical to f_2_c_handle */
612
- rc = ompi_comm_nextcid ( newcomp , /* new communicator */
613
- comm , /* old comm */
614
- NULL , /* bridge comm */
615
- NULL , /* local leader */
616
- NULL , /* remote_leader */
617
- mode , /* mode */
618
- -1 ); /* send first, doesn't matter */
600
+ rc = ompi_comm_nextcid (newcomp , comm , NULL , NULL , NULL , false, mode );
619
601
if ( OMPI_SUCCESS != rc ) {
620
602
goto exit ;
621
603
}
@@ -634,36 +616,15 @@ int ompi_comm_split( ompi_communicator_t* comm, int color, int key,
634
616
635
617
636
618
/* Activate the communicator and init coll-component */
637
- rc = ompi_comm_activate ( & newcomp , /* new communicator */
638
- comm ,
639
- NULL ,
640
- NULL ,
641
- NULL ,
642
- mode ,
643
- -1 );
644
- if ( OMPI_SUCCESS != rc ) {
645
- goto exit ;
646
- }
619
+ rc = ompi_comm_activate (& newcomp , comm , NULL , NULL , NULL , false, mode );
647
620
648
621
exit :
649
- if ( NULL != results ) {
650
- free ( results );
651
- }
652
- if ( NULL != sorted ) {
653
- free ( sorted );
654
- }
655
- if ( NULL != rresults ) {
656
- free ( rresults );
657
- }
658
- if ( NULL != rsorted ) {
659
- free ( rsorted );
660
- }
661
- if ( NULL != lranks ) {
662
- free ( lranks );
663
- }
664
- if ( NULL != rranks ) {
665
- free ( rranks );
666
- }
622
+ free ( results );
623
+ free ( sorted );
624
+ free ( rresults );
625
+ free ( rsorted );
626
+ free ( lranks );
627
+ free ( rranks );
667
628
668
629
/* Step 4: if we are not part of the comm, free the struct */
669
630
/* --------------------------------------------------------- */
@@ -675,7 +636,7 @@ int ompi_comm_split( ompi_communicator_t* comm, int color, int key,
675
636
}
676
637
677
638
* newcomm = newcomp ;
678
- return ( rc ) ;
639
+ return rc ;
679
640
}
680
641
681
642
@@ -925,13 +886,7 @@ ompi_comm_split_type(ompi_communicator_t *comm,
925
886
}
926
887
927
888
/* Determine context id. It is identical to f_2_c_handle */
928
- rc = ompi_comm_nextcid ( newcomp , /* new communicator */
929
- comm , /* old comm */
930
- NULL , /* bridge comm */
931
- NULL , /* local leader */
932
- NULL , /* remote_leader */
933
- mode , /* mode */
934
- -1 ); /* send first, doesn't matter */
889
+ rc = ompi_comm_nextcid (newcomp , comm , NULL , NULL , NULL , false, mode );
935
890
if ( OMPI_SUCCESS != rc ) {
936
891
goto exit ;
937
892
}
@@ -950,13 +905,7 @@ ompi_comm_split_type(ompi_communicator_t *comm,
950
905
951
906
952
907
/* Activate the communicator and init coll-component */
953
- rc = ompi_comm_activate ( & newcomp , /* new communicator */
954
- comm ,
955
- NULL ,
956
- NULL ,
957
- NULL ,
958
- mode ,
959
- -1 );
908
+ rc = ompi_comm_activate (& newcomp , comm , NULL , NULL , NULL , false, mode );
960
909
if ( OMPI_SUCCESS != rc ) {
961
910
goto exit ;
962
911
}
@@ -1031,13 +980,7 @@ int ompi_comm_dup_with_info ( ompi_communicator_t * comm, ompi_info_t *info, omp
1031
980
}
1032
981
1033
982
/* Determine context id. It is identical to f_2_c_handle */
1034
- rc = ompi_comm_nextcid ( newcomp , /* new communicator */
1035
- comm , /* old comm */
1036
- NULL , /* bridge comm */
1037
- NULL , /* local leader */
1038
- NULL , /* remote_leader */
1039
- mode , /* mode */
1040
- -1 ); /* send_first */
983
+ rc = ompi_comm_nextcid (newcomp , comm , NULL , NULL , NULL , false, mode );
1041
984
if ( OMPI_SUCCESS != rc ) {
1042
985
return rc ;
1043
986
}
@@ -1047,13 +990,7 @@ int ompi_comm_dup_with_info ( ompi_communicator_t * comm, ompi_info_t *info, omp
1047
990
newcomp -> c_contextid , comm -> c_contextid );
1048
991
1049
992
/* activate communicator and init coll-module */
1050
- rc = ompi_comm_activate ( & newcomp , /* new communicator */
1051
- comm ,
1052
- NULL ,
1053
- NULL ,
1054
- NULL ,
1055
- mode ,
1056
- -1 );
993
+ rc = ompi_comm_activate (& newcomp , comm , NULL , NULL , NULL , false, mode );
1057
994
if ( OMPI_SUCCESS != rc ) {
1058
995
return rc ;
1059
996
}
@@ -1062,11 +999,15 @@ int ompi_comm_dup_with_info ( ompi_communicator_t * comm, ompi_info_t *info, omp
1062
999
return MPI_SUCCESS ;
1063
1000
}
1064
1001
1065
- struct ompi_comm_idup_with_info_context {
1002
+ struct ompi_comm_idup_with_info_context_t {
1003
+ opal_object_t super ;
1066
1004
ompi_communicator_t * comm ;
1067
1005
ompi_communicator_t * newcomp ;
1068
1006
};
1069
1007
1008
+ typedef struct ompi_comm_idup_with_info_context_t ompi_comm_idup_with_info_context_t ;
1009
+ OBJ_CLASS_INSTANCE (ompi_comm_idup_with_info_context_t , opal_object_t , NULL , NULL );
1010
+
1070
1011
static int ompi_comm_idup_with_info_activate (ompi_comm_request_t * request );
1071
1012
static int ompi_comm_idup_with_info_finish (ompi_comm_request_t * request );
1072
1013
static int ompi_comm_idup_getcid (ompi_comm_request_t * request );
@@ -1085,7 +1026,7 @@ int ompi_comm_idup_with_info (ompi_communicator_t *comm, ompi_info_t *info, ompi
1085
1026
static int ompi_comm_idup_internal (ompi_communicator_t * comm , ompi_group_t * group , ompi_group_t * remote_group ,
1086
1027
ompi_info_t * info , ompi_communicator_t * * newcomm , ompi_request_t * * req )
1087
1028
{
1088
- struct ompi_comm_idup_with_info_context * context ;
1029
+ ompi_comm_idup_with_info_context_t * context ;
1089
1030
ompi_comm_request_t * request ;
1090
1031
ompi_request_t * subreq [1 ];
1091
1032
int rc ;
@@ -1101,15 +1042,15 @@ static int ompi_comm_idup_internal (ompi_communicator_t *comm, ompi_group_t *gro
1101
1042
return OMPI_ERR_OUT_OF_RESOURCE ;
1102
1043
}
1103
1044
1104
- context = calloc ( 1 , sizeof ( * context ) );
1045
+ context = OBJ_NEW ( ompi_comm_idup_with_info_context_t );
1105
1046
if (NULL == context ) {
1106
1047
ompi_comm_request_return (request );
1107
1048
return OMPI_ERR_OUT_OF_RESOURCE ;
1108
1049
}
1109
1050
1110
1051
context -> comm = comm ;
1111
1052
1112
- request -> context = context ;
1053
+ request -> context = & context -> super ;
1113
1054
1114
1055
rc = ompi_comm_set_nb (& context -> newcomp , /* new comm */
1115
1056
comm , /* old comm */
@@ -1142,8 +1083,8 @@ static int ompi_comm_idup_internal (ompi_communicator_t *comm, ompi_group_t *gro
1142
1083
1143
1084
static int ompi_comm_idup_getcid (ompi_comm_request_t * request )
1144
1085
{
1145
- struct ompi_comm_idup_with_info_context * context =
1146
- (struct ompi_comm_idup_with_info_context * ) request -> context ;
1086
+ ompi_comm_idup_with_info_context_t * context =
1087
+ (ompi_comm_idup_with_info_context_t * ) request -> context ;
1147
1088
ompi_request_t * subreq [1 ];
1148
1089
int rc , mode ;
1149
1090
@@ -1154,11 +1095,8 @@ static int ompi_comm_idup_getcid (ompi_comm_request_t *request)
1154
1095
}
1155
1096
1156
1097
/* Determine context id. It is identical to f_2_c_handle */
1157
- rc = ompi_comm_nextcid_nb (context -> newcomp , /* new communicator */
1158
- context -> comm , /* old comm */
1159
- NULL , /* bridge comm */
1160
- mode , /* mode */
1161
- subreq ); /* new subrequest */
1098
+ rc = ompi_comm_nextcid_nb (context -> newcomp , context -> comm , NULL , NULL ,
1099
+ NULL , false, mode , subreq );
1162
1100
if (OMPI_SUCCESS != rc ) {
1163
1101
ompi_comm_request_return (request );
1164
1102
return rc ;
@@ -1171,8 +1109,8 @@ static int ompi_comm_idup_getcid (ompi_comm_request_t *request)
1171
1109
1172
1110
static int ompi_comm_idup_with_info_activate (ompi_comm_request_t * request )
1173
1111
{
1174
- struct ompi_comm_idup_with_info_context * context =
1175
- (struct ompi_comm_idup_with_info_context * ) request -> context ;
1112
+ ompi_comm_idup_with_info_context_t * context =
1113
+ (ompi_comm_idup_with_info_context_t * ) request -> context ;
1176
1114
ompi_request_t * subreq [1 ];
1177
1115
int rc , mode ;
1178
1116
@@ -1187,7 +1125,7 @@ static int ompi_comm_idup_with_info_activate (ompi_comm_request_t *request)
1187
1125
context -> newcomp -> c_contextid , context -> comm -> c_contextid );
1188
1126
1189
1127
/* activate communicator and init coll-module */
1190
- rc = ompi_comm_activate_nb (& context -> newcomp , context -> comm , NULL , mode , subreq );
1128
+ rc = ompi_comm_activate_nb (& context -> newcomp , context -> comm , NULL , NULL , NULL , false, mode , subreq );
1191
1129
if ( OMPI_SUCCESS != rc ) {
1192
1130
return rc ;
1193
1131
}
@@ -1233,13 +1171,7 @@ int ompi_comm_create_group (ompi_communicator_t *comm, ompi_group_t *group, int
1233
1171
}
1234
1172
1235
1173
/* Determine context id. It is identical to f_2_c_handle */
1236
- rc = ompi_comm_nextcid ( newcomp , /* new communicator */
1237
- comm , /* old comm */
1238
- newcomp , /* bridge comm (used to pass the group into the group allreduce) */
1239
- & tag , /* user defined tag */
1240
- NULL , /* remote_leader */
1241
- mode , /* mode */
1242
- -1 ); /* send_first */
1174
+ rc = ompi_comm_nextcid (newcomp , comm , NULL , & tag , NULL , false, mode );
1243
1175
if ( OMPI_SUCCESS != rc ) {
1244
1176
return rc ;
1245
1177
}
@@ -1249,13 +1181,7 @@ int ompi_comm_create_group (ompi_communicator_t *comm, ompi_group_t *group, int
1249
1181
newcomp -> c_contextid , comm -> c_contextid );
1250
1182
1251
1183
/* activate communicator and init coll-module */
1252
- rc = ompi_comm_activate ( & newcomp , /* new communicator */
1253
- comm ,
1254
- newcomp ,
1255
- & tag ,
1256
- NULL ,
1257
- mode ,
1258
- -1 );
1184
+ rc = ompi_comm_activate (& newcomp , comm , NULL , & tag , NULL , false, mode );
1259
1185
if ( OMPI_SUCCESS != rc ) {
1260
1186
return rc ;
1261
1187
}
@@ -1924,13 +1850,8 @@ int ompi_comm_enable(ompi_communicator_t *old_comm,
1924
1850
int ret = OMPI_SUCCESS ;
1925
1851
1926
1852
/* Determine context id. It is identical to f_2_c_handle */
1927
- ret = ompi_comm_nextcid ( new_comm , /* new communicator */
1928
- old_comm , /* old comm */
1929
- NULL , /* bridge comm */
1930
- NULL , /* local leader */
1931
- NULL , /* remote_leader */
1932
- OMPI_COMM_CID_INTRA , /* mode */
1933
- -1 ); /* send first, doesn't matter */
1853
+ ret = ompi_comm_nextcid (new_comm , old_comm , NULL , NULL , NULL , false,
1854
+ OMPI_COMM_CID_INTRA );
1934
1855
if (OMPI_SUCCESS != ret ) {
1935
1856
/* something wrong happened while setting the communicator */
1936
1857
goto complete_and_return ;
@@ -1953,15 +1874,8 @@ int ompi_comm_enable(ompi_communicator_t *old_comm,
1953
1874
goto complete_and_return ;
1954
1875
}
1955
1876
1956
- ret = ompi_comm_activate ( & new_comm , /* new communicator */
1957
- old_comm , /* old comm */
1958
- NULL , /* bridge comm */
1959
- NULL , /* local leader */
1960
- NULL , /* remote_leader */
1961
- OMPI_COMM_CID_INTRA , /* mode */
1962
- -1 ); /* send first, doesn't matter */
1963
-
1964
-
1877
+ ret = ompi_comm_activate (& new_comm , old_comm , NULL , NULL , NULL , false,
1878
+ OMPI_COMM_CID_INTRA );
1965
1879
if (OMPI_SUCCESS != ret ) {
1966
1880
/* something wrong happened while setting the communicator */
1967
1881
goto complete_and_return ;
0 commit comments