Skip to content

Commit 62071c0

Browse files
author
Alessandro Fanfarillo
committed
Passing team list element to compiler instead of MPI_Comm
1 parent b8fa0c3 commit 62071c0

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

src/mpi/mpi_caf.c

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1623,7 +1623,7 @@ PREFIX (send) (caf_token_t token, size_t offset, int image_index,
16231623
gfc_descriptor_t *dest,
16241624
caf_vector_t *dst_vector __attribute__ ((unused)),
16251625
gfc_descriptor_t *src, int dst_kind, int src_kind,
1626-
bool mrt, int *stat)
1626+
bool mrt, int *stat, void* team)
16271627
{
16281628
/* FIXME: Implement vector subscripts, type conversion and check whether
16291629
string-kind conversions are permitted.
@@ -4832,7 +4832,7 @@ void PREFIX (form_team) (int team_id, caf_team_t *team, int index __attribute__
48324832
teams_list = tmp;
48334833
teams_list->team_id = team_id;
48344834
teams_list->team = newcomm;
4835-
*team = newcomm;
4835+
*team = tmp;
48364836
}
48374837

48384838
void PREFIX (change_team) (caf_team_t *team, int coselector __attribute__ ((unused)))
@@ -4843,25 +4843,26 @@ void PREFIX (change_team) (caf_team_t *team, int coselector __attribute__ ((unus
48434843
MPI_Comm *tmp_comm;
48444844

48454845
MPI_Barrier(CAF_COMM_WORLD);
4846-
tmp_team = (void *)*team;
4846+
tmp_list = (struct caf_teams_list *)*team;
4847+
tmp_team = (void *)tmp_list->team;
48474848
tmp_comm = (MPI_Comm *)tmp_team;
48484849

48494850
tmp_used = (caf_used_teams_list *)calloc(1,sizeof(caf_used_teams_list));
48504851
tmp_used->prev = used_teams;
48514852

4852-
/* We need to look in the teams_list and find the appropriate element.
4853-
* This is not efficient but can be easily fixed in the future.
4854-
* Instead of keeping track of the communicator in the compiler
4855-
* we should keep track of the caf_teams_list element associated with it. */
4853+
/* /\* We need to look in the teams_list and find the appropriate element. */
4854+
/* * This is not efficient but can be easily fixed in the future. */
4855+
/* * Instead of keeping track of the communicator in the compiler */
4856+
/* * we should keep track of the caf_teams_list element associated with it. *\/ */
48564857

4857-
tmp_list = teams_list;
4858+
/* tmp_list = teams_list; */
48584859

4859-
while(tmp_list)
4860-
{
4861-
if(tmp_list->team == tmp_team)
4862-
break;
4863-
tmp_list = tmp_list->prev;
4864-
}
4860+
/* while(tmp_list) */
4861+
/* { */
4862+
/* if(tmp_list->team == tmp_team) */
4863+
/* break; */
4864+
/* tmp_list = tmp_list->prev; */
4865+
/* } */
48654866

48664867
if(tmp_list == NULL)
48674868
caf_runtime_error("CHANGE TEAM called on a non-existing team");

0 commit comments

Comments
 (0)