Example #1
0
QString TransitionInfoBin::getCompleteInputsStr(Machine* m/*=NULL*/, Options* opt/*=NULL*/)
{
  QString res;
  res = getInputsStr(m, opt);
  if (opt)
  {
    if (getInputInfo()->isInverted())
      res = opt->getInversionDescriptor() + " " + res;
    else if (getInputInfo()->getAnyInput())
      res = opt->getAnyInputDescriptor();
    else if (getInputInfo()->isDefault())
      res = opt->getDefaultTransitionDescriptor();
  }
  return res;
}
Example #2
0
void PriorityMuxer::clearAll(bool forceClearAll)
{
	if (forceClearAll)
	{
		_activeInputs.clear();
		_currentPriority = PriorityMuxer::LOWEST_PRIORITY;
		_activeInputs[_currentPriority] = _lowestPriorityInfo;
	}
	else
	{
		for(auto key : _activeInputs.keys())
		{
			const InputInfo info = getInputInfo(key);
			if ((info.componentId == hyperion::COMP_COLOR || info.componentId == hyperion::COMP_EFFECT) && key < PriorityMuxer::LOWEST_PRIORITY-1)
			{
				clearInput(key);
			}
		}
	}
}
Example #3
0
void runMaster(int numCenters, int numRounds, int numWorkers,
        char* outputFileName){
    struct inputInfo info;
    info = getInputInfo(DATAFILE);
    int strandLength = info.strandLength;
    printf("dickface strandLength %d\n", strandLength);
    int numStrands = info.totalLines - 1;
    int numNodes;
    Strand *centroids;
    int i;
    MPI_Comm_size(MPI_COMM_WORLD, &numNodes);
    printf("About to divide points\n");
    fflush(stdout);
    master_dividePoints(numStrands, numWorkers);
    centroids = malloc(sizeof(Strand)*numCenters);
    for(i = 0; i < numCenters; i++)
    {
        centroids[i] = malloc(sizeof(int) * strandLength);    
    }
    printf("About to assign centroids\n");
    fflush(stdout);
    assignCentroids(centroids, numCenters, strandLength);
    sendNumRounds(numWorkers,numRounds);

    sendNumCentroids(numWorkers,numCenters);
    sendStrandLength(numWorkers,strandLength); //TODO write this for worker 

    for(i = 0; i < numRounds; i++){
        printf("master starting round %d\n",i);
        calculateCentroids(numCenters, numWorkers, strandLength, centroids);
        printf("master done with round %d\n",i);
    }
    //writePointsOutput should write centroids out to a file
    writeStrandsOutput(numCenters, centroids, strandLength, outputFileName);
    // free(centroids);
}