Wydajno M 7.0 w systemie 2-procesorowym (Core2Duo E6750
Transkrypt
Wydajno M 7.0 w systemie 2-procesorowym (Core2Duo E6750
Wydajno M 7.0 w systemie 2-procesorowym (Core2Duo E6750). Raz benchmark uruchomiony z przypisaniem MathKernel.exe jednemu procesorowi (w WinXP Ctrl+Alt+Del, wybierz MathKernel.exe prawym przyciskiem ,,Ustaw koligacje’’)oraz 2 procesorom. Needs@"Benchmarking‘ "D BenchmarkReport @D Czas wykonania benchmarku na 1 procesorze: single = 831.4, 1.14 , 0.70 , 0.88 , 1.81 , 3.53 , 0.52 , 0.94, 3.11, 4.09 , 1.73 , 2.28 , 2.05 , 1.58 , 3.11 , 3.89< 831.4, 1.14, 0.7, 0.88, 1.81, 3.53, 0.52, 0.94, 3.11, 4.09, 1.73, 2.28, 2.05, 1.58, 3.11, 3.89< Czas na 2 procesorach: dual = 826.6 , 1.41 , 0.78 , 0.98 , 1.67 , 2.20 , 0.53 , 0.92 , 3.09 , 2.39 , 1.73 , 2.50 , 2.06 , 1.56 , 2.27 , 826.6, 1.41, 0.78, 0.98, 1.67, 2.2, 0.53, 0.92, 3.09, 2.39, 1.73, 2.5, 2.06, 1.56, 2.27, 2.45< 2.45< test = 8"Total", "Data Fitting", "Digits of Pi", "Discrete Fourier Transform", "Eigenvalues of a Matrix", "Elementary Functions", "Gamma Function", "Large Integer Multiplication ", "Matrix Arithmetic", "Matrix Multiplication ", " Matrix Transpose", " Numerical Integration", "Polynomial Expansion", "Random Number Sort", "Singular Value Decomposition ", "Solving a Linear System"< 8Total, Data Fitting, Digits of Pi, Discrete Fourier Transform, Eigenvalues of a Matrix, Elementary Functions, Gamma Function, Large Integer Multiplication , Matrix Arithmetic, Matrix Multiplication , Matrix Transpose, Numerical Integration, Polynomial Expansion, Random Number Sort, Singular Value Decomposition , Solving a Linear System< Por wnanie czas w: 8test, single, dual< Transpose TableForm Total Data Fitting Digits of Pi Discrete Fourier Transform Eigenvalues of a Matrix Elementary Functions Gamma Function Large Integer Multiplication Matrix Arithmetic Matrix Multiplication Matrix Transpose Numerical Integration Polynomial Expansion Random Number Sort Singular Value Decomposition Solving a Linear System WzglŒdne przyspieszenie operacji: 31.4 1.14 0.7 0.88 1.81 3.53 0.52 0.94 3.11 4.09 1.73 2.28 2.05 1.58 3.11 3.89 26.6 1.41 0.78 0.98 1.67 2.2 0.53 0.92 3.09 2.39 1.73 2.5 2.06 1.56 2.27 2.45 2 Mathematica_70.nb 8test, single dual< Transpose TableForm Total Data Fitting Digits of Pi Discrete Fourier Transform Eigenvalues of a Matrix Elementary Functions Gamma Function Large Integer Multiplication Matrix Arithmetic Matrix Multiplication Matrix Transpose Numerical Integration Polynomial Expansion Random Number Sort Singular Value Decomposition Solving a Linear System 1.18045 0.808511 0.897436 0.897959 1.08383 1.60455 0.981132 1.02174 1.00647 1.7113 1. 0.912 0.995146 1.01282 1.37004 1.58776 Jak wida istotne przyspieszenie rzŒdu 2x uzyskujemy dla: 1) niekt rych numeryczncych operacji na macierzach ("Matrix Multiplication", "Singular Value Decomposition", "Solving a Linear System") 2) operacji wykonywanych na listach ("Elementary Functions") W pozostalych przypadkach czas jest identyczny lub nawet gorszy, co wynika z lepszego wykorzystania procesora (pozostale procesy byly przypisane do innego). Wyniki tego benchmarku sk‡aniaj„ mnie do podejrzenia, ¿e lepszy wynik (pomimo nieomal identycznego kodu) uzyskany zosta‡ poprzez now„ implementacjŒfunkcji macierzowych i elementarnych w postaci numerycznej. Konkretnie chodzi prawdopodobnie o biblioteki numeryczne intela w wersji ,,threading’’ kt re same z siebie u¿ywaj„ wszystkich procesor w w systemie. Wskazuje na to tez zawartosc katalogu Mathematici w wersji 6.0 versus 7.0. Na dzieæ dzisiejszy mogŒpoda tylko jeden skuteczny (tj. faktycznie dajacy przyspieszenie) spos b wykorzystania 2 (lub wiŒcej) procesor w: AbsoluteTiming @ tbl = Table@NIntegrate@Abs@xD ^ 2 Exp@- x ^ 2D, 8x, - Infinity, t<D, 8t, - 10, 10, 0.01<D D@@ 1DD H* zwyk‡y Table u¿ywaj„cy 1 CPU *L 11.0312500 AbsoluteTiming @tbl = ParallelTable @ NIntegrate@Abs@xD ^ 2 Exp@- x ^ 2D, 8x, - Infinity, t<D, 8t, - 10, 10, 0.01<D D@@1DD H* ParallelTable u¿ywaj„cy wszystkich CPU. Odbywa sie to poprzez uruchomienie 2 dodatkowych kopii kernela Hsprawdz w TaskManager, powinny bec 3 procesy MathKernel.exe, 1 parent i 2 child *L 6.4218750 Jak wida przyspieszenie jest prawie 2x. Prosze zajrzec do manuala kt re funkcje posiadaj„ wersje r wnoleg‡e np. ParallelSum, ParallelMap, ParallelDo i inne Mathematica_70.nb ? ParallelTable ParallelTable@expr, 8imax <D generates in parallel a list of imax copies of expr. ParallelTable@expr, 8i, imax <D generates in parallel a list of the values of expr when i runs from 1 to imax . ParallelTable@expr, 8i, imin , imax <D starts with i = imin . ParallelTable@expr, 8i, imin , imax , di<D uses steps di. ParallelTable@expr, 8i, 8i1 , i2 , <<D uses the successive values i1 , i2 , . ParallelTable@expr, 8i, imin , imax <, 8 j, jmin , jmax <, D gives a nested list. The list associated with i is outermost. Godne uwagi jest por wnanie wersji 6.0 i 7.0 wykonywanej na 1 CPU i 2 CPU. Dla operacji : A = Table@RandomReal@D, 8ii, 1, 5000<, 8jj, 1, 5000<D; B = Table@RandomReal@D, 8ii, 1, 5000<D; AbsoluteTiming @LinearSolve@A, BDD@@1DD Uzyska‡em wyniki (czas w sekundach): 88"", "Mathematica 6.0", "Mathematica 7.0"<, 8"1 CPU" , 15.4, 12.8<, 8"2 CPU", 8.12, 7.2<< TableForm Mathematica 6.0 Mathematica 7.0 1 CPU 15.4 12.8 2 CPU 8.12 7.2 Z powy¿szego wynika ¿e ju¿ wersja 6.0 u¿ywa‡a obydw ch procesor w w obliczeniach z numerycznej algebry liniowej. Dodalem w http://ribes.if.uj.edu.pl/alsymb/benchmarks.html odpowiedni„ pozycje dla Core2Duo z uzywanym 1 rdzeniem. Z innych nowo ci mogŒpoleci funkcjŒLog10, kt rej osobiscie zawsze mi brakowa‡o i StreamPlot (niestety tylko w 2D ...). Nie zauwa¿y‡em wiŒkszych zmian sk‡adni w stosunku do wersji 6.0, wiŒc polecam upgrade bez obawy o wynik kolokwium zaliczeniowego. 3