6 1 1 2 8 0 2 2 9 0 0 3 9 1 2 2 10 0 1 3 11 1 1 3 12 2 2 2 13 0 2 3 14 1 2 3 17 2 2 3 18 0 3 3 19 1 3 3 22 2 3 3 27 3 3 3 nthreads = 1, nparts = 1, time = 4.744 nthreads = 2, nparts = 2, time = 1.185 nthreads = 4, nparts = 4, time = 0.533 nthreads = 8, nparts = 8, time = 0.272 nthreads = 16, nparts = 16, time = 0.141 nthreads = 32, nparts = 32, time = 0.080 nthreads = 16, nparts = 32, time = 0.078 nthreads = 8, nparts = 32, time = 0.083 nthreads = 4, nparts = 32, time = 0.081 nthreads = 2, nparts = 32, time = 0.091 nthreads = 1, nparts = 32, time = 0.174 """ print("Example output is:") print(content) print("Your output is:") run_("python runFor.py")
1 0 0 1 2 0 1 1 3 1 1 1 4 0 0 2 5 0 1 2 6 1 1 2 8 0 2 2 9 0 0 3 9 1 2 2 10 0 1 3 11 1 1 3 12 2 2 2 13 0 2 3 14 1 2 3 17 2 2 3 18 0 3 3 19 1 3 3 22 2 3 3 27 3 3 3 nthreads = 1, nparts = 1, time = 5.866 nthreads = 2, nparts = 2, time = 1.551 nthreads = 4, nparts = 4, time = 0.679 nthreads = 8, nparts = 8, time = 0.327 nthreads = 16, nparts = 16, time = 0.154 nthreads = 32, nparts = 32, time = 0.090 """ print("Example output is:") print(content) print("Your output is:") run_("python runThr.py")
#!/usr/bin/env python # runFor.py from subprocess import run, PIPE from os import sep, curdir, environ import shlex from run_ import run_ run_('gcc -std=c99 -fopenmp -lgomp msortFor.c') environ["OMP_NUM_THREADS"] = str(5) run_(curdir + sep + 'a.out 3 5') sorted = open('sorted.txt') print(sorted.read(), end='') sorted.close() for log2p in range(6): environ["OMP_NUM_THREADS"] = str(2**log2p) run_(curdir + sep + 'a.out 75 %d' % 2**log2p) for log2p in range(5): environ["OMP_NUM_THREADS"] = str(2**(4 - log2p)) run_(curdir + sep + 'a.out 75 32')
#!/usr/bin/env python # runThr.py from subprocess import run, PIPE from os import sep, curdir, environ import shlex from run_ import run_ run_('gcc -std=c99 -fopenmp -lgomp msortThr.c') environ["OMP_NUM_THREADS"] = str(5) run_(curdir + sep + 'a.out 3') sorted = open('sorted.txt') print(sorted.read(), end='') sorted.close() for log2p in range(6): environ["OMP_NUM_THREADS"] = str(2**log2p) run_(curdir + sep + 'a.out 75')
1 0 0 1 2 0 1 1 3 1 1 1 4 0 0 2 5 0 1 2 6 1 1 2 8 0 2 2 9 0 0 3 9 1 2 2 10 0 1 3 11 1 1 3 12 2 2 2 13 0 2 3 14 1 2 3 17 2 2 3 18 0 3 3 19 1 3 3 22 2 3 3 27 3 3 3 nprocs = 1, nparts = 1, time = 4.919 nprocs = 2, nparts = 2, time = 1.449 nprocs = 4, nparts = 4, time = 0.719 nprocs = 8, nparts = 8, time = 1.041 nprocs = 16, nparts = 16, time = 0.696 nprocs = 32, nparts = 32, time = 0.257 """ print("Example output is:") print(content) print("Your output is:") run_("python runP2P.py")
#!/usr/bin/env python # runP2P.py from os import curdir, sep from run_ import run_ run_(curdir + sep + 'msortP2P.py 3') sorted = open('sorted.txt') print(sorted.read(), end='') sorted.close() for log2p in range(6): p = str(2**log2p) run_('mpiexec -n %d python ' % 2**log2p + curdir + sep + 'msortP2P.py 25')