+int smpi_mpi_testsome(int incount, MPI_Request requests[], int *indices,
+ MPI_Status status[])
+{
+ int i, count, count_dead;
+ MPI_Status stat;
+ MPI_Status *pstat = status == MPI_STATUSES_IGNORE ? MPI_STATUS_IGNORE : &stat;
+
+ count = 0;
+ for(i = 0; i < incount; i++) {
+ if((requests[i] != MPI_REQUEST_NULL)) {
+ if(smpi_mpi_test(&requests[i], pstat)) {
+ indices[count] = i;
+ count++;
+ if(status != MPI_STATUSES_IGNORE) {
+ memcpy(&status[i], pstat, sizeof(*pstat));
+ }
+ }
+ }else{
+ count_dead++;
+ }
+ }
+ if(count_dead==incount)return MPI_UNDEFINED;
+ else return count;
+}
+