Esempio n. 1
0
    G1 = kdt.DiGraph.load(file)
    # G1.toBool()
else:
    if kdt.master():
        usage()
    sys.exit(2)


# Call BC
before = time.time()
bc, nStartVerts = G1.centrality("approxBC", sample=sample, BCdebug=BCdebug, batchSize=batchSize, retNVerts=True)
time = time.time() - before

# Torus BC scores should all be identical.
if source == Source.TORUS and ((bc - bc[0]) > 1e-15).any():
    if kdt.master():
        print "not all vertices have same BC value"

# Report
nedges = G1._spm.getnee() * nStartVerts
TEPS = float(nedges) / time
min = bc.min()
max = bc.max()
mean = bc.mean()
std = bc.std()
if kdt.master():
    print "bc[0] = %f, min=%f, max=%f, mean=%f, std=%f" % (bc[0], min, max, mean, std)
    print "   used %d starting vertices" % nStartVerts
    print "   took %4.3f seconds" % time
    print "   TEPS = %s (assumes the graph was connected)" % splitthousands(TEPS)
Esempio n. 2
0
	itertime = time.time() - before
	nedges = len((parents[origI] != -1).find())
	
	K2elapsed.append(itertime)
	K2edges.append(nedges)
	K2TEPS.append(nedges/itertime)
	
	i += 1
	verifyInitTime = time.time()
	verifyResult = "succeeded"
	if not k2Validate(G, start, parents):
		verifyResult = "FAILED"
	verifyTime = time.time() - verifyInitTime

	if kdt.master():
		print "iteration %d: start=%d, BFS took %fs, verification took %fs and %s, TEPS=%s"%(i, start, (itertime), verifyTime, verifyResult, splitthousands(nedges/itertime))

if kdt.master():
	print 'Graph500 benchmark run for scale = %2i' % scale
	print 'Kernel 1 time = %8.4f seconds' % K1elapsed
	#print 'Kernel 2 time = %8.4f seconds' % K2elapsed
	#print '                    %8.4f seconds for each of %i starts' % (K2elapsed/nstarts, nstarts)
	#print 'Kernel 2 TEPS = %7.4e' % (K2edges/K2elapsed)
	
	print "\nKernel 2 BFS execution times"
	printstats(K2elapsed, "time", False)
	
	print "\nKernel 2 number of edges traversed"
	printstats(K2edges, "nedge", False)
	
	print "\nKernel 2 TEPS"
Esempio n. 3
0
	B._spm.Apply(kdt.pyCombBLAS.set(1))
else:
	inmatrixfile = sys.argv[1]
	if (kdt.master()):
		print "Loading matrix from",inmatrixfile
	B = kdt.DiGraph.load(inmatrixfile)

bedges = B._spm.getnee()

expansion=3
inflation = 3
prunelimit = 0.0000001
addSelfLoops=False

# nedges run
if kdt.master():
	print "Starting run to find number of edges..."
C, nedges = B._markov(addSelfLoops=addSelfLoops, expansion=expansion, inflation=inflation, prunelimit=prunelimit, retNEdges=True)

# timed run
if kdt.master():
	print "nedges=%d. Starting timed run..."%(nedges)
before = time.time()
B._markov(addSelfLoops=addSelfLoops, expansion=expansion, inflation=inflation, prunelimit=prunelimit)
time = time.time() - before


cedges = C._spm.getnee()
if kdt.master():
	print "Started with %d edges and finished with %d. Took %lfs, TEPS=%s"%(bedges, cedges, time, splitthousands(nedges/time))