def writeResults( outfile, results ):
    fields = ( "wall", "user", "sys", "cuser", "csys", "nchunks" )

    outfile.write( "host\t%s\n" % "\t".join( ["%s_%s" % (x, y) for x,y in itertools.product( fields, Stats.Summary().getHeaders() ) ] ) )

    hosts = results.keys()
    hosts.sort()

    for host in hosts:
        result = results[host]
        outfile.write( "%s" % host )
        for f in fields:
            d = [ y.__getitem__(f) for y in result ]
            outfile.write( "\t%s" % Stats.Summary( d ) )            
        outfile.write( "\n" )
dataset/ETHPy150Open CGATOxford/cgat/obsolete/benchmark_cluster.py/writeResults/original