Esempio n. 1
0
SpanningTree::SpanningTree()
{
	double sq = sqrt(CkNumPes()*4.0-3.0) - 1; // 1 + arity + arity*arity = CkNumPes()
	arity = (int)ceil(sq/2);
	calcParent(CkMyPe());
	calcNumChildren(CkMyPe());
}
Esempio n. 2
0
	// Helper Functions
	void calcNumChildren(WordNode* w, int depth, int& aggregate){
		if(depth>0){
			--depth;
			std::set<WordNode*> next = w->getLinks();
			int size = w->getLinks().size();
			aggregate += 1;
			for(auto each : next){
				calcNumChildren(each, depth, aggregate);
			}
			return;
		}
		return;
	}