Exemple #1
0
def addAbsTiming(axis, algorithm, optimistic, size, graphtype='SOFTWARE', hostnamelike='e%',colorindex=0,markertype='D-',linelabel='nolabel', additionalwhere=''):

	fixedwhere = "enable_analysis=0 AND debug=0 AND verbose=0 AND processors>=number_of_threads AND algorithm='{0}' AND optimistic={1} AND graph_type='{2}' AND hostname LIKE '{3}' AND graph_num_nodes={4} {5}".format(algorithm,optimistic,graphtype,hostnamelike,size,additionalwhere)

	numthreads = helper.getData('number_of_threads', fixedwhere + ' GROUP BY number_of_threads')

	avgtimings = []

	if (np.size(numthreads)==0):
		return

	for nt in numthreads.flat:
		# print "NUMTHREADS = ", nt
		where = fixedwhere + ' AND number_of_threads={0}'.format(nt)
		timings = helper.getData('total_time',where)
		
		# Compute mean and stddev of first timing
		if(len(avgtimings)==0):
			mean, q25, q75 = helper.median_and_quantiles(data=timings)
			print algorithm, " :   ", mean, " , [", q25 , ",", q75, "]"
	
		violin_parts = axis.violinplot(timings,[nt],widths=0.8)

		for pc in violin_parts['bodies']:
			pc.set_color(helper.getFGcolor(colorindex))

		avgtimings.append(np.mean(timings))

	axis.plot(numthreads,avgtimings[0]/numthreads,'--',color=helper.getBGcolor(colorindex)) # ideal scaling
	axis.plot(numthreads,avgtimings,markertype,markersize=6,linewidth=1,color=helper.getFGcolor(colorindex),label=linelabel) # connecting dots
Exemple #2
0
def addAbsTiming(axis,
                 algorithm,
                 optimistic,
                 size,
                 graphtype='SOFTWARE',
                 hostnamelike='e%',
                 colorindex=0,
                 markertype='D-',
                 linelabel='nolabel',
                 additionalwhere=''):

    fixedwhere = "enable_analysis=0 AND debug=0 AND verbose=0 AND processors>=number_of_threads AND algorithm='{0}' AND optimistic={1} AND graph_type='{2}' AND hostname LIKE '{3}' AND graph_num_nodes={4} {5}".format(
        algorithm, optimistic, graphtype, hostnamelike, size, additionalwhere)

    numthreads = helper.getData('number_of_threads',
                                fixedwhere + ' GROUP BY number_of_threads')

    avgtimings = []

    if (np.size(numthreads) == 0):
        return

    for nt in numthreads.flat:
        # print "NUMTHREADS = ", nt
        where = fixedwhere + ' AND number_of_threads={0}'.format(nt)
        timings = helper.getData('total_time', where)

        # Compute mean and stddev of first timing
        if (len(avgtimings) == 0):
            mean, q25, q75 = helper.median_and_quantiles(data=timings)
            print algorithm, " :   ", mean, " , [", q25, ",", q75, "]"

        violin_parts = axis.violinplot(timings, [nt], widths=0.8)

        for pc in violin_parts['bodies']:
            pc.set_color(helper.getFGcolor(colorindex))

        avgtimings.append(np.mean(timings))

    axis.plot(numthreads,
              avgtimings[0] / numthreads,
              '--',
              color=helper.getBGcolor(colorindex))  # ideal scaling
    axis.plot(numthreads,
              avgtimings,
              markertype,
              markersize=6,
              linewidth=1,
              color=helper.getFGcolor(colorindex),
              label=linelabel)  # connecting dots
ax.set_xlim([0,0.1+ncolors*(s+0.1)])
ax.set_ylim([0,2*s+0.3])

ax.get_xaxis().set_visible(False)
ax.get_yaxis().set_visible(False)

for i in range(0,ncolors):

# Foreground Colors
	ax.add_patch(
			patches.Rectangle(
				(0.1+i*(0.1+s),0.1),	# (x,y)
				s,			# width
				s,			# height
				facecolor=helper.getFGcolor(i)
				)
			)

# Background Colors
	ax.add_patch(
			patches.Rectangle(
				(0.1+i*(0.1+s),s+0.2),	# (x,y)
				s,			# width
				s,			# height
				facecolor=helper.getBGcolor(i)
				)
			)


plt.show()