Pascal's Weblog
The Grid...



Archives
« November 2009
SunMonTueWedThuFriSat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
     
       
Today
Click me to subscribe
Search

Links
 

Today's Page Hits: 32

« Monte Carlo Simulati... | Main | prstat »
Monday Sep 18, 2006
And the result is...
I ran a quick experiment with each node executing 20 million tests:

1 node:    Average: 3.1411545250056307 with 1 nodes.
2 nodes:   Average: 3.141313165330142 with 2 nodes.
20 nodes:  Average: 3.1416765781116878 with 20 nodes.
200 nodes: Average: 3.141568127864779 with 200 nodes.
Actually 3.1415 is a fairly good approximation: π to one MILLION decimal places

Note that to avoid writting a different script I use the feature to pass a parameter to a job to specify the number of clients:

#!/bin/ksh
#$ -N Buffon
#$ -cwd

# Set the environment variables
if [ -f $HOME/.profile ]; then
   . $HOME/.profile
fi

numClients=$1

echo "Starting the server..."
echo "Number of clients: "$numClients
svrResp=$(qsub -N server startServers.ksh)
echo svrResp is $svrResp
svrJobId=$(echo "$svrResp" | awk '{print $3}')
echo svrJobId is $svrJobId

# Wait until the server is started
status="not running"
until [ "$status" == "r" ]
do
  status=$( qstat | nawk '/'$svrJobId'/ {print $5}' )
  echo Server job status is $status
  sleep 10
done

#Wait until the serverhost file is created
filename="$HOME/serverhost"
until test -f $filename
do
  sleep 10
done
# then pull the server node name from the file
servernode=$(cat $filename)
rm $filename

echo "Server is running on" $servernode "Submitting a set of clients to the grid for remote execution..."
qsub -N clients -t 1-$numClients startClient.ksh $servernode

echo "Submitting a cleanup job that will wait until the clients are complete"
qsub -hold_jid clients cleanup.ksh $svrJobId
Posted at 11:34AM Sep 18, 2006 by Pascal Ledru in Grid Computing  |  Comments[0]

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed