Each table row shows performance measurements for this program with a particular command-line input value N.
N | CPU secs | Elapsed secs | Memory KB | Code B | ≈ CPU Load |
---|
Read the ↓ make, command line, and program output logs to see how this program was run.
Read benchmark to see what this program should do.
# The Computer Language Benchmarks Game # http://benchmarksgame.alioth.debian.org/ # Contributed by Sebastien Loisel # Fixed by Isaac Gouy # Sped up by Josh Goldfoot # Dirtily sped up by Simon Descarpentries # Concurrency by Jason Stitt # 2to3 from multiprocessing import Pool from math import sqrt from sys import argv cdef float eval_A(int i, int j): return 1.0 / ((i + j) * (i + j + 1) / 2 + i + 1) def eval_A_times_u(u): cdef int i args = ((i, u) for i in range(len(u))) return pool.map(part_A_times_u, args) def eval_At_times_u(u): args = ((i, u) for i in range(len(u))) return pool.map(part_At_times_u, args) def eval_AtA_times_u(u): return eval_At_times_u(eval_A_times_u(u)) def part_A_times_u(xxx_todo_changeme): cdef int i, j, u_j, partial_sum (i, u) = xxx_todo_changeme partial_sum = 0 for j, u_j in enumerate(u): partial_sum += eval_A(i, j) * u_j return partial_sum def part_At_times_u(xxx_todo_changeme1): cdef int i, j, u_j, partial_sum (i, u) = xxx_todo_changeme1 partial_sum = 0 for j, u_j in enumerate(u): partial_sum += eval_A(j, i) * u_j return partial_sum def main(): cdef int n cdef float ue, ve, vBv, vv n = int(argv[1]) u = [1] * n for dummy in range(10): v = eval_AtA_times_u(u) u = eval_AtA_times_u(v) vBv = vv = 0 for ue, ve in zip(u, v): vBv += ue * ve vv += ve * ve print("%0.9f" % (sqrt(vBv/vv))) pool = Pool(processes=4) main()
Sun, 23 Apr 2023 09:40:33 GMT MAKE: make[1]: Vstupuje se do adresáře „/home/dundee/work/pybenchmarks/bencher/tmp/spectralnorm/tmp“ cp spectralnorm.cython-5.cython `echo spectralnorm.cython-5.cython | sed 's/cython-..//' | sed 's/.cython//'`.pyx cythonize -3 -bi `echo spectralnorm.cython-5.cython | sed 's/cython-..//' | sed 's/.cython//'`.pyx Error compiling Cython file: ------------------------------------------------------------ ... cdef int i, j, u_j, partial_sum (i, u) = xxx_todo_changeme partial_sum = 0 for j, u_j in enumerate(u): partial_sum += eval_A(i, j) * u_j ^ ------------------------------------------------------------ spectralnorm.pyx:42:8: Cannot assign type 'float' to 'int' Error compiling Cython file: ------------------------------------------------------------ ... cdef int i, j, u_j, partial_sum (i, u) = xxx_todo_changeme1 partial_sum = 0 for j, u_j in enumerate(u): partial_sum += eval_A(j, i) * u_j ^ ------------------------------------------------------------ spectralnorm.pyx:52:8: Cannot assign type 'float' to 'int' Compiling /home/dundee/work/pybenchmarks/bencher/tmp/spectralnorm/tmp/spectralnorm.pyx because it changed. [1/1] Cythonizing /home/dundee/work/pybenchmarks/bencher/tmp/spectralnorm/tmp/spectralnorm.pyx Traceback (most recent call last): File "/usr/bin/cythonize", line 33, in <module> sys.exit(load_entry_point('Cython==0.29.34', 'console_scripts', 'cythonize')()) File "/usr/lib/python3.10/site-packages/Cython/Build/Cythonize.py", line 225, in main cython_compile(path, options) File "/usr/lib/python3.10/site-packages/Cython/Build/Cythonize.py", line 97, in cython_compile ext_modules = cythonize( File "/usr/lib/python3.10/site-packages/Cython/Build/Dependencies.py", line 1115, in cythonize cythonize_one(*args) File "/usr/lib/python3.10/site-packages/Cython/Build/Dependencies.py", line 1238, in cythonize_one raise CompileError(None, pyx_file) Cython.Compiler.Errors.CompileError: /home/dundee/work/pybenchmarks/bencher/tmp/spectralnorm/tmp/spectralnorm.pyx make[1]: *** [/home/dundee/work/pybenchmarks/bencher/makefiles/my.linux.Makefile:21: spectralnorm.cython-5.cython_run] Chyba 1 make[1]: Opouští se adresář „/home/dundee/work/pybenchmarks/bencher/tmp/spectralnorm/tmp“ 0.31s to complete and log all make actions COMMAND LINE: /usr/bin/python3 -c "import spectralnorm" 550 PROGRAM FAILED PROGRAM OUTPUT: Traceback (most recent call last): File "<string>", line 1, in <module> ModuleNotFoundError: No module named 'spectralnorm'