If at any stage your LAM program hangs or crashes, you should clean the LAM machine. The command to do that is lamclean:
gustav@jupiter:~ 205 $ lamclean -v killing processes: 0...1...2...3...4...5...6...7...8...9...10...11...12... sweeping messages: 0...1...2...3...4...5...6...7...8...9...10...11...12... closing files: 0...1...2...3...4...5...6...7...8...9...10...11...12... removing groups... gustav@jupiter:~ 206 $