Exemplo n.º 1
0
std::pair<FlushContext::List,bool>
FlushEngine::getSortedTargetList()
{
    FlushContext::List unsortedTargets = getTargetList(false);
    flushengine::TlsStatsMap tlsStatsMap(_tlsStatsFactory->create());
    std::lock_guard<std::mutex> strategyGuard(_strategyLock);
    std::pair<FlushContext::List, bool> ret;
    if (_priorityStrategy) {
        ret = std::make_pair(_priorityStrategy->getFlushTargets(unsortedTargets, tlsStatsMap), true);
    } else {
        ret = std::make_pair(_strategy->getFlushTargets(unsortedTargets, tlsStatsMap), false);
    }
    return ret;
}
Exemplo n.º 2
0
Arquivo: com.c Projeto: 8l/insieme
int
setupTestListParams (  )
{
  if ( wsize % 2 != 0 )
    wsize--;

  if ( argStruct.procFile != NULL )
  {
    if ( !get2entryList ( validateProcCount, 2, MAXINT,
                          &argStruct.procListSize, argStruct.procFile,
                          &argStruct.procList, &argStruct.testCountList ) )
    {
      prestaAbort
        ( "Failed to generate valid process count list from file %s\n",
          argStruct.procFile );
      return 0;
    }
  }
  else
  {
    if ( argStruct.allTasksOnly )
    {
      argStruct.procList = &wsize;
      argStruct.procListSize = 1;
    }
    else if ( argStruct.allocPattern == 'c' )
    {
      if ( !createSeqIntArray ( 2, wsize, wsize / argStruct.procsPerNode,
                                &argStruct.procList,
                                &argStruct.procListSize ) )
      {
        return 0;
      }
    }
    else
    {
      if ( !createSeqIntArray ( 2, wsize, argStruct.messFactor,
                                &argStruct.procList,
                                &argStruct.procListSize ) )
      {
        return 0;
      }
    }
  }

  if ( argStruct.messFile != NULL )
  {
    if ( !get2entryList ( validateMessageSize, MIN_MESS_SIZE, MAX_MESS_SIZE,
                          &argStruct.messListSize, argStruct.messFile,
                          &argStruct.messList, &argStruct.iterList ) )
    {
      prestaRankPrint ( 0, "Failed to open message size source file %s.\n",
                        argStruct.messFile );
      prestaRankPrint ( 0, "Using default message sizes and iterations.\n" );
      if ( !createSeqIntArray
           ( argStruct.messStart, argStruct.messStop, argStruct.messFactor,
             &argStruct.messList, &argStruct.messListSize ) )
      {
        return 0;
      }
    }
  }
  else
  {
    if ( !createSeqIntArray ( argStruct.messStart, argStruct.messStop,
                              argStruct.messFactor, &argStruct.messList,
                              &argStruct.messListSize ) )
    {
      return 0;
    }
  }

  if ( targetFile != NULL && !getTargetList (  ) )
  {
    prestaAbort ( "Failed to open target list source file %s\n", targetFile );
    return 0;
  }

  if ( targetFile != NULL && targetListSize != wsize && rank == 0 )
  {
    prestaAbort
      ( "Target file %s entry count %d does not match MPI_COMM_WORLD size %d\n",
        targetFile, targetListSize, wsize );
    return 0;
  }

  return 1;
}