Hi guys,
I am running a simulation on a cluster server. My cluster server consists of one main machine and 9 auxiliary machines. For the purpose of simulation, I only use 7 machines. I have written a script that enters the 7 machines from main machine simultaneously and runs the simulation program. Following is my script:

while [ $e -ne 0 ]
do
d1=`ssh 192.x.x.1 "ps aux | grep $PRG | grep -v -c grep"`
d2=`ssh 192.x.x.2 "ps aux | grep $PRG | grep -v -c grep"`
d3=`ssh 192.x.x.3 "ps aux | grep $PRG | grep -v -c grep"`
d4=`ssh 192.x.x.4 "ps aux | grep $PRG | grep -v -c grep"`
d5=`ssh 192.x.x.5 "ps aux | grep $PRG | grep -v -c grep"`
d6=`ssh 192.x.x.6 "ps aux | grep $PRG | grep -v -c grep"`
d7=`ssh 192.x.x.7 "ps aux | grep $PRG | grep -v -c grep"`
d10=`ssh 192.x.x.1 "ps aux | grep $TR | grep -v -c grep"`
e=`echo $d1 + $d2 + $d3 + $d4 + $d5 + $d6 + $d7 + $d10 | bc`
sleep 5
done

$PRG and $TR are paths to executables and the "while loop" checks (every 5 sec) whether the simulation stops in all machines.

Problem:
While running the simulation, I get the following network error:
ssh: connect to host 192.x.x.5 port 22: Connection timed out

But, I can ssh the machine 192.x.x.5 from the main server.

My simulation application leaks memory. Is this related to "memory leak"? I would be helpful for me if anyone helps me out of this problem.