int colsum(int from,int to)
{
	int i,sum;
	if (from<0||from>=EXTRACOLUMNCOUNT){return(-1);};
	if (to<0||to>=EXTRACOLUMNCOUNT){return(-1);};
	if (to<from){return(-1);};

	sum=0;
	for (i=from;i<=to;i++)
	{
		sum+=bti(visar[i]);
	};
	return(sum);
};
Exemplo n.º 2
0
double petabricks::PetabricksRuntime::raceConfigs(int n, const std::vector<std::string>* files, int /*retries*/) {
  TestResult aresult;
  TestResult bresult;
  SubprocessTestIsolation ati(GRAPH_MAX_SEC);
  SubprocessTestIsolation bti(GRAPH_MAX_SEC);
  TunableManager& tm = TunableManager::instance();

  int ta = (int)( worker_threads * RACE_SPLIT_RATIO );
  int tb = worker_threads - ta;
  JTRACE("race split")(ta)(tb);
  try {
    loadTestInput(n, files);
    if(CONFIG_FILENAME_ALT != "None") {
      if(ati.beginTest(worker_threads/2)) {
        tm.load(CONFIG_FILENAME);
        _main->reallocate(std::max(IOGEN_N, n));
        computeWrapperSubproc(ati, -1, aresult, NULL);
        ati.endTest(aresult);
      } else if(bti.beginTest(worker_threads/2)) {
        tm.load(CONFIG_FILENAME_ALT);
        _main->reallocate(std::max(IOGEN_N, n));
        computeWrapperSubproc(bti, -1, bresult, NULL);
        bti.endTest(bresult);
      }else{
        SubprocessTestIsolation::recvFirstResult(ati, aresult, bti, bresult);
      }
    } else {
      if(ati.beginTest(worker_threads)) {
        tm.load(CONFIG_FILENAME);
        _main->reallocate(std::max(IOGEN_N, n));
        computeWrapperSubproc(ati, -1, aresult, NULL);
        ati.endTest(aresult);
      }else{
        ati.recvResult(aresult);
      }
    }
  } catch(...) {
    UNIMPLEMENTED();
  }
  std::cout.precision(15);
  std::cout << "<raceresult>" << std::endl;
  aresult.writexml(std::cout, "0");
  std::cout << std::endl;
  bresult.writexml(std::cout, "1");
  std::cout << std::endl;
  std::cout << "</raceresult>" << std::endl;
  return std::min(aresult.time, bresult.time);
}
void CVsMayaMPxFactoryBase::DisplaySummary( const MString &pluginName )
{
	minfo << "\n";
	minfo << "Maya Plugin " << pluginName.asChar() << " Contains The Following:\n";

	typedef std::multimap< std::string, CVsMayaMPxFactoryBase * > ByType_t;
	ByType_t byType;

	// Categorize all of the installed stuff by the type of thing
	for ( CVsMayaMPxFactoryBase *pF( s_pFirstFactory ); pF; pF = pF->m_pNextFactory )
	{
		byType.insert( ByType_t::value_type( pF->GetTypeName().asChar(), pF ) );
	}

	// Now loop through each category, organizing everything by the name of the thing

	typedef std::map< std::string, CVsMayaMPxFactoryBase * > ByName_t;

	for ( ByType_t::const_iterator bti( byType.begin() ); bti != byType.end(); )
	{
		minfo << "\n";
		minfo << bti->first << "s" << ":\n";
		minfo << "\n";

		ByName_t byName;
		for ( const ByType_t::const_iterator ubi( byType.upper_bound( bti->first ) ); bti != ubi; ++bti )
		{
			byName.insert( ByName_t::value_type( bti->second->GetName().asChar(), bti->second ) );
		}

		for ( ByName_t::const_iterator bni( byName.begin() ); bni != byName.end(); ++bni )
		{
			minfo << " * " << bni->first << ": " << bni->second->GetDesc().asChar() << "\n";
		}
	}

	minfo << "\n";
}