@@ -4811,15 +4811,39 @@ void PREFIX (form_team) (int team_id, caf_team_t *team, int index __attribute__
4811
4811
{
4812
4812
struct caf_teams_list * tmp ;
4813
4813
void * tmp_team ;
4814
- MPI_Comm newcomm ;
4814
+ MPI_Comm * newcomm ;
4815
4815
MPI_Comm * current_comm = & current_team ;
4816
4816
4817
- MPI_Comm_split (* current_comm , team_id , caf_this_image , & newcomm );
4817
+ MPI_Barrier (CAF_COMM_WORLD );
4818
+ newcomm = (MPI_Comm * )calloc (1 ,sizeof (MPI_Comm ));
4819
+ MPI_Comm_split (* current_comm , team_id , caf_this_image , newcomm );
4818
4820
4819
4821
tmp = calloc (1 ,sizeof (struct caf_teams_list ));
4820
4822
tmp -> prev = teams_list ;
4821
4823
teams_list = tmp ;
4822
4824
teams_list -> team_id = team_id ;
4823
- teams_list -> team = & newcomm ;
4824
- * team = & newcomm ;
4825
+ teams_list -> team = newcomm ;
4826
+ * team = newcomm ;
4827
+ }
4828
+
4829
+ void PREFIX (change_team ) (caf_team_t * team , int coselector __attribute__ ((unused )))
4830
+ {
4831
+ void * tmp_team ;
4832
+ MPI_Comm * tmp_comm ;
4833
+ MPI_Barrier (CAF_COMM_WORLD );
4834
+ tmp_team = (void * )* team ;
4835
+ tmp_comm = (MPI_Comm * )tmp_team ;
4836
+ CAF_COMM_WORLD = * tmp_comm ;
4837
+ MPI_Comm_rank (* tmp_comm ,& caf_this_image );
4838
+ caf_this_image ++ ;
4839
+ MPI_Comm_size (* tmp_comm ,& caf_num_images );
4840
+
4841
+ /* MPI_Comm_split(*current_comm, team_id, caf_this_image, &newcomm); */
4842
+
4843
+ /* tmp = calloc(1,sizeof(struct caf_teams_list)); */
4844
+ /* tmp->prev = teams_list; */
4845
+ /* teams_list = tmp; */
4846
+ /* teams_list->team_id = team_id; */
4847
+ /* teams_list->team = &newcomm; */
4848
+ /* *team = &newcomm; */
4825
4849
}
0 commit comments