MPI_Group group2, int *ranks2)
{
int retval, i, index;
-
smpi_bench_end();
if (group1 == MPI_GROUP_NULL || group2 == MPI_GROUP_NULL) {
retval = MPI_ERR_GROUP;
} else {
for (i = 0; i < n; i++) {
- index = smpi_group_index(group1, ranks1[i]);
- ranks2[i] = smpi_group_rank(group2, index);
+ if(ranks1[i]==MPI_PROC_NULL){
+ ranks2[i]=MPI_PROC_NULL;
+ }else{
+ index = smpi_group_index(group1, ranks1[i]);
+ ranks2[i] = smpi_group_rank(group2, index);
+ }
}
retval = MPI_SUCCESS;
}
}
}
- *newgroup = smpi_group_new(size);
- j = 0;
- for (i = 0; i < n; i++) {
- for (rank = ranges[i][0]; /* First */
- rank >= 0; /* Last */
- ) {
- index = smpi_group_index(group, rank);
- smpi_group_set_mapping(*newgroup, index, j);
- j++;
- rank += ranges[i][2]; /* Stride */
- if (ranges[i][0]<ranges[i][1]){
- if(rank > ranges[i][1])
- break;
- }else{
- if(rank < ranges[i][1])
- break;
- }
- }
+ *newgroup = smpi_group_new(size);
+ j = 0;
+ for (i = 0; i < n; i++) {
+ for (rank = ranges[i][0]; /* First */
+ rank >= 0; /* Last */
+ ) {
+ index = smpi_group_index(group, rank);
+ smpi_group_set_mapping(*newgroup, index, j);
+ j++;
+ rank += ranges[i][2]; /* Stride */
+ if (ranges[i][0]<ranges[i][1]){
+ if(rank > ranges[i][1])
+ break;
+ }else{
+ if(rank < ranges[i][1])
+ break;
+ }
}
- //}
+ }
}
smpi_group_use(*newgroup);
retval = MPI_SUCCESS;
int retval;
smpi_bench_end();
- if (outcount == NULL || indices == NULL) {
+ if (outcount == NULL) {
retval = MPI_ERR_ARG;
} else {
*outcount = smpi_mpi_waitsome(incount, requests, indices, status);
int retval;
smpi_bench_end();
- if (outcount == NULL || indices == NULL) {
+ if (outcount == NULL) {
retval = MPI_ERR_ARG;
} else {
*outcount = smpi_mpi_testsome(incount, requests, indices, status);
return retval;
}
+int PMPI_Exscan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
+ MPI_Op op, MPI_Comm comm){
+ int retval;
+
+ smpi_bench_end();
+#ifdef HAVE_TRACING
+ int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
+ TRACE_smpi_computing_out(rank);
+ TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
+#endif
+ if (comm == MPI_COMM_NULL) {
+ retval = MPI_ERR_COMM;
+ } else if (datatype == MPI_DATATYPE_NULL) {
+ retval = MPI_ERR_TYPE;
+ } else if (op == MPI_OP_NULL) {
+ retval = MPI_ERR_OP;
+ } else {
+ smpi_mpi_exscan(sendbuf, recvbuf, count, datatype, op, comm);
+ retval = MPI_SUCCESS;
+ }
+#ifdef HAVE_TRACING
+ TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
+ TRACE_smpi_computing_in(rank);
+#endif
+ smpi_bench_begin();
+ return retval;
+}
+
int PMPI_Reduce_scatter(void *sendbuf, void *recvbuf, int *recvcounts,
MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
{
NOT_YET_IMPLEMENTED
}
-int PMPI_Exscan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
- MPI_Op op, MPI_Comm comm){
- NOT_YET_IMPLEMENTED
-}
-
int PMPI_Comm_set_name(MPI_Comm comm, char* name){
NOT_YET_IMPLEMENTED
}