Ejemplo n.º 1
0
def exe_name_from_options(config, opts):
    from pypy.module.sys.version import svn_revision

    backend = config.translation.backend
    if not backend:
        backend = 'c'
    rev = svn_revision()

    nameparts = []

    for opt, v in opts.iteritems():
        if opt == 'translation.backend':
            backend = v
        optname = longoptfromname(config, opt).strip('-')
        if v is False:
            optname = 'no-' + optname
        elif v is not True:
            optname += '=' + str(v)
        nameparts.append(optname)

    suffix = ''
    if nameparts:

        def k(s):
            if s.startswith('no-'):
                return s[3:]
            else:
                return s

        nameparts.sort(key=k)
        suffix = '-' + '-'.join(nameparts)

    return 'pypy-%s-%d%s' % (backend, rev, suffix)
Ejemplo n.º 2
0
def exe_name_from_options(config, opts):
    from pypy.module.sys.version import svn_revision

    backend = config.translation.backend
    if not backend:
        backend = 'c'
    rev = svn_revision()

    nameparts = []

    for opt, v in opts.iteritems():
        if opt == 'translation.backend':
            backend = v
        optname = longoptfromname(config, opt).strip('-')
        if v is False:
            optname = 'no-' + optname
        elif v is not True:
            optname += '=' + str(v)
        nameparts.append(optname)

    suffix = ''
    if nameparts:
        def k(s):
            if s.startswith('no-'):
                return s[3:]
            else:
                return s
        nameparts.sort(key=k)
        suffix = '-' + '-'.join(nameparts)

    return 'pypy-%s-%d%s'%(backend, rev, suffix)
Ejemplo n.º 3
0
import os, sys
from pypy.translator.test import rpystone
from pypy.translator.goal import richards
import pypy.interpreter.gateway # needed before sys, order of imports !!!
from pypy.module.sys.version import svn_revision

# __________  Entry point  __________

VERSION = svn_revision()

# note that we have %f but no length specifiers in RPython

def pystones_main(loops):
    benchtime, stones = rpystone.pystones(abs(loops))
    s = '' # annotator happiness
    if loops >= 0:
        s = ("RPystone(%s) time for %d passes = %f" %
             (VERSION, loops, benchtime) + '\n' + (
             "This machine benchmarks at %f pystones/second\n" % stones))
    os.write(1, s)
    if loops == 12345:
        pystones_main(loops-1)

def richards_main(iterations):
    s = "Richards benchmark (RPython) starting...\n"
    os.write(1, s)
    result, startTime, endTime = richards.entry_point(iterations)
    if not result:
        os.write(2, "Incorrect results!\n")
        return
    os.write(1, "finished.\n")
Ejemplo n.º 4
0
import os, sys
from pypy.translator.test import rpystone
from pypy.translator.goal import richards
import pypy.interpreter.gateway  # needed before sys, order of imports !!!
from pypy.module.sys.version import svn_revision

# __________  Entry point  __________

VERSION = svn_revision()

# note that we have %f but no length specifiers in RPython


def pystones_main(loops):
    benchtime, stones = rpystone.pystones(abs(loops))
    s = ''  # annotator happiness
    if loops >= 0:
        s = ("RPystone(%s) time for %d passes = %f" %
             (VERSION, loops, benchtime) + '\n' +
             ("This machine benchmarks at %f pystones/second\n" % stones))
    os.write(1, s)
    if loops == 12345:
        pystones_main(loops - 1)


def richards_main(iterations):
    s = "Richards benchmark (RPython) starting...\n"
    os.write(1, s)
    result, startTime, endTime = richards.entry_point(iterations)
    if not result:
        os.write(2, "Incorrect results!\n")