if (group == NULL) {
retval = MPI_ERR_ARG;
} else {
- if(*group!= smpi_comm_group(MPI_COMM_WORLD))// do not free the group of the comm_world
smpi_group_destroy(*group);
*group = MPI_GROUP_NULL;
retval = MPI_SUCCESS;
smpi_group_set_mapping(*newgroup, proc2, i);
}
}
- smpi_group_use(*newgroup);
retval = MPI_SUCCESS;
}
smpi_bench_begin();
}
}
}
- smpi_group_use(*newgroup);
retval = MPI_SUCCESS;
}
smpi_bench_begin();
}
}
}
- smpi_group_use(*newgroup);
retval = MPI_SUCCESS;
}
smpi_bench_begin();
*newgroup = MPI_GROUP_EMPTY;
} else if (n == smpi_group_size(group)) {
*newgroup = group;
+ if(group!= smpi_comm_group(MPI_COMM_WORLD)
+ && group != MPI_GROUP_NULL
+ && group != smpi_comm_group(MPI_COMM_SELF)
+ && group != MPI_GROUP_EMPTY)
+ smpi_group_use(group);
} else {
*newgroup = smpi_group_new(n);
for (i = 0; i < n; i++) {
smpi_group_set_mapping(*newgroup, index, i);
}
}
- smpi_group_use(*newgroup);
retval = MPI_SUCCESS;
}
smpi_bench_begin();
} else {
if (n == 0) {
*newgroup = group;
+ if(group!= smpi_comm_group(MPI_COMM_WORLD)
+ && group != MPI_GROUP_NULL
+ && group != smpi_comm_group(MPI_COMM_SELF)
+ && group != MPI_GROUP_EMPTY)
+ smpi_group_use(group);
} else if (n == smpi_group_size(group)) {
*newgroup = MPI_GROUP_EMPTY;
} else {
xbt_free(to_exclude);
}
- smpi_group_use(*newgroup);
retval = MPI_SUCCESS;
}
smpi_bench_begin();
}
}
}
- smpi_group_use(*newgroup);
retval = MPI_SUCCESS;
}
smpi_bench_begin();
} else {
if (n == 0) {
*newgroup = group;
+ if(group!= smpi_comm_group(MPI_COMM_WORLD)
+ && group != MPI_GROUP_NULL
+ && group != smpi_comm_group(MPI_COMM_SELF)
+ && group != MPI_GROUP_EMPTY)
+ smpi_group_use(group);
} else {
size = smpi_group_size(group);
for (i = 0; i < n; i++) {
}
}
}
- smpi_group_use(*newgroup);
retval = MPI_SUCCESS;
}
retval = MPI_ERR_ARG;
} else {
*group = smpi_comm_group(comm);
+ if(*group!= smpi_comm_group(MPI_COMM_WORLD)
+ && *group != MPI_GROUP_NULL
+ && *group != smpi_comm_group(MPI_COMM_SELF)
+ && *group != MPI_GROUP_EMPTY)
+ smpi_group_use(*group);
retval = MPI_SUCCESS;
}
smpi_bench_begin();
} else if (comm == MPI_COMM_NULL) {
retval = MPI_ERR_COMM;
} else if (source == MPI_PROC_NULL) {
+ *flag=TRUE;
smpi_empty_status(status);
status->MPI_SOURCE = MPI_PROC_NULL;
retval = MPI_SUCCESS;
|| ((recvbuf !=MPI_IN_PLACE) && (recvtype == MPI_DATATYPE_NULL))) {
retval = MPI_ERR_TYPE;
} else {
-
- if(recvbuf==MPI_IN_PLACE){
- recvcount=0;
+ if (recvbuf == MPI_IN_PLACE) {
+ recvtype=sendtype;
+ recvcount=sendcount;
}
mpi_coll_scatter_fun(sendbuf, sendcount, sendtype, recvbuf, recvcount,
recvtype, root, comm);
|| ((recvbuf !=MPI_IN_PLACE) && (recvtype == MPI_DATATYPE_NULL))) {
retval = MPI_ERR_TYPE;
} else {
-
- if(recvbuf==MPI_IN_PLACE){
- recvcount=0;
+ if (recvbuf == MPI_IN_PLACE) {
+ recvtype=sendtype;
+ recvcount=sendcounts[smpi_comm_rank(comm)];
}
-
smpi_mpi_scatterv(sendbuf, sendcounts, displs, sendtype, recvbuf,
recvcount, recvtype, root, comm);
retval = MPI_SUCCESS;
retval = MPI_ERR_ARG;
} else {
- char* sendtmpbuf = (char*) sendbuf;
- if( sendbuf == MPI_IN_PLACE ) {
- sendtmpbuf = (char *)xbt_malloc(count*smpi_datatype_get_extent(datatype));
- smpi_datatype_copy(recvbuf, count, datatype,sendtmpbuf, count, datatype);
- }
-
- mpi_coll_reduce_fun(sendtmpbuf, recvbuf, count, datatype, op, root, comm);
-
- if( sendbuf == MPI_IN_PLACE ) {
- xbt_free(sendtmpbuf);
- }
+ mpi_coll_reduce_fun(sendbuf, recvbuf, count, datatype, op, root, comm);
retval = MPI_SUCCESS;
}