close sockets when finishing parallel compute