Xman Blog Inside

Sunday, August 20, 2006

Distributed Parallel Reversi in Java: You have Dual-Core? Quad-Core Processors?

Let's catch up with the technology trends on multi-core processors. If you have bought a dual-core, or quad-core, or a large shared memory parallel machine, or a cluster of computers, then you can run this Distributed Parallel Reversi, xversi-java-parallel-v0.8b.tgz, to make them busy.
Running Distributed Parallel Reversi: Step-by-step
  1. Launch a server in each of your machines that will provide reversi evaluation services.
    • xman@sai xversi-java-parallel-v0.8b # java -Djava.security.policy=xversi.policy XversiEval localhost 9394
      Registered XversiInterface
    • localhost: Machine name, or its IP.
    • 9394: Port number for the client to connect to. Remember to set your firewall to allow this port.
  2. Setup a machine info file called nodeinfo.txt.
    • xman@sai parallel # cat nodeinfo.txt
      2
      localhost:9394
      localhost:9394
    • 2: There are 2 entries about machine information.
    • localhost: Machine name or its IP. I include two identical lines because I'm running this on a dual-processor or dual-core processor machine. This will make the parallel reversi to utilize the two processors in the system.
  3. Launch the Java Applet.
    • xman@sai parallel # appletviewer -J-Djava.security.policy=xversi.policy test.html
      Number of Node : 2
      before lookup
      Node 0 localhost:9394
      name 0 //localhost:9394/xversiInterface
      Node 1 localhost:9394
      name 0 //localhost:9394/xversiInterface
      after lookup
    • I've forgotten how do you specify the policy to a browser to launch the Java applet. TELL ME IF YOU KNOW! ;)
Notice that in picture below, two processors in the system are running at full speed to evaluate different moves at the same time. :) Hence, if you bought a dual-core, quad-core, ... or even a cluster of computers, enjoy the benefit of parallel computing. :) Ideally it will run N times faster with N processors.

Click to see larger picture

Labels: , , , , , , , ,

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home