@@ -5169,15 +5169,39 @@ void PREFIX (form_team) (int team_id, caf_team_t *team, int index __attribute__
5169
5169
{
5170
5170
struct caf_teams_list * tmp ;
5171
5171
void * tmp_team ;
5172
- MPI_Comm newcomm ;
5172
+ MPI_Comm * newcomm ;
5173
5173
MPI_Comm * current_comm = & current_team ;
5174
5174
5175
- MPI_Comm_split (* current_comm , team_id , caf_this_image , & newcomm );
5175
+ MPI_Barrier (CAF_COMM_WORLD );
5176
+ newcomm = (MPI_Comm * )calloc (1 ,sizeof (MPI_Comm ));
5177
+ MPI_Comm_split (* current_comm , team_id , caf_this_image , newcomm );
5176
5178
5177
5179
tmp = calloc (1 ,sizeof (struct caf_teams_list ));
5178
5180
tmp -> prev = teams_list ;
5179
5181
teams_list = tmp ;
5180
5182
teams_list -> team_id = team_id ;
5181
- teams_list -> team = & newcomm ;
5182
- * team = & newcomm ;
5183
+ teams_list -> team = newcomm ;
5184
+ * team = newcomm ;
5185
+ }
5186
+
5187
+ void PREFIX (change_team ) (caf_team_t * team , int coselector __attribute__ ((unused )))
5188
+ {
5189
+ void * tmp_team ;
5190
+ MPI_Comm * tmp_comm ;
5191
+ MPI_Barrier (CAF_COMM_WORLD );
5192
+ tmp_team = (void * )* team ;
5193
+ tmp_comm = (MPI_Comm * )tmp_team ;
5194
+ CAF_COMM_WORLD = * tmp_comm ;
5195
+ MPI_Comm_rank (* tmp_comm ,& caf_this_image );
5196
+ caf_this_image ++ ;
5197
+ MPI_Comm_size (* tmp_comm ,& caf_num_images );
5198
+
5199
+ /* MPI_Comm_split(*current_comm, team_id, caf_this_image, &newcomm); */
5200
+
5201
+ /* tmp = calloc(1,sizeof(struct caf_teams_list)); */
5202
+ /* tmp->prev = teams_list; */
5203
+ /* teams_list = tmp; */
5204
+ /* teams_list->team_id = team_id; */
5205
+ /* teams_list->team = &newcomm; */
5206
+ /* *team = &newcomm; */
5183
5207
}
0 commit comments