1
1

fixing some group function with respect to how to determine the rank of a process in the group.

This commit was SVN r2623.
Этот коммит содержится в:
Edgar Gabriel 2004-09-13 09:03:10 +00:00
родитель e2a5ba5783
Коммит 0ca2a77b68
4 изменённых файлов: 42 добавлений и 8 удалений

Просмотреть файл

@ -110,8 +110,22 @@ int MPI_Group_difference(MPI_Group group1, MPI_Group group2,
/* find my rank */
my_group_rank=group1_pointer->grp_my_rank;
my_proc_pointer=group1_pointer->grp_proc_pointers[my_group_rank];
ompi_set_group_rank(new_group_pointer,my_proc_pointer);
if ( MPI_UNDEFINED != my_group_rank ) {
my_proc_pointer=group1_pointer->grp_proc_pointers[my_group_rank];
}
else {
my_group_rank=group2_pointer->grp_my_rank;
if ( MPI_UNDEFINED != my_group_rank ) {
my_proc_pointer=group2_pointer->grp_proc_pointers[my_group_rank];
}
}
if ( MPI_UNDEFINED == my_group_rank ) {
new_group_pointer->grp_my_rank = MPI_UNDEFINED;
}
else {
ompi_set_group_rank(new_group_pointer,my_proc_pointer);
}
*new_group = (MPI_Group)new_group_pointer;

Просмотреть файл

@ -29,8 +29,7 @@ int MPI_Group_free(MPI_Group *group)
if (MPI_PARAM_CHECK) {
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
if ((MPI_GROUP_NULL == *group) || (MPI_GROUP_EMPTY == *group) ||
(NULL == *group) ) {
if ((MPI_GROUP_NULL == *group) || (NULL == *group) ) {
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_GROUP,
FUNC_NAME);
}

Просмотреть файл

@ -99,8 +99,22 @@ int MPI_Group_intersection(MPI_Group group1, MPI_Group group2,
/* find my rank */
my_group_rank=group1_pointer->grp_my_rank;
my_proc_pointer=group1_pointer->grp_proc_pointers[my_group_rank];
ompi_set_group_rank(new_group_pointer,my_proc_pointer);
if ( MPI_UNDEFINED != my_group_rank ) {
my_proc_pointer=group1_pointer->grp_proc_pointers[my_group_rank];
}
else {
my_group_rank=group2_pointer->grp_my_rank;
if ( MPI_UNDEFINED != my_group_rank ) {
my_proc_pointer=group2_pointer->grp_proc_pointers[my_group_rank];
}
}
if ( MPI_UNDEFINED == my_group_rank ) {
new_group_pointer->grp_my_rank = MPI_UNDEFINED;
}
else {
ompi_set_group_rank(new_group_pointer,my_proc_pointer);
}
*new_group = (MPI_Group)new_group_pointer;

Просмотреть файл

@ -125,12 +125,19 @@ int MPI_Group_union(MPI_Group group1, MPI_Group group2, MPI_Group *new_group)
my_group_rank = group1_pointer->grp_my_rank;
if (MPI_UNDEFINED == my_group_rank) {
my_group_rank = group2_pointer->grp_my_rank;
my_proc_pointer = group2_pointer->grp_proc_pointers[my_group_rank];
if ( MPI_UNDEFINED != my_group_rank) {
my_proc_pointer = group2_pointer->grp_proc_pointers[my_group_rank];
}
} else {
my_proc_pointer = group1_pointer->grp_proc_pointers[my_group_rank];
}
ompi_set_group_rank(new_group_pointer, my_proc_pointer);
if ( MPI_UNDEFINED == my_group_rank ) {
new_group_pointer->grp_my_rank = MPI_UNDEFINED;
}
else {
ompi_set_group_rank(new_group_pointer, my_proc_pointer);
}
*new_group = (MPI_Group) new_group_pointer;