Hi,<br><br>I tried this benchmark on a 8-CPU (4 dual core) AMD Opteron server running Solaris 10. Here are the results. It looks pretty good.<br><br>elastigirl:chandru 92 # /usr/local/otp_R11B-1/bin/erl -smp <br>Erlang (BEAM) emulator version
5.5.1 [source] [64-bit] [smp:8] [async-threads:0] <br><br>Eshell V5.5.1 (abort with ^G)<br>1> big:bang(50).<br>16759 % 16 ms<br>2> big:bang(100).<br>100620 % 100 ms<br>3> big:bang(300).
<br>927302 % 927 ms<br>4> big:bang(500).<br>2384194 % 2.4 secs<br>5> big:bang(600).<br>3780862 % 3.8 secs<br>6> big:bang(700).<br>5359640 %
5.3 secs<br>7> big:bang(800).<br>7995201 % 8 secs<br>8> big:bang(900).<br>9918226 % 9.9 secs<br>9> big:bang(1000).<br>14688772 % 14.6 secs<br>11> big:bang(2000).
<br>111368322 % 111 secs<br><br>cheers<br>Chandru<br><br><div><span class="gmail_quote">On 07/03/06, <b class="gmail_sendername">Rickard Green</b> <<a href="mailto:rickard.s.green@ericsson.com">rickard.s.green@ericsson.com
</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Trying again...<br><br>-------- Original Message --------<br>Subject: Message passing benchmark on smp emulator
<br>Date: Tue, 07 Mar 2006 17:30:40 +0100<br>From: Rickard Green <<a href="mailto:rickard.s.green@ericsson.com">rickard.s.green@ericsson.com</a>><br>Newsgroups: erix.mailing-list.erlang-questions<br><br>The message passing benchmark used in estone (and bstone) isn't very
<br>well suited for the smp emulator since it sends a message in a ring<br>(more or less only 1 process runnable all the time).<br><br>In order to be able to take advantage of an smp emulator I wrote another<br>message passing benchmark. In this benchmark all participating processes
<br>sends a message to all processes and waits for replies on the sent messages.<br><br>I've attached the benchmark. Run like this:<br>big:bang(NoOfParticipatingProcesses).<br><br>I ran the benchmark on a machine with two hyperthreaded Xeon
2.40GHz<br>processors.<br><br>big:bang(50):<br>* r10b completed after about 0.014 seconds.<br>* p11b with 4 schedulers completed after about 0.018 seconds.<br><br>big:bang(100):<br>* r10b completed after about 0.088 seconds.
<br>* p11b with 4 schedulers completed after about 0.088 seconds.<br><br>big:bang(300):<br>* r10b completed after about 2.6 seconds.<br>* p11b with 4 schedulers completed after about 1.0 seconds.<br><br>big:bang(500):<br>
* r10b completed after about 10.7 seconds.<br>* p11b with 4 schedulers completed after about 3.5 seconds.<br><br>big:bang(600):<br>* r10b completed after about 18.0 seconds.<br>* p11b with 4 schedulers completed after about
5.8 seconds.<br><br>big:bang(700):<br>* r10b completed after about 27.0 seconds.<br>* p11b with 4 schedulers completed after about 9.3 seconds.<br><br>Quite a good result I guess.<br><br>Note that this is a special case and these kind of speedups are not
<br>expected for an arbitrary Erlang program.<br><br>If you want to try yourself download a P11B snapshot at:<br><a href="http://www.erlang.org/download/snapshots/">http://www.erlang.org/download/snapshots/</a><br>remember to enable smp support:
<br>./configure --enable-smp-support --disable-lock-checking<br><br>You can change the number of schedulers used by passing the<br>+S<NO_OF_SCHEDULERS> command line argument to erl or by calling:<br>erlang:system_flag(schedulers, NoOfSchedulers) -> {ok|PosixError,
<br>CurrentNo, OldNo}<br><br>/Rickard Green, Erlang/OTP<br><br><br><br><br>%%%-------------------------------------------------------------------<br>%%% File : big.erl<br>%%% Author : Rickard Green <<a href="mailto:rickard.s.green@ericsson.com">
rickard.s.green@ericsson.com</a>><br>%%% Description : A simple message passing benchmark<br>%%%<br>%%% Created : 30 Dec 2005 by Rickard Green <<a href="mailto:rickard.s.green@ericsson.com">rickard.s.green@ericsson.com
</a>><br>%%%-------------------------------------------------------------------<br>-module(big).<br><br>-export([bang/1]).<br><br>pinger([], [], true) -><br> receive<br> {procs, Procs, ReportTo} -><br> pinger(Procs, [], ReportTo)
<br> end;<br>pinger([], [], false) -><br> receive {ping, From} -> From ! {pong, self()} end,<br> pinger([],[],false);<br>pinger([], [], ReportTo) -><br> ReportTo ! {done, self()},<br> pinger([],[],false);
<br>pinger([],[Po|Pos] = Pongers, ReportTo) -><br> receive<br> {ping, From} -><br> From ! {pong, self()},<br> pinger([], Pongers, ReportTo);<br> {pong, Po} -><br> pinger([], Pos, ReportTo)
<br> end;<br>pinger([Pi|Pis], Pongers, ReportTo) -><br> receive {ping, From} -> From ! {pong, self()}<br> after 0 -> ok<br> end,<br> Pi ! {ping, self()},<br> pinger(Pis, [Pi|Pongers], ReportTo).
<br><br>spawn_procs(N) when N =< 0 -><br> [];<br>spawn_procs(N) -><br> [spawn_link(fun () -> pinger([],[],true) end) | spawn_procs(N-1)].<br><br>send_procs([], Msg) -><br> Msg;<br>send_procs([P|Ps], Msg) ->
<br> P ! Msg,<br> send_procs(Ps, Msg).<br><br>receive_msgs([]) -><br> ok;<br>receive_msgs([M|Ms]) -><br> receive<br> M -><br> receive_msgs(Ms)<br> end.<br><br>bang(N) when integer(N) ->
<br> Procs = spawn_procs(N),<br> RMsgs = lists:map(fun (P) -> {done, P} end, Procs),<br> Start = now(),<br> send_procs(Procs, {procs, Procs, self()}),<br> receive_msgs(RMsgs),<br> Stop = now(),<br> lists:foreach(fun (P) -> exit(P, normal) end, Procs),
<br> timer:now_diff(Stop, Start).<br><br><br><br><br></blockquote></div><br>