@@ -173,6 +173,9 @@ char err_buffer[MPI_MAX_ERROR_STRING];
173
173
MPI_COMM_WORLD for interoperability purposes. */
174
174
MPI_Comm CAF_COMM_WORLD ;
175
175
176
+ static caf_teams_list * teams_list = NULL ;
177
+ static MPI_Comm current_team ;
178
+
176
179
#ifdef WITH_FAILED_IMAGES
177
180
/* The stati of the other images. image_stati is an array of size
178
181
* caf_num_images at the beginning the status of each image is noted here
@@ -754,6 +757,8 @@ PREFIX (init) (int *argc, char ***argv)
754
757
755
758
stat_tok = malloc (sizeof (MPI_Win ));
756
759
760
+ current_team = CAF_COMM_WORLD ;
761
+
757
762
#ifdef WITH_FAILED_IMAGES
758
763
MPI_Comm_dup (MPI_COMM_WORLD , & alive_comm );
759
764
/* Handling of failed/stopped images is done by setting an error handler
@@ -4310,7 +4315,6 @@ PREFIX(atomic_ref) (caf_token_t token, size_t offset,
4310
4315
return ;
4311
4316
}
4312
4317
4313
-
4314
4318
void
4315
4319
PREFIX (atomic_cas ) (caf_token_t token , size_t offset ,
4316
4320
int image_index , void * old , void * compare ,
@@ -4802,3 +4806,20 @@ unimplemented_alloc_comps_message (const char * functionname)
4802
4806
exit (EXIT_FAILURE );
4803
4807
#endif
4804
4808
}
4809
+
4810
+ void PREFIX (form_team ) (int team_id , caf_team_t * team , int index __attribute__ ((unused )))
4811
+ {
4812
+ struct caf_teams_list * tmp ;
4813
+ void * tmp_team ;
4814
+ MPI_Comm newcomm ;
4815
+ MPI_Comm * current_comm = & current_team ;
4816
+
4817
+ MPI_Comm_split (* current_comm , team_id , caf_this_image , & newcomm );
4818
+
4819
+ tmp = calloc (1 ,sizeof (struct caf_teams_list ));
4820
+ tmp -> prev = teams_list ;
4821
+ teams_list = tmp ;
4822
+ teams_list -> team_id = team_id ;
4823
+ teams_list -> team = & newcomm ;
4824
+ * team = & newcomm ;
4825
+ }
0 commit comments