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_Testall = PMPIO_Testall
00014 #elif defined(HAVE_PRAGMA_HP_SEC_DEF)
00015 #pragma _HP_SECONDARY_DEF PMPIO_Testall MPIO_Testall
00016 #elif defined(HAVE_PRAGMA_CRI_DUP)
00017 #pragma _CRI duplicate MPIO_Testall as PMPIO_Testall
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_Testall(int count, MPIO_Request requests[], int *flag,
00032 MPI_Status statuses[])
00033 {
00034 int done, i, err;
00035 MPIU_THREADPRIV_DECL;
00036
00037 MPIU_THREAD_CS_ENTER(ALLFUNC,);
00038 if (count == 1) {
00039 err = MPIO_Test( requests, flag, statuses );
00040 goto fn_exit;
00041 }
00042
00043
00044
00045
00046
00047
00048 done = 1;
00049 for (i=0; i<count; i++) {
00050 if (requests[i] != MPIO_REQUEST_NULL) {
00051 err = MPIO_Test( &requests[i], flag, &statuses[i] );
00052 if (!*flag) done = 0;
00053 if (err) goto fn_exit;
00054 }
00055 else {
00056 #ifdef MPICH2
00057
00058 if (statuses != MPI_STATUSES_IGNORE) {
00059 statuses[i].MPI_SOURCE = MPI_ANY_SOURCE;
00060 statuses[i].MPI_TAG = MPI_ANY_TAG;
00061 statuses[i].count = 0;
00062 statuses[i].cancelled = 0;
00063 }
00064 #else
00065 ;
00066 #endif
00067 }
00068 }
00069
00070 *flag = done;
00071
00072 err = MPI_SUCCESS;
00073 fn_exit:
00074 MPIU_THREAD_CS_EXIT(ALLFUNC,);
00075 return err;
00076 }
00077