Пример #1
0
int MPI_Waitany(int count, MPI_Request* request, int* index, MPI_Status* status)
{
    while(1)
    {
        for (int i = 0; i < count; i++)
        {
            if (request[i] != MPI_REQUEST_NULL)
            {
                int flag, ret;
                centry_t* mycentry = cqueue_get_centry((long)request[i]);

                if (mycentry != NULL)
                    ret = cqueue_test(mycentry, &request[i], &flag, &status[i]);
                else
                    ret = PMPI_Test(&request[i], &flag, &status[i]);

                if (flag == 1)
                {
                    *index = i;
                    return ret;
                }
            }
        }
    }
    return MPI_SUCCESS;
}
Пример #2
0
int MPI_Test(MPI_Request *request, int *flag, MPI_Status *status)
{
    int err;
    ALLOCATE_STATUS(newstatus,1)
    err=PMPI_Test(request, flag, newstatus);
    COPY_STATUS(status,newstatus,1)
    return err;
}
Пример #3
0
int MPI_Test(MPI_Request* request, int* flag, MPI_Status* status)
{
    if (*request != MPI_REQUEST_NULL)
    {
        centry_t* mycentry = cqueue_get_centry((long)*request);

        if (mycentry != NULL)
            return cqueue_test(mycentry, request, flag, status);
        else
            return PMPI_Test(request, flag, status);
    }
    return MPI_SUCCESS;
}
Пример #4
0
int   MPI_Test(MPI_Request *request, int *flag, MPI_Status *status)
{
  int   returnVal;
  MPI_Request lreq = *request;

  
  returnVal = PMPI_Test( request, flag, status );

  if (*flag) 
    ProcessWaitTest_1( lreq, status, "MPI_Test" );

  return returnVal;
}
Пример #5
0
int PMPI_Testsome( 
        int incount, 
        MPI_Request array_of_requests[], 
        int *outcount, 
        int array_of_indices[], 
        MPI_Status array_of_statuses[] )
{
  int i, j, num_active, flag, t;
  *outcount = 0;
  j = 0;
  num_active = 0;
  for ( i = 0; i < incount; ++i )
  {
    if ( array_of_requests[i] != MPI_REQUEST_NULL )
    {
      ++num_active;
      if ( array_of_statuses == MPI_STATUSES_IGNORE )
        t = PMPI_Test( array_of_requests+i, &flag, MPI_STATUS_IGNORE );
      else
        t = PMPI_Test( array_of_requests+i, &flag, array_of_statuses+j );
      if ( t != MPI_SUCCESS )
        return t;
      
      if ( flag )
      {
        array_of_indices[j] = i;
        ++(*outcount);
        ++j;
      }
    }
  }
  
  if ( num_active == 0 )
    *outcount = MPI_UNDEFINED;
  
  return MPI_SUCCESS;
}
Пример #6
0
int MPI_Test(MPI_Request * request, int *flag, MPI_Status * status)
{
  return PMPI_Test(request, flag, status);
}