@@ -214,6 +214,9 @@ char err_buffer[MPI_MAX_ERROR_STRING];
214
214
MPI_COMM_WORLD for interoperability purposes. */
215
215
MPI_Comm CAF_COMM_WORLD ;
216
216
217
+ static caf_teams_list * teams_list = NULL ;
218
+ static MPI_Comm current_team ;
219
+
217
220
#ifdef WITH_FAILED_IMAGES
218
221
/* The stati of the other images. image_stati is an array of size
219
222
* caf_num_images at the beginning the status of each image is noted here
@@ -795,6 +798,8 @@ PREFIX (init) (int *argc, char ***argv)
795
798
796
799
stat_tok = malloc (sizeof (MPI_Win ));
797
800
801
+ current_team = CAF_COMM_WORLD ;
802
+
798
803
#ifdef WITH_FAILED_IMAGES
799
804
MPI_Comm_dup (MPI_COMM_WORLD , & alive_comm );
800
805
/* Handling of failed/stopped images is done by setting an error handler
@@ -4668,7 +4673,6 @@ PREFIX(atomic_ref) (caf_token_t token, size_t offset,
4668
4673
return ;
4669
4674
}
4670
4675
4671
-
4672
4676
void
4673
4677
PREFIX (atomic_cas ) (caf_token_t token , size_t offset ,
4674
4678
int image_index , void * old , void * compare ,
@@ -5160,3 +5164,20 @@ unimplemented_alloc_comps_message (const char * functionname)
5160
5164
exit (EXIT_FAILURE );
5161
5165
#endif
5162
5166
}
5167
+
5168
+ void PREFIX (form_team ) (int team_id , caf_team_t * team , int index __attribute__ ((unused )))
5169
+ {
5170
+ struct caf_teams_list * tmp ;
5171
+ void * tmp_team ;
5172
+ MPI_Comm newcomm ;
5173
+ MPI_Comm * current_comm = & current_team ;
5174
+
5175
+ MPI_Comm_split (* current_comm , team_id , caf_this_image , & newcomm );
5176
+
5177
+ tmp = calloc (1 ,sizeof (struct caf_teams_list ));
5178
+ tmp -> prev = teams_list ;
5179
+ teams_list = tmp ;
5180
+ teams_list -> team_id = team_id ;
5181
+ teams_list -> team = & newcomm ;
5182
+ * team = & newcomm ;
5183
+ }
0 commit comments