public class PiDistributed extends PiParallel
OperationServer. The names and ports of the cluster nodes are read from the file
cluster.properties, or a
ResourceBundleby the name "cluster". The format of the property file is as follows:
server1=hostname.company.com:1234 server2=hostname2.company.com:2345 server3=hostname3.company.com:3456 weight1=100 weight2=110 weight3=50The server addresses are specified as hostname:port. Weights can (but don't have to) be assigned to nodes to indicate the relative performance of each node, to allow distributing a suitable amount of work for each node. For example,
weight2is the relative performance of
server2etc. The weights must be integers in the range 1...1000.
Guidelines for configuring the servers:
clockFrequency * numberOfProcessors. For example, a machine with two 1600MHz processors is four times as fast as a machine with one 800MHz processor.
PiParallelwith one million digits. Remember to specify the correct number of CPUs on each machine.
OperationServeron the cluster nodes, specify the number of worker threads for each server to be the same as the number of CPUs of the machine.
apfloat.propertiesfile for each cluster server.
Similarly as with
PiParallel, if some nodes have multiple
CPUs, to get any performance gain from running many
threads in parallel, the JVM must be executing native threads.
If the JVM is running in green threads mode, there is no
advantage of having multiple threads, as the JVM will in fact
execute just one thread and divide its time to multiple
|Modifier and Type||Class and Description|
Distributed version of the binary splitting algorithm.
Class for calculating pi using the distributed Chudnovskys' binary splitting algorithm.
Class for calculating pi using the distributed Ramanujan's binary splitting algorithm.
RemoteOperationExecutor that implements the weight property.
PiParallel.ParallelBinarySplittingPiCalculator, PiParallel.ParallelChudnovskyPiCalculator, PiParallel.ParallelRamanujanPiCalculator, PiParallel.ThreadLimitedOperation<T>
Pi.AbstractBinarySplittingSeries, Pi.BinarySplittingPiCalculator, Pi.BinarySplittingProgressIndicator, Pi.BinarySplittingSeries, Pi.BorweinPiCalculator, Pi.ChudnovskyBinarySplittingSeries, Pi.ChudnovskyPiCalculator, Pi.GaussLegendrePiCalculator, Pi.RamanujanBinarySplittingSeries, Pi.RamanujanPiCalculator
|Modifier and Type||Method and Description|
Command-line entry point.
checkAlive, getErr, getInt, getLong, getOut, getPrecision, getRadix, run, setAlive, setErr, setOut
Copyright © 2017. All rights reserved.