00001
00002
00003
00004
00005
00006
00007
00008 #include "mpioimpl.h"
00009
00010 #ifdef HAVE_WEAK_SYMBOLS
00011
00012 #if defined(HAVE_PRAGMA_WEAK)
00013 #pragma weak MPIO_Testsome = PMPIO_Testsome
00014 #elif defined(HAVE_PRAGMA_HP_SEC_DEF)
00015 #pragma _HP_SECONDARY_DEF PMPIO_Testsome MPIO_Testsome
00016 #elif defined(HAVE_PRAGMA_CRI_DUP)
00017 #pragma _CRI duplicate MPIO_Testsome as PMPIO_Testsome
00018
00019 #endif
00020
00021
00022 #define MPIO_BUILD_PROFILING
00023 #include "mpioprof.h"
00024 #endif
00025
00026
00027
00028
00029
00030
00031 int MPIO_Testsome(int count, MPIO_Request requests[], int *outcount,
00032 int indices[], MPI_Status *statuses)
00033 {
00034 int i, err;
00035 int flag;
00036 MPIU_THREADPRIV_DECL;
00037
00038 MPIU_THREAD_CS_ENTER(ALLFUNC,);
00039
00040 if (count == 1) {
00041 err = MPIO_Test( requests, &flag, statuses );
00042 if (!err) {
00043 if (flag) {
00044 indices[0] = 0;
00045 *outcount = 1;
00046 }
00047 else {
00048 *outcount = 0;
00049 }
00050 }
00051 goto fn_exit;
00052 }
00053
00054
00055 for (i=0; i<count; i++) {
00056 if (requests[i] != MPIO_REQUEST_NULL) {
00057 break;
00058 }
00059 }
00060 if (i == count) {
00061 *outcount = MPI_UNDEFINED;
00062 err = MPI_SUCCESS;
00063 goto fn_exit;
00064 }
00065
00066 err = MPI_SUCCESS;
00067 *outcount = 0;
00068 for (i=0; i<count; i++) {
00069 if (requests[i] != MPIO_REQUEST_NULL) {
00070 err = MPIO_Test( &requests[i], &flag, statuses );
00071 if (flag) {
00072 if (!err) {
00073 indices[0] = i;
00074 indices++;
00075 statuses++;
00076 *outcount = *outcount + 1;
00077 }
00078 }
00079 }
00080 }
00081
00082 fn_exit:
00083
00084 MPIU_THREAD_CS_EXIT(ALLFUNC,);
00085 return err;
00086 }