Skip to main content.
(up)
(home) > Installation

III Installation for the use of a network of workstations

All the scripts are supposed to be located in the same folder as the JAR files described above.

The parallelization has been performed through the use of RMI. See this website for further details.

A/ Multi-nodes, server side

Under MS-Windows

You also need the script file.bat. The path of rmiregistry must be modified

"C:\Program Files\Java\jdk1.5.0\bin\rmiregistry"

You need the following script (referred from now as RmiServer.bat).

"C:\Program Files\Java\jdk1.5.0\bin\java" -Xms15m -Xmx200m -Djava.rmi.server.hostname=129.215.153.135 -Djava.rmi.server.codebase="file://\Zip_05_05\jars\NML_PLAY.jar file://\Zip_05_05\jars\Holger_modules.jar" -Djava.security.policy=C:\Zip_05_05\jars\policy -classpath NML_PLAY.jar;Holger_modules.jar;jdom.jar;j3dcore.jar;j3dutils.jar;vecmath.jar neosim.rmikernel.RmiServer 12

Set the path, server IP and total number of nodes (clients+server) to be connected to the server appropriately.

You need the following script (referred from now as ServerClientMulti.bat).

pskill rmiregistry
pskill java
start file.bat
PING 1.1.1.1 -n 1 -w 1000 >NUL
START RmiServer.bat
PING 1.1.1.1 -n 2 -w 1000 >NUL
"C:\Program Files\Java\jdk1.5.0\bin\java" -Xss512k -Xms15m -Xmx800m -Djava.rmi.server.codebase="file://\Zip_05_05\jars\NML_PLAY.jar file://\Zip_05_05\jars\Holger_modules.jar" -Djava.security.policy=C:\Zip_05_05\jars\policy -classpath NML_PLAY.jar;Holger_modules.jar;jdom.jar;j3dcore.jar;j3dutils.jar;vecmath.jar nmlplay.NMLPlay_2 BasicModel.xml
pause
pskill rmiregistry
pskill java
pskill cmd

Set the path appropriately.

Under Linux

You can start the application under Linux on a remote node with the following script (referred from now as Script).

export DISPLAY=dhcp-153-158.inf.ed.ac.uk:0.0
ps -C rmiregistry|awk '$1 ~/[0-9]+/{print $1}'|xargs kill -9
ps|grep java|cut -c1-6|xargs kill
unset CLASSPATH
home/jgrunche/jre1.5.0_01/bin/rmiregistry &
home/jgrunche/jre1.5.0_01/bin/java -Xss512k -Xms15m -Xmx1800m -Djava.rmi.server.codebase="file:///home/jgrunche/NMLPLAY/nml_play.jar file:///home/jgrunche/NMLPLAY/Holger_modules.jar" -Djava.security.policy=/home/jgrunche/NMLPLAY/policy -classpath /home/jgrunche/NMLPLAY/nml_play.jar:/home/jgrunche/NMLPLAY/Holger_modules.jar:/home/jgrunche/NMLPLAY/jdom.jar:/home/jgrunche/jre1.5.0_01/lib/ext/j3dcore.jar:
/home/jgrunche/jre1.5.0_01/lib/ext/j3dutils.jar:/home/jgrunche/jre1.5.0_01/lib/ext/vecmath.jar neosim.rmikernel.RmiServer $1 &
sleep 2
/home/jgrunche/jre1.5.0_01/bin/java -Xss512k -Xms15m -Xmx1800m -Djava.rmi.server.codebase="file:///home/jgrunche/NMLPLAY/nml_play.jar file:///home/jgrunche/NMLPLAY/Holger_modules.jar" -Djava.security.policy=/home/jgrunche/NMLPLAY/policy -classpath /home/jgrunche/NMLPLAY/nml_play.jar:/home/jgrunche/NMLPLAY/Holger_modules.jar:/home/jgrunche/NMLPLAY/jdom.jar:/home/jgrunche/jre1.5.0_01/lib/ext/j3dcore.jar:
/home/jgrunche/jre1.5.0_01/lib/ext/j3dutils.jar:/home/jgrunche/jre1.5.0_01/lib/ext/vecmath.jar nmlplay.NMLPlay_2 $2

The first line is required in order to run the GUI on a remote node. On the local machine, you need to have typed the command xhost + . If the application is run locally, none of this is not required.

You need to put the right Java path instead of /home/jgrunche/jre1.5.0_01.You need to replace /home/jgrunche/NMLPLAY by the path to the root of the application. The application is started by typing ./Script nb where nb is the number of nodes to connect to the server (any number would fit if the application is not expected to run in parallel).

B/ Multi-nodes, client side

Under MS-Windows

The file is called Client.bat

"C:\Program Files\Java\jdk1.5.0\bin\java" -Xss512k -Xms15m -Xmx500m -Djava.rmi.server.codebase="file://\Zip_05_05\jars\NML_PLAY.jar file://\Zip_05_05\jars\Holger_modules.jar" -Djava.security.policy=C:\Zip_05_05\jars\policy -classpath NML_PLAY.jar;Holger_modules.jar;jdom.jar;j3dcore.jar;j3dutils.jar;vecmath.jar neosim.util.BasicApp rmi 129.215.153.135 user 12 1

Set the paths, server IP and total number of nodes (clients) to be connected to the server appropriately.

Under Linux

The file is called Client.

ps|grep java|cut -c1-6|xargs kill
rm CommandQueueRun*.*
rm ErrorsCom*.*
rm tra*
home/jgrunche/jre1.5.0_01/bin/java -Xss512k -Xms15m -Xmx1800m -Djava.rmi.server.codebase="file:///home/jgrunche/NMLPLAY/nml_play.jar file:///home/jgrunche/NMLPLAY/Holger_modules.jar" -Djava.security.policy=/home/jgrunche/NMLPLAY/policy -classpath /home/jgrunche/NMLPLAY/nml_play.jar:/home/jgrunche/NMLPLAY/Holger_modules.jar:/home/jgrunche/NMLPLAY/jdom.jar:/home/jgrunche/jre1.5.0_01/lib/ext/j3dcore.jar:
/home/jgrunche/jre1.5.0_01/lib/ext/j3dutils.jar:/home/jgrunche/jre1.5.0_01/lib/ext/vecmath.jar neosim.util.BasicApp rmi 129.215.153.135 user $1 1

You need to put the right Java path instead of /home/jgrunche/jre1.5.0_01.You need to replace /home/jgrunche/NMLPLAY by the path to the root of the application. You also need to set the server IP appropriately. The application is started by typing ./Client nb where nb is the number of nodes to connect to the server.

C/ Multi-nodes, policy

A file called policy needs to be part of the root folder. It gives the permissions required for the distributed computation to work.

 

grant {
  permission java.net.SocketPermission "129.215.153.135:1024-", "listen, accept, connect, resolve";
  permission java.net.SocketPermission "129.215.153.158:1024-", "listen, accept, connect, resolve";
  permission java.net.SocketPermission "129.215.29.150:1024-", "listen, accept, connect, resolve";
  permission java.net.SocketPermission "129.215.29.151:1024-", "listen, accept, connect, resolve";
  permission java.net.SocketPermission "129.215.29.152:1024-", "listen, accept, connect, resolve";
  permission java.net.SocketPermission "129.215.29.153:1024-", "listen, accept, connect, resolve";
  permission java.net.SocketPermission "129.215.29.154:1024-", "listen, accept, connect, resolve";
  permission java.net.SocketPermission "129.215.29.155:1024-", "listen, accept, connect, resolve";
  permission java.net.SocketPermission "129.215.29.156:1024-", "listen, accept, connect, resolve";
  permission java.net.SocketPermission "129.215.29.157:1024-", "listen, accept, connect, resolve";
  permission java.net.SocketPermission "129.215.29.158:1024-", "listen, accept, connect, resolve";
  permission java.net.SocketPermission "129.215.29.159:1024-", "listen, accept, connect, resolve";
  permission java.net.SocketPermission "129.215.29.160:1024-", "listen, accept, connect, resolve";
  permission java.net.SocketPermission "129.215.29.161:1024-", "listen, accept, connect, resolve";

  permission java.io.FilePermission "C:\\NMLPLAY_CVS\\jars", "read,write,execute,delete";
  permission java.io.FilePermission "C:\\NMLPLAY_CVS\\jars\\-", "read,write,execute,delete";

  permission java.lang.RuntimePermission "createSecurityManager";
  permission java.lang.RuntimePermission "setSecurityManager";
  permission java.lang.RuntimePermission "modifyThreadGroup";
  permission java.lang.RuntimePermission "loadLibrary.*";
  permission java.lang.RuntimePermission "accessClassInPackage.*";
  permission java.util.PropertyPermission "*", "read,write";
};

You need to replace the list in bold by corresponding lines which include the IPs of the distributed nodes.

Under MS-Windows

You also need to replace the name of the root folder in the lines in italic (download there).

Under Linux

You also need to replace the name of the root folder in the lines in italic. The path is likely to look like "/home/username/NMLPLAY" and "/home/username/NMLPLAY/-". Also include the path of the root of your home folder (download there).

As for me, I have the following lines in the policy file located mars :

  permission java.io.FilePermission "/home/jgrunche/NMLPLAY", "read,write,execute,delete";
  permission java.io.FilePermission "/home/jgrunche/NMLPLAY/-", "read,write,execute,delete";
  permission java.io.FilePermission "/home/jgrunche", "read,write,execute,delete";
  permission java.io.FilePermission "/home/jgrunche/-", "read,write,execute,delete";

 

D/ Automated use of ssh (linux Clients)

With the local machine operating under Linux

You need to set a public and private keys on your local machines, the clients (and the master node if it is used remotely). See there for further explanations.

You also need to correct the server IP in the file Client (running on mars1, whose IP at the time of this writing up is 129.215.29.150).

On your local machine you need the following script (referred as launch_12_procs).

xhost +
ssh jgrunche@mars1.inf.ed.ac.uk /home/jgrunche/NMLPLAY/Script 12 /home/jgrunche/NMLPLAY/BasicModel.xml &
sleep 10
ssh jgrunche@mars2.inf.ed.ac.uk /home/jgrunche/NMLPLAY/Client 12 &
ssh jgrunche@mars3.inf.ed.ac.uk /home/jgrunche/NMLPLAY/Client 12 &
ssh jgrunche@mars4.inf.ed.ac.uk /home/jgrunche/NMLPLAY/Client 12 &
ssh jgrunche@mars5.inf.ed.ac.uk /home/jgrunche/NMLPLAY/Client 12 &
ssh jgrunche@mars6.inf.ed.ac.uk /home/jgrunche/NMLPLAY/Client 12 &
ssh jgrunche@mars7.inf.ed.ac.uk /home/jgrunche/NMLPLAY/Client 12 &
ssh jgrunche@mars8.inf.ed.ac.uk /home/jgrunche/NMLPLAY/Client 12 &
ssh jgrunche@mars9.inf.ed.ac.uk /home/jgrunche/NMLPLAY/Client 12 &
ssh jgrunche@mars10.inf.ed.ac.uk /home/jgrunche/NMLPLAY/Client 12 &
ssh jgrunche@mars11.inf.ed.ac.uk /home/jgrunche/NMLPLAY/Client 12 &
ssh jgrunche@mars12.inf.ed.ac.uk /home/jgrunche/NMLPLAY/Client 12 &

Replace the user name, the name of the machines, the file path and the number of nodes accordingly.

 

With the local machine operating under MS-Windows

Automating parallel scripts is possible through the use of putty, pscp, pageant etc (See on this website).