Home - Summaries: (main) : (py3.11) : Everything - Nightly builds - Benchmarks - RPython - Builders - About

pypy/module/pypyjit/test_pypy_c/test_micronumpy.py::TestMicroNumPy::()::test_mixed_div

self = <pypy.module.pypyjit.test_pypy_c.test_micronumpy.TestMicroNumPy object at 0x000001f1c526f280>

    def test_mixed_div(self):
        N = 1500
        def main():
            N = 1500
            import _numpypy.multiarray as np
            arr = np.zeros(N)
            l = [arr[i]/2. for i in range(N)]
            return l
>       log = self.run(main, [])

pypy\module\pypyjit\test_pypy_c\test_micronumpy.py:427: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <pypy.module.pypyjit.test_pypy_c.test_micronumpy.TestMicroNumPy object at 0x000001f1c526f280>
func_or_src = <function main at 0x000001f1c2ef7b50>, args = []
import_site = False, discard_stdout_before_last_line = False
jitopts = {'disable_unrolling': 9999, 'threshold': 200}
src = <py._code.source.Source object at 0x000001f1c526f2f0>, funcname = 'main'
arglist = ''
f = <closed file 'd:\\systemtemp\\pytest\\usession-win-rpython-500\\test-pypy-jit\\test_mixed_div.py', mode 'w' at 0x000001f1c2ef7bc8>
logfile = local('d:\\systemtemp\\pytest\\usession-win-rpython-500\\test-pypy-jit\\test_mixed_div.log')
cmdline = ['d:\\pypy_stuff\\buildbot64\\slave\\pypy-c-jit-win-x86-64\\build\\pypy\\goal\\pypy-c.exe', '-S', '--jit', 'threshold=200,disable_unrolling=9999', 'd:\\systemtemp\\pytest\\usession-win-rpython-500\\test-pypy-jit\\test_mixed_div.py']
key = 'disable_unrolling'

    def run(self, func_or_src, args=[], import_site=False,
            discard_stdout_before_last_line=False, **jitopts):
        jitopts.setdefault('threshold', 200)
        jitopts.setdefault('disable_unrolling', 9999)
        src = py.code.Source(func_or_src)
        if isinstance(func_or_src, types.FunctionType):
            funcname = func_or_src.func_name
        else:
            funcname = 'main'
        # write the snippet
        arglist = ', '.join(map(repr, args))
        with self.filepath.open("w") as f:
            # we don't want to see the small bridges created
            # by the checkinterval reaching the limit
            f.write("import sys\n")
            f.write("sys.setcheckinterval(10000000)\n")
            f.write(str(src) + "\n")
            f.write("print %s(%s)\n" % (funcname, arglist))
        #
        # run a child pypy-c with logging enabled
        logfile = self.filepath.new(ext='.log')
        #
        cmdline = [sys.executable]
        if not import_site:
            cmdline.append('-S')
        if jitopts:
            jitcmdline = ['%s=%s' % (key, value)
                          for key, value in jitopts.items()]
            cmdline += ['--jit', ','.join(jitcmdline)]
        cmdline.append(str(self.filepath))
        #
        env = os.environ.copy()
        # TODO old logging system
        env['PYPYLOG'] = self.log_string + ':' + str(logfile)
        jitlogfile = str(logfile) + '.jlog'
        env['JITLOG'] = str(jitlogfile)
        pipe = subprocess.Popen(cmdline,
                                env=env,
                                stdout=subprocess.PIPE,
                                stderr=subprocess.PIPE)
        stdout, stderr = pipe.communicate()
        if pipe.wait() < 0:
            raise IOError("subprocess was killed by signal %d" % (
                pipe.returncode,))
        if stderr.startswith('SKIP:'):
            py.test.skip(stderr)
        #if stderr.startswith('debug_alloc.h:'):   # lldebug builds
        #    stderr = ''
        #assert not stderr
        if stderr:
            print '*** stderr of the subprocess: ***'
            print stderr
        #
        if discard_stdout_before_last_line:
            stdout = stdout.splitlines(True)[-1]
        #
        # parse the JIT log
        rawlog = logparser.parse_log_file(str(logfile), verbose=False)
        rawtraces = logparser.extract_category(rawlog, 'jit-log-opt-')
        log = Log(rawtraces)
>       log.result = eval(stdout)
E         File "<string>", line 0
E           
E          ^
E       SyntaxError: invalid syntax

pypy\module\pypyjit\test_pypy_c\test_00_model.py:88: SyntaxError
---------- Captured stdout call ----------
*** stderr of the subprocess: ***
Traceback (most recent call last):
  File "d:\systemtemp\pytest\usession-win-rpython-500\test-pypy-jit\test_mixed_div.py", line 9, in <module>
    print main()
  File "d:\systemtemp\pytest\usession-win-rpython-500\test-pypy-jit\test_mixed_div.py", line 5, in main
    import _numpypy.multiarray as np
ImportError: No module named _numpypy
builder: pypy-c-jit-win-x86-64 build #2372+
test: pypy/module/pypyjit/test_pypy_c/test_micronumpy.py::TestMicroNumPy::()::test_mixed_div